Function at 0x10005030
Capabilities:
Parse pe header
Read file on windows
Read file via mapping

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x48
mov eax, dword [0x1013ba6c]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 8]
mov ecx, dword [ebp + 0xc]
mov edx, dword [ebp + 0x10]
push esi
push 0
push 0
push 3
push 0
push 1
push connect
push eax
mov dword [ebp - 0x44], ecx
mov dword [ebp - 0x40], edx
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov esi, eax
cmp esi, 0xffffffff
je 0x10005083
lea eax, [ebp - 0x38]
push eax
push esi
call dword [sym.imp.KERNEL32.dll_GetFileInformationByHandle]
test eax, eax
jne 0x10005096
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
xor al, al
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.1001092b
mov esp, ebp
pop ebp
ret 0xc
mov ecx, dword [ebp - 0x14]
mov edx, dword [ebp - 0x18]
push edi
push 0
push ecx
push edx
push 2
push 0
push esi
call dword [sym.imp.KERNEL32.dll_CreateFileMappingA]
mov edi, eax
mov dword [ebp - 0x3c], edi
test edi, edi
jne 0x100050d0
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
pop edi
xor al, al
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.1001092b
mov esp, ebp
pop ebp
ret 0xc
mov eax, dword [ebp - 0x14]
push ebx
push eax
push 0
push 0
push 4
push edi
call dword [sym.imp.KERNEL32.dll_MapViewOfFile]
mov ebx, eax
test ebx, ebx
je 0x100050f9
mov ecx, 0x5a4d
cmp word [ebx], cx
je 0x1000511a
push ebx
call dword [sym.imp.KERNEL32.dll_UnmapViewOfFile]
push edi
mov edi, dword [sym.imp.KERNEL32.dll_CloseHandle]
call edi
push esi
call edi
pop ebx
pop edi
xor al, al
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.1001092b
mov esp, ebp
pop ebp
ret 0xc
mov edi, dword [ebx + 0x3c]
add edi, ebx
cmp dword [edi], 0x4550
jne 0x10005197
movzx eax, word [edi + 4]
mov ecx, 0x14c
cmp ax, cx
je 0x1000513f
mov edx, 0x8664
cmp ax, dx
jne 0x10005152
mov ecx, dword [edi + 0x28]
mov edx, dword [edi + 0x34]
push ecx
push edx
push edi
call dword [sym.imp.dbghelp.dll_ImageRvaToSection]
test eax, eax
jne 0x1000517d
push ebx
call dword [sym.imp.KERNEL32.dll_UnmapViewOfFile]
mov eax, dword [ebp - 0x3c]
mov edi, dword [sym.imp.KERNEL32.dll_CloseHandle]
push eax
call edi
push esi
call edi
pop ebx
pop edi
xor al, al
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.1001092b
mov esp, ebp
pop ebp
ret 0xc
mov ecx, dword [eax + 0x14]
sub ecx, dword [eax + 0xc]
push 0
add ecx, dword [edi + 0x28]
push 0
push ecx
push esi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp eax, 0xffffffff
jne 0x100051c2
push ebx
call dword [sym.imp.KERNEL32.dll_UnmapViewOfFile]
mov edx, dword [ebp - 0x3c]
mov edi, dword [sym.imp.KERNEL32.dll_CloseHandle]
push edx
call edi
push esi
call edi
pop ebx
pop edi
xor al, al
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.1001092b
mov esp, ebp
pop ebp
ret 0xc
mov ecx, dword [ebp - 0x40]
push 0
lea eax, [ebp - 0x48]
push eax
push 0x20
push ecx
push esi
mov dword [ebp - 0x48], 0
call dword [sym.imp.KERNEL32.dll_ReadFile]
push ebx
test eax, eax
je 0x10005198
mov eax, dword [edi + 0x28]
add eax, dword [edi + 0x34]
mov ecx, dword [ebp - 0x44]
mov dword [ecx], eax
call dword [sym.imp.KERNEL32.dll_UnmapViewOfFile]
mov edx, dword [ebp - 0x3c]
mov edi, dword [sym.imp.KERNEL32.dll_CloseHandle]
push edx
call edi
push esi
call edi
mov ecx, dword [ebp - 4]
pop ebx
pop edi
xor ecx, ebp
mov al, 1
pop esi
call fcn.1001092b
mov esp, ebp
pop ebp
ret 0xc