Function at 0x494888
Capabilities:
Terminate thread

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x2c
mov dword [ebp - 4], edi
mov dword [ebp - 0xc], esi
mov dword [ebp - 8], ebx
mov ebx, edx
mov edi, eax
push 0x52011c
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
lea eax, [edi + 5]
and eax, 0x7f
mov esi, dword [eax*4 + 0x524940]
test esi, esi
je 0x4948c7
cmp edi, dword [esi + 0x20]
je 0x494c3c
mov esi, dword [esi + 0x1c]
test esi, esi
jne 0x4948b7
mov eax, dword [0x52013c]
test eax, eax
je 0x4948f1
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
cmp eax, dword [0x52013c]
je 0x4948f1
push 0x52011c
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
push 0
call dword [sym.imp.KERNEL32.dll_ExitThread]
xor esi, esi
test esi, esi
je 0x494c2f
mov eax, dword [esi + 0x18]
add eax, 0x18
push eax
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
test ebx, ebx
je 0x494959
movzx eax, byte [esi + 0x159]
test al, 0x18
jne 0x494950
mov edx, dword [esi + 0x20]
lea ecx, [edx + 5]
and ecx, 0x7f
mov eax, dword [ecx*4 + 0x524940]
cmp edx, dword [eax + 0x20]
jne 0x494938
mov eax, dword [eax + 0x1c]
mov dword [ecx*4 + 0x524940], eax
jmp 0x494950
mov ecx, dword [eax + 0x1c]
cmp edx, dword [ecx + 0x20]
je 0x49494a
mov eax, ecx
mov ecx, dword [ecx + 0x1c]
cmp edx, dword [ecx + 0x20]
jne 0x494940
mov edx, dword [ecx + 0x1c]
mov dword [eax + 0x1c], edx
cmp ebx, 2
je 0x494bf5
push 0x52011c
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov eax, dword [esi + 0x64]
mov dword [esi + 0x64], 0
test eax, eax
je 0x494979
mov dword [eax + 4], 0
test ebx, ebx
je 0x494ae0
mov eax, dword [esi + 0x18]
mov edx, dword [eax + 0x18]
mov dword [ebp - 0x24], edx
mov ecx, dword [eax + 0x1c]
cmp ebx, 1
mov dword [ebp - 0x20], ecx
mov edi, dword [eax + 0x20]
mov dword [ebp - 0x1c], edi
mov edx, dword [eax + 0x24]
mov dword [ebp - 0x18], edx
mov ecx, dword [eax + 0x28]
mov dword [ebp - 0x14], ecx
mov eax, dword [eax + 0x2c]
mov dword [ebp - 0x10], eax
je 0x494c05
mov ecx, dword [esi + 0x18]
mov eax, dword [ecx + 0x34]
test eax, eax
je 0x4949e9
mov edx, dword [eax]
mov dword [ecx + 0x34], edx
mov ecx, dword [eax + 4]
test ecx, ecx
je 0x4949b1
mov edx, dword [eax + 4]
mov dword [ebp - 0x2c], edx
mov eax, dword [eax + 8]
mov dword [ebp - 0x28], eax
push 0
push dword [ebp - 0x2c]
call dword [sym.imp.KERNEL32.dll_TerminateThread]
push dword [ebp - 0x2c]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x4949b1
mov eax, dword [ecx + 4]
test eax, eax
jle 0x494a29
xor ebx, ebx
mov edi, dword [ecx]
lea edx, [ebx + ebx*4]
movzx edi, byte [edi + edx*4 + 0x10]
test edi, 4
je 0x494a24
mov eax, dword [ecx]
mov ecx, dword [eax + edx*4 + 4]
mov dword [ecx], 1
mov edi, dword [esi + 0x18]
mov eax, dword [edi]
push dword [eax + edx*4]
call dword [sym.imp.KERNEL32.dll_SetEvent]
mov ecx, dword [esi + 0x18]
mov eax, dword [ecx + 4]
inc ebx
cmp ebx, eax
jl 0x4949f2
mov eax, dword [ecx + 0xc]
test eax, eax
je 0x494a68
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov ecx, dword [esi + 0x18]
cmp eax, dword [ecx + 0xc]
je 0x494a68
mov eax, dword [ecx + 8]
test eax, eax
je 0x494a68
mov eax, dword [ecx + 8]
mov dword [ebp - 0x2c], eax
mov edx, dword [ecx + 0xc]
mov dword [ebp - 0x28], edx
push 0
push dword [ebp - 0x2c]
call dword [sym.imp.KERNEL32.dll_TerminateThread]
push dword [ebp - 0x2c]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [esi + 0x18]
push dword [ecx]
call fcn.004849b0
push dword [esi + 0x18]
call fcn.004849b0
add esp, 8
movzx eax, byte [esi + 0x159]
test al, 0x18
je 0x494ac0
push 0x170
push 0
mov ebx, dword [esi + 0xf0]
push esi
call fcn.004e2770
add esp, 0xc
movzx eax, byte [esi + 0x159]
or byte [esi + 0x162], 4
and eax, 0xffffffe7
or eax, 8
mov byte [esi + 0x159], al
mov dword [esi + 0xf0], ebx
mov dword [esi + 0x20], ebx
jmp 0x494ac7
push esi
call fcn.004849b0
pop ecx
lea eax, [ebp - 0x24]
push eax
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
lea eax, [ebp - 0x24]
push eax
call dword [sym.imp.KERNEL32.dll_DeleteCriticalSection]
jmp 0x494be6
mov eax, dword [esi + 0x18]
mov dword [eax + 0xc], 0
movzx eax, byte [esi + 0x163]
test al, 1
je 0x494b1e
movzx edi, byte [esi + 0x15b]
mov edx, edi
and edx, 0xffffffdf
and edi, 0x40
shr edi, 6
and edi, 1
shl edi, 5
or edx, edi
mov byte [esi + 0x15b], dl
and eax, 0xfffffffe
mov byte [esi + 0x163], al
test al, 2
je 0x494b38
movzx edx, byte [esi + 0x152]
mov byte [esi + 0x151], dl
and eax, 0xfffffffd
mov byte [esi + 0x163], al
test al, 4
je 0x494b52
movzx edx, byte [esi + 0x14a]
mov byte [esi + 0x149], dl
and eax, 0xfffffffb
mov byte [esi + 0x163], al
test al, 8
je 0x494b7e
movzx edi, byte [esi + 0x15e]
mov edx, edi
and edx, 0xfffffffd
and edi, 4
shr edi, 2
and edi, 1
add edi, edi
or edx, edi
mov byte [esi + 0x15e], dl
and eax, 0xfffffff7
mov byte [esi + 0x163], al
test al, 0x10
je 0x494b98
movzx edx, byte [esi + 0x150]
mov byte [esi + 0x14f], dl
and eax, 0xffffffef
mov byte [esi + 0x163], al
test al, 0x20
je 0x494bb2
movzx edx, byte [esi + 0x154]
mov byte [esi + 0x153], dl
and eax, 0xffffffdf
mov byte [esi + 0x163], al
mov eax, dword [esi + 0x18]
push dword [eax + 8]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [esi + 0x18]
and byte [eax + 0x44], 0xfe
mov ecx, dword [esi + 0x18]
movzx edx, byte [ecx + 0x44]
test dl, 2
jne 0x494be6
mov edx, dword [ecx + 0x34]
test edx, edx
je 0x494c23
mov eax, dword [edx]
mov dword [ecx + 0x34], eax
push dword [edx + 0xc]
call dword [sym.imp.KERNEL32.dll_SetEvent]
mov ebx, dword [ebp - 8]
mov esi, dword [ebp - 0xc]
mov edi, dword [ebp - 4]
xor eax, eax
mov esp, ebp
pop ebp
ret
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov dword [0x52013c], eax
jmp 0x494959
mov ecx, dword [esi + 0x18]
mov eax, dword [ecx + 0x34]
test eax, eax
je 0x494a68
mov edx, dword [eax]
mov dword [ecx + 0x34], edx
push dword [eax + 0xc]
call dword [sym.imp.KERNEL32.dll_SetEvent]
jmp 0x494c05
add ecx, 0x18
push ecx
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
jmp 0x494be6
push 0x52011c
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
jmp 0x494be6
mov eax, dword [esi + 0x18]
test eax, eax
jne 0x4948f3
mov esi, 0
jmp 0x4948f3