Function at 0x40d891
Capabilities:
Resume thread

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x2d8
mov eax, dword [0x6c45ac]
xor eax, ebp
mov dword [ebp - 4], eax
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
cmp dword [0x6e1d3c], eax
je 0x40d8bc
mov eax, 0x10dd
jmp 0x40daa9
cmp dword [0x6da22c], 0
je 0x40d8cf
call fcn.0040d793
jmp 0x40daa4
push ebx
push esi
push edi
mov edi, dword [0x6e1d50]
xor ebx, ebx
jmp 0x40d926
mov ecx, dword [edi + 0x10]
cmp dword [edi + 4], ebx
je 0x40d8fd
movzx eax, byte [ecx + 0x36]
push eax
lea eax, [ecx + 0x20]
push eax
push dword [edi + 0xc]
call fcn.005a8a40
mov eax, dword [edi + 0xc]
add esp, 0xc
jmp 0x40d91f
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.0040d0ad
mov eax, dword [edi + 0x10]
mov ecx, dword [edi + 8]
mov dword [ecx], eax
mov edi, dword [edi]
test edi, edi
jne 0x40d8dc
mov edi, dword [0x6e1d4c]
jmp 0x40d9c9
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 0x40d9c7
mov esi, dword [0x6e1d50]
test esi, esi
je 0x40d9c7
mov edx, dword [ebp - 0x218]
cmp dword [esi + 4], ebx
je 0x40d985
mov ecx, dword [esi + 0x10]
cmp edx, ecx
jb 0x40d9c1
lea eax, [ecx + 4]
cmp edx, eax
jae 0x40d9c1
sub dl, cl
call fcn.0040d84a
movzx eax, al
add eax, dword [esi + 0xc]
jmp 0x40d9a5
cmp edx, dword [esi + 0xc]
jb 0x40d9c1
mov ecx, dword [esi + 0x10]
movzx eax, byte [ecx + 0x36]
add eax, dword [esi + 0xc]
cmp edx, eax
jae 0x40d9c1
sub dl, byte [esi + 0xc]
movzx edx, dl
call fcn.0040d86d
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 0x40d963
mov edi, dword [edi]
test edi, edi
jne 0x40d935
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
mov edi, dword [0x6e1d50]
mov esi, eax
mov dword [ebp - 0x2d4], esi
test edi, edi
je 0x40da47
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 0x40da2f
mov ecx, dword [edi + 0x10]
test ecx, ecx
je 0x40da2f
call fcn.0040d64a
and dword [edi + 0x10], 0
xor ebx, ebx
inc ebx
mov esi, dword [edi]
push 0x18
push edi
call fcn.00590bf9
pop ecx
mov edi, esi
test esi, esi
mov esi, dword [ebp - 0x2d4]
pop ecx
jne 0x40d9e9
and dword [0x6e1d50], 0
test ebx, ebx
je 0x40da60
cmp dword [0x6ccac4], 0
jne 0x40da60
call fcn.0040d6a7
call fcn.0040d3c0
mov edi, dword [0x6e1d4c]
test edi, edi
je 0x40da93
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.00590bf9
mov edi, esi
pop ecx
pop ecx
test esi, esi
jne 0x40da6f
and dword [0x6e1d4c], 0
and dword [0x6e1d3c], 0
pop edi
pop esi
pop ebx
mov eax, dword [0x6da22c]
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00590be8
leave
ret