Function at 0x10016c5c
Capabilities:
Resume thread

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x2dc
mov eax, dword [0x10040014]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
mov ebx, dword [ebp + 8]
mov dword [ebp - 0x2dc], ebx
test ebx, ebx
je 0x10016c84
mov eax, dword [0x10040b88]
mov dword [ebx], eax
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
cmp dword [0x10040b80], eax
je 0x10016c9c
mov eax, 0x10dd
jmp 0x10016ea9
cmp dword [0x10040b84], 0
je 0x10016caf
call fcn.10016b59
jmp 0x10016ea4
and dword [ebp - 0x2d8], 0
push esi
mov esi, dword [0x10040b90]
push edi
jmp 0x10016d11
cmp dword [esi + 4], 0
je 0x10016ce2
mov ecx, dword [esi + 0x10]
movzx eax, byte [ecx + 0x36]
push eax
lea eax, [ecx + 0x20]
push eax
push dword [esi + 0xc]
call fcn.10018ba0
mov eax, dword [esi + 0xc]
add esp, 0xc
jmp 0x10016d0a
mov eax, dword [esi + 0x10]
mov edx, dword [esi + 0xc]
mov ecx, dword [eax + 0x44]
lea eax, [edx + 5]
mov byte [edx], 0xe9
sub ecx, eax
mov dword [edx + 1], ecx
mov eax, dword [esi + 0x10]
push dword [eax + 0x40]
lea eax, [edx + 5]
push eax
call fcn.100165e1
mov eax, dword [esi + 0x10]
pop ecx
pop ecx
mov ecx, dword [esi + 8]
mov dword [ecx], eax
mov esi, dword [esi]
test esi, esi
jne 0x10016cc0
mov edi, dword [0x10040b8c]
jmp 0x10016dbf
lea eax, [ebp - 0x2d0]
mov dword [ebp - 0x2d0], 0x10001
push eax
push dword [edi + 4]
call dword [sym.imp.KERNEL32.dll_GetThreadContext]
test eax, eax
je 0x10016dbd
mov esi, dword [0x10040b90]
test esi, esi
je 0x10016dbd
mov ecx, dword [ebp - 0x218]
cmp dword [esi + 4], 0
je 0x10016d76
mov edx, dword [esi + 0x10]
cmp ecx, edx
jb 0x10016db7
lea eax, [edx + 4]
cmp ecx, eax
jae 0x10016db7
sub cl, dl
movzx eax, cl
push eax
push edx
call fcn.10016232
movzx eax, al
add eax, dword [esi + 0xc]
jmp 0x10016d99
cmp ecx, dword [esi + 0xc]
jb 0x10016db7
mov edx, dword [esi + 0x10]
movzx eax, byte [edx + 0x36]
add eax, dword [esi + 0xc]
cmp ecx, eax
jae 0x10016db7
sub cl, byte [esi + 0xc]
movzx eax, cl
push eax
push edx
call fcn.10016209
add eax, dword [esi + 0x10]
pop ecx
mov dword [ebp - 0x218], eax
lea eax, [ebp - 0x2d0]
pop ecx
push eax
push dword [edi + 4]
call dword [sym.imp.KERNEL32.dll_SetThreadContext]
mov ecx, dword [ebp - 0x218]
mov esi, dword [esi]
test esi, esi
jne 0x10016d4e
mov edi, dword [edi]
test edi, edi
jne 0x10016d20
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
mov edi, dword [0x10040b90]
mov dword [ebp - 0x2d4], eax
test edi, edi
je 0x10016e44
mov ebx, eax
lea eax, [ebp - 0x2d4]
push eax
mov eax, dword [edi + 0x10]
push dword [edi + 0x14]
movzx eax, byte [eax + 0x36]
push eax
push dword [edi + 0xc]
call dword [sym.imp.KERNEL32.dll_VirtualProtect]
mov eax, dword [edi + 0x10]
movzx eax, byte [eax + 0x36]
push eax
push dword [edi + 0xc]
push ebx
call dword [sym.imp.KERNEL32.dll_FlushInstructionCache]
cmp dword [edi + 4], 0
je 0x10016e2f
cmp dword [edi + 0x10], 0
je 0x10016e2f
push dword [edi + 0x10]
call fcn.10016575
and dword [edi + 0x10], 0
pop ecx
mov dword [ebp - 0x2d8], 1
mov esi, dword [edi]
push edi
call fcn.10017e9c
mov edi, esi
pop ecx
test esi, esi
jne 0x10016ddf
mov ebx, dword [ebp - 0x2dc]
and dword [0x10040b90], 0
cmp dword [ebp - 0x2d8], 0
je 0x10016e62
cmp dword [0x10040b7c], 0
jne 0x10016e62
call fcn.1001659f
call fcn.100166c3
mov edi, dword [0x10040b8c]
test edi, edi
je 0x10016e89
push dword [edi + 4]
call dword [sym.imp.KERNEL32.dll_ResumeThread]
mov esi, dword [edi]
push edi
call fcn.10017e9c
mov edi, esi
pop ecx
test esi, esi
jne 0x10016e71
and dword [0x10040b8c], 0
and dword [0x10040b80], 0
pop edi
pop esi
test ebx, ebx
je 0x10016ea4
mov eax, dword [0x10040b88]
mov dword [ebx], eax
mov eax, dword [0x10040b84]
mov ecx, dword [ebp - 4]
xor ecx, ebp
pop ebx
call fcn.100174a0
mov esp, ebp
pop ebp
ret 4