Skip to content

Instantly share code, notes, and snippets.

@ercoppa
Last active November 15, 2016 13:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ercoppa/5f8eb9d0f9b39b138509733a5f3137dc to your computer and use it in GitHub Desktop.
Save ercoppa/5f8eb9d0f9b39b138509733a5f3137dc to your computer and use it in GitHub Desktop.
Example of symbolic code
.globl foo
.text
foo:
movl 4(%esp), %eax # load arg0 into eax
leal (foo_real), %ecx
jmp *%ecx
.data
foo_real:
subl $666, %eax # trigger input is 666
addb $0xeb, %al
leal (L1), %edx
leal (L2), %ecx
subl %edx, %ecx
movb %cl, %ah
leal (L1), %ecx
movw %ax, -2(%ecx)
nop
nop
L1:
movl $1, %eax
jmp exit
L2:
movl $2, %eax
exit:
ret
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment