Function at 0x40d460
Capabilities:
Get file size
Parse pe header

Disassembly:
sub esp, 0x58
push ebx
push ebp
mov ebp, dword [esp + 0x64]
push esi
push edi
xor edi, edi
push 0x30
mov ebx, eax
lea eax, [esp + 0x3c]
push edi
push eax
mov esi, ecx
mov dword [esp + 0x28], edi
mov dword [esp + 0x24], edi
call fcn.004f7580
add esp, 0xc
lea ecx, [esp + 0x58]
push ecx
push esi
mov dword [esp + 0x40], esi
call dword [sym.imp.KERNEL32.dll_GetFileSizeEx]
test eax, eax
jne 0x40d4b1
push 0x542610
mov eax, 0x542610
call fcn.004118c0
jmp 0x40d93e
push 0x4000
mov dword [esp + 0x68], 0x4000
call fcn.004f9398
mov esi, eax
add esp, 4
cmp esi, edi
jne 0x40d4d4
push 8
call dword [sym.imp.KERNEL32.dll_SetLastError]
mov dword [esp + 0x60], esi
cmp esi, edi
jne 0x40d4f0
push 0x542610
mov eax, 0x542610
call fcn.004118c0
jmp 0x40d93e
push 0x40
push ebx
push edi
push edi
lea edi, [esp + 0x48]
call fcn.0040d1f0
add esp, 0x10
test eax, eax
je 0x40d941
mov edx, 0x5a4d
cmp word [ebx], dx
jne 0x40d92f
mov eax, dword [ebx + 0x3c]
test eax, eax
jle 0x40d92f
push 4
cdq
lea ecx, [esp + 0x30]
push ecx
push edx
push eax
call fcn.0040d1f0
add esp, 0x10
test eax, eax
je 0x40d941
cmp dword [esp + 0x2c], 0x4550
jne 0x40d92f
mov eax, dword [ebx + 0x3c]
xor ecx, ecx
lea esi, [eax + 4]
mov dword [esp + 0x34], ecx
mov dword [ebp + 0xa0], ecx
cmp eax, 0x110
jb 0x40d591
push 0x90
push ebx
push ecx
push 0x80
call fcn.0040d1f0
add esp, 0x10
test eax, eax
je 0x40d941
cmp dword [ebx], 0x82c8851f
jne 0x40d591
mov dword [ebp + 0xa0], 0x80
mov edx, dword [esp + 0x34]
push 0x14
push ebx
push edx
push esi
lea edi, [esp + 0x48]
call fcn.0040d1f0
add esp, 0x10
test eax, eax
je 0x40d941
mov eax, dword [esp + 0x34]
push 2
add esi, 0x14
lea ecx, [esp + 0x2c]
adc eax, 0
push ecx
push eax
push esi
mov dword [esp + 0x44], eax
call fcn.0040d1f0
add esp, 0x10
test eax, eax
je 0x40d941
mov eax, dword [esp + 0x28]
mov edx, 0x10b
cmp ax, dx
jne 0x40d606
movzx ecx, word [ebx + 0x10]
cmp cx, 0x78
jb 0x40d92f
mov eax, 0xe0
mov dword [esp + 0x20], 1
mov dword [esp + 0x14], eax
xor edx, edx
jmp 0x40d638
mov ecx, 0x20b
cmp ax, cx
jne 0x40d92f
movzx ecx, word [ebx + 0x10]
mov edx, 0x88
cmp cx, dx
jb 0x40d92f
xor edx, edx
mov dword [esp + 0x14], 0xf0
mov eax, dword [esp + 0x14]
mov dword [esp + 0x20], edx
movzx ecx, cx
cmp ecx, eax
jae 0x40d645
mov dword [esp + 0x14], ecx
mov eax, ecx
movzx ecx, word [ebx + 2]
mov dword [esp + 0x10], ecx
cmp eax, edx
je 0x40d673
mov edx, dword [esp + 0x34]
push eax
push ebx
push edx
push esi
lea edi, [esp + 0x48]
call fcn.0040d1f0
add esp, 0x10
test eax, eax
je 0x40d941
mov eax, dword [esp + 0x14]
xor edx, edx
lea ecx, [esi + 0x40]
mov dword [ebp], ecx
cmp dword [esp + 0x20], edx
je 0x40d6d7
lea ecx, [esi + 0x80]
mov dword [ebp + 4], ecx
mov ecx, dword [ebx + 0x80]
mov dword [ebp + 0xc], ecx
mov ecx, dword [ebx + 0x84]
mov dword [ebp + 0x14], ecx
mov ecx, dword [ebx + 0x40]
mov dword [ebp + 0x10], ecx
mov ecx, 1
mov byte [ebp + 0x9c], 0
cmp word [ebx + 0x44], cx
jne 0x40d6c4
mov byte [ebp + 0x9d], cl
mov edi, dword [ebx + 0x70]
mov dword [esp + 0x20], edi
mov edi, dword [ebx + 0x74]
jmp 0x40d729
mov byte [ebp + 0x9d], 0
mov edi, dword [ebx + 0x70]
mov dword [esp + 0x20], edi
mov edi, dword [ebx + 0x74]
jmp 0x40d729
lea ecx, [esi + 0x90]
mov dword [ebp + 4], ecx
mov ecx, dword [ebx + 0x90]
mov dword [ebp + 0xc], ecx
mov ecx, dword [ebx + 0x94]
mov dword [ebp + 0x14], ecx
mov ecx, dword [ebx + 0x40]
mov dword [ebp + 0x10], ecx
mov ecx, 1
mov byte [ebp + 0x9c], 1
cmp word [ebx + 0x44], cx
jne 0x40d712
mov byte [ebp + 0x9d], cl
jmp 0x40d719
mov byte [ebp + 0x9d], 0
mov edi, dword [ebx + 0x80]
mov dword [esp + 0x20], edi
mov edi, dword [ebx + 0x84]
mov dword [esp + 0x24], edi
mov edi, dword [ebp + 4]
add edi, 4
add esi, eax
adc dword [esp + 0x34], edx
mov dword [ebp + 8], edi
mov dword [esp + 0x30], esi
mov dword [ebp + 0x18], edx
mov byte [ebp + 0x9e], 0
mov dword [ebp + 0xb0], esi
cmp dword [ebp + 0xa0], edx
je 0x40d76e
cmp byte [ebp + 0x9c], 0
jne 0x40d76e
cmp byte [ebp + 0x9d], 0
mov dword [esp + 0x14], ecx
jne 0x40d772
mov dword [esp + 0x14], edx
cmp dword [esp + 0x20], edx
jne 0x40d782
cmp dword [esp + 0x14], edx
je 0x40d925
mov ecx, dword [esp + 0x10]
mov eax, 0x333
mov edx, eax
mov dword [esp + 0x28], eax
cmp cx, dx
jbe 0x40d79c
mov dword [esp + 0x10], eax
jmp 0x40d7ae
mov eax, 0xffff
cmp cx, ax
jne 0x40d7ae
mov dword [esp + 0x10], 0xfffe
movzx esi, word [esp + 0x10]
lea esi, [esi + esi*4]
add esi, esi
add esi, esi
add esi, esi
mov eax, esi
call fcn.0040caf0
mov dword [esp + 0x18], eax
test eax, eax
jne 0x40d7df
push 0x542610
mov eax, 0x542610
call fcn.004118c0
jmp 0x40d93e
test esi, esi
je 0x40d807
mov ecx, dword [esp + 0x34]
mov edx, dword [esp + 0x30]
push esi
push eax
push ecx
push edx
lea edi, [esp + 0x48]
call fcn.0040d1f0
add esp, 0x10
test eax, eax
je 0x40d941
mov eax, dword [esp + 0x18]
add dword [ebp + 0xb0], esi
cmp dword [esp + 0x14], 0
mov esi, dword [esp + 0x10]
je 0x40d843
xor edi, edi
xor edx, edx
mov ecx, eax
cmp di, si
jae 0x40d843
cmp dword [ecx], 0x54494e49
jne 0x40d831
cmp byte [ecx + 4], 0
je 0x40d83c
inc edx
add ecx, 0x28
cmp dx, si
jb 0x40d823
jmp 0x40d843
mov byte [ebp + 0x9e], 1
mov ecx, dword [esp + 0x24]
mov edx, dword [esp + 0x20]
push ecx
call fcn.0040da20
mov esi, eax
add esp, 4
mov dword [esp + 0x20], esi
test esi, esi
je 0x40d925
push 0xa
push esi
lea eax, [esp + 0x40]
call fcn.0040d970
add esp, 8
test eax, eax
je 0x40d925
mov eax, dword [eax + 4]
test eax, eax
jns 0x40d925
and eax, 0x7fffffff
add eax, esi
push 0x360
push eax
lea eax, [esp + 0x40]
call fcn.0040d970
add esp, 8
test eax, eax
je 0x40d925
mov eax, dword [eax + 4]
test eax, eax
jns 0x40d925
and eax, 0x7fffffff
add eax, esi
push 0
push eax
lea eax, [esp + 0x40]
call fcn.0040d970
add esp, 8
test eax, eax
je 0x40d925
mov eax, dword [eax + 4]
test eax, eax
js 0x40d925
push 0x10
xor ecx, ecx
push ebx
add eax, esi
push ecx
push eax
lea edi, [esp + 0x48]
call fcn.0040d1f0
add esp, 0x10
test eax, eax
je 0x40d941
cmp dword [ebx + 4], 0x80
jne 0x40d925
mov esi, dword [esp + 0x10]
mov eax, dword [esp + 0x18]
mov edx, dword [ebx]
push 0x80
call fcn.0040da20
add esp, 4
push 0x80
lea edx, [ebp + 0x1c]
push edx
push 0
push eax
call fcn.0040d1f0
add esp, 0x10
test eax, eax
je 0x40d941
mov eax, dword [esp + 0x20]
mov dword [ebp + 0x18], eax
mov dword [esp + 0x1c], 1
jmp 0x40d941
push 0x542610
mov eax, 1
call fcn.00411b70
add esp, 4
mov eax, dword [esp + 0x60]
test eax, eax
je 0x40d952
push eax
call fcn.004f82be
add esp, 4
mov eax, dword [esp + 0x18]
test eax, eax
je 0x40d963
push eax
call fcn.004f82be
add esp, 4
mov eax, dword [esp + 0x1c]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x58
ret