Skip to content

Instantly share code, notes, and snippets.

@mietek
Created March 1, 2012 13:36
Show Gist options
  • Save mietek/1949857 to your computer and use it in GitHub Desktop.
Save mietek/1949857 to your computer and use it in GitHub Desktop.
DTrace contest solutions
# ad8b0a518f4e717b
strings zosia
# b96fce77a01aa3f1
dtrace -c ./zosia -n 'syscall::open:entry /execname == "zosia"/ { printf("code b: %s", copyinstr(arg0)); }'
# c27c4c97a2cca1e5
dtrace -c ./zosia -n 'syscall::write:entry /execname == "zosia"/ { printf("code c: %s", copyinstr(arg1)); }'
# da2c30abab3f9ba0
dtrace -c ./zosia -n 'pid$target::calloc:entry { printf("code d: %x%x", arg0, arg1); }'
# e92ae02dda5d7947
dtrace -c ./zosia -n 'pid$target::target_*:entry { printf("code e: %s", probefunc); }'
# fd328a9f4ffbe5cb
dtrace -c ./zosia -n 'pid$target::another_target:return { printf("code f: %s", copyinstr(arg1)); }'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment