Function at 0x4150dc
Capabilities:
Terminate thread

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x422a57
mov eax, dword fs:[0]
push eax
sub esp, 0x2c
push esi
push edi
mov eax, dword [0x431034]
xor eax, esp
push eax
lea eax, [esp + 0x38]
mov dword fs:[0], eax
cmp dword [ebx + 0x38], 0
je 0x41533d
lea eax, [ebx + 0x54]
push eax
mov dword [esp + 0x20], eax
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov byte [esp + 0x20], 1
and dword [esp + 0x40], 0
lea edi, [ebx + 4]
call fcn.004156f5
push dword [esp + 0x1c]
mov esi, dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
call esi
push dword [ebx + 0x38]
call dword [sym.imp.KERNEL32.dll_SetEvent]
lea eax, [ebx + 0x54]
push eax
mov dword [esp + 0x20], eax
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov byte [esp + 0x20], 1
mov dword [esp + 0x40], 1
mov eax, dword [ebx + 0x24]
mov ecx, dword [eax]
mov dword [esp + 0x10], ecx
cmp ecx, eax
je 0x41518c
mov ecx, dword [ecx + 0x18]
test ecx, ecx
je 0x41517a
mov eax, dword [ecx]
call dword [eax + 0xc]
lea eax, [esp + 0x10]
call fcn.00415af0
mov ecx, dword [esp + 0x10]
cmp ecx, dword [ebx + 0x24]
jne 0x41516e
lea edi, [ebx + 0x20]
call fcn.00415931
or dword [esp + 0x40], 0xffffffff
push dword [esp + 0x1c]
call esi
lea esi, [esp + 0x24]
call fcn.00415736
lea esi, [ebx + 0x3c]
mov dword [esp + 0x40], 2
push esi
mov dword [esp + 0x20], esi
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov byte [esp + 0x20], 1
lea eax, [ebx + 0x10]
lea edi, [esp + 0x24]
mov byte [esp + 0x40], 3
call fcn.00415761
push esi
mov byte [esp + 0x44], 2
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov eax, dword [esp + 0x2c]
test eax, eax
je 0x4152b3
xor ecx, ecx
push 4
pop edx
mov dword [esp + 0x14], eax
mul edx
seto cl
neg ecx
or ecx, eax
push ecx
call fcn.00421ab1
pop ecx
mov ecx, dword [esp + 0x28]
mov edi, eax
mov eax, dword [ecx]
mov dword [esp + 0x1c], edi
mov dword [esp + 0x10], eax
cmp eax, ecx
je 0x415234
mov eax, dword [eax + 0x18]
mov dword [edi], eax
lea eax, [esp + 0x10]
call fcn.00415af0
mov eax, dword [esp + 0x10]
add edi, 4
cmp eax, dword [esp + 0x28]
jne 0x415219
push 0xffffffffffffffff
push 1
push dword [esp + 0x24]
push dword [esp + 0x20]
call dword [sym.imp.KERNEL32.dll_WaitForMultipleObjects]
cmp eax, 0x102
jne 0x4152a8
mov eax, dword [esp + 0x28]
mov edi, dword [eax]
mov dword [esp + 0x14], edi
cmp edi, eax
je 0x4152a8
and dword [esp + 0x10], 0
lea eax, [esp + 0x10]
push eax
push dword [edi + 0x18]
call dword [sym.imp.KERNEL32.dll_GetExitCodeThread]
cmp dword [esp + 0x10], 0x103
jne 0x415283
push 0xffffffffffffffff
push dword [edi + 0x18]
call dword [sym.imp.KERNEL32.dll_TerminateThread]
mov eax, dword [edi + 0x18]
test eax, eax
je 0x415295
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
and dword [edi + 0x18], 0
lea eax, [esp + 0x14]
call fcn.00415af0
mov edi, dword [esp + 0x14]
cmp edi, dword [esp + 0x28]
jne 0x41525b
push dword [esp + 0x1c]
call dword [sym.imp.MSVCR100.dll_void___cdecl_operator_delete___void__]
pop ecx
push esi
mov dword [esp + 0x18], esi
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov byte [esp + 0x18], 1
mov byte [esp + 0x40], 4
mov eax, dword [esp + 0x28]
mov edi, dword [eax]
mov dword [esp + 0x1c], edi
cmp edi, eax
je 0x41530d
mov eax, dword [edi + 0x14]
test eax, eax
je 0x4152e8
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
and dword [edi + 0x14], 0
mov eax, dword [edi + 0x18]
test eax, eax
je 0x4152fa
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
and dword [edi + 0x18], 0
lea eax, [esp + 0x1c]
call fcn.00415af0
mov edi, dword [esp + 0x1c]
cmp edi, dword [esp + 0x28]
jne 0x4152d6
lea edi, [ebx + 0x10]
call fcn.0041583a
push esi
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
or dword [esp + 0x40], 0xffffffff
lea eax, [esp + 0x24]
push eax
call fcn.00414fea
mov eax, dword [ebx + 0x38]
test eax, eax
je 0x41533d
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
and dword [ebx + 0x38], 0
mov ecx, dword [esp + 0x38]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
mov esp, ebp
pop ebp
ret