duma.sh 450 B

123456789101112131415161718
  1. #!/usr/bin/env sh
  2. # Simple script to run DUMA on stuff.
  3. # (Requires libduma.so.0.0 insalled).
  4. # Usage.
  5. if [ "$#" -lt 1 ]; then
  6. printf '%s\n' "$0: Usage: duma <executable> [optional arguments]."
  7. printf '%s\n' " Runs the executable under the DUMA malloc debugger."
  8. exit 1
  9. fi
  10. # Set the environment to preload DUMA library.
  11. export LD_PRELOAD=libduma.so.0.0.0
  12. export DYLD_INSERT_LIBRARIES=libduma.dylib
  13. export DYLD_FORCE_FLAT_NAMESPACE=1
  14. exec "$@"