Function at 0x401520
Capabilities:
Read file on windows

Disassembly:
sub esp, 0x1a0
mov eax, dword [0x409034]
push ebx
push esi
push 0
push 0x20
push 4
push 0
push 3
mov dword [esp + 0x1b8], eax
mov eax, dword [esp + 0x1c0]
push 0x80000000
mov ebx, ecx
push eax
mov dword [esp + 0x28], ebx
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov esi, eax
test esi, esi
jne 0x401586
mov ecx, dword [esp + 0x1b0]
push eax
push eax
push eax
push ecx
mov ecx, ebx
call fcn.00401140
pop esi
pop ebx
mov ecx, dword [esp + 0x19c]
call fcn.00403267
add esp, 0x1a0
ret 8
push edi
mov edi, dword [sym.imp.KERNEL32.dll_ReadFile]
push 0
lea edx, [esp + 0x10]
push edx
push 0x40
lea eax, [esp + 0x7c]
push eax
push esi
call edi
mov ax, word [esp + 0x70]
cmp al, 0x4d
jne 0x401993
cmp ah, 0x5a
jne 0x401993
mov eax, dword [esp + 0xac]
test eax, eax
jne 0x4015f3
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [esp + 0x1b4]
push 0
push 0
push 0
push ecx
mov ecx, ebx
call fcn.00401140
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x19c]
call fcn.00403267
add esp, 0x1a0
ret 8
push 0
push 0
push eax
push esi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
push 0
lea edx, [esp + 0x10]
push edx
push 0xf8
lea eax, [esp + 0xbc]
push eax
push esi
call edi
mov eax, dword [esp + 0x138]
test eax, eax
je 0x4015bf
movzx eax, word [esp + 0xb6]
lea edx, [eax + eax*4]
shl edx, 3
push ebp
push edx
call fcn.00403228
add esp, 4
mov ebp, eax
push 0
lea eax, [esp + 0x14]
push eax
movzx eax, word [esp + 0xc2]
lea ecx, [eax + eax*4]
shl ecx, 3
push ecx
push ebp
push esi
mov dword [esp + 0x30], ebp
call edi
movzx ecx, word [esp + 0xba]
xor eax, eax
test ecx, ecx
jle 0x401681
mov ebx, dword [esp + 0x13c]
lea edx, [ebp + 0xc]
cmp dword [edx], ebx
je 0x40167d
inc eax
add edx, 0x28
cmp eax, ecx
jl 0x401671
mov ebx, dword [esp + 0x14]
cmp eax, ecx
jne 0x4016aa
push ebp
call fcn.00403275
add esp, 4
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov edx, dword [esp + 0x1b8]
push 0
push 0
push 0
push edx
mov ecx, ebx
jmp 0x40175d
lea eax, [eax + eax*4]
lea eax, [ebp + eax*8]
mov ebp, dword [eax + 0x14]
mov eax, dword [eax + 0xc]
push 0
push 0
push ebp
sub eax, ebp
push esi
mov dword [esp + 0x50], eax
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
push 0
lea ecx, [esp + 0x14]
push ecx
push 0x10
lea edx, [esp + 0x30]
push edx
push esi
call edi
movzx eax, word [esp + 0x30]
movzx ecx, word [esp + 0x32]
add eax, ecx
shl eax, 3
push eax
call fcn.00403228
movzx ecx, word [esp + 0x36]
mov ebx, eax
movzx eax, word [esp + 0x34]
add esp, 4
push 0
lea edx, [esp + 0x14]
push edx
add eax, ecx
shl eax, 3
push eax
push ebx
push esi
call edi
movzx edx, word [esp + 0x30]
movzx ecx, word [esp + 0x32]
add ecx, edx
xor eax, eax
test ecx, ecx
jle 0x40172d
cmp word [ebx + eax*8], 3
je 0x40172d
inc eax
cmp eax, ecx
jl 0x401721
cmp eax, ecx
jne 0x40177b
push ebx
call fcn.00403275
mov edx, dword [esp + 0x20]
push edx
call fcn.00403275
add esp, 8
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [esp + 0x1b8]
push 0
push 0
push 0
push eax
mov ecx, dword [esp + 0x24]
call fcn.00401140
pop ebp
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x19c]
call fcn.00403267
add esp, 0x1a0
ret 8
mov ecx, dword [ebx + eax*8 + 4]
push 0
and ecx, 0x7fffffff
push 0
add ecx, ebp
push ecx
push esi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
push 0
lea edx, [esp + 0x14]
push edx
push 0x10
lea eax, [esp + 0x30]
push eax
push esi
call edi
push ebx
call fcn.00403275
movzx ecx, word [esp + 0x34]
movzx edx, word [esp + 0x36]
add ecx, edx
shl ecx, 3
push ecx
call fcn.00403228
movzx ecx, word [esp + 0x38]
movzx edx, word [esp + 0x3a]
add esp, 8
mov ebx, eax
push 0
lea eax, [esp + 0x14]
push eax
add ecx, edx
shl ecx, 3
push ecx
push ebx
push esi
mov dword [esp + 0x4c], ebx
call edi
movzx ecx, word [esp + 0x32]
xor eax, eax
mov dword [esp + 0x20], eax
mov dword [esp + 0x34], eax
mov dword [esp + 0x3c], eax
movzx eax, word [esp + 0x30]
add eax, ecx
test eax, eax
jle 0x401904
add ebx, 4
mov dword [esp + 0x18], ebx
lea esp, [esp]
mov edx, dword [esp + 0x18]
mov eax, dword [edx]
push 0
and eax, 0x7fffffff
push 0
add eax, ebp
push eax
push esi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
push 0
lea ecx, [esp + 0x14]
push ecx
push 0x10
lea edx, [esp + 0x50]
push edx
push esi
call edi
movzx eax, word [esp + 0x50]
movzx ecx, word [esp + 0x52]
add eax, ecx
shl eax, 3
push eax
call fcn.00403228
movzx ecx, word [esp + 0x56]
mov ebx, eax
movzx eax, word [esp + 0x54]
add esp, 4
push 0
lea edx, [esp + 0x14]
push edx
add eax, ecx
shl eax, 3
push eax
push ebx
push esi
call edi
mov edx, dword [ebx + 4]
push 0
push 0
add edx, ebp
push edx
push esi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
push ebx
call fcn.00403275
add esp, 4
push 0
lea eax, [esp + 0x14]
push eax
push 0x10
lea ecx, [esp + 0x70]
push ecx
push esi
call edi
mov eax, dword [esp + 0x68]
cmp eax, dword [esp + 0x20]
jbe 0x4018d0
mov edx, dword [esp + 0x14]
cmp eax, dword [edx]
ja 0x4018d0
mov edx, dword [esp + 0x6c]
mov ecx, dword [esp + 0x64]
mov dword [esp + 0x5c], edx
mov edx, dword [esp + 0x70]
mov dword [esp + 0x54], ecx
mov dword [esp + 0x58], eax
mov dword [esp + 0x60], edx
mov dword [esp + 0x20], eax
mov dword [esp + 0x34], ecx
mov ecx, dword [esp + 0x18]
movzx edx, word [esp + 0x32]
mov eax, dword [esp + 0x3c]
add ecx, 8
mov dword [esp + 0x18], ecx
movzx ecx, word [esp + 0x30]
inc eax
add ecx, edx
cmp eax, ecx
mov dword [esp + 0x3c], eax
jl 0x401810
mov ebp, dword [esp + 0x20]
test ebp, ebp
jne 0x401931
mov ebx, dword [esp + 0x38]
push ebx
call fcn.00403275
mov eax, dword [esp + 0x20]
push eax
call fcn.00403275
add esp, 8
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [esp + 0x1b8]
push 0
push 0
push 0
push ecx
jmp 0x401759
mov edx, dword [esp + 0x38]
push edx
call fcn.00403275
mov eax, dword [esp + 0x20]
push eax
call fcn.00403275
mov ecx, dword [esp + 0x1c]
mov edx, dword [ecx]
push edx
call fcn.00403228
mov edx, dword [esp + 0x4c]
add esp, 0xc
mov ebx, eax
mov eax, dword [esp + 0x34]
push 0
push 0
sub eax, edx
push eax
push esi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
push 0
lea eax, [esp + 0x14]
push eax
push ebp
push ebx
push esi
call edi
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov edx, dword [esp + 0x1b8]
lea ecx, [esp + 0x54]
push ecx
push ebx
push ebp
push edx
jmp 0x401759
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [esp + 0x1b4]
push 0
push 0
push 0
push eax
mov ecx, ebx
call fcn.00401140
mov ecx, dword [esp + 0x1a8]
pop edi
pop esi
pop ebx
call fcn.00403267
add esp, 0x1a0
ret 8