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

Disassembly:
push ebp
mov ebp, esp
mov eax, dword [0x612c18]
sub esp, 8
test eax, eax
jne 0x405616
push esi
push edi
mov edi, dword [ebp + 8]
mov eax, 0x5a4d
cmp word [edi], ax
je 0x4053e6
xor esi, esi
jmp 0x4053fa
mov eax, dword [edi + 0x3c]
cmp dword [eax + edi], 0x4550
je 0x4053f6
xor esi, esi
jmp 0x4053fa
mov esi, dword [eax + edi + 0x50]
push ebx
push 0x40
push 0x3000
push esi
push 0
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov ebx, eax
mov dword [ebp - 8], ebx
mov dword [0x612c18], ebx
test ebx, ebx
je 0x405611
push esi
push 0
push ebx
call fcn.005779a0
mov ecx, dword [edi + 0x3c]
add ecx, edi
push dword [ecx + 0x54]
movzx eax, word [ecx + 6]
lea esi, [ecx + 0x18]
mov dword [ebp + 8], eax
movzx eax, word [ecx + 0x14]
push edi
push ebx
add esi, eax
call fcn.00577420
mov eax, dword [ebp + 8]
xor ecx, ecx
add esp, 0x18
cmp cx, ax
jae 0x40548f
movzx edx, ax
mov dword [ebp + 8], edx
nop dword [eax]
mov ecx, dword [esi + 0xc]
test ecx, ecx
je 0x405484
mov eax, dword [esi + 0x10]
test eax, eax
je 0x405484
push eax
mov eax, dword [esi + 0x14]
add eax, edi
push eax
lea eax, [ecx + ebx]
push eax
call fcn.00577420
mov edx, dword [ebp + 8]
add esp, 0xc
add esi, 0x28
sub edx, 1
mov dword [ebp + 8], edx
jne 0x405460
mov eax, dword [ebx + 0x3c]
add eax, ebx
mov dword [ebp + 8], eax
mov esi, dword [eax + 0xa0]
add esi, ebx
cmp esi, ebx
je 0x4054fb
cmp dword [esi], 0
je 0x4054fb
mov eax, dword [esi + 4]
test eax, eax
je 0x4054fb
lea edi, [eax - 8]
shr edi, 1
je 0x4054f4
lea edx, [esi + 8]
nop dword [eax]
movzx eax, word [edx]
mov ecx, eax
and ecx, 0xf000
cmp ecx, 0x3000
jne 0x4054e9
and eax, 0xfff
mov ecx, ebx
add eax, dword [esi]
add eax, ebx
mov ebx, dword [ebp + 8]
sub ecx, dword [ebx + 0x34]
add dword [eax], ecx
mov ebx, dword [ebp - 8]
add edx, 2
sub edi, 1
jne 0x4054c0
mov eax, dword [esi + 4]
add esi, eax
cmp dword [esi], 0
jne 0x4054a8
mov eax, dword [ebx + 0x3c]
xor esi, esi
mov edi, dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov dword [ebp - 8], esi
mov ecx, dword [eax + ebx + 0x80]
add ecx, ebx
mov dword [ebp - 4], ecx
cmp dword [ecx + 0xc], esi
je 0x4055b8
nop
mov esi, dword [ecx + 0xc]
add esi, ebx
push esi
call dword [sym.imp.KERNEL32.dll_GetModuleHandleA]
mov ecx, eax
mov dword [ebp + 8], ecx
test ecx, ecx
jne 0x405545
push esi
call dword [sym.imp.KERNEL32.dll_LoadLibraryA]
mov ecx, eax
mov dword [ebp + 8], eax
test ecx, ecx
je 0x40559f
mov esi, dword [ebp - 4]
mov esi, dword [esi + 0x10]
add esi, ebx
mov eax, dword [esi]
test eax, eax
je 0x40559f
jns 0x40555e
and eax, 0x7fffffff
push eax
push ecx
jmp 0x40558f
lea edi, [eax + 2]
add edi, ebx
push edi
push str.GetModuleFileNameA
call fcn.0057f237
add esp, 8
test eax, eax
jne 0x405585
mov edi, dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov eax, 0x405750
mov dword [ebp - 8], esi
jmp 0x405591
push edi
push dword [ebp + 8]
mov edi, dword [sym.imp.KERNEL32.dll_GetProcAddress]
call edi
mov ecx, dword [ebp + 8]
mov dword [esi], eax
add esi, 4
mov eax, dword [esi]
test eax, eax
jne 0x405553
mov ecx, dword [ebp - 4]
add ecx, 0x14
mov dword [ebp - 4], ecx
cmp dword [ecx + 0xc], 0
jne 0x405520
mov eax, dword [ebx + 0x3c]
mov esi, dword [ebp - 8]
mov dword [eax + ebx + 0x34], ebx
mov eax, dword [ebx + 0x3c]
push 0
push 1
push ebx
mov eax, dword [eax + ebx + 0x28]
add eax, ebx
call eax
test eax, eax
je 0x4055f0
push str.GetModuleFileNameA
push str.kernel32.dll
call dword [sym.imp.KERNEL32.dll_GetModuleHandleA]
push eax
call edi
mov dword [esi], eax
mov eax, ebx
pop ebx
pop edi
pop esi
mov esp, ebp
pop ebp
ret 4
mov eax, dword [0x612c18]
test eax, eax
je 0x405611
push 0x8000
push 0
push eax
call dword [sym.imp.KERNEL32.dll_VirtualFree]
mov dword [0x612c18], 0
pop ebx
pop edi
xor eax, eax
pop esi
mov esp, ebp
pop ebp
ret 4