Created
August 26, 2015 19:34
-
-
Save SafeEval/6fe9b33d25c136c7f5bb to your computer and use it in GitHub Desktop.
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
| ; stackbuffer_x86-intel.s - Stack buffer example. | |
| ; Build string on the stack: "ABCDEFG"\x00 | |
| [SECTION .text] | |
| global _start | |
| _start: | |
| push 0xFF474645 ; 'EFG'<pad> in little endian | |
| push 0x44434241 ; 'ABCD' in little endian | |
| inc byte [esp+7] ; null terminate 'ABCDEFG' | |
| mov ebx,esp ; ebx points to the stack buffer | |
| nop | |
| xor eax,eax | |
| mov al,1 | |
| int 0x80 ; exit() syscall |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment