Last active
November 15, 2016 13:44
-
-
Save ercoppa/5f8eb9d0f9b39b138509733a5f3137dc to your computer and use it in GitHub Desktop.
Example of symbolic code
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.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