Function at 0x663778
Capabilities:
Hijack thread execution
Resume thread
Suspend thread

Disassembly:
push ebx
push esi
push edi
push ebp
add esp, 0xfffffcf4
mov dword [esp], edx
mov esi, eax
mov eax, dword [0x66d694]
cmp byte [eax], 0
je 0x66379b
mov eax, dword [0x66d3fc]
cmp dword [eax], 1
jg 0x6637a4
mov eax, dword [0x66d3fc]
xor edx, edx
mov dword [eax], edx
lea edi, [esp + 0x14]
add edi, 0xf
and edi, 0xfffffff0
xor eax, eax
mov dword [esp + 8], eax
xor ebx, ebx
cmp byte [0x66d02c], 0
je 0x6637c6
mov ebp, 0x384
jmp 0x6637cb
mov ebp, 0x1f4
test ebp, ebp
jle 0x6638bb
push esi
call sub.kernel32.dll_SuspendThread
cmp eax, 0xffffffff
je 0x663a30
mov bl, 1
mov eax, edi
xor ecx, ecx
mov edx, 0xcc
call fcn.004032f4
mov dword [edi], 0x10003
cmp dword [esp], 0
je 0x6638a0
push edi
push esi
call sub.kernel32.dll_GetThreadContext
test eax, eax
je 0x6638a0
mov eax, dword [edi + 0xc4]
mov dword [esp + 4], eax
mov eax, dword [esp]
cmp eax, dword [esp + 4]
jb 0x6638a0
mov eax, dword [esp]
sub eax, dword [esp + 4]
cmp eax, 0x400000
ja 0x6638a0
cmp byte [0x66d028], 0
je 0x663846
mov eax, dword [esp]
sub eax, dword [esp + 4]
mov dword [esp + 8], eax
mov eax, dword [0x66d3fc]
cmp dword [eax], 0
jne 0x663890
cmp byte [0x66d02c], 0
jne 0x663862
cmp byte [0x66d024], 0
je 0x663890
mov eax, dword [esp]
push eax
push 0x20
mov ecx, dword [edi + 0xb8]
mov edx, dword [edi + 0xb4]
mov eax, dword [esp + 0xc]
call fcn.006636c4
mov eax, dword [0x66d3fc]
cmp dword [eax], 1
jg 0x6638bb
mov eax, dword [0x66d3fc]
xor edx, edx
mov dword [eax], edx
cmp byte [0x66d028], 0
je 0x6638a0
cmp dword [esp + 8], 0
jg 0x6638bb
xor ebx, ebx
push esi
call sub.kernel32.dll_ResumeThread
mov eax, 1
call fcn.00418afc
dec ebp
test ebp, ebp
jg 0x6637d3
cmp byte [0x66d028], 0
je 0x6639d8
cmp dword [esp + 8], 0
jle 0x6639d8
lea eax, [esp + 0xf2]
mov ecx, 0x103
xor edx, edx
call fcn.00460788
mov ebp, eax
call fcn.00442e20
mov dword [esp + 0xc], eax
mov eax, 0x103
sub eax, ebp
push eax
lea ecx, [esp + 0x10]
mov edx, 0x663a3c
lea eax, [esp + ebp*2 + 0xf6]
call fcn.004112e0
lea eax, [esp + 0xf2]
xor edx, edx
call fcn.00416df8
mov ebp, eax
cmp ebp, 0xffffffff
je 0x6639d8
mov dword [esp + 0x2fa], 0x44534d44
xor eax, eax
mov dword [esp + 0x2fe], eax
push 0
lea ecx, [esp + 0x10]
mov edx, 0x663a4c
mov eax, 0x663a50
call fcn.0040db64
test eax, eax
jne 0x66395f
mov eax, dword [esp + 0xc]
mov dword [esp + 0x2fe], eax
xor eax, eax
mov dword [esp + 0x302], eax
mov dword [esp + 0x306], 0xcc
lea eax, [esp + 0x10]
push eax
lea edx, [esp + 0x2fe]
mov ecx, 0x10
mov eax, ebp
call fcn.004167f4
lea eax, [esp + 0x10]
push eax
mov edx, edi
mov ecx, 0xcc
mov eax, ebp
call fcn.004167f4
lea eax, [esp + 0xc]
mov edx, dword [esp + 8]
mov dword [eax], edx
lea eax, [esp + 0x10]
push eax
lea edx, [esp + 0x10]
mov ecx, 4
mov eax, ebp
call fcn.004167f4
lea eax, [esp + 0x10]
push eax
mov edx, dword [esp + 8]
mov ecx, dword [esp + 0xc]
mov eax, ebp
call fcn.004167f4
mov eax, ebp
call fcn.00416794
cmp byte [0x66d02c], 0
jne 0x6639eb
mov eax, dword [0x66d694]
cmp byte [eax], 0
je 0x663a0b
test bl, bl
je 0x663a30
mov eax, dword [0x66d694]
mov byte [eax], 0
mov eax, fcn.00442514
mov dword [edi + 0xb8], eax
push edi
push esi
call sub.kernel32.dll_SetThreadContext
jmp 0x663a26
cmp byte [0x66d024], 0
je 0x663a26
mov eax, dword [0x66d3fc]
cmp dword [eax], 0
jle 0x663a26
mov eax, dword [0x66d694]
mov byte [eax], 1
test bl, bl
je 0x663a30
push esi
call sub.kernel32.dll_ResumeThread
add esp, 0x30c
pop ebp
pop edi
pop esi
pop ebx
ret