Function at 0x46e690
Capabilities:
Parse pe header

Disassembly:
push ecx
mov eax, dword [esp + 8]
push ebx
push ebp
push esi
cmp word [eax], 0x5a4d
push edi
je 0x46e6b3
push 0xc1
call dword [sym.imp.KERNEL32.dll_SetLastError]
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
pop ecx
ret
mov ebp, dword [eax + 0x3c]
add ebp, eax
cmp dword [ebp], 0x4550
je 0x46e6d4
push 0xc1
call dword [sym.imp.KERNEL32.dll_SetLastError]
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
pop ecx
ret
cmp word [ebp + 4], 0x14c
je 0x46e6ef
push 0xc1
call dword [sym.imp.KERNEL32.dll_SetLastError]
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
pop ecx
ret
mov eax, dword [ebp + 0x50]
mov ecx, dword [ebp + 0x34]
mov esi, dword [sym.imp.KERNEL32.dll_VirtualAlloc]
push 4
push 0x3000
push eax
push ecx
call esi
mov edi, eax
test edi, edi
mov dword [esp + 0x10], edi
jne 0x46e73a
mov edx, dword [ebp + 0x50]
push 4
push 0x3000
push edx
push eax
call esi
test eax, eax
mov dword [esp + 0x10], eax
jne 0x46e736
push 0xe
call dword [sym.imp.KERNEL32.dll_SetLastError]
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
pop ecx
ret
mov edi, dword [esp + 0x10]
push 0x30
push 0
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov ebx, eax
xor eax, eax
cmp ebx, eax
jne 0x46e771
push 0xe
call dword [sym.imp.KERNEL32.dll_SetLastError]
push 0x8000
push 0
push edi
call dword [sym.imp.KERNEL32.dll_VirtualFree]
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
pop ecx
ret
mov ecx, dword [esp + 0x1c]
mov dword [ebx + 4], edi
mov dword [ebx + 0xc], eax
mov dword [ebx + 8], eax
mov dword [ebx + 0x10], eax
mov ax, word [ebp + 0x16]
mov edx, dword [esp + 0x20]
mov dword [ebx + 0x1c], ecx
mov ecx, dword [esp + 0x28]
mov dword [ebx + 0x20], edx
shr eax, 0xd
and eax, 1
mov dword [ebx + 0x28], ecx
mov dword [ebx + 0x14], eax
mov eax, dword [esp + 0x24]
mov dword [ebx + 0x24], eax
mov edx, dword [ebp + 0x54]
push 4
push 0x1000
push edx
push edi
call esi
mov ecx, dword [ebp + 0x54]
mov esi, dword [esp + 0x18]
mov edx, ecx
mov edi, eax
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
push ebx
and ecx, 3
push ebp
rep movsb byte es:[edi], byte [esi]
mov ecx, dword [esp + 0x20]
mov esi, dword [esp + 0x18]
push ecx
mov edx, dword [ecx + 0x3c]
add eax, edx
mov dword [ebx], eax
mov dword [eax + 0x34], esi
call fcn.0046e890
mov ecx, dword [ebp + 0x34]
mov eax, esi
add esp, 0xc
sub eax, ecx
je 0x46e800
push eax
push ebx
call fcn.0046ea70
add esp, 8
mov dword [ebx + 0x18], eax
jmp 0x46e807
mov dword [ebx + 0x18], 1
push ebx
call fcn.0046eb10
add esp, 4
test eax, eax
je 0x46e84b
push ebx
call fcn.0046e960
push ebx
call fcn.0046ea30
mov eax, dword [ebx]
add esp, 8
mov eax, dword [eax + 0x28]
test eax, eax
je 0x46e878
mov ecx, dword [ebx + 0x14]
test ecx, ecx
je 0x46e86b
push 0
push 1
add eax, esi
push esi
call eax
test eax, eax
jne 0x46e85c
push 0x45a
call dword [sym.imp.KERNEL32.dll_SetLastError]
push ebx
call fcn.0046ed20
add esp, 4
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
pop ecx
ret
pop edi
pop esi
mov dword [ebx + 0x10], 1
mov eax, ebx
pop ebp
pop ebx
pop ecx
ret
add eax, esi
pop edi
mov dword [ebx + 0x2c], eax
pop esi
mov eax, ebx
pop ebp
pop ebx
pop ecx
ret
pop edi
pop esi
mov dword [ebx + 0x2c], 0
mov eax, ebx
pop ebp
pop ebx
pop ecx
ret