Skip to content

Instantly share code, notes, and snippets.

@pete
Created April 2, 2009 19:38
Show Gist options
  • Save pete/89379 to your computer and use it in GitHub Desktop.
Save pete/89379 to your computer and use it in GitHub Desktop.
# I have successfully defeated Ruby-FFI to produce a pointer to an
# arbitrary memory location:
module C
extend FFI::Library
extend self
attach_function :atoi, [:string], :pointer
def pointer_to address
@p ||= atoi("-1")
@p + 1 + address
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment