Skip to content

Instantly share code, notes, and snippets.

@HackerFoo
Created January 25, 2017 19:16
Show Gist options
  • Save HackerFoo/b32a581602c5032de5070033e60edb3c to your computer and use it in GitHub Desktop.
Save HackerFoo/b32a581602c5032de5070033e60edb3c to your computer and use it in GitHub Desktop.
$ clang -O0 curry.c -o curry
$ ./curry a 1 2 3
pc = 0lx0000000000400cd9
f1_f = 10
c[48] =
[ 0x55, 0x48, 0x89, 0xe5, 0x48, 0x83, 0xec, 0x10,
0x48, 0xb8, 0x00, 0x07, 0x40, 0x00, 0x00, 0x00,
0x00, 0x00, 0x89, 0x7d, 0xfc, 0x48, 0x89, 0x45,
0xf0, 0x48, 0x8b, 0x04, 0x25, 0x50, 0x20, 0x60,
0x00, 0x48, 0x8b, 0x7d, 0xf0, 0x8b, 0x75, 0xfc,
0xff, 0xd0, 0x48, 0x83, 0xc4, 0x10, 0x5d, 0xc3 ]
f2_f = 10
f2_x = 28
c[64] =
[ 0x55, 0x48, 0x89, 0xe5, 0x48, 0x83, 0xec, 0x20,
0x48, 0xb8, 0x00, 0x07, 0x40, 0x00, 0x00, 0x00,
0x00, 0x00, 0x89, 0x7d, 0xfc, 0x48, 0x89, 0x45,
0xf0, 0xc7, 0x45, 0xec, 0x01, 0x00, 0x00, 0x00,
0x48, 0x8b, 0x45, 0xf0, 0x8b, 0x7d, 0xec, 0x8b,
0x75, 0xfc, 0xff, 0xd0, 0x48, 0x83, 0xc4, 0x20,
0x5d, 0xc3, 0x66, 0x66, 0x66, 0x66, 0x66, 0x2e,
0x0f, 0x1f, 0x84, 0x00, 0x00, 0x00, 0x00, 0x00 ]
c1 = curry(op_add) = 0x00868000
c2 = c1(1) = 0x00869000
r1 = c2(2) = 3
r2 = c2(3) = 4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment