Function at 0x40d894
Capabilities:
Resume thread

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x2d8
mov eax, dword [0x6c75ac]
xor eax, ebp
mov dword [ebp - 4], eax
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
cmp dword [0x6e4d8c], eax
je 0x40d8bf
mov eax, 0x10dd
jmp 0x40daac
cmp dword [0x6dd27c], 0
je 0x40d8d2
call fcn.0040d796
jmp 0x40daa7
push ebx
push esi
push edi
mov edi, dword [0x6e4da0]
xor ebx, ebx
jmp 0x40d929
mov ecx, dword [edi + 0x10]
cmp dword [edi + 4], ebx
je 0x40d900
movzx eax, byte [ecx + 0x36]
push eax
lea eax, [ecx + 0x20]
push eax
push dword [edi + 0xc]
call fcn.005aa530
mov eax, dword [edi + 0xc]
add esp, 0xc
jmp 0x40d922
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.0040d0b0
mov eax, dword [edi + 0x10]
mov ecx, dword [edi + 8]
mov dword [ecx], eax
mov edi, dword [edi]
test edi, edi
jne 0x40d8df
mov edi, dword [0x6e4d9c]
jmp 0x40d9cc
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 0x40d9ca
mov esi, dword [0x6e4da0]
test esi, esi
je 0x40d9ca
mov edx, dword [ebp - 0x218]
cmp dword [esi + 4], ebx
je 0x40d988
mov ecx, dword [esi + 0x10]
cmp edx, ecx
jb 0x40d9c4
lea eax, [ecx + 4]
cmp edx, eax
jae 0x40d9c4
sub dl, cl
call fcn.0040d84d
movzx eax, al
add eax, dword [esi + 0xc]
jmp 0x40d9a8
cmp edx, dword [esi + 0xc]
jb 0x40d9c4
mov ecx, dword [esi + 0x10]
movzx eax, byte [ecx + 0x36]
add eax, dword [esi + 0xc]
cmp edx, eax
jae 0x40d9c4
sub dl, byte [esi + 0xc]
movzx edx, dl
call fcn.0040d870
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 0x40d966
mov edi, dword [edi]
test edi, edi
jne 0x40d938
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
mov edi, dword [0x6e4da0]
mov esi, eax
mov dword [ebp - 0x2d4], esi
test edi, edi
je 0x40da4a
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 0x40da32
mov ecx, dword [edi + 0x10]
test ecx, ecx
je 0x40da32
call fcn.0040d64d
and dword [edi + 0x10], 0
xor ebx, ebx
inc ebx
mov esi, dword [edi]
push 0x18
push edi
call fcn.005926e9
pop ecx
mov edi, esi
test esi, esi
mov esi, dword [ebp - 0x2d4]
pop ecx
jne 0x40d9ec
and dword [0x6e4da0], 0
test ebx, ebx
je 0x40da63
cmp dword [0x6cfb14], 0
jne 0x40da63
call fcn.0040d6aa
call fcn.0040d3c3
mov edi, dword [0x6e4d9c]
test edi, edi
je 0x40da96
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.005926e9
mov edi, esi
pop ecx
pop ecx
test esi, esi
jne 0x40da72
and dword [0x6e4d9c], 0
and dword [0x6e4d8c], 0
pop edi
pop esi
pop ebx
mov eax, dword [0x6dd27c]
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.005926d8
leave
ret