Function at 0x405700
Capabilities:
Get file size
Resolve function by parsing pe exports

Disassembly:
sub esp, 0x868
mov eax, dword [0x4231d0]
xor eax, esp
mov dword [esp + 0x864], eax
mov eax, dword [esp + 0x86c]
push ebx
push ebp
push esi
push edi
mov dword [esp + 0x1c], eax
xor eax, eax
push 0x208
mov edi, ecx
push eax
lea ecx, [esp + 0x260]
push ecx
mov dword [esp + 0x20], 0
mov dword [esp + 0x2c], eax
mov dword [esp + 0x30], eax
mov dword [esp + 0x34], eax
mov dword [esp + 0x38], eax
mov dword [esp + 0x3c], eax
mov dword [esp + 0x40], eax
call fcn.0040d9e0
add esp, 0xc
push str.NtQueryInformationProcess
push str.ntdll.dll
or ebp, 0xffffffff
call dword [sym.imp.KERNEL32.dll_GetModuleHandleW]
push eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov esi, eax
test esi, esi
je 0x405976
push 0
push 0x18
lea edx, [esp + 0x28]
push edx
push 0
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
push eax
call esi
test eax, eax
jl 0x405976
mov eax, dword [esp + 0x34]
push eax
push 0
push 0x410
call dword [sym.imp.KERNEL32.dll_OpenProcess]
mov ebx, eax
test ebx, ebx
je 0x40598f
push 0x104
lea ecx, [esp + 0x25c]
push ecx
push 0
push ebx
call sub.PSAPI.DLL_GetModuleFileNameExW
test eax, eax
je 0x40597a
lea edx, [esp + 0x258]
push edx
call fcn.00404ea0
add esp, 4
test eax, eax
je 0x40597a
push 0
push 0x80
push 3
push 0
push 1
push SysReAllocString
lea eax, [esp + 0x270]
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov ebp, eax
cmp ebp, 0xffffffff
je 0x40597a
push 0
push ebp
call dword [sym.imp.KERNEL32.dll_GetFileSize]
cmp eax, 0xa00000
jbe 0x405831
mov dword [esp + 0x14], 1
test edi, edi
je 0x405851
lea eax, [esp + 0x258]
mov edx, edi
mov ecx, eax
sub edx, ecx
movzx ecx, word [eax]
mov word [edx + eax], cx
add eax, 2
test cx, cx
jne 0x405842
cmp dword [esp + 0x1c], 0
je 0x40597a
xor edx, edx
push 0x1d6
push edx
lea eax, [esp + 0x8a]
push eax
mov word [esp + 0x8c], dx
call fcn.0040d9e0
xor eax, eax
add esp, 0xc
push 0x38
push eax
lea ecx, [esp + 0x50]
push ecx
mov dword [esp + 0x24], 0
mov dword [esp + 0x44], eax
mov dword [esp + 0x48], eax
mov dword [esp + 0x4c], eax
mov dword [esp + 0x50], eax
call fcn.0040d9e0
xor eax, eax
add esp, 0xc
push eax
push 0x18
lea edx, [esp + 0x28]
push edx
push eax
push ebx
mov dword [esp + 0x34], eax
mov dword [esp + 0x38], eax
mov dword [esp + 0x3c], eax
mov dword [esp + 0x40], eax
mov dword [esp + 0x44], eax
mov dword [esp + 0x48], eax
call esi
test eax, eax
jl 0x40597a
mov edx, dword [esp + 0x24]
mov edi, dword [sym.imp.KERNEL32.dll_ReadProcessMemory]
lea eax, [esp + 0x18]
push eax
push 0x1d8
lea ecx, [esp + 0x88]
push ecx
push edx
push ebx
call edi
test eax, eax
je 0x40597a
mov edx, dword [esp + 0x90]
lea eax, [esp + 0x18]
push eax
push 0x48
lea ecx, [esp + 0x40]
push ecx
push edx
push ebx
call edi
test eax, eax
je 0x40597a
mov ax, word [esp + 0x78]
mov ecx, 0x40e
cmp cx, ax
jae 0x40592a
mov eax, ecx
jmp 0x40592d
movzx eax, ax
mov ecx, dword [esp + 0x7c]
movzx esi, ax
lea edx, [esp + 0x18]
push edx
push esi
lea eax, [esp + 0x468]
push eax
push ecx
push ebx
call edi
test eax, eax
je 0x40597a
xor edx, edx
shr esi, 1
mov word [esp + esi*2 + 0x460], dx
mov edx, dword [esp + 0x1c]
lea eax, [esp + 0x460]
mov ecx, eax
sub edx, ecx
movzx ecx, word [eax]
mov word [edx + eax], cx
add eax, 2
test cx, cx
jne 0x405965
jmp 0x40597a
mov ebx, dword [esp + 0x1c]
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
test ebx, ebx
je 0x405987
push ebx
call esi
cmp ebp, 0xffffffff
je 0x40598f
push ebp
call esi
mov ecx, dword [esp + 0x874]
mov eax, dword [esp + 0x14]
pop edi
pop esi
pop ebp
pop ebx
xor ecx, esp
call fcn.0040caaf
add esp, 0x868
ret