Function at 0x401450
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
mov eax, 0x132c
call fcn.004022c0
mov eax, dword [0x405770]
xor eax, ebp
mov dword [ebp - 4], eax
mov ecx, dword [ebp + 8]
push esi
mov esi, dword [ebp + 0xc]
lea eax, [ecx - 2]
cmp eax, 1
ja 0x401c3b
lea edx, [ebp - 0x108]
push edi
cmp ecx, 2
jne 0x4014eb
mov ecx, dword [esi + 4]
sub edx, ecx
nop dword [eax + eax]
mov al, byte [ecx]
lea ecx, [ecx + 1]
mov byte [edx + ecx - 1], al
test al, al
jne 0x401490
lea eax, [ebp - 0x108]
push 0x2e
push eax
call sub.VCRUNTIME140.dll_strrchr
mov edi, eax
add esp, 8
test edi, edi
je 0x4014c9
push 0x403760
push edi
call dword [sym.imp.api_ms_win_crt_string_l1_1_0.dll_strpbrk]
add esp, 8
test eax, eax
jne 0x4014c9
mov byte [edi], al
lea ecx, [ebp - 0x108]
dec ecx
mov al, byte [ecx + 1]
lea ecx, [ecx + 1]
test al, al
jne 0x4014d0
mov eax, dword [str..lst]
mov dword [ecx], eax
mov al, byte [0x403768]
mov byte [ecx + 4], al
jmp 0x4014fd
mov ecx, dword [esi + 8]
sub edx, ecx
mov al, byte [ecx]
lea ecx, [ecx + 1]
mov byte [edx + ecx - 1], al
test al, al
jne 0x4014f0
push ebx
mov ebx, dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fopen]
push 0x40376c
push dword [esi + 4]
call ebx
add esp, 8
mov dword [0x405788], eax
test eax, eax
jne 0x401540
push dword [esi + 4]
push str.Unable_to_open_input_file___s__n
call fcn.00401d70
add esp, 8
pop ebx
pop edi
mov eax, 1
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004022ae
mov esp, ebp
pop ebp
ret
lea eax, [ebp - 0x108]
push 0x403790
push eax
call ebx
mov edi, eax
add esp, 8
mov dword [ebp - 0x131c], edi
test edi, edi
jne 0x40156b
lea eax, [ebp - 0x108]
push eax
push str.Unable_to_create_output_file___s__n
jmp 0x401522
push dword [0x405788]
push 0x4057c8
call fcn.00401e30
neg eax
push 0
sbb eax, eax
push 0
push dword [0x405788]
inc eax
mov dword [0x4057c4], eax
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fseek]
push dword [0x405788]
push 1
push 0x38
push 0x40578c
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fread]
add esp, 0x24
test eax, eax
jne 0x4015f0
push dword [0x405788]
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_feof]
add esp, 4
test eax, eax
je 0x4015d4
mov eax, str.End_of_file_reached
push eax
push str.Unable_to_read_AMX_header:__s_n
jmp 0x401522
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__errno]
push dword [eax]
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll_strerror]
add esp, 4
push eax
push str.Unable_to_read_AMX_header:__s_n
jmp 0x401522
mov eax, 0xf1e0
cmp word [0x405790], ax
je 0x401610
push str.Not_a_valid_AMX_file_n
call fcn.00401d70
add esp, 4
jmp 0x40152a
movsx eax, byte [0x405792]
mov esi, dword [0x4057a0]
sub esi, dword [0x405798]
push eax
push str._File_version:__d_n
push edi
mov dword [ebp - 0x1318], esi
call fcn.00401420
push str._Flags:
push edi
call fcn.00401420
mov ax, word [0x405794]
add esp, 0x14
test al, 4
je 0x401661
push str.compact_encoding
push edi
call fcn.00401420
mov ax, word [0x405794]
add esp, 8
test al, 2
je 0x401679
push str.debug_info
push edi
call fcn.00401420
mov ax, word [0x405794]
add esp, 8
test al, 0x10
je 0x401691
push str.no_checks
push edi
call fcn.00401420
mov ax, word [0x405794]
add esp, 8
test al, 8
je 0x4016a3
push str.sleep
push edi
call fcn.00401420
add esp, 8
push 0x40385c
push edi
call fcn.00401420
push esi
call dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_malloc]
mov ebx, eax
add esp, 0xc
mov dword [ebp - 0x1324], ebx
test ebx, ebx
jne 0x4016cf
push esi
push str.Insufficient_memory:_need__d_bytes_n
jmp 0x401522
push 0
push dword [0x405798]
push dword [0x405788]
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fseek]
push dword [0x405788]
mov esi, dword [0x40578c]
push dword [ebp - 0x1318]
sub esi, dword [0x405798]
push 1
push ebx
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fread]
add esp, 0x1c
cmp eax, esi
jge 0x40174a
push dword [0x405788]
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_feof]
add esp, 4
test eax, eax
je 0x40172e
mov eax, str.End_of_file_reached
push eax
push str.Unable_to_read_code:__s_n
jmp 0x401522
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__errno]
push dword [eax]
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll_strerror]
add esp, 4
push eax
push str.Unable_to_read_code:__s_n
jmp 0x401522
test byte [0x405794], 4
je 0x40188b
mov eax, dword [0x4057a0]
xor edi, edi
sub eax, dword [0x405798]
xor ebx, ebx
mov dword [ebp - 0x1314], eax
mov dword [ebp - 0x1318], edi
mov dword [ebp - 0x130c], ebx
test esi, esi
jle 0x40187f
mov ebx, dword [ebp - 0x1324]
xor edx, edx
xor ecx, ecx
nop word [eax + eax]
mov al, byte [esi + ebx - 1]
dec esi
mov byte [ebp - 0x131d], al
movzx eax, al
and eax, 0x7f
shl eax, cl
add ecx, 7
or edx, eax
test esi, esi
jle 0x4017b3
cmp byte [esi + ebx - 1], 0
jl 0x401790
mov ebx, dword [ebp - 0x130c]
mov dword [ebp - 0x1310], edx
cmp ecx, 0x20
jge 0x4017e7
test byte [ebp - 0x131d], 0x40
je 0x4017e7
nop dword [eax]
mov eax, 0xff
shl eax, cl
add ecx, 8
or edx, eax
cmp ecx, 0x20
jl 0x4017d0
mov dword [ebp - 0x1310], edx
test ebx, ebx
je 0x401825
mov edx, dword [ebp - 0x1324]
mov ecx, dword [ebp + edi*8 - 0x1308]
cmp ecx, esi
jle 0x401819
mov eax, dword [ebp + edi*8 - 0x1304]
inc edi
mov dword [ecx + edx], eax
and edi, 0x8000003f
jns 0x401814
dec edi
or edi, 0xffffffc0
inc edi
sub ebx, 1
jne 0x4017f1
mov edx, dword [ebp - 0x1310]
mov dword [ebp - 0x130c], ebx
mov ecx, dword [ebp - 0x1314]
sub ecx, 4
mov dword [ebp - 0x1314], ecx
cmp ecx, esi
jg 0x40186e
jne 0x40183e
test ecx, ecx
je 0x40186e
mov eax, dword [ebp - 0x1318]
mov dword [ebp + eax*8 - 0x1308], ecx
mov dword [ebp + eax*8 - 0x1304], edx
inc eax
and eax, 0x8000003f
jns 0x40185f
dec eax
or eax, 0xffffffc0
inc eax
inc ebx
mov dword [ebp - 0x1318], eax
mov dword [ebp - 0x130c], ebx
jmp 0x401877
mov eax, dword [ebp - 0x1324]
mov dword [ecx + eax], edx
test esi, esi
jg 0x401780
mov edi, dword [ebp - 0x131c]
mov ebx, dword [ebp - 0x1324]
mov eax, dword [0x40579c]
mov ecx, ebx
sub eax, dword [0x405798]
mov dword [ebp - 0x1314], ebx
mov dword [ebp - 0x1318], eax
mov dword [ebp - 0x1310], 0xffffffff
test eax, eax
jle 0x401a4b
xor esi, esi
mov dword [ebp - 0x130c], esi
nop
cmp dword [ecx], 0x2e
jne 0x4018d3
push 0x4036b8
push edi
call fcn.00401420
add esp, 8
cmp dword [0x4057c4], 0
je 0x4019fc
lea eax, [ebp - 0x132c]
and esi, 0xfffffffc
push eax
push esi
push 0x4057c8
call fcn.00402190
lea eax, [ebp - 0x1328]
push eax
push esi
push 0x4057c8
call fcn.00402260
mov ecx, dword [ebp - 0x132c]
add esp, 0x18
test ecx, ecx
je 0x4019f6
mov eax, dword [ebp - 0x1328]
cmp eax, dword [ebp - 0x1310]
je 0x4019f6
inc eax
push eax
push ecx
push str._s:_ld_n
push edi
call fcn.00401420
push 0x4038a8
push dword [ebp - 0x132c]
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fopen]
add esp, 0x18
mov dword [ebp - 0x131c], eax
test eax, eax
je 0x4019ea
xor esi, esi
cmp dword [ebp - 0x1328], esi
jl 0x4019e0
mov ebx, eax
nop word [eax + eax]
push ebx
lea eax, [ebp - 0x1108]
push 0xfff
push eax
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fgets]
add esp, 0xc
test eax, eax
je 0x4019d4
mov cl, byte [ebp - 0x1108]
xor eax, eax
cmp cl, 0x20
jg 0x4019a8
test cl, cl
je 0x4019a8
mov cl, byte [ebp + eax - 0x1107]
inc eax
cmp cl, 0x20
jle 0x401997
cmp esi, dword [ebp - 0x1310]
jle 0x4019cb
cmp byte [ebp + eax - 0x1108], 0
je 0x4019cb
lea eax, [ebp - 0x1108]
push edi
push eax
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fputs]
add esp, 8
inc esi
cmp esi, dword [ebp - 0x1328]
jle 0x401970
mov ebx, dword [ebp - 0x1324]
mov eax, dword [ebp - 0x131c]
push eax
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fclose]
add esp, 4
mov eax, dword [ebp - 0x1328]
mov dword [ebp - 0x1310], eax
mov esi, dword [ebp - 0x130c]
mov ecx, dword [ebp - 0x1314]
and esi, 0xfffffffc
push esi
mov ecx, dword [ecx]
movzx eax, cx
push ecx
lea eax, [eax + eax*2]
mov edx, dword [eax*4 + 0x405008]
mov eax, dword [ebp - 0x1314]
add eax, 4
push eax
push edi
call edx
mov ecx, dword [ebp - 0x1314]
add esp, 0x10
lea ecx, [ecx + eax*4]
mov esi, ecx
mov dword [ebp - 0x1314], ecx
sub esi, ebx
mov dword [ebp - 0x130c], esi
cmp esi, dword [ebp - 0x1318]
jl 0x4018c0
push str._n_n_DATA
push edi
call fcn.00401420
mov esi, dword [0x40579c]
xor eax, eax
sub esi, dword [0x405798]
add esp, 8
mov dword [ebp - 0x131c], esi
mov dword [ebp - 0x1310], eax
mov byte [ebp - 0x108], al
lea ecx, [esi + ebx]
mov dword [ebp - 0x130c], ecx
mov ecx, dword [0x4057a0]
sub ecx, dword [0x405798]
mov dword [ebp - 0x1318], ecx
cmp esi, ecx
jge 0x401bc7
mov ebx, dword [ebp - 0x130c]
test eax, eax
jne 0x401af7
lea ecx, [ebp - 0x108]
lea edx, [ecx + 1]
nop
mov al, byte [ecx]
inc ecx
test al, al
jne 0x401ab0
sub ecx, edx
je 0x401ad7
lea eax, [ebp - 0x108]
push eax
push 0x4038b4
push edi
call fcn.00401420
add esp, 0xc
mov byte [ebp - 0x108], 0
mov eax, esi
and eax, 0xfffffffc
sub eax, dword [0x40579c]
add eax, dword [0x405798]
push eax
push str._n_08x
push edi
call fcn.00401420
add esp, 0xc
push dword [ebx]
push str._08x
push edi
call fcn.00401420
mov ebx, dword [ebx]
lea esi, [ebp - 0x108]
mov eax, dword [ebp - 0x1310]
add esp, 0xc
lea esi, [esi + eax*4]
mov edx, 0x20
mov eax, ebx
shl ebx, 8
sar eax, 0x18
movzx ecx, al
cmp ecx, edx
mov eax, ecx
cmovae edx, eax
mov eax, ebx
sar eax, 0x18
movzx ecx, al
mov byte [esi], dl
mov eax, ecx
shl ebx, 8
mov edx, 0x20
cmp ecx, edx
cmovae edx, eax
mov eax, ebx
sar eax, 0x18
movzx ecx, al
mov byte [esi + 1], dl
mov eax, ecx
shl ebx, 8
mov edx, 0x20
cmp ecx, edx
cmovae edx, eax
sar ebx, 0x18
mov byte [esi + 2], dl
mov edx, 0x20
movzx ecx, bl
cmp ecx, edx
mov eax, ecx
cmovae edx, eax
mov eax, dword [ebp - 0x1310]
inc eax
mov byte [esi + 3], dl
mov byte [esi + 4], 0
and eax, 0x80000003
jns 0x401b91
dec eax
or eax, 0xfffffffc
inc eax
mov esi, dword [ebp - 0x131c]
mov ebx, dword [ebp - 0x130c]
add esi, 4
add ebx, 4
mov dword [ebp - 0x1310], eax
mov dword [ebp - 0x130c], ebx
mov dword [ebp - 0x131c], esi
cmp esi, dword [ebp - 0x1318]
jl 0x401aa2
mov ebx, dword [ebp - 0x1324]
lea ecx, [ebp - 0x108]
lea edx, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x401bd0
sub ecx, edx
je 0x401bf7
lea eax, [ebp - 0x108]
push eax
push 0x4038b4
push edi
call fcn.00401420
add esp, 0xc
mov byte [ebp - 0x108], 0
cmp dword [0x4057c4], 0
je 0x401c0d
push 0x4057c8
call fcn.00401da0
add esp, 4
push ebx
call dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
push dword [0x405788]
mov ebx, dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fclose]
call ebx
push edi
call ebx
add esp, 0xc
xor eax, eax
pop ebx
pop edi
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004022ae
mov esp, ebp
pop ebp
ret
push str.Usage:_pawndisasm__input___output__n
call fcn.00401d70
mov ecx, dword [ebp - 4]
add esp, 4
xor ecx, ebp
mov eax, 1
pop esi
call fcn.004022ae
mov esp, ebp
pop ebp
ret