Function at 0x4018f0
Capabilities:
Parse pe header

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x1c
mov eax, dword [0x405040]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, ecx
mov ecx, 0x5a4d
push ebx
mov dword [ebp - 0x10], eax
cmp word [eax], cx
jne 0x401d16
mov ebx, dword [eax + 0x3c]
add ebx, eax
mov dword [ebp - 0x14], ebx
cmp dword [ebx], 0x4550
jne 0x401d16
push esi
mov esi, dword [sym.imp.KERNEL32.dll_VirtualAlloc]
push 4
push 0x3000
push dword [ebx + 0x50]
push dword [ebx + 0x34]
call esi
mov dword [ebp - 0x18], eax
test eax, eax
jne 0x401973
push 4
push 0x3000
push dword [ebx + 0x50]
push eax
call esi
mov dword [ebp - 0x18], eax
test eax, eax
jne 0x401973
push 0xe
call dword [sym.imp.KERNEL32.dll_SetLastError]
pop esi
xor eax, eax
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00401ea6
mov esp, ebp
pop ebp
ret
push edi
push 0x24
push 0
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov edi, eax
mov dword [ebp - 8], edi
test edi, edi
jne 0x4019b9
push 0xe
call dword [sym.imp.KERNEL32.dll_SetLastError]
mov ecx, dword [ebp - 0x18]
push 0x8000
push edi
push ecx
call dword [sym.imp.KERNEL32.dll_VirtualFree]
pop edi
pop esi
xor eax, eax
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00401ea6
mov esp, ebp
pop ebp
ret
mov eax, dword [ebp - 0x18]
push 4
push 0x1000
mov dword [edi + 4], eax
mov dword [edi + 0xc], 0
mov dword [edi + 8], 0
mov dword [edi + 0x10], 0
mov dword [edi + 0x14], 0x4018b0
mov dword [edi + 0x18], 0x4018c0
mov dword [edi + 0x1c], 0x4018e0
mov dword [edi + 0x20], 0
push dword [ebx + 0x54]
push eax
call esi
push dword [ebx + 0x54]
mov esi, eax
push dword [ebp - 0x10]
push esi
call sub.VCRUNTIME140.dll_memcpy
mov eax, dword [ebp - 0x10]
add esp, 0xc
mov ecx, dword [ebp - 0x18]
mov dword [ebp - 0x1c], 0
mov eax, dword [eax + 0x3c]
add eax, esi
xor esi, esi
mov dword [edi], eax
mov dword [eax + 0x34], ecx
mov ecx, dword [edi]
mov edx, dword [edi + 4]
mov dword [ebp - 0xc], edx
movzx eax, word [ecx + 0x14]
add eax, 0x28
cmp si, word [ecx + 6]
jae 0x401ab7
lea ebx, [eax + ecx]
nop
mov eax, dword [ebx]
test eax, eax
jne 0x401a72
mov eax, dword [ebp - 0x14]
mov esi, dword [eax + 0x38]
test esi, esi
jle 0x401aa0
mov eax, dword [ebx - 4]
push 4
push 0x1000
push esi
add eax, edx
push eax
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
push esi
push 0
push eax
mov dword [ebx - 8], eax
call sub.VCRUNTIME140.dll_memset
jmp 0x401a9a
push 4
push 0x1000
push eax
mov eax, dword [ebx - 4]
add eax, edx
push eax
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
push dword [ebx]
mov ecx, dword [ebx + 4]
mov esi, eax
add ecx, dword [ebp - 0x10]
push ecx
push esi
call sub.VCRUNTIME140.dll_memcpy
mov dword [ebx - 8], esi
mov edx, dword [ebp - 0xc]
add esp, 0xc
mov ecx, dword [edi]
add ebx, 0x28
mov esi, dword [ebp - 0x1c]
inc esi
mov dword [ebp - 0x1c], esi
movzx eax, word [ecx + 6]
cmp esi, eax
jl 0x401a40
mov ebx, dword [ebp - 0x14]
mov eax, dword [ebp - 0x18]
sub eax, dword [ebx + 0x34]
mov dword [ebp - 0x1c], eax
je 0x401b3d
cmp dword [ecx + 0xa4], 0
jbe 0x401b3d
mov edx, dword [edi + 4]
mov ebx, dword [ecx + 0xa0]
add ebx, edx
mov dword [ebp - 0xc], edx
mov eax, dword [ebx]
test eax, eax
je 0x401b3d
nop
mov ecx, dword [ebx + 4]
add eax, edx
mov dword [ebp - 0x14], eax
lea edx, [ebx + 8]
xor esi, esi
lea eax, [ecx - 8]
test eax, 0xfffffffe
jbe 0x401b2e
mov edi, dword [ebp - 0x14]
nop word [eax + eax]
movzx eax, word [edx]
mov ecx, eax
and ecx, 0xf000
cmp ecx, 0x3000
jne 0x401b1e
mov ecx, dword [ebp - 0x1c]
and eax, 0xfff
add dword [eax + edi], ecx
mov ecx, dword [ebx + 4]
inc esi
add edx, 2
lea eax, [ecx - 8]
shr eax, 1
cmp esi, eax
jb 0x401b00
mov eax, dword [ebx + ecx]
add ebx, ecx
mov edx, dword [ebp - 0xc]
test eax, eax
jne 0x401ae0
mov edi, dword [ebp - 8]
mov ecx, edi
call fcn.00401740
mov ebx, dword [sym.imp.KERNEL32.dll_VirtualFree]
test eax, eax
je 0x401c73
mov ecx, dword [edi]
xor eax, eax
mov dword [ebp - 0x14], 0
movzx esi, word [ecx + 0x14]
add esi, 0x28
cmp ax, word [ecx + 6]
jae 0x401c14
mov dword [ebp - 0xc], ecx
add esi, ecx
mov ebx, dword [esi + 0x14]
mov edx, dword [esi]
test ebx, 0x2000000
je 0x401b93
mov ebx, dword [sym.imp.KERNEL32.dll_VirtualFree]
push 0x4000
push edx
push dword [esi - 8]
call ebx
jmp 0x401bf9
mov ecx, ebx
mov eax, ebx
shr eax, 0x1e
and eax, 1
shr ecx, 0x1d
and ecx, 1
lea ecx, [eax + ecx*2]
mov eax, ebx
shr eax, 0x1f
lea eax, [eax + ecx*2]
mov ecx, dword [eax*4 + 0x4032d4]
mov dword [ebp - 0x10], ecx
or dword [ebp - 0x10], 0x200
test ebx, 0x4000000
mov eax, dword [ebp - 0x10]
cmove eax, ecx
test edx, edx
jne 0x401bea
test bl, 0x40
je 0x401bdc
mov edx, dword [ebp - 0xc]
mov edx, dword [edx + 0x20]
jmp 0x401be6
test bl, bl
jns 0x401bf9
mov edx, dword [ebp - 0xc]
mov edx, dword [edx + 0x24]
test edx, edx
je 0x401bf9
lea ecx, [ebp - 8]
push ecx
push eax
push edx
push dword [esi - 8]
call dword [sym.imp.KERNEL32.dll_VirtualProtect]
mov ecx, dword [edi]
add esi, 0x28
mov edx, dword [ebp - 0x14]
inc edx
mov dword [ebp - 0xc], ecx
mov dword [ebp - 0x14], edx
movzx eax, word [ecx + 6]
cmp edx, eax
jl 0x401b73
mov esi, dword [ecx + 0xc0]
test esi, esi
je 0x401c41
mov ebx, dword [edi + 4]
mov esi, dword [esi + ebx + 0xc]
test esi, esi
je 0x401c41
mov eax, dword [esi]
test eax, eax
je 0x401c41
nop
push 0
push 1
push ebx
call eax
mov eax, dword [esi + 4]
lea esi, [esi + 4]
test eax, eax
jne 0x401c30
mov eax, dword [edi]
mov eax, dword [eax + 0x28]
test eax, eax
je 0x401d03
mov ecx, dword [ebp - 0x18]
add eax, ecx
push 0
push 1
push ecx
call eax
test eax, eax
jne 0x401cfc
push 0x45a
call dword [sym.imp.KERNEL32.dll_SetLastError]
mov ebx, dword [sym.imp.KERNEL32.dll_VirtualFree]
cmp dword [edi + 0x10], 0
je 0x401c91
mov eax, dword [edi]
mov ecx, dword [edi + 4]
push 0
push 0
mov eax, dword [eax + 0x28]
push ecx
add eax, ecx
call eax
mov dword [edi + 0x10], 0
cmp dword [edi + 8], 0
je 0x401cc8
xor esi, esi
cmp dword [edi + 0xc], esi
jle 0x401cbc
nop
mov eax, dword [edi + 8]
mov eax, dword [eax + esi*4]
test eax, eax
je 0x401cb6
push dword [edi + 0x20]
push eax
mov eax, dword [edi + 0x1c]
call eax
add esp, 8
inc esi
cmp esi, dword [edi + 0xc]
jl 0x401ca0
push dword [edi + 8]
call dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
add esp, 4
mov eax, dword [edi + 4]
test eax, eax
je 0x401cd9
push 0x8000
push 0
push eax
call ebx
push edi
push 0
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapFree]
pop edi
pop esi
xor eax, eax
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00401ea6
mov esp, ebp
pop ebp
ret
mov dword [edi + 0x10], 1
mov eax, edi
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00401ea6
mov esp, ebp
pop ebp
ret
push 0xc1
call dword [sym.imp.KERNEL32.dll_SetLastError]
mov ecx, dword [ebp - 4]
xor eax, eax
xor ecx, ebp
pop ebx
call fcn.00401ea6
mov esp, ebp
pop ebp
ret