Function at 0x40cce7
Capabilities:
Parse pe header
Read file via mapping

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x48
mov eax, dword [ebp + 0x10]
push ebx
push esi
xor ecx, ecx
push edi
lea edi, [eax + 0x10]
mov dword [eax + 8], ecx
mov dword [eax + 0xc], ecx
mov dword [eax], ecx
mov ebx, dword [edi + 0x10]
lea esi, [ebp - 0x20]
mov dword [ebp - 0x18], ecx
mov dword [ebp - 8], edi
call fcn.00416513
mov ebx, dword [edi + 0xc]
lea esi, [ebp - 0x14]
call fcn.00416513
push dword [ebp - 0x1c]
lea eax, [ebp - 0x20]
push dword [ebp - 0x20]
push dword [ebp - 0x10]
push dword [ebp - 0x14]
push eax
push edi
call fcn.00415a95
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
push eax
call fcn.0040b682
pop ecx
test eax, eax
je 0x40cd67
push str.Wow64EnableWow64FsRedirection
push str.Kernel32.dll
call dword [sym.imp.KERNEL32.dll_GetModuleHandleW]
push eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov esi, eax
xor edi, edi
cmp esi, edi
je 0x40cd6c
push edi
call esi
jmp 0x40cd6c
mov esi, dword [ebp - 0x18]
xor edi, edi
push edi
push 0x80
push 3
push edi
push 1
push SysReAllocString
push dword [ebp + 0xc]
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov ebx, eax
mov dword [ebp - 0x18], ebx
cmp esi, edi
je 0x40cd92
push 1
call esi
cmp ebx, 0xffffffff
je 0x40cedb
push edi
push edi
push edi
push 2
push edi
push ebx
call dword [sym.imp.KERNEL32.dll_CreateFileMappingW]
mov esi, eax
mov dword [ebp - 0x1c], esi
cmp esi, edi
jne 0x40cdbd
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x40cedb
push edi
push edi
push edi
push 4
push esi
call dword [sym.imp.KERNEL32.dll_MapViewOfFile]
mov ebx, eax
mov dword [ebp - 0x10], ebx
cmp ebx, edi
jne 0x40cdd8
push esi
jmp 0x40cece
mov eax, 0x5a4d
cmp word [ebx], ax
jne 0x40cec4
mov eax, dword [ebx + 0x3c]
lea esi, [eax + ebx]
mov eax, 0x100
test word [esi + 0x16], ax
je 0x40ce3e
movzx eax, word [esi + 4]
mov ecx, 0x8664
cmp ax, cx
je 0x40ce3e
mov ecx, 0x200
cmp ax, cx
je 0x40ce3e
push 0xf8
push esi
call dword [sym.imp.KERNEL32.dll_IsBadReadPtr]
test eax, eax
jne 0x40cec4
cmp dword [esi], 0x4550
jne 0x40cec4
mov ecx, dword [esi + 0x54]
movzx ebx, word [esi + 6]
add esi, 0xf8
jmp 0x40ce63
push 0x108
push esi
call dword [sym.imp.KERNEL32.dll_IsBadReadPtr]
test eax, eax
jne 0x40cec4
cmp dword [esi], 0x4550
jne 0x40cec4
mov ecx, dword [esi + 0x54]
movzx ebx, word [esi + 6]
add esi, 0x108
mov dword [ebp - 0xc], esi
cmp ebx, edi
je 0x40cec1
mov eax, dword [ebp + 0x10]
mov dword [eax + 8], ecx
mov ecx, dword [ebp + 8]
mov dword [eax], ecx
push 0xa
pop ecx
mov dword [eax + 0xc], edi
sub esp, 0x28
xor eax, eax
push 0xa
lea edi, [ebp - 0x48]
rep stosd dword es:[edi], eax
pop ecx
mov edi, esp
lea esi, [ebp - 0x48]
rep movsd dword es:[edi], dword [esi]
mov esi, dword [ebp - 8]
push ebx
mov ecx, esi
call fcn.004159b5
mov eax, dword [esi + 0x10]
sub eax, dword [esi + 0xc]
push 0x28
cdq
pop ecx
idiv ecx
test eax, eax
ja 0x40ceaf
call fcn.0041a15a
imul ebx, ebx, 0x28
push ebx
push dword [ebp - 0xc]
push dword [esi + 0xc]
call fcn.0041a3d0
add esp, 0xc
mov ebx, dword [ebp - 0x10]
push ebx
call dword [sym.imp.KERNEL32.dll_UnmapViewOfFile]
push dword [ebp - 0x1c]
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
call esi
push dword [ebp - 0x18]
call esi
pop edi
pop esi
pop ebx
leave
ret