Function at 0x40c55d
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], 0x5285a4
mov dword [esp + 0x34], eax
mov dword [esp + 0x38], ecx
call dword [sym.imp.KERNEL32.dll_LocalAlloc]
mov edx, eax
mov dword [esp + 0x14], edx
test edx, edx
je 0x40c7a2
mov ecx, dword [esp + 0x18]
mov eax, dword [ecx + 8]
add eax, 0xc
push eax
push ecx
lea eax, [edx + 0x14]
push eax
call fcn.0049fa90
push 4
mov edx, ebp
lea ecx, [esp + 0x34]
call fcn.004095aa
add esp, 0x10
test eax, eax
je 0x40c798
mov eax, dword [esp + 0x14]
lea edx, [esp + 0x1c]
push ebp
lea ecx, [esp + 0x28]
mov dword [esp + 0x20], eax
call fcn.004092a6
pop ecx
test eax, eax
je 0x40c78f
mov ecx, dword [ebx + 4]
mov eax, dword [ecx]
sub eax, 1
je 0x40c67b
dec eax
sub eax, 1
jne 0x40c78f
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.00409cda
xor ebp, ebp
lea eax, [esp + 0x38]
push ebp
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.004083ec
mov esi, eax
add esp, 0x20
test esi, esi
jne 0x40c70a
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.00409cda
pop ecx
pop ecx
jmp 0x40c78f
xor ebp, ebp
cmp dword [0x528c94], 5
push ebp
jbe 0x40c6b2
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 0x40c6e1
push eax
mov dword [esp + 0x58], ebp
push str.ERROR_kull_m_remotelib_create___RtlCreateUserThread__0x_08x__n
jmp 0x40c6da
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 0x40c6ed
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.ERROR_kull_m_remotelib_create___CreateRemoteThread__0x_08x__n
call fcn.00409cda
pop ecx
pop ecx
mov eax, dword [esp + 0x54]
test eax, eax
je 0x40c78f
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 0x40c78f
push 0x14
lea edx, [esp + 0x28]
mov dword [esp + 0x20], edi
lea ecx, [esp + 0x20]
call fcn.004092a6
mov esi, eax
pop ecx
test esi, esi
je 0x40c78f
mov eax, dword [edi + 0x10]
mov dword [esp + 0x34], eax
test eax, eax
je 0x40c78f
lea eax, [esp + 0x3c]
cmp edi, eax
je 0x40c786
cmp dword [edi + 0xc], 0
mov esi, ebp
mov dword [edi + 0x10], ebp
je 0x40c783
push dword [edi + 0xc]
push 0x40
call dword [sym.imp.KERNEL32.dll_LocalAlloc]
mov dword [esp + 0x1c], eax
test eax, eax
je 0x40c783
push dword [edi + 0xc]
lea edx, [esp + 0x38]
lea ecx, [esp + 0x20]
call fcn.004092a6
mov esi, eax
pop ecx
test esi, esi
je 0x40c775
mov eax, dword [esp + 0x1c]
mov dword [edi + 0x10], eax
jmp 0x40c77f
push dword [esp + 0x1c]
call dword [sym.imp.KERNEL32.dll_LocalFree]
test esi, esi
jne 0x40c786
mov dword [edi + 0xc], ebp
lea ecx, [esp + 0x34]
call fcn.00409632
lea ecx, [esp + 0x24]
call fcn.00409632
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