Function at 0x401960
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
mov eax, 0x1124
call fcn.00402f50
mov eax, dword [0x4075ec]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 8]
push ebx
xor ebx, ebx
push esi
lea ecx, [eax - 2]
push edi
mov edi, dword [ebp + 0xc]
mov dword [ebp - 0x110c], ebx
mov dword [ebp - 0x1110], ebx
mov dword [ebp - 0x111c], 1
mov dword [0x407728], ebx
cmp ecx, 1
ja 0x402016
lea edx, [ebp - 0x108]
cmp eax, 2
jne 0x401a1b
mov eax, dword [edi + 4]
sub edx, eax
lea ebx, [ebx]
mov cl, byte [eax]
mov byte [edx + eax], cl
inc eax
test cl, cl
jne 0x4019c0
lea edx, [ebp - 0x108]
push 0x2e
push edx
call dword [sym.imp.MSVCR100.dll_strrchr]
mov esi, eax
add esp, 8
cmp esi, ebx
je 0x4019f7
push 0x405fa8
push esi
call dword [sym.imp.MSVCR100.dll_strpbrk]
add esp, 8
test eax, eax
jne 0x4019f7
mov byte [esi], bl
lea eax, [ebp - 0x108]
dec eax
mov edi, edi
mov cl, byte [eax + 1]
inc eax
test cl, cl
jne 0x401a00
mov ecx, dword [str..lst]
mov dl, byte [0x405fa4]
mov dword [eax], ecx
mov byte [eax + 4], dl
jmp 0x401a2a
mov eax, dword [edi + 8]
sub edx, eax
mov cl, byte [eax]
mov byte [edx + eax], cl
inc eax
test cl, cl
jne 0x401a20
mov eax, dword [edi + 4]
mov esi, dword [sym.imp.MSVCR100.dll_fopen]
push 0x405f9c
push eax
call esi
add esp, 8
mov dword [0x407728], eax
cmp eax, ebx
jne 0x401a5e
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
jmp 0x402024
lea edx, [ebp - 0x108]
push 0x405f70
push edx
call esi
add esp, 8
mov dword [ebp - 0x110c], eax
cmp eax, ebx
jne 0x401a93
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
jmp 0x402024
mov ecx, dword [0x407728]
push ecx
push 0x40772c
call fcn.00401023
mov edx, dword [0x407728]
mov esi, dword [sym.imp.MSVCR100.dll_fseek]
neg eax
push 0
sbb eax, eax
inc eax
push 0
push edx
mov dword [0x407748], eax
call esi
mov eax, dword [0x407728]
mov ebx, dword [sym.imp.MSVCR100.dll_fread]
push eax
push 1
push 0x38
push 0x40774c
call ebx
add esp, 0x24
test eax, eax
jne 0x401b32
mov ecx, dword [0x407728]
push ecx
call dword [sym.imp.MSVCR100.dll_feof]
add esp, 4
test eax, eax
je 0x401b0c
mov eax, str.End_of_file_reached
push eax
push str.Unable_to_read_AMX_header:__s_n
call dword [sym.imp.MSVCR100.dll_printf]
add esp, 8
jmp 0x402024
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
call dword [sym.imp.MSVCR100.dll_printf]
add esp, 8
jmp 0x402024
mov eax, 0xf1e0
cmp word [0x407750], ax
je 0x401b4a
push str.Not_a_valid_AMX_file_n
jmp 0x40201b
movsx ecx, byte [0x407752]
mov edx, dword [ebp - 0x110c]
mov edi, dword [0x407760]
sub edi, dword [0x407758]
push ecx
push str._File_version:__d_n
push edx
call dword [sym.imp.MSVCR100.dll_fprintf]
mov eax, dword [ebp - 0x110c]
push str._Flags:
push eax
call dword [sym.imp.MSVCR100.dll_fprintf]
add esp, 0x14
test byte [0x407754], 4
je 0x401ba3
mov ecx, dword [ebp - 0x110c]
push str._compact_encoding
push ecx
call dword [sym.imp.MSVCR100.dll_fprintf]
add esp, 8
test byte [0x407754], 2
je 0x401bc1
mov edx, dword [ebp - 0x110c]
push str._debug_info
push edx
call dword [sym.imp.MSVCR100.dll_fprintf]
add esp, 8
test byte [0x407754], 0x10
je 0x401bdf
mov eax, dword [ebp - 0x110c]
push str._no_checks
push eax
call dword [sym.imp.MSVCR100.dll_fprintf]
add esp, 8
test byte [0x407754], 8
je 0x401bfd
mov ecx, dword [ebp - 0x110c]
push str._sleep
push ecx
call dword [sym.imp.MSVCR100.dll_fprintf]
add esp, 8
mov edx, dword [ebp - 0x110c]
push 0x405e78
push edx
call dword [sym.imp.MSVCR100.dll_fprintf]
push edi
call dword [sym.imp.MSVCR100.dll_malloc]
add esp, 0xc
mov dword [ebp - 0x1110], eax
test eax, eax
jne 0x401c37
push edi
push str.Insufficient_memory:_need__d_bytes_n
call dword [sym.imp.MSVCR100.dll_printf]
add esp, 8
jmp 0x402024
mov eax, dword [0x407758]
mov ecx, dword [0x407728]
push 0
push eax
push ecx
call esi
mov edx, dword [0x407728]
mov eax, dword [ebp - 0x1110]
mov esi, dword [0x40774c]
sub esi, dword [0x407758]
push edx
push edi
push 1
push eax
call ebx
add esp, 0x1c
cmp eax, esi
jge 0x401cc1
mov ecx, dword [0x407728]
push ecx
call dword [sym.imp.MSVCR100.dll_feof]
add esp, 4
test eax, eax
je 0x401c9b
mov eax, str.End_of_file_reached
push eax
push str.Unable_to_read_code:__s_n
call dword [sym.imp.MSVCR100.dll_printf]
add esp, 8
jmp 0x402024
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_code:__s_n
call dword [sym.imp.MSVCR100.dll_printf]
add esp, 8
jmp 0x402024
test byte [0x407754], 4
je 0x401ce5
mov ecx, dword [0x407760]
sub ecx, dword [0x407758]
mov edx, dword [ebp - 0x1110]
push esi
call fcn.00401760
add esp, 4
mov eax, dword [0x40775c]
sub eax, dword [0x407758]
mov ebx, dword [ebp - 0x1110]
mov edi, ebx
mov dword [ebp - 0x1120], eax
mov dword [ebp - 0x1114], 0xffffffff
test eax, eax
jle 0x401e99
cmp dword [edi], 0x2e
jne 0x401d2a
mov eax, dword [ebp - 0x110c]
push 0x405d08
push eax
call dword [sym.imp.MSVCR100.dll_fprintf]
add esp, 8
cmp dword [0x407748], 0
je 0x401e54
mov esi, edi
sub esi, ebx
sar esi, 2
lea ecx, [ebp - 0x1124]
add esi, esi
push ecx
add esi, esi
push esi
push 0x40772c
call fcn.00401078
lea edx, [ebp - 0x1118]
push edx
push esi
push 0x40772c
call fcn.00401073
mov eax, dword [ebp - 0x1124]
add esp, 0x18
test eax, eax
je 0x401e54
mov ecx, dword [ebp - 0x1118]
cmp ecx, dword [ebp - 0x1114]
je 0x401e54
inc ecx
push ecx
push eax
mov eax, dword [ebp - 0x110c]
push str._s:_ld_n
push eax
call dword [sym.imp.MSVCR100.dll_fprintf]
mov ecx, dword [ebp - 0x1124]
push 0x405e1c
push ecx
call dword [sym.imp.MSVCR100.dll_fopen]
mov esi, eax
add esp, 0x18
test esi, esi
je 0x401e48
xor ebx, ebx
cmp dword [ebp - 0x1118], ebx
jl 0x401e38
jmp 0x401dd0
push esi
lea edx, [ebp - 0x1108]
push 0xfff
push edx
call dword [sym.imp.MSVCR100.dll_fgets]
add esp, 0xc
test eax, eax
je 0x401e38
mov al, byte [ebp - 0x1108]
xor ecx, ecx
cmp al, 0x20
jg 0x401e06
test al, al
je 0x401e06
mov al, byte [ebp + ecx - 0x1107]
inc ecx
cmp al, 0x20
jle 0x401df6
cmp byte [ebp + ecx - 0x1108], 0
je 0x401e2f
cmp ebx, dword [ebp - 0x1114]
jle 0x401e2f
mov eax, dword [ebp - 0x110c]
push eax
lea ecx, [ebp - 0x1108]
push ecx
call dword [sym.imp.MSVCR100.dll_fputs]
add esp, 8
inc ebx
cmp ebx, dword [ebp - 0x1118]
jle 0x401dd0
push esi
call dword [sym.imp.MSVCR100.dll_fclose]
mov ebx, dword [ebp - 0x1110]
add esp, 4
mov edx, dword [ebp - 0x1118]
mov dword [ebp - 0x1114], edx
mov eax, dword [edi]
cmp eax, 0x9e
jae 0x402000
mov ecx, dword [eax*8 + 0x407004]
test ecx, ecx
je 0x402000
mov edx, edi
sub edx, ebx
push edx
mov edx, dword [ebp - 0x110c]
push eax
lea eax, [edi + 4]
push eax
push edx
call ecx
lea edi, [edi + eax*4]
mov eax, edi
sub eax, ebx
add esp, 0x10
cmp eax, dword [ebp - 0x1120]
jl 0x401d10
mov eax, dword [ebp - 0x110c]
push str._n_n_DATA
push eax
call dword [sym.imp.MSVCR100.dll_fprintf]
mov eax, dword [0x407758]
mov esi, dword [0x40775c]
mov ebx, dword [0x407760]
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 0x401fa1
mov dword [ebp - 0x1114], eax
test edi, edi
jne 0x401f52
lea eax, [ebp - 0x108]
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x401ef5
sub eax, edx
je 0x401f23
mov edx, dword [ebp - 0x110c]
lea ecx, [ebp - 0x108]
push ecx
push 0x405e0c
push edx
call dword [sym.imp.MSVCR100.dll_fprintf]
add esp, 0xc
mov byte [ebp - 0x108], 0
mov eax, dword [ebp - 0x1114]
mov ecx, dword [ebp - 0x110c]
sar eax, 2
add eax, eax
add eax, eax
sub eax, dword [0x40775c]
add eax, dword [0x407758]
push eax
push str._n_08x
push ecx
call dword [sym.imp.MSVCR100.dll_fprintf]
add esp, 0xc
mov edx, dword [esi]
mov eax, dword [ebp - 0x110c]
push edx
push str._08x
push eax
call dword [sym.imp.MSVCR100.dll_fprintf]
mov eax, dword [esi]
add esp, 0xc
mov ecx, edi
lea edx, [ebp - 0x108]
call fcn.004018c0
inc edi
and edi, 0x80000003
jns 0x401f87
dec edi
or edi, 0xfffffffc
inc edi
mov eax, dword [ebp - 0x1114]
add eax, 4
add esi, 4
mov dword [ebp - 0x1114], eax
cmp eax, ebx
jl 0x401ee8
lea eax, [ebp - 0x108]
lea edx, [eax + 1]
lea ebx, [ebx]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x401fb0
sub eax, edx
je 0x401fde
mov edx, dword [ebp - 0x110c]
lea ecx, [ebp - 0x108]
push ecx
push 0x405e0c
push edx
call dword [sym.imp.MSVCR100.dll_fprintf]
add esp, 0xc
mov byte [ebp - 0x108], 0
cmp dword [0x407748], 0
je 0x401ff4
push 0x40772c
call fcn.00401091
add esp, 4
mov dword [ebp - 0x111c], 0
jmp 0x402024
mov ecx, edi
sub ecx, ebx
push ecx
push eax
push str.Invalid_opcode__08x_at_address__08x_n
call dword [sym.imp.MSVCR100.dll_printf]
add esp, 0xc
jmp 0x402024
push str.Usage:_pawndisasm__input___output__n
call dword [sym.imp.MSVCR100.dll_printf]
add esp, 4
mov eax, dword [ebp - 0x1110]
push eax
call dword [sym.imp.MSVCR100.dll_free]
mov eax, dword [0x407728]
add esp, 4
pop edi
pop esi
pop ebx
test eax, eax
je 0x40204a
push eax
call dword [sym.imp.MSVCR100.dll_fclose]
add esp, 4
mov eax, dword [ebp - 0x110c]
test eax, eax
je 0x40205e
push eax
call dword [sym.imp.MSVCR100.dll_fclose]
add esp, 4
mov ecx, dword [ebp - 4]
mov eax, dword [ebp - 0x111c]
xor ecx, ebp
call fcn.00402ef4
mov esp, ebp
pop ebp
ret