Skip to content

Instantly share code, notes, and snippets.

@pbalduino
Created March 22, 2014 23:59
Show Gist options
  • Select an option

  • Save pbalduino/9716310 to your computer and use it in GitHub Desktop.

Select an option

Save pbalduino/9716310 to your computer and use it in GitHub Desktop.
......... ...
mov %edx,%edi
jmp 0x40143b <__mingw_CRTStartup+699>
mov %edx,%ebx
jmp 0x40128b <__mingw_CRTStartup+267>
mov %edx,%eax
nop
jmp 0x40134b <__mingw_CRTStartup+459>
mov %edx,%ebx
jmp 0x4014dc <__mingw_CRTStartup+860>
lea 0x0(%esi,%eiz,1),%esi
mainCRTStartup:
sub $0x1c,%esp
movl $0x1,(%esp)
call *0x40e1bc
call 0x401180 <__mingw_CRTStartup>
lea 0x0(%esi,%eiz,1),%esi
lea 0x0(%edi,%eiz,1),%edi
WinMainCRTStartup:
sub $0x1c,%esp
movl $0x2,(%esp)
call *0x40e1bc
call 0x401180 <__mingw_CRTStartup>
lea 0x0(%esi,%eiz,1),%esi
lea 0x0(%edi,%eiz,1),%edi
atexit:
mov 0x40e1e8,%eax
jmp *%eax
mov %esi,%esi
lea 0x0(%edi,%eiz,1),%edi
_onexit:
mov 0x40e1dc,%eax
jmp *%eax
nop
nop
nop
nop
nop
nop
nop
nop
nop
__gcc_register_frame:
push %ebp
mov %esp,%ebp
sub $0x18,%esp
movl $0x40a000,(%esp)
call 0x4084e0 <GetModuleHandleA@4>
mov $0x0,%edx
sub $0x4,%esp
test %eax,%eax
je 0x401603 <__gcc_register_frame+51>
movl $0x40a013,0x4(%esp)
mov %eax,(%esp)
call 0x4084e8 <GetProcAddress@8>
sub $0x8,%esp
mov %eax,%edx
test %edx,%edx
je 0x401618 <__gcc_register_frame+72>
movl $0x40d008,0x4(%esp)
movl $0x40b0ac,(%esp)
call *%edx
mov 0x409024,%eax
test %eax,%eax
je 0x40165b <__gcc_register_frame+139>
movl $0x40a029,(%esp)
call 0x4084e0 <GetModuleHandleA@4>
mov $0x0,%edx
sub $0x4,%esp
test %eax,%eax
je 0x40164e <__gcc_register_frame+126>
movl $0x40a037,0x4(%esp)
mov %eax,(%esp)
call 0x4084e8 <GetProcAddress@8>
sub $0x8,%esp
mov %eax,%edx
test %edx,%edx
je 0x40165b <__gcc_register_frame+139>
movl $0x409024,(%esp)
call *%edx
leave
ret
lea 0x0(%esi),%esi
__gcc_deregister_frame:
push %ebp
......... ...
in $0x83,%eax
in (%dx),%al
sbb %al,%bh
add $0x24,%al
add %ah,0x6ee80040(%eax)
(%esi),(%dx)
add %al,(%eax)
mov $0x0,%edx
sub $0x4,%esp
test %eax,%eax
je 0x401693 <__gcc_deregister_frame+51>
movl $0x40a04b,0x4(%esp)
mov %eax,(%esp)
call 0x4084e8 <GetProcAddress@8>
sub $0x8,%esp
mov %eax,%edx
test %edx,%edx
je 0x4016a0 <__gcc_deregister_frame+64>
movl $0x40b0ac,(%esp)
call *%edx
leave
ret
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
printf:
push %ebp
mov %esp,%ebp
push %ebx
sub $0x24,%esp
lea 0xc(%ebp),%eax
mov %eax,-0xc(%ebp)
mov -0xc(%ebp),%eax
mov %eax,0x4(%esp)
mov 0x8(%ebp),%eax
mov %eax,(%esp)
call 0x402f80 <__mingw_vprintf>
mov %eax,%ebx
mov %ebx,%eax
add $0x24,%esp
pop %ebx
pop %ebp
ret
main:
push %ebp
mov %esp,%ebp
and $0xfffffff0,%esp
sub $0x40,%esp
call 0x402060 <__main>
movl $0x0,0x2c(%esp)
movl $0x0,0x28(%esp)
movl $0x0,0x24(%esp)
movl $0x0,0x3c(%esp)
movb $0x0,0x3b(%esp)
movb $0x0,0x3a(%esp)
movb $0x0,0x39(%esp)
movl $0x1,0x34(%esp)
jmp 0x40183a <main+353>
mov 0x34(%esp),%eax
lea 0x0(,%eax,4),%edx
mov 0xc(%ebp),%eax
add %edx,%eax
mov (%eax),%eax
movl $0x40a064,0x4(%esp)
mov %eax,(%esp)
call 0x4083d8 <strcmp>
test %eax,%eax
je 0x40176f <main+150>
mov 0x34(%esp),%eax
lea 0x0(,%eax,4),%edx
mov 0xc(%ebp),%eax
add %edx,%eax
mov (%eax),%eax
movl $0x40a06b,0x4(%esp)
mov %eax,(%esp)
call 0x4083d8 <strcmp>
test %eax,%eax
jne 0x401779 <main+160>
movb $0x1,0x39(%esp)
jmp 0x401847 <main+366>
mov 0x34(%esp),%eax
lea 0x0(,%eax,4),%edx
mov 0xc(%ebp),%eax
add %edx,%eax
mov (%eax),%eax
movl $0x40a06e,0x4(%esp)
mov %eax,(%esp)
call 0x4083d8 <strcmp>
test %eax,%eax
je 0x4017c5 <main+236>
mov 0x34(%esp),%eax
lea 0x0(,%eax,4),%edx
mov 0xc(%ebp),%eax
add %edx,%eax
mov (%eax),%eax
movl $0x40a071,0x4(%esp)
mov %eax,(%esp)
call 0x4083d8 <strcmp>
test %eax,%eax
jne 0x4017cc <main+243>
movb $0x1,0x3a(%esp)
jmp 0x401835 <main+348>
mov 0x34(%esp),%eax
lea 0x0(,%eax,4),%edx
mov 0xc(%ebp),%eax
add %edx,%eax
mov (%eax),%eax
movl $0x40a07b,0x4(%esp)
mov %eax,(%esp)
call 0x4083d8 <strcmp>
test %eax,%eax
je 0x401818 <main+319>
mov 0x34(%esp),%eax
lea 0x0(,%eax,4),%edx
mov 0xc(%ebp),%eax
add %edx,%eax
mov (%eax),%eax
movl $0x40a07e,0x4(%esp)
mov %eax,(%esp)
call 0x4083d8 <strcmp>
test %eax,%eax
jne 0x40181f <main+326>
movb $0x1,0x3b(%esp)
jmp 0x401835 <main+348>
mov 0x34(%esp),%eax
lea 0x0(,%eax,4),%edx
mov 0xc(%ebp),%eax
add %edx,%eax
mov (%eax),%eax
mov %eax,0x3c(%esp)
addl $0x1,0x34(%esp)
mov 0x34(%esp),%eax
cmp 0x8(%ebp),%eax
jl 0x401723 <main+74>
cmpb $0x0,0x39(%esp)
je 0x401858 <main+383>
call 0x401a77 <cc_show_options>
jmp 0x40194f <main+630>
cmpl $0x0,0x3c(%esp)
je 0x401943 <main+618>
movl $0x40a087,0x4(%esp)
mov 0x3c(%esp),%eax
mov %eax,(%esp)
call 0x4083e0 <fopen>
mov %eax,0x30(%esp)
cmpl $0x0,0x30(%esp)
je 0x40192d <main+596>
movzbl 0x3b(%esp),%edx
movzbl 0x3a(%esp),%eax
lea 0x24(%esp),%ecx
mov %ecx,0x14(%esp)
lea 0x28(%esp),%ecx
mov %ecx,0x10(%esp)
lea 0x2c(%esp),%ecx
mov %ecx,0xc(%esp)
mov %edx,0x8(%esp)
mov %eax,0x4(%esp)
mov 0x30(%esp),%eax
mov %eax,(%esp)
call 0x401981 <cc_run>
cmpb $0x0,0x3b(%esp)
jne 0x40191f <main+582>
movl $0x40a089,(%esp)
call 0x4016b0 <printf>
mov 0x3c(%esp),%eax
mov %eax,0x4(%esp)
movl $0x40a08e,(%esp)
call 0x4016b0 <printf>
mov 0x2c(%esp),%eax
mov %eax,0x4(%esp)
movl $0x40a0a0,(%esp)
call 0x4016b0 <printf>
mov 0x24(%esp),%eax
mov %eax,0x4(%esp)
movl $0x40a0b9,(%esp)
call 0x4016b0 <printf>
mov 0x28(%esp),%eax
mov %eax,0x4(%esp)
movl $0x40a0d2,(%esp)
call 0x4016b0 <printf>
mov 0x30(%esp),%eax
mov %eax,(%esp)
call 0x4083e8 <fclose>
jmp 0x40194f <main+630>
mov 0x3c(%esp),%eax
mov %eax,0x4(%esp)
movl $0x40a0eb,(%esp)
call 0x4016b0 <printf>
jmp 0x40194f <main+630>
movl $0x40a106,(%esp)
call 0x4016b0 <printf>
mov $0x0,%eax
leave
ret
nop
nop
printf:
push %ebp
mov %esp,%ebp
push %ebx
sub $0x24,%esp
lea 0xc(%ebp),%eax
mov %eax,-0xc(%ebp)
mov -0xc(%ebp),%eax
mov %eax,0x4(%esp)
mov 0x8(%ebp),%eax
mov %eax,(%esp)
call 0x402f80 <__mingw_vprintf>
mov %eax,%ebx
mov %ebx,%eax
add $0x24,%esp
pop %ebx
pop %ebp
ret
cc_run:
push %ebp
mov %esp,%ebp
sub $0x28,%esp
mov 0xc(%ebp),%edx
mov 0x10(%ebp),%eax
mov %dl,-0x1c(%ebp)
mov %al,-0x20(%ebp)
movb $0x1,-0xa(%ebp)
movb $0x0,-0xb(%ebp)
movb $0x0,-0xd(%ebp)
movb $0x0,-0xc(%ebp)
movb $0x0,-0xe(%ebp)
mov 0x8(%ebp),%eax
mov %eax,(%esp)
call 0x4083f0 <fgetc>
mov %al,-0x9(%ebp)
cmpb $0xff,-0x9(%ebp)
je 0x4019cd <cc_run+76>
mov 0x14(%ebp),%eax
mov (%eax),%eax
lea 0x1(%eax),%edx
mov 0x14(%ebp),%eax
mov %edx,(%eax)
jmp 0x401a6b <cc_run+234>
jmp 0x401a6b <cc_run+234>
cmpb $0xa,-0x9(%ebp)
jne 0x401a1d <cc_run+156>
cmpb $0x0,-0xa(%ebp)
je 0x4019ed <cc_run+108>
mov 0x1c(%ebp),%eax
mov (%eax),%eax
lea 0x1(%eax),%edx
mov 0x1c(%ebp),%eax
mov %edx,(%eax)
jmp 0x401a13 <cc_run+146>
cmpb $0x0,-0xc(%ebp)
je 0x401a06 <cc_run+133>
movb $0x0,-0xc(%ebp)
mov 0x18(%ebp),%eax
mov (%eax),%eax
lea 0x1(%eax),%edx
mov 0x18(%ebp),%eax
mov %edx,(%eax)
jmp 0x401a13 <cc_run+146>
mov 0x14(%ebp),%eax
mov (%eax),%eax
lea 0x1(%eax),%edx
mov 0x14(%ebp),%eax
mov %edx,(%eax)
movb $0x1,-0xa(%ebp)
movb $0x0,-0xb(%ebp)
jmp 0x401a5d <cc_run+220>
cmpb $0x20,-0x9(%ebp)
jne 0x401a29 <cc_run+168>
cmpb $0xd,-0x9(%ebp)
je 0x401a5d <cc_run+220>
movb $0x0,-0xa(%ebp)
cmpb $0x2f,-0x9(%ebp)
jne 0x401a49 <cc_run+200>
cmpb $0x0,-0xb(%ebp)
jne 0x401a3f <cc_run+190>
movb $0x1,-0xb(%ebp)
jmp 0x401a5d <cc_run+220>
movb $0x0,-0xb(%ebp)
movb $0x1,-0xc(%ebp)
jmp 0x401a5d <cc_run+220>
cmpb $0x0,-0xb(%ebp)
je 0x401a5d <cc_run+220>
cmpb $0x2a,-0x9(%ebp)
jne 0x401a5d <cc_run+220>
movb $0x0,-0xb(%ebp)
movb $0x1,-0xe(%ebp)
mov 0x8(%ebp),%eax
mov %eax,(%esp)
call 0x4083f0 <fgetc>
mov %al,-0x9(%ebp)
cmpb $0xff,-0x9(%ebp)
jne 0x4019d2 <cc_run+81>
leave
ret
cc_show_options:
push %ebp
mov %esp,%ebp
sub $0x18,%esp
movl $0x40a124,(%esp)
call 0x401958 <printf>
movl $0x40a160,(%esp)
call 0x401958 <printf>
movl $0x40a18e,(%esp)
call 0x401958 <printf>
movl $0x40a198,(%esp)
call 0x401958 <printf>
movl $0x40a1bf,(%esp)
call 0x401958 <printf>
......... ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment