Function at 0x40bf62
Capabilities:
Create thread

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x48
push ebx
push esi
mov esi, ecx
xor ecx, ecx
push edi
mov edi, eax
mov eax, dword [esi + 4]
mov ebx, dword [edi + 8]
mov dword [ebp - 0x1c], eax
mov dword [ebp - 0x2c], eax
mov eax, dword [esi]
add ebx, 0x20
mov dword [ebp - 8], ecx
mov dword [ebp - 0x20], ecx
mov dword [ebp - 0x30], ecx
mov dword [ebp - 0x18], ecx
mov dword [ebp - 0x14], 0x4fdef0
mov dword [ebp - 0x28], eax
mov dword [ebp - 0x24], ecx
cmp dword [ebp + 8], ecx
jne 0x40bfa6
lea eax, [ebp - 0x44]
mov dword [ebp + 8], eax
push ebx
push 0x40
call dword [sym.imp.KERNEL32.dll_LocalAlloc]
mov dword [ebp - 0x10], eax
test eax, eax
je 0x40c18e
mov ecx, dword [edi + 8]
add ecx, 0xc
push ecx
add eax, 0x14
push edi
push eax
call sub.msvcrt.dll_memcpy
push 4
push ebx
lea edi, [ebp - 0x20]
call fcn.00409122
mov edi, dword [sym.imp.KERNEL32.dll_LocalFree]
add esp, 0x14
test eax, eax
je 0x40c189
mov eax, dword [ebp - 0x10]
mov dword [ebp - 0x18], eax
push ebx
lea eax, [ebp - 0x18]
push eax
lea eax, [ebp - 0x20]
push eax
call fcn.00408e1a
add esp, 0xc
test eax, eax
je 0x40c181
mov eax, dword [esi + 4]
mov ecx, dword [eax]
dec ecx
je 0x40c06e
dec ecx
dec ecx
jne 0x40c181
mov eax, dword [ebp - 0x20]
push eax
push dword [ebp - 0x28]
mov dword [ebp - 0x24], eax
push str.Th____p_nDa____p_n
call fcn.00409709
xor ebx, ebx
push ebx
push ebx
push 8
lea eax, [ebp - 0x28]
push eax
mov eax, dword [esi + 4]
mov eax, dword [eax + 4]
push 0x22c1c3
push dword [eax]
xor esi, esi
call fcn.00407fb3
add esp, 0x24
mov dword [ebp - 8], eax
cmp eax, ebx
jne 0x40c0fd
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.00409709
pop ecx
pop ecx
jmp 0x40c0f4
mov eax, dword [eax + 4]
xor ebx, ebx
cmp dword [0x4fe32c], 5
push ebx
jbe 0x40c0a6
lea ecx, [ebp - 0xc]
push ecx
push dword [ebp - 0x20]
push dword [esi]
push ebx
push ebx
push ebx
push ebx
push ebx
push dword [eax]
call sub.ntdll.dll_RtlCreateUserThread
cmp eax, ebx
jge 0x40c0d2
push eax
push str.ERROR_kull_m_remotelib_create___RtlCreateUserThread__0x_08x__n
mov dword [ebp - 0xc], ebx
call fcn.00409709
jmp 0x40c0d0
push ebx
push dword [ebp - 0x20]
push dword [esi]
push ebx
push ebx
push dword [eax]
call dword [sym.imp.KERNEL32.dll_CreateRemoteThread]
mov dword [ebp - 0xc], eax
cmp eax, ebx
jne 0x40c0dd
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.ERROR_kull_m_remotelib_create___CreateRemoteThread__0x_08x__n
call fcn.00409709
xor ebx, ebx
pop ecx
pop ecx
mov eax, dword [ebp - 0xc]
cmp eax, ebx
je 0x40c181
push 0xffffffffffffffff
push eax
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
push dword [ebp - 0xc]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [ebp - 8], eax
xor ebx, ebx
cmp dword [ebp - 8], ebx
je 0x40c181
mov esi, dword [ebp + 8]
push 0x14
lea eax, [ebp - 0x20]
push eax
lea eax, [ebp - 0x18]
push eax
mov dword [ebp - 0x18], esi
call fcn.00408e1a
add esp, 0xc
mov dword [ebp - 8], eax
cmp eax, ebx
je 0x40c181
mov eax, dword [esi + 0x10]
mov dword [ebp - 0x30], eax
cmp eax, ebx
je 0x40c181
lea eax, [ebp - 0x44]
cmp esi, eax
je 0x40c179
mov eax, dword [esi + 0xc]
mov dword [ebp - 8], ebx
mov dword [esi + 0x10], ebx
cmp eax, ebx
je 0x40c176
push eax
push 0x40
call dword [sym.imp.KERNEL32.dll_LocalAlloc]
mov dword [ebp - 0x18], eax
cmp eax, ebx
je 0x40c176
push dword [esi + 0xc]
lea eax, [ebp - 0x30]
push eax
lea eax, [ebp - 0x18]
push eax
call fcn.00408e1a
add esp, 0xc
mov dword [ebp - 8], eax
cmp eax, ebx
je 0x40c16c
mov eax, dword [ebp - 0x18]
mov dword [esi + 0x10], eax
jmp 0x40c171
push dword [ebp - 0x18]
call edi
cmp dword [ebp - 8], ebx
jne 0x40c179
mov dword [esi + 0xc], ebx
lea ecx, [ebp - 0x30]
call fcn.004091a9
lea ecx, [ebp - 0x20]
call fcn.004091a9
push dword [ebp - 0x10]
call edi
mov eax, dword [ebp - 8]
pop edi
pop esi
pop ebx
leave
ret