Skip to content

Instantly share code, notes, and snippets.

@jonleighton
Created October 29, 2012 22:51
Show Gist options
  • Save jonleighton/3977052 to your computer and use it in GitHub Desktop.
Save jonleighton/3977052 to your computer and use it in GitHub Desktop.
[7] pry(main)> c = DL.dlopen "/lib64/libc.so.6"
=> #<DL::Handle:0x00000002c43478>
[8] pry(main)> f = Fiddle::Function.new(c['getsid'], [Fiddle::TYPE_INT], Fiddle::TYPE_INT)
=> #<Fiddle::Function:0x00000002d19e38
@abi=2,
@args=[4],
@ptr=263015086048,
@return_type=4>
[9] pry(main)> f.(Process.pid)
=> 29496
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment