An unusual question...
rustompmody at gmail.com
Sun Apr 17 13:30:01 EDT 2011
On Apr 17, 9:37 pm, <wisecrac... at tesco.net> wrote:
> Hi Sturla...
> > You'll need to mmap or valloc a page-alligned memory
> > buffer (for which the size must be a multiple of the system
> > page size), and call mprotect to make it executable.
> > Copy your binary code into this buffer. Then you will
> > need to do some magic with ctypes, Cython or C to call
> > it; i.e. cast or memcpy the address of the excutable buffer
> > into a function pointer, and dereference/call the function
> > pointer.
Thats a dense info-filled para!
If you make it work (and prove Steve wrong :-) ) please post your how/
what/where here --
We (at least I) would be interested in seeing this work.
More information about the Python-list