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 0x41cb80
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 0x40c120
push ebx
call fcn.00401260
add esp, 0xc
push 0x40c118
push 0x41cdb0
push ebx
call fcn.00401260
lea eax, [ebp - 0x24]
add esp, 0xc
push 0
push eax
push 1
push 0x41cdd5
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 0x41cdd4
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 0x41cdda
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 0x41cdd8
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 0x41cdb8
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 [0x41cdb8]
push eax
call fcn.00401230
cmp eax, 3
pop ecx
mov dword [0x41cdb8], eax
jne 0x401730
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 [0x41cdd0], 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 [0x41cdd0]
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
mov eax, dword [ebp - 0x14]
mov ecx, dword [0x41cdd0]
xor esi, esi
mov byte [ecx + eax + 0x10], 0
mov edi, 0x41cd80
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 0x401678
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 + 0x41cd80]
push eax
call fcn.00401230
mov dword [esi*4 + 0x41cd80], eax
inc esi
add edi, 4
pop ecx
cmp esi, 6
jl 0x401655
xor esi, esi
mov edi, 0x41cd98
lea eax, [eax]
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 0x4016a0
lea eax, [ebp - 0x24]
push 0
push eax
push 1
push 0x41cdd6
push ebx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x4016e0
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 0x41cdd9
push ebx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x401707
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 0x41cdd7
push ebx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x401730
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 0x40c128
push ebx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x40174e
cmp dword [ebp - 0x24], 1
jae 0x401760
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
lea esp, [ebp - 0xc]
pop edi
pop esi
pop ebx
pop ebp
ret
cmp byte [0x40c128], 0
je 0x401805
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 0x40178a
cmp dword [ebp - 0x24], 1
jae 0x4017a0
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 [0x41cdc4], eax
jne 0x4017c7
lea esp, [ebp - 0xc]
pop edi
pop esi
pop ebx
pop ebp
ret
lea eax, [ebp - 0x24]
mov edx, dword [ebp - 0x10]
push 0
push eax
mov eax, dword [0x41cdc4]
push edx
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x4017e8
cmp dword [ebp - 0x24], 1
jae 0x4017f7
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]
mov ecx, dword [0x41cdc4]
mov byte [ecx + eax + 0x10], 0
lea eax, [ebp - 0x18]
push eax
push 0x40c124
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