Function at 0x46dec8
Capabilities:
Terminate thread

Disassembly:
push ebp
mov ebp, esp
push esi
push edi
push ebx
sub esp, 0x28
mov ebx, edx
push 0x50612c
mov edi, eax
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
cmp edi, 0xfffffff9
lea eax, [edi + 6]
jg 0x46deea
mov eax, edi
and eax, 0x7f
mov esi, dword [eax*4 + 0x50bf40]
test esi, esi
je 0x46e295
cmp edi, dword [esi + 0x28]
je 0x46df11
mov esi, dword [esi + 0x24]
test esi, esi
je 0x46e295
cmp edi, dword [esi + 0x28]
jne 0x46df01
mov eax, dword [esi + 0x20]
test eax, eax
je 0x46e288
add eax, 0x18
push eax
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
test ebx, ebx
je 0x46e120
test byte [esi + 0x18d], 0x18
jne 0x46df9d
mov eax, dword [esi + 0x28]
cmp eax, 0xfffffff9
lea edx, [eax + 6]
jg 0x46df44
mov edx, eax
and edx, 0x7f
mov ecx, dword [edx*4 + 0x50bf40]
cmp eax, dword [ecx + 0x28]
jne 0x46df71
cmp eax, 0xfffffff9
jle 0x46df5b
add eax, 6
and eax, 0x7f
mov edx, dword [eax*4 + 0x50bf40]
mov ecx, dword [edx + 0x24]
mov dword [eax*4 + 0x50bf40], ecx
jmp 0x46df9d
cmp eax, 0xfffffff9
lea edx, [eax + 6]
jg 0x46df7b
mov edx, eax
and edx, 0x7f
mov ecx, dword [edx*4 + 0x50bf40]
mov edx, dword [ecx + 0x24]
cmp eax, dword [edx + 0x28]
je 0x46df97
mov ecx, edx
mov edx, dword [edx + 0x24]
cmp eax, dword [edx + 0x28]
jne 0x46df8d
mov eax, dword [edx + 0x24]
mov dword [ecx + 0x24], eax
cmp ebx, 2
je 0x46e26c
push 0x50612c
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov eax, dword [esi + 0x78]
mov dword [esi + 0x78], 0
test eax, eax
je 0x46dfc6
mov dword [eax + 4], 0
mov edx, dword [esi + 0x20]
mov eax, dword [edx + 0x18]
mov ecx, dword [edx + 0x1c]
mov edi, dword [edx + 0x20]
mov dword [ebp - 0x2c], eax
mov dword [ebp - 0x28], ecx
mov dword [ebp - 0x24], edi
mov eax, dword [edx + 0x24]
mov ecx, dword [edx + 0x28]
mov edi, dword [edx + 0x2c]
mov dword [ebp - 0x20], eax
mov dword [ebp - 0x1c], ecx
mov dword [ebp - 0x18], edi
mov eax, dword [edx + 0x34]
cmp ebx, 1
je 0x46e247
test eax, eax
je 0x46e034
mov ecx, dword [eax]
mov dword [edx + 0x34], ecx
cmp dword [eax + 4], 0
je 0x46e02a
mov edx, dword [eax + 4]
mov dword [ebp - 0x14], edx
mov eax, dword [eax + 8]
mov dword [ebp - 0x10], eax
push 0
mov eax, dword [ebp - 0x14]
push eax
call dword [sym.imp.KERNEL32.dll_TerminateThread]
mov eax, dword [ebp - 0x14]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov edx, dword [esi + 0x20]
mov eax, dword [edx + 0x34]
test eax, eax
jne 0x46dffd
mov ecx, dword [edx + 4]
test ecx, ecx
jle 0x46e06c
xor ebx, ebx
mov edi, dword [edx]
lea eax, [ebx + ebx*4]
test byte [edi + eax*4 + 0x10], 4
je 0x46e067
mov edx, dword [edi + eax*4 + 4]
mov dword [edx], 1
mov ecx, dword [esi + 0x20]
mov edi, dword [ecx]
push dword [edi + eax*4]
call dword [sym.imp.KERNEL32.dll_SetEvent]
mov edx, dword [esi + 0x20]
mov ecx, dword [edx + 4]
inc ebx
cmp ebx, ecx
jl 0x46e03d
cmp dword [edx + 0xc], 0
je 0x46e0a8
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov edx, dword [esi + 0x20]
cmp eax, dword [edx + 0xc]
je 0x46e0a8
cmp dword [edx + 8], 0
je 0x46e0a8
mov eax, dword [edx + 8]
mov dword [ebp - 0x34], eax
mov edx, dword [edx + 0xc]
mov dword [ebp - 0x30], edx
push 0
mov eax, dword [ebp - 0x34]
push eax
call dword [sym.imp.KERNEL32.dll_TerminateThread]
mov eax, dword [ebp - 0x34]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [esi + 0x20]
push dword [eax]
call fcn.00460cc0
push dword [esi + 0x20]
call fcn.00460cc0
add esp, 8
test byte [esi + 0x18d], 0x18
je 0x46e101
push 0x1b0
push 0
push esi
mov ebx, dword [esi + 0x118]
call fcn.004a08c0
add esp, 0xc
movzx eax, byte [esi + 0x18d]
and eax, 0xffffffe7
add eax, 8
or byte [esi + 0x196], 4
mov byte [esi + 0x18d], al
mov dword [esi + 0x118], ebx
mov dword [esi + 0x28], ebx
jmp 0x46e10a
push esi
call fcn.00460cc0
add esp, 4
lea ebx, [ebp - 0x2c]
push ebx
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
push ebx
call dword [sym.imp.KERNEL32.dll_DeleteCriticalSection]
jmp 0x46e23d
push 0x50612c
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov eax, dword [esi + 0x78]
mov dword [esi + 0x78], 0
test eax, eax
je 0x46e140
mov dword [eax + 4], 0
mov eax, dword [esi + 0x20]
mov dword [eax + 0xc], 0
movzx eax, byte [esi + 0x197]
mov edx, eax
btr edx, 0
jae 0x46e17e
movzx edi, byte [esi + 0x18f]
mov eax, edi
shr edi, 6
and eax, 0xffffffdf
and edi, 1
shl edi, 5
or eax, edi
mov byte [esi + 0x18f], al
mov eax, edx
mov byte [esi + 0x197], al
test al, 2
je 0x46e198
movzx edx, byte [esi + 0x188]
and eax, 0xfffffffd
mov byte [esi + 0x187], dl
mov byte [esi + 0x197], al
test al, 4
je 0x46e1b2
movzx edx, byte [esi + 0x180]
and eax, 0xfffffffb
mov byte [esi + 0x17f], dl
mov byte [esi + 0x197], al
test al, 8
je 0x46e1db
movzx edi, byte [esi + 0x192]
mov edx, edi
shr edi, 2
and edx, 0xfffffffd
and edi, 1
and eax, 0xfffffff7
add edi, edi
or edx, edi
mov byte [esi + 0x192], dl
mov byte [esi + 0x197], al
test al, 0x10
je 0x46e1f5
movzx edx, byte [esi + 0x186]
and eax, 0xffffffef
mov byte [esi + 0x185], dl
mov byte [esi + 0x197], al
test al, 0x20
je 0x46e20f
movzx edx, byte [esi + 0x18a]
and eax, 0xffffffdf
mov byte [esi + 0x189], dl
mov byte [esi + 0x197], al
mov ebx, dword [esi + 0x20]
push dword [ebx + 8]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
and byte [ebx + 0x44], 0xfe
mov ecx, dword [esi + 0x20]
test byte [ecx + 0x44], 2
jne 0x46e23d
mov edx, dword [ecx + 0x34]
test edx, edx
je 0x46e27c
mov eax, dword [edx]
mov dword [ecx + 0x34], eax
push dword [edx + 0xc]
call dword [sym.imp.KERNEL32.dll_SetEvent]
xor eax, eax
lea esp, [ebp - 0xc]
pop ebx
pop edi
pop esi
pop ebp
ret
test eax, eax
je 0x46e0a8
mov ecx, dword [eax]
mov dword [edx + 0x34], ecx
push dword [eax + 0xc]
call dword [sym.imp.KERNEL32.dll_SetEvent]
mov edx, dword [esi + 0x20]
mov eax, dword [edx + 0x34]
test eax, eax
jne 0x46e24f
jmp 0x46e0a8
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov dword [0x50615c], eax
jmp 0x46dfa6
add ecx, 0x18
push ecx
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
jmp 0x46e23d
push 0x50612c
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
jmp 0x46e23d
cmp dword [0x50615c], 0
je 0x46e288
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
cmp eax, dword [0x50615c]
je 0x46e288
push 0x50612c
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
push 0
call dword [sym.imp.KERNEL32.dll_ExitThread]