Function at 0x40f360
Capabilities:
Create thread

Disassembly:
push 0xffffffffffffffff
push 0x4c08e0
mov eax, dword fs:[0]
push eax
sub esp, 0xc
push ebx
push ebp
push esi
push edi
mov eax, dword [0x4e5b00]
xor eax, esp
push eax
lea eax, [esp + 0x20]
mov dword fs:[0], eax
mov ebp, dword [esp + 0x30]
push 0x428
call fcn.0046110e
mov ebx, eax
add esp, 4
test ebx, ebx
jne 0x40f3b4
xor eax, eax
mov ecx, dword [esp + 0x20]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x18
ret
push 0x428
push 0
push ebx
call fcn.00465660
add esp, 0xc
push 0
push 0
push 0
push 0
call dword [sym.imp.KERNEL32.dll_CreateEventA]
mov dword [ebx], eax
test eax, eax
je 0x40f39e
mov esi, ebx
mov edi, 0x50ce38
nop
mov eax, dword [edi]
push eax
lea ecx, [esp + 0x18]
call fcn.00402ad0
xor eax, eax
mov dword [esp + 0x28], eax
cmp ebp, eax
je 0x40f409
mov eax, ebp
lea edx, [eax + 1]
jmp 0x40f400
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x40f400
sub eax, edx
push eax
push ebp
lea ecx, [esp + 0x1c]
call fcn.0040b3d0
mov eax, dword [esp + 0x14]
mov ecx, dword [ebx]
mov edx, esi
sub edx, eax
mov dword [esi], ecx
add edx, 8
mov cl, byte [eax]
mov byte [edx + eax], cl
inc eax
test cl, cl
jne 0x40f423
push esi
push 0
push 0x40f110
call fcn.004632c0
mov dword [esp + 0x34], 0xffffffff
mov eax, dword [esp + 0x20]
add eax, 0xfffffff0
add esp, 0xc
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40f465
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
add edi, 4
add esi, 0x214
cmp edi, 0x50ce40
jl 0x40f3e0
mov ecx, dword [ebx]
push 0x7530
push ecx
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
call fcn.0044916d
xor ecx, ecx
test eax, eax
setne cl
test ecx, ecx
jne 0x40f4a2
push 0x80004005
call fcn.004020d0
mov edx, dword [eax]
mov ecx, eax
mov eax, dword [edx + 0xc]
call eax
add eax, 0x10
mov dword [esp + 0x18], eax
mov dword [esp + 0x28], 1
xor ecx, ecx
lea esi, [ebx + 0x10c]
cmp dword [esi - 0x108], 0
je 0x40f4db
mov eax, esi
lea edi, [eax + 1]
mov dl, byte [eax]
inc eax
test dl, dl
jne 0x40f4d0
sub eax, edi
jne 0x40f4e9
inc ecx
add esi, 0x214
cmp ecx, 2
jl 0x40f4c2
jmp 0x40f517
imul ecx, ecx, 0x214
lea edx, [ecx + ebx + 0x10c]
test edx, edx
jne 0x40f4fe
xor eax, eax
jmp 0x40f50c
mov eax, edx
lea esi, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x40f503
sub eax, esi
push eax
push edx
lea ecx, [esp + 0x20]
call fcn.004029c0
mov esi, dword [esp + 0x18]
push 0x3b
push ecx
mov ecx, dword [esi - 0x10]
mov edx, dword [ecx]
mov eax, dword [edx + 0x10]
add esi, 0xfffffff0
mov dword [esp + 0x24], esp
mov ebp, esp
call eax
cmp dword [esi + 0xc], 0
lea ecx, [esi + 0xc]
jl 0x40f54b
cmp eax, dword [esi]
jne 0x40f54b
mov edi, esi
mov edx, 1
lock xadd dword [ecx], edx
jmp 0x40f580
mov ecx, dword [esi + 4]
mov edx, dword [eax]
mov edx, dword [edx]
push 1
push ecx
mov ecx, eax
call edx
mov edi, eax
test edi, edi
jne 0x40f564
call fcn.00401e90
mov eax, dword [esi + 4]
mov dword [edi + 4], eax
mov eax, dword [esi + 4]
inc eax
push eax
lea ecx, [esi + 0x10]
push ecx
push eax
lea edx, [edi + 0x10]
push edx
call fcn.0046087f
add esp, 0x10
mov ecx, dword [esp + 0x3c]
add edi, 0x10
mov dword [ebp], edi
call fcn.00413380
push 8
call fcn.0046110e
add esp, 0xc
test eax, eax
je 0x40f5b7
push eax
xor ecx, ecx
push ecx
push 0x40f310
mov dword [eax + 4], 2
mov dword [eax], ebx
call fcn.004632c0
add esp, 0xc
mov dword [esp + 0x28], 0xffffffff
lea eax, [esi + 0xc]
or ecx, 0xffffffff
lock xadd dword [eax], ecx
dec ecx
test ecx, ecx
jg 0x40f5d8
mov ecx, dword [esi]
mov edx, dword [ecx]
mov eax, dword [edx + 4]
push esi
call eax
mov eax, 1
mov ecx, dword [esp + 0x20]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x18
ret