Function at 0x100016f0
Capabilities:
Resume thread

Disassembly:
sub esp, 0x2dc
mov eax, dword [0x10011040]
xor eax, esp
mov dword [esp + 0x2d8], eax
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
cmp dword [0x10012aa0], eax
je 0x1000172c
mov eax, 0x10dd
mov ecx, dword [esp + 0x2d8]
xor ecx, esp
call fcn.10002dfc
add esp, 0x2dc
ret
cmp dword [0x10012aa4], 0
je 0x1000173f
call fcn.10001620
jmp 0x100019ea
push ebx
push ebp
push esi
mov esi, dword [0x10012ab0]
push edi
mov dword [esp + 0x10], 0
test esi, esi
je 0x100017bd
cmp dword [esi + 4], 0
je 0x1000177d
mov eax, dword [esi + 0x10]
movzx ecx, byte [eax + 0x36]
mov edx, dword [esi + 0xc]
push ecx
add eax, 0x20
push eax
push edx
call fcn.100079d0
mov eax, dword [esi + 8]
mov ecx, dword [esi + 0xc]
add esp, 0xc
mov dword [eax], ecx
jmp 0x100017b7
mov edx, dword [esi + 0x10]
mov eax, dword [esi + 0xc]
mov ecx, dword [edx + 0x44]
mov byte [eax], 0xe9
lea edx, [eax + 5]
sub ecx, edx
inc eax
mov dword [eax], ecx
mov ecx, dword [esi + 0x10]
mov ecx, dword [ecx + 0x40]
add eax, 4
cmp eax, ecx
jae 0x100017af
sub ecx, eax
push ecx
push 0xcc
push eax
call fcn.10008020
add esp, 0xc
mov edx, dword [esi + 8]
mov eax, dword [esi + 0x10]
mov dword [edx], eax
mov esi, dword [esi]
test esi, esi
jne 0x10001755
mov eax, dword [0x10012aac]
mov ebp, eax
test eax, eax
je 0x100018ba
mov ebx, dword [sym.imp.KERNEL32.dll_SetThreadContext]
mov edx, dword [ebp + 4]
lea ecx, [esp + 0x1c]
push ecx
push edx
mov dword [esp + 0x24], 0x10001
call dword [sym.imp.KERNEL32.dll_GetThreadContext]
test eax, eax
je 0x100018af
mov edi, dword [0x10012ab0]
test edi, edi
je 0x100018af
mov ecx, dword [esp + 0xd4]
cmp dword [edi + 4], 0
je 0x1000185a
mov esi, dword [edi + 0x10]
cmp ecx, esi
jb 0x100018a5
lea eax, [esi + 4]
cmp ecx, eax
jae 0x100018a5
xor eax, eax
sub cl, byte [edi + 0x10]
mov dl, byte [esi + eax + 0x38]
shr dl, 3
cmp dl, cl
je 0x10001852
inc eax
cmp eax, 8
jb 0x10001827
xor al, al
mov edx, dword [ebp + 4]
movzx eax, al
add eax, dword [edi + 0xc]
lea ecx, [esp + 0x1c]
push ecx
mov dword [esp + 0xd8], eax
push edx
jmp 0x1000189c
mov al, byte [eax + esi + 0x38]
and al, 7
jmp 0x1000183a
mov eax, dword [edi + 0xc]
cmp ecx, eax
jb 0x100018a5
mov esi, dword [edi + 0x10]
movzx edx, byte [esi + 0x36]
add edx, eax
cmp ecx, edx
jae 0x100018a5
xor eax, eax
sub cl, byte [edi + 0xc]
mov dl, byte [esi + eax + 0x38]
and dl, 7
cmp dl, cl
je 0x10001a04
inc eax
cmp eax, 8
jb 0x10001873
xor eax, eax
mov ecx, dword [ebp + 4]
add esi, eax
lea eax, [esp + 0x1c]
push eax
mov dword [esp + 0xd8], esi
push ecx
call ebx
mov ecx, dword [esp + 0xd4]
mov edi, dword [edi]
test edi, edi
jne 0x10001806
mov ebp, dword [ebp]
test ebp, ebp
jne 0x100017d2
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
mov esi, dword [0x10012ab0]
mov ebx, dword [sym.imp.KERNEL32.dll_VirtualProtect]
mov dword [esp + 0x14], eax
test esi, esi
je 0x10001959
jmp 0x100018e0
mov ecx, dword [esi + 0x10]
mov eax, dword [esi + 0x14]
lea edx, [esp + 0x18]
push edx
movzx edx, byte [ecx + 0x36]
push eax
mov eax, dword [esi + 0xc]
push edx
push eax
call ebx
mov ecx, dword [esi + 0x10]
movzx edx, byte [ecx + 0x36]
mov eax, dword [esi + 0xc]
mov ecx, dword [esp + 0x14]
push edx
push eax
push ecx
call dword [sym.imp.KERNEL32.dll_FlushInstructionCache]
cmp dword [esi + 4], 0
je 0x10001948
mov ebp, dword [esi + 0x10]
test ebp, ebp
je 0x10001948
push 0x48
push 0
mov edi, ebp
push ebp
and edi, 0xffff0000
call fcn.10008020
mov edx, dword [edi + 8]
mov dword [ebp + 0x40], edx
mov dword [edi + 8], ebp
add esp, 0xc
mov dword [esi + 0x10], 0
mov dword [esp + 0x10], 1
mov edi, dword [esi]
push esi
call fcn.10002e0b
add esp, 4
mov esi, edi
test edi, edi
jne 0x100018e0
cmp dword [esp + 0x10], 0
mov dword [0x10012ab0], 0
je 0x10001978
cmp dword [0x10012a9c], 0
jne 0x10001978
call fcn.10001510
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
mov esi, dword [0x10012a90]
mov edi, eax
test esi, esi
je 0x100019b3
lea ebx, [ebx]
lea eax, [esp + 0x18]
push eax
push 0x20
push 0x10000
push esi
call ebx
push 0x10000
push esi
push edi
call dword [sym.imp.KERNEL32.dll_FlushInstructionCache]
mov esi, dword [esi + 4]
test esi, esi
jne 0x10001990
mov esi, dword [0x10012aac]
test esi, esi
je 0x100019da
mov ebp, dword [sym.imp.KERNEL32.dll_ResumeThread]
mov ecx, dword [esi + 4]
push ecx
call ebp
mov edi, dword [esi]
push esi
call fcn.10002e0b
add esp, 4
mov esi, edi
test edi, edi
jne 0x100019c3
pop edi
pop esi
xor eax, eax
pop ebp
mov dword [0x10012aac], eax
mov dword [0x10012aa0], eax
pop ebx
mov ecx, dword [esp + 0x2d8]
mov eax, dword [0x10012aa4]
xor ecx, esp
call fcn.10002dfc
add esp, 0x2dc
ret
movzx eax, byte [eax + esi + 0x38]
shr eax, 3
jmp 0x1000188a