Function at 0x405c6b
Capabilities:
Create thread

Disassembly:
sub esp, 0x40
push ebx
push ebp
mov ebp, dword [edx + 8]
mov ebx, ecx
push esi
xor ecx, ecx
mov dword [esp + 0x14], edx
push edi
mov eax, dword [ebx + 4]
lea edi, [esp + 0x3c]
add ebp, 0x20
mov dword [esp + 0x28], eax
cmp dword [esp + 0x54], ecx
mov esi, ecx
push ebp
cmovne edi, dword [esp + 0x58]
mov dword [esp + 0x3c], eax
mov eax, dword [ebx]
push 0x40
mov dword [esp + 0x2c], ecx
mov dword [esp + 0x3c], ecx
mov dword [esp + 0x24], ecx
mov dword [esp + 0x28], 0x4d5e64
mov dword [esp + 0x34], eax
mov dword [esp + 0x38], ecx
call dword [sym.imp.KERNEL32.dll_LocalAlloc]
mov ecx, eax
mov dword [esp + 0x14], ecx
test ecx, ecx
je 0x405eae
mov edx, dword [esp + 0x18]
mov eax, dword [edx + 8]
add eax, 0xc
push eax
push edx
lea eax, [ecx + 0x14]
push eax
call fcn.004793b0
add esp, 0xc
lea ecx, [esp + 0x24]
mov edx, ebp
push 4
call fcn.0040383c
pop ecx
test eax, eax
je 0x405ea4
mov eax, dword [esp + 0x14]
lea edx, [esp + 0x1c]
push ebp
lea ecx, [esp + 0x28]
mov dword [esp + 0x20], eax
call fcn.00403545
pop ecx
test eax, eax
je 0x405e9b
mov ecx, dword [ebx + 4]
mov eax, dword [ecx]
sub eax, 1
je 0x405d8b
dec eax
sub eax, 1
jne 0x405e9b
mov eax, dword [esp + 0x24]
push eax
push dword [esp + 0x30]
mov dword [esp + 0x38], eax
push str.Th____p_nDa____p_n
call fcn.00403fb4
pop ecx
pop ecx
xor ebp, ebp
lea eax, [esp + 0x30]
push ebp
push ebp
push 8
push eax
mov eax, dword [ebx + 4]
mov edx, 0x22c1c3
mov ecx, dword [eax + 4]
mov ecx, dword [ecx]
call fcn.004030ed
mov esi, eax
add esp, 0x14
test esi, esi
jne 0x405e1a
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.ERROR_kull_m_remotelib_create___kull_m_kernel_ioctl_handle__0x_08x__n
call fcn.00403fb4
pop ecx
pop ecx
jmp 0x405e9b
xor ebp, ebp
cmp dword [0x4d64d4], 5
push ebp
jbe 0x405dc2
lea eax, [esp + 0x58]
push eax
push dword [esp + 0x2c]
mov eax, dword [ecx + 4]
push dword [ebx]
push ebp
push ebp
push ebp
push ebp
push ebp
push dword [eax]
call dword [sym.imp.ntdll.dll_RtlCreateUserThread]
test eax, eax
jns 0x405df1
push eax
mov dword [esp + 0x58], ebp
push str.ERROR_kull_m_remotelib_create___RtlCreateUserThread__0x_08x__n
jmp 0x405dea
mov eax, dword [ecx + 4]
push ebp
push dword [esp + 0x2c]
push dword [ebx]
push ebp
push ebp
push dword [eax]
call dword [sym.imp.KERNEL32.dll_CreateRemoteThread]
mov dword [esp + 0x54], eax
test eax, eax
jne 0x405dfd
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.ERROR_kull_m_remotelib_create___CreateRemoteThread__0x_08x__n
call fcn.00403fb4
pop ecx
pop ecx
mov eax, dword [esp + 0x54]
test eax, eax
je 0x405e9b
push 0xffffffffffffffff
push eax
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
push dword [esp + 0x54]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov esi, eax
test esi, esi
je 0x405e9b
push 0x14
lea edx, [esp + 0x28]
mov dword [esp + 0x20], edi
lea ecx, [esp + 0x20]
call fcn.00403545
mov esi, eax
pop ecx
test esi, esi
je 0x405e9b
mov eax, dword [edi + 0x10]
mov dword [esp + 0x34], eax
test eax, eax
je 0x405e9b
lea eax, [esp + 0x3c]
cmp edi, eax
je 0x405e92
cmp dword [edi + 0xc], 0
mov esi, ebp
mov dword [edi + 0x10], ebp
je 0x405e8f
push dword [edi + 0xc]
push 0x40
call dword [sym.imp.KERNEL32.dll_LocalAlloc]
mov dword [esp + 0x1c], eax
test eax, eax
je 0x405e8f
push dword [edi + 0xc]
lea edx, [esp + 0x38]
lea ecx, [esp + 0x20]
call fcn.00403545
mov esi, eax
pop ecx
test esi, esi
je 0x405e85
mov eax, dword [esp + 0x1c]
mov dword [edi + 0x10], eax
jmp 0x405e92
push dword [esp + 0x1c]
call dword [sym.imp.KERNEL32.dll_LocalFree]
mov dword [edi + 0xc], ebp
lea ecx, [esp + 0x34]
call fcn.004038c4
lea ecx, [esp + 0x24]
call fcn.004038c4
push dword [esp + 0x14]
call dword [sym.imp.KERNEL32.dll_LocalFree]
pop edi
mov eax, esi
pop esi
pop ebp
pop ebx
add esp, 0x40
ret