Function at 0x420360
Capabilities:
Check if file exists
Get file attributes
Get file size
Parse pe header
Read file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x78
mov eax, dword [0x44bb64]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 0xc]
mov ecx, dword [ebp + 0x10]
mov edx, dword [ebp + 0x14]
push esi
mov esi, dword [ebp + 8]
push edi
mov edi, dword [ebp + 0x1c]
mov dword [ebp - 0x64], eax
mov eax, dword [ebp + 0x18]
push esi
mov dword [ebp - 0x70], ecx
mov dword [ebp - 0x78], edx
mov dword [ebp - 0x6c], eax
call dword [sym.imp.KERNEL32.dll_GetFileType]
cmp eax, 1
je 0x4203b1
pop edi
mov eax, 0x1000000
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004234ee
mov esp, ebp
pop ebp
ret
push ebx
xor ebx, ebx
cmp edi, ebx
je 0x4203da
push edi
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
jne 0x4203ec
pop ebx
pop edi
mov eax, 0x200
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004234ee
mov esp, ebp
pop ebp
ret
lea ecx, [ebp - 0x38]
push ecx
push esi
call dword [sym.imp.KERNEL32.dll_GetFileInformationByHandle]
test eax, eax
je 0x4203c4
mov eax, dword [ebp - 0x38]
mov edx, eax
xor edi, edi
and edx, 1
je 0x4203ff
mov dword [ebp - 0x3c], 1
mov edi, dword [ebp - 0x3c]
test al, 2
je 0x420406
or edi, 2
test al, 4
je 0x42040d
or edi, 4
mov ecx, eax
and ecx, 0x10
je 0x420417
or edi, 0x10
test al, 0x20
je 0x42041e
or edi, 0x20
cmp ecx, ebx
je 0x42042a
or edi, 0x40000000
jmp 0x420430
or edi, 0x80000000
or edi, 0x1000000
mov dword [ebp - 0x3c], edi
cmp edx, ebx
jne 0x420446
or edi, 0x800000
mov dword [ebp - 0x3c], edi
push ebx
push esi
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov dword [ebp - 0x44], eax
cmp eax, 0x28
jbe 0x4204ea
mov edi, dword [sym.imp.KERNEL32.dll_SetFilePointer]
push ebx
push ebx
push ebx
push esi
call edi
push ebx
mov ebx, dword [sym.imp.KERNEL32.dll_ReadFile]
lea edx, [ebp - 0x50]
push edx
push 2
lea eax, [ebp - 0x40]
push eax
push esi
call ebx
push 0
push 0
push 0x24
push esi
call edi
push 0
lea ecx, [ebp - 0x50]
push ecx
push 4
lea edx, [ebp - 0x68]
push edx
push esi
call ebx
mov eax, 0x54ad
cmp word [ebp - 0x40], ax
jne 0x4204e5
mov eax, dword [ebp - 0x68]
lea ecx, [eax + 0x34]
cmp dword [ebp - 0x44], ecx
jbe 0x4204e5
push 0
push 0
push eax
push esi
call edi
push 0
lea edx, [ebp - 0x50]
push edx
push 4
lea eax, [ebp - 0x74]
push eax
push esi
call ebx
mov eax, dword [ebp - 0x74]
cmp eax, 0x5a4d
je 0x4204de
cmp eax, 0x454e
je 0x4204de
cmp eax, 0x454c
je 0x4204de
cmp eax, 0x4550
jne 0x4204e5
or dword [ebp - 0x3c], 0x400000
mov edi, dword [ebp - 0x3c]
xor ebx, ebx
mov eax, dword [ebp - 0x64]
cmp eax, ebx
je 0x4204f3
mov dword [eax], edi
mov eax, dword [ebp - 0x70]
cmp eax, ebx
je 0x4204ff
mov ecx, dword [ebp - 0x44]
mov dword [eax], ecx
lea edx, [ebp - 0x4c]
push edx
lea eax, [ebp - 0x58]
push eax
lea ecx, [ebp - 0x60]
push ecx
push esi
mov dword [ebp - 0x58], ebx
mov dword [ebp - 0x54], ebx
mov dword [ebp - 0x4c], ebx
mov dword [ebp - 0x48], ebx
mov dword [ebp - 0x60], ebx
mov dword [ebp - 0x5c], ebx
call dword [sym.imp.KERNEL32.dll_GetFileTime]
mov esi, dword [ebp - 0x78]
cmp esi, ebx
je 0x420566
mov edx, dword [ebp - 0x54]
mov eax, dword [ebp - 0x58]
push edx
push eax
call fcn.004202b0
mov ecx, dword [ebp - 0x48]
mov dword [esi + 4], edx
mov edx, dword [ebp - 0x4c]
push ecx
push edx
mov dword [esi], eax
call fcn.004202b0
mov ecx, dword [ebp - 0x60]
mov dword [esi + 8], eax
mov eax, dword [ebp - 0x5c]
push eax
push ecx
mov dword [esi + 0xc], edx
call fcn.004202b0
add esp, 0x18
mov dword [esi + 0x10], eax
mov dword [esi + 0x14], edx
mov esi, dword [ebp - 0x6c]
cmp esi, ebx
je 0x42058e
lea edx, [ebp - 0x3c]
push edx
lea eax, [ebp - 0x40]
push eax
lea ecx, [ebp - 0x4c]
push ecx
call dword [sym.imp.KERNEL32.dll_FileTimeToDosDateTime]
movzx edx, word [ebp - 0x40]
movzx eax, word [ebp - 0x3c]
shl edx, 0x10
or edx, eax
mov dword [esi], edx
mov ecx, dword [ebp - 4]
pop ebx
pop edi
xor ecx, ebp
xor eax, eax
pop esi
call fcn.004234ee
mov esp, ebp
pop ebp
ret