Function at 0x1013a30
Capabilities:
Terminate thread

Disassembly:
push ebx
push ebp
push esi
mov esi, ecx
mov eax, dword [esi + 0x24]
test eax, eax
push edi
je 0x1013ab7
mov ecx, dword [eax + 0x2c]
test ecx, ecx
je 0x1013ab0
mov ebx, dword [ecx + 4]
test ebx, ebx
mov edi, dword [esi + 0x10]
je 0x1013ab0
mov eax, edi
xor edx, edx
shr eax, 4
div dword [ecx + 8]
mov edx, dword [ebx + edx*4]
test edx, edx
je 0x1013ab0
cmp dword [edx + 8], edi
je 0x1013a6c
mov edx, dword [edx]
test edx, edx
jne 0x1013a5f
jmp 0x1013ab0
test edx, edx
je 0x1013ab0
mov ebx, dword [ecx + 4]
test ebx, ebx
je 0x1013ab0
mov eax, edi
shr eax, 4
xor edx, edx
div dword [ecx + 8]
mov eax, dword [ebx + edx*4]
test eax, eax
lea edx, [ebx + edx*4]
je 0x1013ab0
cmp dword [eax + 8], edi
je 0x1013a9a
mov edx, eax
mov eax, dword [eax]
test eax, eax
jne 0x1013a8b
jmp 0x1013ab0
mov edi, dword [eax]
mov dword [edx], edi
mov edx, dword [ecx + 0x10]
mov dword [eax], edx
mov dword [ecx + 0x10], eax
dec dword [ecx + 0xc]
jne 0x1013ab0
call fcn.01013ef0
mov dword [esi + 0x24], 0
mov eax, dword [esi + 0x30]
test eax, eax
jne 0x1013acf
mov eax, dword [esi]
push 1
push eax
call dword [sym.imp.KERNEL32.dll_TerminateThread]
mov dword [esi], 0
mov eax, dword [esi + 4]
mov edi, dword [sym.imp.KERNEL32.dll_FlushFileBuffers]
mov ebx, dword [sym.imp.KERNEL32.dll_DisconnectNamedPipe]
or ebp, 0xffffffff
cmp eax, ebp
je 0x1013afb
push eax
call edi
mov ecx, dword [esi + 4]
push ecx
call ebx
mov edx, dword [esi + 4]
push edx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [esi + 4], ebp
mov eax, dword [esi + 8]
test eax, eax
je 0x1013b10
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [esi + 8], 0
mov eax, dword [esi + 0xc]
cmp eax, ebp
je 0x1013b2d
push eax
call edi
mov eax, dword [esi + 0xc]
push eax
call ebx
mov ecx, dword [esi + 0xc]
push ecx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [esi + 0xc], ebp
mov eax, dword [esi + 0x18]
test eax, eax
je 0x1013bc2
mov ebp, dword [eax + 0xc]
test ebp, ebp
jle 0x1013bad
mov edi, dword [esi + 0x18]
mov eax, dword [edi + 0xc]
neg eax
sbb eax, eax
test eax, eax
je 0x1013bad
cmp eax, 0xffffffff
mov ebx, eax
jne 0x1013b6e
mov edx, dword [edi + 8]
xor eax, eax
test edx, edx
jbe 0x1013b6e
mov ecx, dword [edi + 4]
mov ebx, dword [ecx]
test ebx, ebx
jne 0x1013b6e
inc eax
add ecx, 4
cmp eax, edx
jb 0x1013b60
cmp dword [ebx], 0
jne 0x1013b91
mov eax, dword [ebx + 4]
mov edx, dword [edi + 8]
inc eax
cmp eax, edx
jae 0x1013b91
mov ecx, dword [edi + 4]
lea ecx, [ecx + eax*4]
cmp dword [ecx], 0
jne 0x1013b91
inc eax
add ecx, 4
cmp eax, edx
jb 0x1013b84
mov ebx, dword [ebx + 0xc]
test ebx, ebx
je 0x1013ba8
mov ecx, ebx
call fcn.01013c40
push ebx
call fcn.0108e495
add esp, 4
dec ebp
test ebp, ebp
jg 0x1013b3f
mov ecx, dword [esi + 0x18]
test ecx, ecx
je 0x1013bbb
mov edx, dword [ecx]
push 1
call dword [edx + 4]
mov dword [esi + 0x18], 0
mov ecx, dword [esi + 0x1c]
test ecx, ecx
je 0x1013c01
mov eax, dword [ecx + 0xc]
test eax, eax
je 0x1013bec
call fcn.01089b69
test eax, eax
je 0x1013be2
push eax
call fcn.0108e495
add esp, 4
mov ecx, dword [esi + 0x1c]
mov eax, dword [ecx + 0xc]
test eax, eax
jne 0x1013bd0
mov ecx, dword [esi + 0x1c]
test ecx, ecx
je 0x1013bfa
mov eax, dword [ecx]
push 1
call dword [eax + 4]
mov dword [esi + 0x1c], 0
mov eax, dword [esi + 0x20]
test eax, eax
je 0x1013c16
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [esi + 0x20], 0
pop edi
pop esi
pop ebp
pop ebx
ret