Function at 0x4015b0
Capabilities:
Allocate or change rwx memory
Enumerate pe sections
Execute shellcode via indirect call
Parse pe header

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x3c
mov eax, dword [ebp + 8]
mov eax, dword [ebp + 8]
mov dword [ebp - 8], eax
mov eax, dword [ebp + 8]
mov dword [esp], eax
call fcn.00401340
mov dword [ebp - 0xc], eax
mov eax, dword [ebp - 8]
movzx eax, word [eax]
cmp eax, 0x5a4d
jne 0x4015e5
mov eax, dword [ebp - 0xc]
cmp dword [eax], 0x4550
je 0x4015ff
lea eax, str.Wrong_format_of_PE_file_n
mov dword [esp], eax
call fcn.00402630
mov dword [ebp - 4], 0
jmp 0x4017a7
mov eax, dword [ebp - 0xc]
mov ecx, dword [eax + 0x34]
mov eax, dword [ebp - 0xc]
mov eax, dword [eax + 0x50]
mov dword [esp], ecx
mov dword [esp + 4], eax
mov dword [esp + 8], 0x3000
mov dword [esp + 0xc], 0x40
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
sub esp, 0x10
mov dword [ebp - 0x10], eax
mov dword [ebp - 0x14], 0
cmp dword [ebp - 0x10], 0
jne 0x401696
mov eax, dword [ebp - 0xc]
mov eax, dword [eax + 0x50]
xor ecx, ecx
mov dword [esp], 0
mov dword [esp + 4], eax
mov dword [esp + 8], 0x3000
mov dword [esp + 0xc], 0x40
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
sub esp, 0x10
mov dword [ebp - 0x10], eax
cmp dword [ebp - 0x10], 0
jne 0x40168a
lea eax, str.Can_not_allocate_memory_for_PE_n
mov dword [esp], eax
call fcn.00402630
mov dword [ebp - 4], 0
jmp 0x4017a7
mov eax, dword [ebp - 0x10]
mov ecx, dword [ebp - 0xc]
sub eax, dword [ecx + 0x34]
mov dword [ebp - 0x14], eax
mov edx, dword [ebp - 0x10]
mov ecx, dword [ebp + 8]
mov eax, dword [ebp - 0xc]
mov eax, dword [eax + 0x54]
mov dword [esp], edx
mov dword [esp + 4], ecx
mov dword [esp + 8], eax
call sub.msvcrt.dll_memcpy
mov eax, dword [ebp - 0xc]
add eax, 0x18
mov ecx, dword [ebp - 0xc]
movzx ecx, word [ecx + 0x14]
add eax, ecx
mov dword [ebp - 0x18], eax
mov dword [ebp - 0x1c], 0
mov eax, dword [ebp - 0x1c]
mov ecx, dword [ebp - 0xc]
movzx ecx, word [ecx + 6]
cmp eax, ecx
jge 0x401721
mov eax, dword [ebp - 0x10]
mov ecx, dword [ebp - 0x18]
add eax, dword [ecx + 0xc]
mov dword [ebp - 0x20], eax
mov eax, dword [ebp + 8]
mov ecx, dword [ebp - 0x18]
add eax, dword [ecx + 0x14]
mov dword [ebp - 0x24], eax
mov edx, dword [ebp - 0x20]
mov ecx, dword [ebp - 0x24]
mov eax, dword [ebp - 0x18]
mov eax, dword [eax + 0x10]
mov dword [esp], edx
mov dword [esp + 4], ecx
mov dword [esp + 8], eax
call sub.msvcrt.dll_memcpy
mov eax, dword [ebp - 0x1c]
add eax, 1
mov dword [ebp - 0x1c], eax
mov eax, dword [ebp - 0x18]
add eax, 0x28
mov dword [ebp - 0x18], eax
jmp 0x4016cb
mov edx, dword [ebp - 0x10]
mov ecx, dword [ebp - 0xc]
mov eax, dword [ebp - 0x14]
mov dword [esp], edx
mov dword [esp + 4], ecx
mov dword [esp + 8], eax
call fcn.00401360
mov ecx, dword [ebp - 0x10]
mov eax, dword [ebp - 0xc]
mov dword [esp], ecx
mov dword [esp + 4], eax
call fcn.00401440
test al, 1
jne 0x401788
lea eax, str.Error_loading_imports_n
mov dword [esp], eax
call fcn.00402630
mov eax, dword [ebp - 0x10]
xor ecx, ecx
mov dword [esp], eax
mov dword [esp + 4], 0
mov dword [esp + 8], 0x8000
call dword [sym.imp.KERNEL32.dll_VirtualFree]
sub esp, 0xc
mov dword [ebp - 4], 0
jmp 0x4017a7
mov eax, dword [ebp - 0x10]
mov ecx, dword [ebp - 0xc]
add eax, dword [ecx + 0x28]
mov dword [ebp - 0x28], eax
mov eax, dword [ebp - 0x28]
mov dword [ebp - 0x2c], eax
nop
mov eax, eax
call dword [ebp - 0x2c]
mov dword [ebp - 4], 1
mov eax, dword [ebp - 4]
add esp, 0x3c
pop ebp
ret