Function at 0x401310
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
push ebx
push esi
push edi
sub esp, 0x20
mov dword [ebp - 0x28], 0
push 0
push pe_nt_image_headers32
push 3
push 0
push 1
push SysReAllocString
push 0x422b80
mov dword [ebp - 0x20], 0
mov dword [ebp - 0x24], 0
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov ebx, eax
push 2
push 0
push 0xffffffffffffffec
push ebx
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp eax, 0xffffffff
jne 0x401370
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
lea esp, [ebp - 0xc]
pop edi
pop esi
pop ebx
pop ebp
ret
lea eax, [ebp - 0x24]
push 0
push eax
lea eax, [ebp - 0x28]
push 4
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x40139e
cmp dword [ebp - 0x24], 4
jb 0x40139e
mov eax, dword [ebp - 0x28]
push eax
call fcn.00401230
cmp eax, 0x38424452
pop ecx
je 0x4013b0
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
lea esp, [ebp - 0xc]
pop edi
pop esi
pop ebx
pop ebp
ret
lea eax, [ebp - 0x24]
push 0
push eax
lea eax, [ebp - 0x1c]
push 4
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x4013de
cmp dword [ebp - 0x24], 4
jb 0x4013de
mov eax, dword [ebp - 0x1c]
push eax
call fcn.00401230
cmp eax, 3
pop ecx
je 0x4013f0
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
lea esp, [ebp - 0xc]
pop edi
pop esi
pop ebx
pop ebp
ret
lea eax, [ebp - 0x24]
push 0
push eax
lea eax, [ebp - 0x20]
push 4
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x40140d
cmp dword [ebp - 0x24], 4
jae 0x401420
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
lea esp, [ebp - 0xc]
pop edi
pop esi
pop ebx
pop ebp
ret
mov eax, dword [ebp - 0x20]
push eax
call fcn.00401230
pop ecx
mov dword [ebp - 0x20], eax
push 0
push 0
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp eax, 0xffffffff
jne 0x401450
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
lea esp, [ebp - 0xc]
pop edi
pop esi
pop ebx
pop ebp
ret
lea eax, [ebp - 0x24]
push 0
push eax
lea eax, [ebp - 0x28]
push 4
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x40147e
cmp dword [ebp - 0x24], 4
jb 0x40147e
mov eax, dword [ebp - 0x28]
push eax
call fcn.00401230
cmp eax, 0x38424452
pop ecx
je 0x401490
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
lea esp, [ebp - 0xc]
pop edi
pop esi
pop ebx
pop ebp
ret
lea eax, [ebp - 0x18]
push eax
push 0x40c130
push ebx
call fcn.00401260
add esp, 0xc
push 0x40c128
push 0x422db0
push ebx
call fcn.00401260
lea eax, [ebp - 0x24]
add esp, 0xc
push 0
push eax
push 1
push 0x422dd5
push ebx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x4014d3
cmp dword [ebp - 0x24], 1
jae 0x4014e2
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
lea esp, [ebp - 0xc]
pop edi
pop esi
pop ebx
pop ebp
ret
lea eax, [ebp - 0x24]
push 0
push eax
push 1
push 0x422dd4
push ebx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x401500
cmp dword [ebp - 0x24], 1
jae 0x401510
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
lea esp, [ebp - 0xc]
pop edi
pop esi
pop ebx
pop ebp
ret
lea eax, [ebp - 0x24]
push 0
push eax
push 1
push 0x422dda
push ebx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x40152e
cmp dword [ebp - 0x24], 1
jae 0x401540
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
lea esp, [ebp - 0xc]
pop edi
pop esi
pop ebx
pop ebp
ret
lea eax, [ebp - 0x24]
push 0
push eax
push 1
push 0x422dd8
push ebx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x40155e
cmp dword [ebp - 0x24], 1
jae 0x401570
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
lea esp, [ebp - 0xc]
pop edi
pop esi
pop ebx
pop ebp
ret
lea eax, [ebp - 0x24]
push 0
push eax
push 4
push 0x422db8
push ebx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x40158e
cmp dword [ebp - 0x24], 1
jae 0x4015a0
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
lea esp, [ebp - 0xc]
pop edi
pop esi
pop ebx
pop ebp
ret
mov eax, dword [0x422db8]
push eax
call fcn.00401230
cmp eax, 3
pop ecx
mov dword [0x422db8], eax
jne 0x401727
lea eax, [ebp - 0x24]
push 0
push eax
lea eax, [ebp - 0x14]
push 4
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x4015d9
cmp dword [ebp - 0x24], 1
jae 0x4015e8
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
lea esp, [ebp - 0xc]
pop edi
pop esi
pop ebx
pop ebp
ret
mov eax, dword [ebp - 0x14]
push eax
call fcn.00401230
pop ecx
push eax
push 0x40
mov dword [ebp - 0x14], eax
call dword [sym.imp.KERNEL32.dll_GlobalAlloc]
test eax, eax
mov dword [0x422dd0], eax
jne 0x401610
lea esp, [ebp - 0xc]
pop edi
pop esi
pop ebx
pop ebp
ret
lea eax, [ebp - 0x24]
mov edx, dword [ebp - 0x14]
push 0
push eax
mov eax, dword [0x422dd0]
push edx
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x401631
cmp dword [ebp - 0x24], 1
jae 0x401640
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
lea esp, [ebp - 0xc]
pop edi
pop esi
pop ebx
pop ebp
ret
xor esi, esi
mov edi, 0x422d80
lea eax, [ebp - 0x24]
push 0
push eax
push 4
push edi
push ebx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x401670
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
lea esp, [ebp - 0xc]
pop edi
pop esi
pop ebx
pop ebp
ret
mov eax, dword [esi*4 + 0x422d80]
push eax
call fcn.00401230
mov dword [esi*4 + 0x422d80], eax
inc esi
add edi, 4
pop ecx
cmp esi, 6
jl 0x401647
xor esi, esi
mov edi, 0x422d98
lea eax, [ebp - 0x24]
push eax
push edi
push ebx
call fcn.00401260
inc esi
add esp, 0xc
add edi, 4
cmp esi, 6
jl 0x401695
lea eax, [ebp - 0x24]
push 0
push eax
push 1
push 0x422dd6
push ebx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x4016d3
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
lea esp, [ebp - 0xc]
pop edi
pop esi
pop ebx
pop ebp
ret
lea eax, [ebp - 0x24]
push 0
push eax
push 1
push 0x422dd9
push ebx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x401700
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
lea esp, [ebp - 0xc]
pop edi
pop esi
pop ebx
pop ebp
ret
lea eax, [ebp - 0x24]
push 0
push eax
push 1
push 0x422dd7
push ebx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x401727
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
lea esp, [ebp - 0xc]
pop edi
pop esi
pop ebx
pop ebp
ret
lea eax, [ebp - 0x24]
push 0
push eax
push 1
push 0x40c138
push ebx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x401745
cmp dword [ebp - 0x24], 1
jae 0x401754
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
lea esp, [ebp - 0xc]
pop edi
pop esi
pop ebx
pop ebp
ret
cmp byte [0x40c138], 0
je 0x4017e7
lea eax, [ebp - 0x24]
push 0
push eax
lea eax, [ebp - 0x10]
push 4
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x40177e
cmp dword [ebp - 0x24], 1
jae 0x401790
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
lea esp, [ebp - 0xc]
pop edi
pop esi
pop ebx
pop ebp
ret
mov eax, dword [ebp - 0x10]
push eax
call fcn.00401230
pop ecx
push eax
push 0x40
mov dword [ebp - 0x10], eax
call dword [sym.imp.KERNEL32.dll_GlobalAlloc]
test eax, eax
mov dword [0x422dc4], eax
jne 0x4017b7
lea esp, [ebp - 0xc]
pop edi
pop esi
pop ebx
pop ebp
ret
lea eax, [ebp - 0x24]
mov ecx, dword [ebp - 0x10]
push 0
push eax
mov eax, dword [0x422dc4]
push ecx
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x4017d8
cmp dword [ebp - 0x24], 1
jae 0x4017e7
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
lea esp, [ebp - 0xc]
pop edi
pop esi
pop ebx
pop ebp
ret
lea eax, [ebp - 0x18]
push eax
push 0x40c134
push ebx
call fcn.00401260
add esp, 0xc
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
lea esp, [ebp - 0xc]
pop edi
pop esi
pop ebx
pop ebp
ret