Function at 0x410170
Capabilities:
Terminate thread

Disassembly:
push 0xffffffffffffffff
push 0x4157f6
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x10
push ebx
push ebp
push esi
mov esi, ecx
push edi
mov dword [esp + 0x14], esi
mov dword [esi], 0x416320
mov cl, byte [esi + 0x38]
mov eax, 1
test cl, cl
mov dword [esp + 0x28], eax
mov byte [esi + 0x68], al
je 0x4102df
mov eax, dword [esi + 0x6c]
xor edi, edi
cmp eax, edi
je 0x410249
cmp eax, 0xffffffff
je 0x410249
push edi
push eax
call dword [sym.imp.KERNEL32.dll_TerminateThread]
test eax, eax
jne 0x410206
push ecx
mov ecx, esp
mov dword [esp + 0x14], esp
push 0x4207b8
call fcn.00413dc4
push ecx
mov byte [esp + 0x30], 2
mov ecx, esp
mov dword [esp + 0x20], esp
push str.TerminateThread__Main_Server_Thread_
call fcn.00413dc4
push edi
mov byte [esp + 0x34], 1
call fcn.00406a10
add esp, 0xc
mov eax, dword [esi + 0x6c]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
test eax, eax
jne 0x410249
push ecx
mov ecx, esp
mov dword [esp + 0x1c], esp
push 0x4207b8
call fcn.00413dc4
push ecx
mov byte [esp + 0x30], 3
mov ecx, esp
mov dword [esp + 0x18], esp
push str.CloseHandle__Main_Server_Thread_
call fcn.00413dc4
push edi
mov byte [esp + 0x34], 1
call fcn.00406a10
add esp, 0xc
mov eax, dword [esi + 0x48]
mov ebp, dword [esi + 0x40]
cmp eax, edi
mov dword [esp + 0x10], edi
jle 0x41041f
mov ebx, dword [sym.imp.KERNEL32.dll_SetEvent]
lea edi, [ebp + 8]
test edi, edi
je 0x41041d
mov eax, dword [edi + 4]
test eax, eax
je 0x41041d
mov ecx, dword [edi + 0x1c]
push ecx
call ebx
mov edx, dword [edi + 4]
mov ebp, dword [ebp]
push 0x3e8
push edx
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
cmp eax, 0xffffffff
jne 0x4102ca
push ecx
mov ecx, esp
mov dword [esp + 0x1c], esp
push 0x4207b8
call fcn.00413dc4
push ecx
mov byte [esp + 0x30], 4
mov ecx, esp
mov dword [esp + 0x24], esp
push str.WaitForSingleObject__server_
call fcn.00413dc4
push 0
mov byte [esp + 0x34], 1
call fcn.00406a10
add esp, 0xc
mov eax, dword [esp + 0x10]
mov ecx, dword [esi + 0x48]
inc eax
cmp eax, ecx
mov dword [esp + 0x10], eax
jl 0x410261
jmp 0x41041d
mov cl, byte [esi + 0x39]
test cl, cl
mov ecx, dword [esi + 0x48]
jne 0x4103b6
cmp ecx, eax
jne 0x41041d
mov eax, dword [esi + 0x40]
mov edi, dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [eax + 8]
push ecx
call edi
test eax, eax
jne 0x41033e
push ecx
mov ecx, esp
mov dword [esp + 0x20], esp
push 0x4207b8
call fcn.00413dc4
push ecx
mov byte [esp + 0x30], 5
mov ecx, esp
mov dword [esp + 0x20], esp
push str.CloseHandle__single_thread_client_1_
call fcn.00413dc4
push 0
mov byte [esp + 0x34], 1
call fcn.00406a10
add esp, 0xc
mov edx, dword [esi + 0x40]
mov eax, dword [edx + 0x3c]
push eax
call edi
test eax, eax
jne 0x410381
push ecx
mov ecx, esp
mov dword [esp + 0x20], esp
push 0x4207b8
call fcn.00413dc4
push ecx
mov byte [esp + 0x30], 6
mov ecx, esp
mov dword [esp + 0x20], esp
push str.CloseHandle__single_thread_client_2_
call fcn.00413dc4
push 0
mov byte [esp + 0x34], 1
call fcn.00406a10
add esp, 0xc
mov ecx, dword [esi + 0x40]
mov edx, dword [ecx + 0x40]
push edx
call edi
test eax, eax
jne 0x41041d
push ecx
mov ecx, esp
mov dword [esp + 0x20], esp
push 0x4207b8
call fcn.00413dc4
push ecx
mov byte [esp + 0x30], 7
mov ecx, esp
mov dword [esp + 0x20], esp
push str.CloseHandle__single_thread_client_3_
jmp 0x410409
cmp ecx, eax
jne 0x41041d
mov edi, dword [esi + 0x40]
add edi, 8
je 0x41041d
mov eax, dword [edi + 4]
test eax, eax
je 0x41041d
mov eax, dword [edi + 0x1c]
push eax
call dword [sym.imp.KERNEL32.dll_SetEvent]
mov ecx, dword [edi + 4]
push 0x3e8
push ecx
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
cmp eax, 0xffffffff
jne 0x41041d
push ecx
mov ecx, esp
mov dword [esp + 0x20], esp
push 0x4207b8
call fcn.00413dc4
push ecx
mov byte [esp + 0x30], 8
mov ecx, esp
mov dword [esp + 0x20], esp
push str.WaitForSingleObject__client_
call fcn.00413dc4
push 0
mov byte [esp + 0x34], 1
call fcn.00406a10
add esp, 0xc
xor edi, edi
mov edx, dword [esi + 0x30]
mov ebx, dword [sym.imp.KERNEL32.dll_CloseHandle]
push edx
mov dword [esi + 0x18], edi
mov dword [esi + 0x2c], edi
call ebx
test eax, eax
jne 0x41046a
push ecx
mov ecx, esp
mov dword [esp + 0x20], esp
push 0x4207b8
call fcn.00413dc4
push ecx
mov byte [esp + 0x30], 9
mov ecx, esp
mov dword [esp + 0x20], esp
push str.CloseHandle__read_event_
call fcn.00413dc4
push edi
mov byte [esp + 0x34], 1
call fcn.00406a10
add esp, 0xc
mov eax, dword [esi + 0x34]
push eax
call ebx
test eax, eax
jne 0x4104a9
push ecx
mov ecx, esp
mov dword [esp + 0x20], esp
push 0x4207b8
call fcn.00413dc4
push ecx
mov byte [esp + 0x30], 0xa
mov ecx, esp
mov dword [esp + 0x20], esp
push str.CloseHandle__write_event_
call fcn.00413dc4
push edi
mov byte [esp + 0x34], 1
call fcn.00406a10
add esp, 0xc
mov al, byte [esi + 0x39]
test al, al
je 0x4106e4
mov ebx, dword [esi + 0x40]
cmp ebx, edi
je 0x4106e4
lea edi, [ebx + 8]
test edi, edi
je 0x4106e2
mov eax, dword [edi]
test eax, eax
je 0x41056c
cmp eax, 0xffffffff
je 0x41056c
mov cl, byte [esi + 0x38]
test cl, cl
je 0x410525
push eax
call dword [sym.imp.KERNEL32.dll_DisconnectNamedPipe]
test eax, eax
jne 0x410525
push ecx
mov ecx, esp
mov dword [esp + 0x20], esp
push 0x4207b8
call fcn.00413dc4
push ecx
mov byte [esp + 0x30], 0xb
mov ecx, esp
mov dword [esp + 0x20], esp
push str.DisconnectNamedPipe
call fcn.00413dc4
push 0
mov byte [esp + 0x34], 1
call fcn.00406a10
add esp, 0xc
mov ecx, dword [edi]
mov ebp, dword [sym.imp.KERNEL32.dll_CloseHandle]
push ecx
call ebp
test eax, eax
jne 0x4105a8
push ecx
mov ecx, esp
mov dword [esp + 0x20], esp
push 0x4207b8
call fcn.00413dc4
push ecx
mov byte [esp + 0x30], 0xc
mov ecx, esp
mov dword [esp + 0x20], esp
push str.CloseHandle__hPipe_
call fcn.00413dc4
push 0
mov byte [esp + 0x34], 1
call fcn.00406a10
add esp, 0xc
jmp 0x4105a8
push ecx
mov ecx, esp
mov dword [esp + 0x20], esp
push 0x4207b8
call fcn.00413dc4
push ecx
mov byte [esp + 0x30], 0xd
mov ecx, esp
mov dword [esp + 0x20], esp
push str.InstanceThread:_Invalid_worker_pipe.
call fcn.00413dc4
push 0
mov byte [esp + 0x34], 1
call fcn.00406a10
mov ebp, dword [sym.imp.KERNEL32.dll_CloseHandle]
add esp, 0xc
mov eax, dword [edi + 0x34]
test eax, eax
je 0x4105ec
push eax
call ebp
test eax, eax
jne 0x4105ec
push ecx
mov ecx, esp
mov dword [esp + 0x20], esp
push 0x4207b8
call fcn.00413dc4
push ecx
mov byte [esp + 0x30], 0xe
mov ecx, esp
mov dword [esp + 0x20], esp
push str.CloseHandle__hReadEvent_
call fcn.00413dc4
push 0
mov byte [esp + 0x34], 1
call fcn.00406a10
add esp, 0xc
mov eax, dword [edi + 0x38]
test eax, eax
je 0x410630
push eax
call ebp
test eax, eax
jne 0x410630
push ecx
mov ecx, esp
mov dword [esp + 0x20], esp
push 0x4207b8
call fcn.00413dc4
push ecx
mov byte [esp + 0x30], 0xf
mov ecx, esp
mov dword [esp + 0x20], esp
push str.CloseHandle__hWriteEvent_
call fcn.00413dc4
push 0
mov byte [esp + 0x34], 1
call fcn.00406a10
add esp, 0xc
mov eax, dword [edi + 4]
test eax, eax
je 0x410674
push eax
call ebp
test eax, eax
jne 0x410674
push ecx
mov ecx, esp
mov dword [esp + 0x20], esp
push 0x4207b8
call fcn.00413dc4
push ecx
mov byte [esp + 0x30], 0x10
mov ecx, esp
mov dword [esp + 0x20], esp
push str.CloseHandle__hWorkerThread_
call fcn.00413dc4
push 0
mov byte [esp + 0x34], 1
call fcn.00406a10
add esp, 0xc
cmp ebx, dword [esi + 0x40]
jne 0x410680
mov edx, dword [ebx]
mov dword [esi + 0x40], edx
jmp 0x410687
mov eax, dword [ebx + 4]
mov ecx, dword [ebx]
mov dword [eax], ecx
cmp ebx, dword [esi + 0x44]
jne 0x410694
mov edx, dword [ebx + 4]
mov dword [esi + 0x44], edx
jmp 0x41069c
mov eax, dword [ebx]
mov ecx, dword [ebx + 4]
mov dword [eax + 4], ecx
mov edx, dword [esi + 0x4c]
mov dword [ebx], edx
mov eax, dword [esi + 0x48]
dec eax
mov dword [esi + 0x4c], ebx
mov dword [esi + 0x48], eax
jne 0x4106d7
mov eax, dword [esi + 0x40]
xor ecx, ecx
cmp eax, ecx
je 0x4106bc
mov eax, dword [eax]
cmp eax, ecx
jne 0x4106b6
mov dword [esi + 0x48], ecx
mov dword [esi + 0x4c], ecx
mov dword [esi + 0x44], ecx
mov dword [esi + 0x40], ecx
mov ecx, dword [esi + 0x50]
call sub.MFC42u.DLL_CPlex::FreeDataChain
mov dword [esi + 0x50], 0
mov ebx, dword [esi + 0x40]
test ebx, ebx
jne 0x4104bf
xor edi, edi
lea ecx, [esi + 0x64]
mov byte [esp + 0x28], 0
call sub.MFC42u.DLL_CString::CString
add esi, 0x3c
mov dword [esp + 0x1c], esi
mov dword [esi], 0x416324
mov eax, dword [esi + 4]
mov dword [esp + 0x28], 0x11
cmp eax, edi
je 0x410713
mov eax, dword [eax]
cmp eax, edi
jne 0x41070d
mov ecx, dword [esi + 0x14]
mov dword [esi + 0xc], edi
mov dword [esi + 0x10], edi
mov dword [esi + 8], edi
mov dword [esi + 4], edi
call sub.MFC42u.DLL_CPlex::FreeDataChain
mov ecx, dword [esp + 0x20]
mov dword [esi + 0x14], edi
mov dword [esi], 0x4162d8
pop edi
pop esi
pop ebp
mov dword fs:[0], ecx
pop ebx
add esp, 0x1c
ret