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

Disassembly:
push ebp
mov ebp, esp
push ebx
sub esp, 0x54
mov eax, dword [ebp + 8]
mov dword [ebp - 0x1c], eax
mov eax, dword [ebp - 0x1c]
mov eax, dword [eax + 0x3c]
mov edx, eax
mov eax, dword [ebp + 8]
add eax, edx
mov dword [ebp - 0x20], eax
mov eax, dword [ebp - 0x20]
add eax, 0xa0
mov dword [ebp - 0x24], eax
mov eax, dword [ebp - 0x24]
mov eax, dword [eax]
test eax, eax
je 0x4016c0
mov eax, dword [ebp - 0x24]
mov eax, dword [eax + 4]
test eax, eax
jne 0x4016ca
mov eax, 0
jmp 0x40190a
mov eax, dword [ebp - 0x20]
mov eax, dword [eax + 0x50]
mov dword [esp + 0xc], 0x40
mov dword [esp + 8], 0x3000
mov dword [esp + 4], eax
mov dword [esp], 0
mov eax, dword [sym.imp.KERNEL32.dll_VirtualAlloc]
call eax
sub esp, 0x10
mov dword [ebp - 0x28], eax
cmp dword [ebp - 0x28], 0
jne 0x401708
mov eax, 0
jmp 0x40190a
mov eax, dword [ebp - 0x20]
movzx eax, word [eax + 0x14]
movzx edx, ax
mov eax, dword [ebp - 0x20]
add eax, edx
add eax, 0x18
mov dword [ebp - 0x2c], eax
mov eax, dword [ebp - 0x20]
movzx eax, word [eax + 6]
movzx edx, ax
mov eax, edx
shl eax, 2
add eax, edx
shl eax, 3
mov edx, eax
mov eax, dword [ebp - 0x2c]
add eax, edx
sub eax, dword [ebp + 8]
mov dword [ebp - 0x30], eax
mov eax, dword [ebp - 0x30]
mov dword [esp + 8], eax
mov eax, dword [ebp + 8]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x28]
mov dword [esp], eax
call sub.msvcrt.dll_memcpy
mov dword [ebp - 0xc], 0
jmp 0x4017c4
mov edx, dword [ebp - 0xc]
mov eax, edx
shl eax, 2
add eax, edx
shl eax, 3
mov edx, eax
mov eax, dword [ebp - 0x2c]
add eax, edx
mov ecx, dword [eax + 0x10]
mov edx, dword [ebp - 0xc]
mov eax, edx
shl eax, 2
add eax, edx
shl eax, 3
mov edx, eax
mov eax, dword [ebp - 0x2c]
add eax, edx
mov edx, dword [eax + 0x14]
mov eax, dword [ebp + 8]
lea ebx, [edx + eax]
mov edx, dword [ebp - 0xc]
mov eax, edx
shl eax, 2
add eax, edx
shl eax, 3
mov edx, eax
mov eax, dword [ebp - 0x2c]
add eax, edx
mov edx, dword [eax + 0xc]
mov eax, dword [ebp - 0x28]
add eax, edx
mov dword [esp + 8], ecx
mov dword [esp + 4], ebx
mov dword [esp], eax
call sub.msvcrt.dll_memcpy
add dword [ebp - 0xc], 1
mov eax, dword [ebp - 0x20]
movzx eax, word [eax + 6]
movzx eax, ax
cmp dword [ebp - 0xc], eax
jl 0x401760
mov eax, dword [ebp - 0x20]
sub eax, 0xffffff80
mov dword [ebp - 0x34], eax
mov eax, dword [ebp - 0x34]
mov edx, dword [eax]
mov eax, dword [ebp - 0x28]
add eax, edx
mov dword [ebp - 0x38], eax
mov eax, dword [ebp - 0x28]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x38]
mov dword [esp], eax
call fcn.00401590
test eax, eax
sete al
test al, al
je 0x40182e
mov dword [esp + 8], 0x8000
mov dword [esp + 4], 0
mov eax, dword [ebp - 0x28]
mov dword [esp], eax
mov eax, dword [sym.imp.KERNEL32.dll_VirtualFree]
call eax
sub esp, 0xc
mov eax, 0
jmp 0x40190a
mov eax, dword [ebp - 0x24]
mov edx, dword [eax]
mov eax, dword [ebp - 0x28]
add eax, edx
mov dword [ebp - 0x3c], eax
mov eax, dword [ebp - 0x3c]
mov dword [ebp - 0x10], eax
mov edx, dword [ebp - 0x28]
mov eax, dword [ebp - 0x20]
mov eax, dword [eax + 0x34]
sub edx, eax
mov dword [ebp - 0x40], edx
mov eax, dword [ebp - 0x24]
mov edx, dword [eax + 4]
mov eax, dword [ebp - 0x3c]
add eax, edx
mov dword [ebp - 0x44], eax
jmp 0x4018ea
mov eax, dword [ebp - 0x10]
mov eax, dword [eax + 4]
sub eax, 8
shr eax, 1
mov dword [ebp - 0x14], eax
mov eax, dword [ebp - 0x10]
add eax, 8
mov dword [ebp - 0x18], eax
mov eax, dword [ebp - 0x10]
mov edx, dword [eax]
mov eax, dword [ebp - 0x28]
add eax, edx
mov dword [ebp - 0x48], eax
jmp 0x4018cf
mov eax, dword [ebp - 0x18]
movzx eax, word [eax]
shr ax, 0xc
cmp ax, 3
jne 0x4018cb
mov eax, dword [ebp - 0x18]
movzx eax, word [eax]
movzx eax, ax
and eax, 0xfff
mov edx, eax
mov eax, dword [ebp - 0x48]
add eax, edx
mov ecx, dword [eax]
mov eax, dword [ebp - 0x18]
movzx eax, word [eax]
movzx eax, ax
and eax, 0xfff
mov edx, eax
mov eax, dword [ebp - 0x48]
add eax, edx
mov edx, dword [ebp - 0x40]
add edx, ecx
mov dword [eax], edx
add dword [ebp - 0x18], 2
mov eax, dword [ebp - 0x14]
lea edx, [eax - 1]
mov dword [ebp - 0x14], edx
test eax, eax
setne al
test al, al
jne 0x401888
mov eax, dword [ebp - 0x10]
mov eax, dword [eax + 4]
add dword [ebp - 0x10], eax
mov eax, dword [ebp - 0x10]
cmp eax, dword [ebp - 0x44]
jae 0x4018ff
mov eax, dword [ebp - 0x10]
mov eax, dword [eax]
test eax, eax
jne 0x401862
mov eax, dword [ebp - 0x20]
mov edx, dword [eax + 0x28]
mov eax, dword [ebp - 0x28]
add eax, edx
mov ebx, dword [ebp - 4]
leave
ret