Machine code: Difference between revisions
Content added Content deleted
Thundergnat (talk | contribs) m (→{{header|Raku}}: enable syntax highlighting) |
m (Updated whitespace.) |
||
Line 68: | Line 68: | ||
#include <sys/mman.h> |
#include <sys/mman.h> |
||
#include <string.h> |
#include <string.h> |
||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
{ |
|||
⚫ | |||
/* |
|||
⚫ | |||
mov EAX, [ESP+4] |
|||
⚫ | |||
add EAX, [ESP+8] |
|||
⚫ | |||
ret |
|||
⚫ | |||
*/ |
|||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
/* copy code to executable buffer */ |
|||
⚫ | |||
MAP_PRIVATE|MAP_ANON,-1,0); |
|||
⚫ | |||
/* run code */ |
|||
⚫ | |||
/* free buffer */ |
|||
⚫ | |||
⚫ | |||
} |
} |
||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
{ |
|||
⚫ | |||
⚫ | |||
}</lang> |
}</lang> |
||