Created
April 2, 2009 19:38
-
-
Save pete/89379 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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