Function at 0x1001669c
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 0x100166c4
mov eax, dword [0x10040b88]
mov dword [ebx], eax
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
cmp dword [0x10040b80], eax
je 0x100166dc
mov eax, 0x10dd
jmp 0x100168e9
cmp dword [0x10040b84], 0
je 0x100166ef
call fcn.10016599
jmp 0x100168e4
and dword [ebp - 0x2d8], 0
push esi
mov esi, dword [0x10040b90]
push edi
jmp 0x10016751
cmp dword [esi + 4], 0
je 0x10016722
mov ecx, dword [esi + 0x10]
movzx eax, byte [ecx + 0x36]
push eax
lea eax, [ecx + 0x20]
push eax
push dword [esi + 0xc]
call fcn.100184e0
mov eax, dword [esi + 0xc]
add esp, 0xc
jmp 0x1001674a
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.10016021
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 0x10016700
mov edi, dword [0x10040b8c]
jmp 0x100167ff
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 0x100167fd
mov esi, dword [0x10040b90]
test esi, esi
je 0x100167fd
mov ecx, dword [ebp - 0x218]
cmp dword [esi + 4], 0
je 0x100167b6
mov edx, dword [esi + 0x10]
cmp ecx, edx
jb 0x100167f7
lea eax, [edx + 4]
cmp ecx, eax
jae 0x100167f7
sub cl, dl
movzx eax, cl
push eax
push edx
call fcn.10015c72
movzx eax, al
add eax, dword [esi + 0xc]
jmp 0x100167d9
cmp ecx, dword [esi + 0xc]
jb 0x100167f7
mov edx, dword [esi + 0x10]
movzx eax, byte [edx + 0x36]
add eax, dword [esi + 0xc]
cmp ecx, eax
jae 0x100167f7
sub cl, byte [esi + 0xc]
movzx eax, cl
push eax
push edx
call fcn.10015c49
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 0x1001678e
mov edi, dword [edi]
test edi, edi
jne 0x10016760
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
mov edi, dword [0x10040b90]
mov dword [ebp - 0x2d4], eax
test edi, edi
je 0x10016884
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 0x1001686f
cmp dword [edi + 0x10], 0
je 0x1001686f
push dword [edi + 0x10]
call fcn.10015fb5
and dword [edi + 0x10], 0
pop ecx
mov dword [ebp - 0x2d8], 1
mov esi, dword [edi]
push edi
call fcn.100177de
mov edi, esi
pop ecx
test esi, esi
jne 0x1001681f
mov ebx, dword [ebp - 0x2dc]
and dword [0x10040b90], 0
cmp dword [ebp - 0x2d8], 0
je 0x100168a2
cmp dword [0x10040b7c], 0
jne 0x100168a2
call fcn.10015fdf
call fcn.10016103
mov edi, dword [0x10040b8c]
test edi, edi
je 0x100168c9
push dword [edi + 4]
call dword [sym.imp.KERNEL32.dll_ResumeThread]
mov esi, dword [edi]
push edi
call fcn.100177de
mov edi, esi
pop ecx
test esi, esi
jne 0x100168b1
and dword [0x10040b8c], 0
and dword [0x10040b80], 0
pop edi
pop esi
test ebx, ebx
je 0x100168e4
mov eax, dword [0x10040b88]
mov dword [ebx], eax
mov eax, dword [0x10040b84]
mov ecx, dword [ebp - 4]
xor ecx, ebp
pop ebx
call fcn.10016ee0
mov esp, ebp
pop ebp
ret 4