Skip to content

Instantly share code, notes, and snippets.

@pajp
Created August 26, 2012 13:18
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pajp/3479177 to your computer and use it in GitHub Desktop.
Save pajp/3479177 to your computer and use it in GitHub Desktop.
print out oauth tokens from a process using dtrace
#!/bin/sh
/Applications/Twitter.app/Contents/MacOS/Twitter &
sudo dtrace -q -p $! -n 'pid$target::free:entry /arg0 != 0/ { printf("%s\n", copyinstr(arg0)) }' 2> /dev/null | grep oauth
@stisti
Copy link

stisti commented Aug 27, 2012

Nice hack! Does it work?

@pajp
Copy link
Author

pajp commented Sep 5, 2012

It works surprisingly well. It was inspired by this: https://twitter.com/joedamato/statuses/237583522003574784

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment