Skip to content

Instantly share code, notes, and snippets.

@masomel
Created February 5, 2018 08:38
Show Gist options
  • Save masomel/a13130597095bb20ef2378a7ea6284bf to your computer and use it in GitHub Desktop.
Save masomel/a13130597095bb20ef2378a7ea6284bf to your computer and use it in GitHub Desktop.
Output of memory interaction tests
$ python testapp.py
---- Memory interaction testing: 02-05-18 00:37 ----
-- test 1: Trying to change the value of an immutable object (expect AssertionError if the change succeeds)
Original param value: 4
New param value: 4
Adding 4 to 3; want 7, get 7
-- test 2: Trying to change the value of a mutable object (expect AssertionError if the change fails)
Original param value: [5]
New param value: [6]
Adding 5 to 3; want 8, get 9
-- test 3: Accessing a native global variable:
Global variable from native: 12
New global variable value: 11
Adding 12 to 3; want 15, get 14
-- test 4: Making a callback from native into the main Python program:
The sum from 1 to 3 is:
6
-- test 5: longjmp'ing from native into the main Python program:
Native jumping back to Python main
*hey you*
-- test 6: comparing mem addresses of extA.func and extB->extA.func:
Different mem addresses for the function pointer and corresponding python function object: [817498752], [139827800996464]
Same mem address native.PyNative_Hello and memtestlib_native->native.PyNative_Hello: [817498752]
-- test 7: comparing mem addresses of extA->libc_func and extB->libc_func:
Same mem address for native->fopen and memtestlib_native->fopen: [839224688]
-- test 8: comparing mem addresses of explcitly dyn. linked extA->openssl_func and extB->openssl_func:
Same mem address for native->RAND_bytes and memtestlib_native->RAND_bytes: [820764640]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment