Skip to content

Instantly share code, notes, and snippets.

@vault
Last active December 14, 2015 18:38
Show Gist options
  • Save vault/5130478 to your computer and use it in GitHub Desktop.
Save vault/5130478 to your computer and use it in GitHub Desktop.
#include <stdio.h>
unsigned char return_number[] __attribute__((section (".text"))) =
{0x55, 0x48, 0x89, 0xE5, 0xB8, 255, 255,0,0, 0x5D,0xC3 };
int main()
{
int (*fn)(void);
fn = (int(*)(void))&return_number;
printf("%d\n", (*fn)());
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment