Function at 0x4019f0
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
mov eax, 0x1128
call fcn.00402f40
mov eax, dword [0x4078e4]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 8]
lea ecx, [eax - 2]
push edi
mov edi, dword [ebp + 0xc]
cmp ecx, 1
ja 0x402064
push esi
lea edx, [ebp - 0x108]
cmp eax, 2
jne 0x401a8b
mov eax, dword [edi + 4]
sub edx, eax
jmp 0x401a30
mov cl, byte [eax]
mov byte [edx + eax], cl
inc eax
test cl, cl
jne 0x401a30
lea edx, [ebp - 0x108]
push 0x2e
push edx
call dword [sym.imp.MSVCR100.dll_strrchr]
mov esi, eax
add esp, 8
test esi, esi
je 0x401a67
push 0x405fa8
push esi
call dword [sym.imp.MSVCR100.dll_strpbrk]
add esp, 8
test eax, eax
jne 0x401a67
mov byte [esi], al
lea eax, [ebp - 0x108]
dec eax
mov edi, edi
mov cl, byte [eax + 1]
inc eax
test cl, cl
jne 0x401a70
mov ecx, dword [str..lst]
mov dl, byte [0x405fa4]
mov dword [eax], ecx
mov byte [eax + 4], dl
jmp 0x401a9a
mov eax, dword [edi + 8]
sub edx, eax
mov cl, byte [eax]
mov byte [edx + eax], cl
inc eax
test cl, cl
jne 0x401a90
mov eax, dword [edi + 4]
mov esi, dword [sym.imp.MSVCR100.dll_fopen]
push 0x405f9c
push eax
call esi
add esp, 8
mov dword [0x407a10], eax
test eax, eax
jne 0x401ade
mov ecx, dword [edi + 4]
push ecx
push str.Unable_to_open_input_file___s__n
call dword [sym.imp.MSVCR100.dll_printf]
add esp, 8
pop esi
mov eax, 1
pop edi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00402ee4
mov esp, ebp
pop ebp
ret
push ebx
lea edx, [ebp - 0x108]
push 0x405f70
push edx
call esi
mov ebx, eax
add esp, 8
mov dword [ebp - 0x1114], ebx
test ebx, ebx
jne 0x401b27
lea eax, [ebp - 0x108]
push eax
push str.Unable_to_create_output_file___s__n
call dword [sym.imp.MSVCR100.dll_printf]
add esp, 8
pop ebx
pop esi
mov eax, 1
pop edi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00402ee4
mov esp, ebp
pop ebp
ret
mov ecx, dword [0x407a10]
push ecx
push 0x407a14
call fcn.00401023
mov edx, dword [0x407a10]
neg eax
push 0
sbb eax, eax
inc eax
push 0
push edx
mov dword [0x407a30], eax
call dword [sym.imp.MSVCR100.dll_fseek]
mov eax, dword [0x407a10]
push eax
push 1
push 0x38
push 0x407a34
call dword [sym.imp.MSVCR100.dll_fread]
add esp, 0x24
test eax, eax
jne 0x401bb0
mov ecx, dword [0x407a10]
push ecx
call dword [sym.imp.MSVCR100.dll_feof]
add esp, 4
test eax, eax
je 0x401b93
mov eax, str.End_of_file_reached
push eax
push str.Unable_to_read_AMX_header:__s_n
jmp 0x401b08
call dword [sym.imp.MSVCR100.dll__errno]
mov edx, dword [eax]
push edx
call dword [sym.imp.MSVCR100.dll_strerror]
add esp, 4
push eax
push str.Unable_to_read_AMX_header:__s_n
jmp 0x401b08
mov eax, 0xf1e0
cmp word [0x407a38], ax
je 0x401bd1
push str.Not_a_valid_AMX_file_n
call dword [sym.imp.MSVCR100.dll_printf]
add esp, 4
jmp 0x401b11
movsx ecx, byte [0x407a3a]
mov edi, dword [0x407a48]
mov esi, dword [sym.imp.MSVCR100.dll_fprintf]
sub edi, dword [0x407a40]
push ecx
push str._File_version:__d_n
push ebx
call esi
push str._Flags:
push ebx
call esi
add esp, 0x14
test byte [0x407a3c], 4
je 0x401c12
push str.compact_encoding
push ebx
call esi
add esp, 8
test byte [0x407a3c], 2
je 0x401c26
push str.debug_info
push ebx
call esi
add esp, 8
test byte [0x407a3c], 0x10
je 0x401c3a
push str.no_checks
push ebx
call esi
add esp, 8
test byte [0x407a3c], 8
je 0x401c4e
push str.sleep
push ebx
call esi
add esp, 8
push 0x405e78
push ebx
call esi
push edi
call dword [sym.imp.MSVCR100.dll_malloc]
add esp, 0xc
mov dword [ebp - 0x1110], eax
test eax, eax
jne 0x401c75
push edi
push str.Insufficient_memory:_need__d_bytes_n
jmp 0x401b08
mov edx, dword [0x407a40]
mov eax, dword [0x407a10]
push 0
push edx
push eax
call dword [sym.imp.MSVCR100.dll_fseek]
mov ecx, dword [0x407a10]
mov esi, dword [0x407a34]
sub esi, dword [0x407a40]
push ecx
push edi
mov edi, dword [ebp - 0x1110]
push 1
push edi
call dword [sym.imp.MSVCR100.dll_fread]
add esp, 0x1c
cmp eax, esi
jge 0x401cf5
mov edx, dword [0x407a10]
push edx
call dword [sym.imp.MSVCR100.dll_feof]
add esp, 4
test eax, eax
je 0x401cd8
mov eax, str.End_of_file_reached
push eax
push str.Unable_to_read_code:__s_n
jmp 0x401b08
call dword [sym.imp.MSVCR100.dll__errno]
mov eax, dword [eax]
push eax
call dword [sym.imp.MSVCR100.dll_strerror]
add esp, 4
push eax
push str.Unable_to_read_code:__s_n
jmp 0x401b08
test byte [0x407a3c], 4
je 0x401d15
mov ecx, dword [0x407a48]
sub ecx, dword [0x407a40]
push esi
mov edx, edi
call fcn.004017f0
add esp, 4
mov esi, dword [0x407a44]
sub esi, dword [0x407a40]
mov dword [ebp - 0x1120], 0xffffffff
mov dword [ebp - 0x1118], esi
test esi, esi
jle 0x401ed5
mov dword [ebp - 0x110c], 0
cmp dword [edi], 0x2e
jne 0x401d57
push 0x405d34
push ebx
call dword [sym.imp.MSVCR100.dll_fprintf]
add esp, 8
cmp dword [0x407a30], 0
je 0x401e90
mov esi, dword [ebp - 0x110c]
sar esi, 2
lea ecx, [ebp - 0x1128]
add esi, esi
push ecx
add esi, esi
push esi
push 0x407a14
call fcn.00401078
lea edx, [ebp - 0x111c]
push edx
push esi
push 0x407a14
call fcn.00401073
mov eax, dword [ebp - 0x1128]
add esp, 0x18
test eax, eax
je 0x401e8a
mov ecx, dword [ebp - 0x111c]
cmp ecx, dword [ebp - 0x1120]
je 0x401e8a
inc ecx
push ecx
push eax
push str._s:_ld_n
push ebx
call dword [sym.imp.MSVCR100.dll_fprintf]
mov eax, dword [ebp - 0x1128]
push 0x405e1c
push eax
call dword [sym.imp.MSVCR100.dll_fopen]
mov esi, eax
add esp, 0x18
test esi, esi
je 0x401e7e
cmp dword [ebp - 0x111c], 0
mov dword [ebp - 0x1124], 0
jl 0x401e74
lea esp, [esp]
push esi
lea ecx, [ebp - 0x1108]
push 0xfff
push ecx
call dword [sym.imp.MSVCR100.dll_fgets]
add esp, 0xc
test eax, eax
je 0x401e74
mov al, byte [ebp - 0x1108]
xor ecx, ecx
cmp al, 0x20
jg 0x401e36
test al, al
je 0x401e36
mov al, byte [ebp + ecx - 0x1107]
inc ecx
cmp al, 0x20
jle 0x401e26
cmp byte [ebp + ecx - 0x1108], 0
je 0x401e5f
mov edx, dword [ebp - 0x1124]
cmp edx, dword [ebp - 0x1120]
jle 0x401e5f
lea eax, [ebp - 0x1108]
push ebx
push eax
call dword [sym.imp.MSVCR100.dll_fputs]
add esp, 8
mov eax, dword [ebp - 0x1124]
inc eax
mov dword [ebp - 0x1124], eax
cmp eax, dword [ebp - 0x111c]
jle 0x401e00
push esi
call dword [sym.imp.MSVCR100.dll_fclose]
add esp, 4
mov ecx, dword [ebp - 0x111c]
mov dword [ebp - 0x1120], ecx
mov esi, dword [ebp - 0x1118]
mov ecx, dword [edi]
mov eax, ecx
and eax, 0xffff
lea edx, [eax + eax*2]
mov eax, dword [edx*4 + 0x407008]
mov edx, dword [ebp - 0x110c]
sar edx, 2
add edx, edx
add edx, edx
push edx
push ecx
lea ecx, [edi + 4]
push ecx
push ebx
call eax
lea edi, [edi + eax*4]
mov eax, edi
sub eax, dword [ebp - 0x1110]
add esp, 0x10
mov dword [ebp - 0x110c], eax
cmp eax, esi
jl 0x401d43
push str._n_n_DATA
push ebx
call dword [sym.imp.MSVCR100.dll_fprintf]
mov eax, dword [0x407a40]
mov esi, dword [0x407a44]
mov ebx, dword [0x407a48]
sub esi, eax
add esi, dword [ebp - 0x1110]
sub ebx, eax
mov eax, esi
sub eax, dword [ebp - 0x1110]
add esp, 8
xor edi, edi
mov byte [ebp - 0x108], 0
cmp eax, ebx
jge 0x401fdc
mov dword [ebp - 0x110c], eax
mov edi, edi
test edi, edi
jne 0x401f8d
lea eax, [ebp - 0x108]
lea edx, [eax + 1]
lea ecx, [ecx]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x401f30
sub eax, edx
je 0x401f5e
mov eax, dword [ebp - 0x1114]
lea edx, [ebp - 0x108]
push edx
push 0x405e0c
push eax
call dword [sym.imp.MSVCR100.dll_fprintf]
add esp, 0xc
mov byte [ebp - 0x108], 0
mov ecx, dword [ebp - 0x110c]
mov edx, dword [ebp - 0x1114]
sar ecx, 2
add ecx, ecx
add ecx, ecx
sub ecx, dword [0x407a44]
add ecx, dword [0x407a40]
push ecx
push str._n_08x
push edx
call dword [sym.imp.MSVCR100.dll_fprintf]
add esp, 0xc
mov eax, dword [esi]
mov ecx, dword [ebp - 0x1114]
push eax
push str._08x
push ecx
call dword [sym.imp.MSVCR100.dll_fprintf]
mov eax, dword [esi]
add esp, 0xc
mov ecx, edi
lea edx, [ebp - 0x108]
call fcn.00401950
inc edi
and edi, 0x80000003
jns 0x401fc2
dec edi
or edi, 0xfffffffc
inc edi
mov eax, dword [ebp - 0x110c]
add eax, 4
add esi, 4
mov dword [ebp - 0x110c], eax
cmp eax, ebx
jl 0x401f20
lea eax, [ebp - 0x108]
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x401fe5
sub eax, edx
je 0x402013
mov eax, dword [ebp - 0x1114]
lea edx, [ebp - 0x108]
push edx
push 0x405e0c
push eax
call dword [sym.imp.MSVCR100.dll_fprintf]
add esp, 0xc
mov byte [ebp - 0x108], 0
cmp dword [0x407a30], 0
je 0x402029
push 0x407a14
call fcn.004010a0
add esp, 4
mov ecx, dword [ebp - 0x1110]
push ecx
call dword [sym.imp.MSVCR100.dll_free]
mov edx, dword [0x407a10]
mov esi, dword [sym.imp.MSVCR100.dll_fclose]
push edx
call esi
mov eax, dword [ebp - 0x1114]
push eax
call esi
add esp, 0xc
pop ebx
pop esi
xor eax, eax
pop edi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00402ee4
mov esp, ebp
pop ebp
ret
push str.Usage:_pawndisasm__input___output__n
call dword [sym.imp.MSVCR100.dll_printf]
mov ecx, dword [ebp - 4]
add esp, 4
xor ecx, ebp
mov eax, 1
pop edi
call fcn.00402ee4
mov esp, ebp
pop ebp
ret