Skip to content

Instantly share code, notes, and snippets.

@Endle
Created August 22, 2014 04:11
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 Endle/cd5f4ee2d5301b697fa0 to your computer and use it in GitHub Desktop.
Save Endle/cd5f4ee2d5301b697fa0 to your computer and use it in GitHub Desktop.
Code sample for HrbLUG
.file "sample.c"
.def ___main; .scl 2; .type 32; .endef
.section .rdata,"dr"
LC0:
.ascii "C:\\sample.txt\0"
.text
.globl _main
.def _main; .scl 2; .type 32; .endef
_main:
leal 4(%esp), %ecx
andl $-16, %esp
pushl -4(%ecx)
pushl %ebp
movl %esp, %ebp
pushl %ecx
subl $20, %esp
call ___main
movl $LC0, (%esp)
call _DeleteFileA@4
subl $4, %esp
movl $0, %eax
movl -4(%ebp), %ecx
leave
leal -4(%ecx), %esp
ret
.def _DeleteFileA@4; .scl 2; .type 32; .endef
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment