Function at 0x40d89f
Capabilities:
Resume thread

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x2d8
mov eax, dword [0x6d35ac]
xor eax, ebp
mov dword [ebp - 4], eax
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
cmp dword [0x6f0dfc], eax
je 0x40d8ca
mov eax, 0x10dd
jmp 0x40dab7
cmp dword [0x6e92ec], 0
je 0x40d8dd
call fcn.0040d7a1
jmp 0x40dab2
push ebx
push esi
push edi
mov edi, dword [0x6f0e10]
xor ebx, ebx
jmp 0x40d934
mov ecx, dword [edi + 0x10]
cmp dword [edi + 4], ebx
je 0x40d90b
movzx eax, byte [ecx + 0x36]
push eax
lea eax, [ecx + 0x20]
push eax
push dword [edi + 0xc]
call fcn.005b2600
mov eax, dword [edi + 0xc]
add esp, 0xc
jmp 0x40d92d
mov esi, dword [edi + 0xc]
mov ecx, dword [ecx + 0x44]
lea eax, [esi + 5]
mov byte [esi], 0xe9
sub ecx, eax
mov dword [esi + 1], ecx
lea ecx, [esi + 5]
mov edx, dword [edi + 0x10]
mov edx, dword [edx + 0x40]
call fcn.0040d0bb
mov eax, dword [edi + 0x10]
mov ecx, dword [edi + 8]
mov dword [ecx], eax
mov edi, dword [edi]
test edi, edi
jne 0x40d8ea
mov edi, dword [0x6f0e0c]
jmp 0x40d9d7
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 0x40d9d5
mov esi, dword [0x6f0e10]
test esi, esi
je 0x40d9d5
mov edx, dword [ebp - 0x218]
cmp dword [esi + 4], ebx
je 0x40d993
mov ecx, dword [esi + 0x10]
cmp edx, ecx
jb 0x40d9cf
lea eax, [ecx + 4]
cmp edx, eax
jae 0x40d9cf
sub dl, cl
call fcn.0040d858
movzx eax, al
add eax, dword [esi + 0xc]
jmp 0x40d9b3
cmp edx, dword [esi + 0xc]
jb 0x40d9cf
mov ecx, dword [esi + 0x10]
movzx eax, byte [ecx + 0x36]
add eax, dword [esi + 0xc]
cmp edx, eax
jae 0x40d9cf
sub dl, byte [esi + 0xc]
movzx edx, dl
call fcn.0040d87b
add eax, ecx
mov dword [ebp - 0x218], eax
lea eax, [ebp - 0x2d0]
push eax
push dword [edi + 4]
call dword [sym.imp.KERNEL32.dll_SetThreadContext]
mov edx, dword [ebp - 0x218]
mov esi, dword [esi]
test esi, esi
jne 0x40d971
mov edi, dword [edi]
test edi, edi
jne 0x40d943
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
mov edi, dword [0x6f0e10]
mov esi, eax
mov dword [ebp - 0x2d4], esi
test edi, edi
je 0x40da55
lea eax, [ebp - 0x2d8]
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 esi
call dword [sym.imp.KERNEL32.dll_FlushInstructionCache]
cmp dword [edi + 4], 0
je 0x40da3d
mov ecx, dword [edi + 0x10]
test ecx, ecx
je 0x40da3d
call fcn.0040d658
and dword [edi + 0x10], 0
xor ebx, ebx
inc ebx
mov esi, dword [edi]
push 0x18
push edi
call fcn.0059a7b3
pop ecx
mov edi, esi
test esi, esi
mov esi, dword [ebp - 0x2d4]
pop ecx
jne 0x40d9f7
and dword [0x6f0e10], 0
test ebx, ebx
je 0x40da6e
cmp dword [0x6dbb84], 0
jne 0x40da6e
call fcn.0040d6b5
call fcn.0040d3ce
mov edi, dword [0x6f0e0c]
test edi, edi
je 0x40daa1
push dword [edi + 4]
call dword [sym.imp.KERNEL32.dll_ResumeThread]
push dword [edi + 4]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov esi, dword [edi]
push 8
push edi
call fcn.0059a7b3
mov edi, esi
pop ecx
pop ecx
test esi, esi
jne 0x40da7d
and dword [0x6f0e0c], 0
and dword [0x6f0dfc], 0
pop edi
pop esi
pop ebx
mov eax, dword [0x6e92ec]
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0059a7a2
leave
ret