Function at 0x485448
Capabilities:
Terminate thread

Disassembly:
push ebp
mov ebp, esp
push esi
push edi
push ebx
sub esp, 0x28
mov esi, edx
push 0x2dfa2f4
mov edi, eax
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
cmp edi, 0xfffffff9
lea eax, [edi + 6]
jg 0x48546a
mov eax, edi
and eax, 0x7f
mov ebx, dword [eax*4 + 0x6a47e80]
test ebx, ebx
je 0x485817
cmp edi, dword [ebx + 0x28]
je 0x485491
mov ebx, dword [ebx + 0x24]
test ebx, ebx
je 0x485817
cmp edi, dword [ebx + 0x28]
jne 0x485481
mov eax, dword [ebx + 0x20]
test eax, eax
je 0x48580a
add eax, 0x18
push eax
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
test esi, esi
je 0x4856a2
test byte [ebx + 0x1a1], 0x18
jne 0x48551d
mov eax, dword [ebx + 0x28]
cmp eax, 0xfffffff9
lea edx, [eax + 6]
jg 0x4854c4
mov edx, eax
and edx, 0x7f
mov ecx, dword [edx*4 + 0x6a47e80]
cmp eax, dword [ecx + 0x28]
jne 0x4854f1
cmp eax, 0xfffffff9
jle 0x4854db
add eax, 6
and eax, 0x7f
mov edx, dword [eax*4 + 0x6a47e80]
mov ecx, dword [edx + 0x24]
mov dword [eax*4 + 0x6a47e80], ecx
jmp 0x48551d
cmp eax, 0xfffffff9
lea edx, [eax + 6]
jg 0x4854fb
mov edx, eax
and edx, 0x7f
mov ecx, dword [edx*4 + 0x6a47e80]
mov edx, dword [ecx + 0x24]
cmp eax, dword [edx + 0x28]
je 0x485517
mov ecx, edx
mov edx, dword [edx + 0x24]
cmp eax, dword [edx + 0x28]
jne 0x48550d
mov eax, dword [edx + 0x24]
mov dword [ecx + 0x24], eax
cmp esi, 2
je 0x4857ee
push 0x2dfa2f4
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov eax, dword [ebx + 0x7c]
mov dword [ebx + 0x7c], 0
test eax, eax
je 0x485546
mov dword [eax + 4], 0
mov edx, dword [ebx + 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 esi, 1
je 0x4857c9
test eax, eax
je 0x4855b4
mov ecx, dword [eax]
mov dword [edx + 0x34], ecx
cmp dword [eax + 4], 0
je 0x4855aa
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 [ebx + 0x20]
mov eax, dword [edx + 0x34]
test eax, eax
jne 0x48557d
mov eax, dword [edx + 4]
test eax, eax
jle 0x4855ee
xor edi, edi
xor esi, esi
mov ecx, dword [edx]
test byte [ecx + esi + 0x10], 4
je 0x4855e6
mov eax, dword [ecx + esi + 4]
mov dword [eax], 1
mov edx, dword [ebx + 0x20]
mov ecx, dword [edx]
push dword [ecx + esi]
call dword [sym.imp.KERNEL32.dll_SetEvent]
mov edx, dword [ebx + 0x20]
mov eax, dword [edx + 4]
inc edi
add esi, 0x14
cmp edi, eax
jl 0x4855bf
cmp dword [edx + 0xc], 0
je 0x48562a
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov edx, dword [ebx + 0x20]
cmp eax, dword [edx + 0xc]
je 0x48562a
cmp dword [edx + 8], 0
je 0x48562a
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 [ebx + 0x20]
push dword [eax]
call fcn.00487660
push dword [ebx + 0x20]
call fcn.00487660
add esp, 8
test byte [ebx + 0x1a1], 0x18
je 0x485683
push 0x1b8
push 0
push ebx
mov esi, dword [ebx + 0x124]
call fcn.004ca8b0
add esp, 0xc
movzx eax, byte [ebx + 0x1a1]
and eax, 0xffffffe7
add eax, 8
or byte [ebx + 0x1aa], 4
mov byte [ebx + 0x1a1], al
mov dword [ebx + 0x124], esi
mov dword [ebx + 0x28], esi
jmp 0x48568c
push ebx
call fcn.00487660
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 0x4857bf
push 0x2dfa2f4
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov eax, dword [ebx + 0x7c]
mov dword [ebx + 0x7c], 0
test eax, eax
je 0x4856c2
mov dword [eax + 4], 0
mov eax, dword [ebx + 0x20]
mov dword [eax + 0xc], 0
movzx eax, byte [ebx + 0x1ab]
mov edx, eax
btr edx, 0
jae 0x485700
movzx esi, byte [ebx + 0x1a3]
mov eax, esi
shr esi, 6
and eax, 0xffffffdf
and esi, 1
shl esi, 5
or eax, esi
mov byte [ebx + 0x1a3], al
mov eax, edx
mov byte [ebx + 0x1ab], al
test al, 2
je 0x48571a
movzx edx, byte [ebx + 0x19a]
and eax, 0xfffffffd
mov byte [ebx + 0x199], dl
mov byte [ebx + 0x1ab], al
test al, 4
je 0x485734
movzx edx, byte [ebx + 0x192]
and eax, 0xfffffffb
mov byte [ebx + 0x191], dl
mov byte [ebx + 0x1ab], al
test al, 8
je 0x48575d
movzx esi, byte [ebx + 0x1a6]
mov edx, esi
shr esi, 2
and edx, 0xfffffffd
and esi, 1
and eax, 0xfffffff7
add esi, esi
or edx, esi
mov byte [ebx + 0x1a6], dl
mov byte [ebx + 0x1ab], al
test al, 0x10
je 0x485777
movzx edx, byte [ebx + 0x198]
and eax, 0xffffffef
mov byte [ebx + 0x197], dl
mov byte [ebx + 0x1ab], al
test al, 0x20
je 0x485791
movzx edx, byte [ebx + 0x19c]
and eax, 0xffffffdf
mov byte [ebx + 0x19b], dl
mov byte [ebx + 0x1ab], al
mov esi, dword [ebx + 0x20]
push dword [esi + 8]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
and byte [esi + 0x44], 0xfe
mov ecx, dword [ebx + 0x20]
test byte [ecx + 0x44], 2
jne 0x4857bf
mov edx, dword [ecx + 0x34]
test edx, edx
je 0x4857fe
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 0x48562a
mov ecx, dword [eax]
mov dword [edx + 0x34], ecx
push dword [eax + 0xc]
call dword [sym.imp.KERNEL32.dll_SetEvent]
mov edx, dword [ebx + 0x20]
mov eax, dword [edx + 0x34]
test eax, eax
jne 0x4857d1
jmp 0x48562a
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov dword [0x2dfa324], eax
jmp 0x485526
add ecx, 0x18
push ecx
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
jmp 0x4857bf
push 0x2dfa2f4
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
jmp 0x4857bf
cmp dword [0x2dfa324], 0
je 0x48580a
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
cmp eax, dword [0x2dfa324]
je 0x48580a
push 0x2dfa2f4
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
push 0
call dword [sym.imp.KERNEL32.dll_ExitThread]