Function at 0x40c5d0
Capabilities:
Create thread

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x45de13
mov eax, dword fs:[0]
push eax
sub esp, 0x28
push ebx
push esi
push edi
mov eax, dword [0x474cb0]
xor eax, esp
push eax
lea eax, [esp + 0x38]
mov dword fs:[0], eax
push 0xec
call fcn.00446372
mov edi, eax
add esp, 4
mov dword [esp + 0x28], edi
xor eax, eax
mov dword [esp + 0x40], eax
cmp edi, eax
je 0x40c65d
sub esp, 0x10
mov esi, esp
mov dword [esp + 0x34], esp
push eax
push eax
mov dword [esi], vtable.CBuffer.0
mov byte [esi + 4], al
mov dword [esi + 8], eax
mov dword [esi + 0xc], eax
call fcn.00412c60
mov byte [esp + 0x50], 1
mov ebx, dword [ebp + 8]
mov eax, dword [ebx + 0x144]
push 0
push ebx
push eax
push edi
mov byte [esp + 0x60], 0
call fcn.00413760
mov edi, eax
mov dword [esp + 0x14], edi
jmp 0x40c666
mov ebx, dword [ebp + 8]
mov dword [esp + 0x14], eax
mov edi, eax
mov dword [esp + 0x40], 0xffffffff
mov dword [esp + 0x1c], edi
call fcn.00414680
mov ecx, 0xb
mov dword [edi + 0x14], ecx
mov eax, 0x2710
lea esi, [ebx + 0x164]
mov dword [edi + 0x24], eax
mov dword [edi + 0x28], eax
cmp dword [esi + 0x78], 0
mov dword [esp + 0x28], esi
je 0x40c7df
cmp dword [edi + 0x10], 0
jne 0x40c7df
cmp dword [esi + 0x60], 0
lea eax, [esi + 0x60]
mov dword [esp + 0x18], eax
je 0x40c7df
push edi
push esi
call fcn.00410f50
test eax, eax
jne 0x40c7f7
mov eax, dword [esp + 0x18]
push eax
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
inc dword [esi + 4]
mov eax, dword [esi + 4]
mov dword [edi + 0x10], eax
mov eax, dword [esi + 0x1c]
mov edx, dword [eax + 4]
lea ebx, [esi + 8]
lea ecx, [esp + 0x1c]
push ecx
push edx
push eax
mov dword [esp + 0x30], ebx
mov dword [esp + 0x3c], eax
call fcn.00411e70
mov ecx, ebx
mov dword [esp + 0x1c], eax
call fcn.00411f20
mov eax, dword [esp + 0x1c]
mov ecx, dword [esp + 0x30]
mov dword [ecx + 4], eax
mov edx, dword [eax + 4]
mov dword [edx], eax
cmp dword [esi + 0x20], 0x64
jbe 0x40c75e
mov eax, dword [ebx + 0x14]
mov ecx, dword [eax]
mov edx, dword [ebx]
lea esi, [esp + 0x1c]
mov dword [esp + 0x20], ecx
mov dword [esp + 0x1c], edx
call fcn.00411ac0
mov ecx, dword [eax]
test ecx, ecx
je 0x40c740
mov eax, dword [ecx]
mov edx, dword [eax]
push 1
call edx
mov eax, dword [ebx + 0x14]
mov eax, dword [eax]
mov ebx, dword [ebx]
mov edi, dword [esp + 0x24]
push eax
push ebx
lea ebx, [esp + 0x34]
call fcn.00411940
mov esi, dword [esp + 0x28]
mov edi, dword [esp + 0x14]
mov ecx, dword [esp + 0x18]
push ecx
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov edx, dword [edi]
mov eax, dword [edx + 0xc]
push 0
mov ecx, edi
call eax
mov ecx, dword [esi + 0x78]
push ecx
call dword [sym.imp.KERNEL32.dll_SetEvent]
cmp dword [esi + 0x80], 0xffffffff
jne 0x40c7c0
push 0
push 0
push esi
push 0x410a50
push 0
push 0
call dword [sym.imp.KERNEL32.dll_CreateThread]
mov edx, dword [ebp + 8]
mov dword [esi + 0x80], eax
mov dword [edx + 4], 0xb
mov ecx, dword [esp + 0x38]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 4
mov eax, dword [ebp + 8]
mov dword [eax + 4], 0xb
mov ecx, dword [esp + 0x38]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 4
mov dword [ebx + 4], ecx
mov ecx, dword [esp + 0x38]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 4
mov dword [ebx + 4], 0xb
mov ecx, dword [esp + 0x38]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 4