Skip to content

Instantly share code, notes, and snippets.

@SafeEval
Created August 26, 2015 19:34
Show Gist options
  • Save SafeEval/6fe9b33d25c136c7f5bb to your computer and use it in GitHub Desktop.
Save SafeEval/6fe9b33d25c136c7f5bb to your computer and use it in GitHub Desktop.
; 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