Function at 0x411250
Capabilities:
Get file size
Parse pe header
Read file on windows

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x4538c6
mov eax, dword fs:[0]
push eax
mov eax, 0x3010
call fcn.0043dc10
mov eax, dword [0x46ebd0]
xor eax, ebp
mov dword [ebp - 0x10], eax
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
push 0x1000
lea eax, [ebp - 0x3010]
xor edi, edi
push eax
push edi
mov dword [ebp - 0x3018], edi
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
push edi
push 0x80
push 3
push edi
push 1
push SysReAllocStringLen
lea ecx, [ebp - 0x3010]
push ecx
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov esi, eax
cmp esi, 0xffffffff
je 0x4114c8
push edi
lea edx, [ebp - 0x301c]
push edx
push 0x1000
lea eax, [ebp - 0x1010]
push eax
push esi
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x4114c1
mov ecx, 0x5a4d
cmp word [ebp - 0x1010], cx
jne 0x4114c1
mov eax, dword [ebp - 0xfd4]
cmp eax, 0xf08
jae 0x4114c1
cmp dword [ebp + eax - 0x1010], 0x4550
lea eax, [ebp + eax - 0x1010]
jne 0x4114c1
lea ecx, [eax + 0xf8]
lea edx, [ebp - 0x10]
cmp ecx, edx
jae 0x4114c1
movzx eax, word [eax + 6]
mov dword [ebp - 0x3014], edi
test eax, eax
jle 0x411361
add ecx, 0x14
mov edx, eax
mov eax, dword [ecx]
cmp eax, dword [ebp - 0x3014]
jbe 0x41135b
mov edi, dword [ecx - 4]
mov dword [ebp - 0x3014], eax
add edi, eax
add ecx, 0x28
dec edx
jne 0x411346
push 0
push esi
call dword [sym.imp.KERNEL32.dll_GetFileSize]
cmp eax, 0xffffffff
je 0x4114c1
cmp edi, eax
jae 0x4114c1
sub eax, edi
cmp eax, 0xc
jb 0x4114c1
push 0
push 0
push edi
push esi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp eax, 0xffffffff
je 0x4114c1
push 0xc
call fcn.004146f2
add esp, 4
push 0
mov edi, eax
lea eax, [ebp - 0x301c]
push eax
push 0xc
push edi
push esi
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x4114b8
cmp dword [ebp - 0x301c], 0xc
jb 0x4114b8
cmp dword [edi], 0xfade1234
jne 0x4114b8
cmp dword [edi + 8], 0xfade1234
jne 0x4114b8
mov eax, dword [edi + 4]
test eax, eax
je 0x4114b8
add eax, 8
push eax
call fcn.00439e00
add esp, 4
push 0
lea ecx, [ebp - 0x301c]
push ecx
mov ecx, dword [edi + 4]
push ecx
push eax
push esi
mov dword [ebp - 0x3014], eax
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x41142f
mov edx, dword [ebp - 0x3014]
push edx
call fcn.00439b91
jmp 0x4114be
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push 0x45da4c
lea ecx, [ebp - 0x3018]
call fcn.00404600
mov dword [ebp - 4], 0
mov eax, dword [edi + 4]
mov esi, dword [ebp - 0x3014]
cmp dword [ebp - 0x301c], eax
jne 0x41148e
mov byte [eax + esi], 0
push esi
lea eax, [ebp - 0x3014]
push eax
call fcn.00411500
push eax
lea ecx, [ebp - 0x3018]
mov byte [ebp - 4], 1
call fcn.00404730
lea ecx, [ebp - 0x3014]
mov byte [ebp - 4], 0
call fcn.00401950
push edi
call fcn.00414721
push esi
call fcn.00439b91
add esp, 8
lea ecx, [ebp - 0x3018]
push ecx
mov ecx, ebx
call fcn.00403e90
lea ecx, [ebp - 0x3018]
call fcn.00401950
jmp 0x4114d4
push edi
call fcn.00414721
add esp, 4
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push 0x45da4c
mov ecx, ebx
call fcn.00404600
mov eax, ebx
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.00438b64
mov esp, ebp
pop ebp
ret