Function at 0x40b051
Capabilities:
Resume thread

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x2d8
mov eax, dword [0x649ffc]
xor eax, ebp
mov dword [ebp - 4], eax
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
cmp dword [0x6622e8], eax
je 0x40b07c
mov eax, 0x10dd
jmp 0x40b269
cmp dword [0x6622e4], 0
je 0x40b08f
call fcn.0040af53
jmp 0x40b264
push ebx
push esi
push edi
mov edi, dword [0x6622fc]
xor ebx, ebx
jmp 0x40b0e6
mov ecx, dword [edi + 0x10]
cmp dword [edi + 4], ebx
je 0x40b0bd
movzx eax, byte [ecx + 0x36]
push eax
lea eax, [ecx + 0x20]
push eax
push dword [edi + 0xc]
call fcn.005868f0
mov eax, dword [edi + 0xc]
add esp, 0xc
jmp 0x40b0df
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.0040a86d
mov eax, dword [edi + 0x10]
mov ecx, dword [edi + 8]
mov dword [ecx], eax
mov edi, dword [edi]
test edi, edi
jne 0x40b09c
mov edi, dword [0x6622f8]
jmp 0x40b189
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 0x40b187
mov esi, dword [0x6622fc]
test esi, esi
je 0x40b187
mov edx, dword [ebp - 0x218]
cmp dword [esi + 4], ebx
je 0x40b145
mov ecx, dword [esi + 0x10]
cmp edx, ecx
jb 0x40b181
lea eax, [ecx + 4]
cmp edx, eax
jae 0x40b181
sub dl, cl
call fcn.0040b00a
movzx eax, al
add eax, dword [esi + 0xc]
jmp 0x40b165
cmp edx, dword [esi + 0xc]
jb 0x40b181
mov ecx, dword [esi + 0x10]
movzx eax, byte [ecx + 0x36]
add eax, dword [esi + 0xc]
cmp edx, eax
jae 0x40b181
sub dl, byte [esi + 0xc]
movzx edx, dl
call fcn.0040b02d
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 0x40b123
mov edi, dword [edi]
test edi, edi
jne 0x40b0f5
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
mov edi, dword [0x6622fc]
mov esi, eax
mov dword [ebp - 0x2d4], esi
test edi, edi
je 0x40b207
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 0x40b1ef
mov ecx, dword [edi + 0x10]
test ecx, ecx
je 0x40b1ef
call fcn.0040ae0a
and dword [edi + 0x10], 0
xor ebx, ebx
inc ebx
mov esi, dword [edi]
push 0x18
push edi
call fcn.0056e998
pop ecx
mov edi, esi
test esi, esi
mov esi, dword [ebp - 0x2d4]
pop ecx
jne 0x40b1a9
and dword [0x6622fc], 0
test ebx, ebx
je 0x40b220
cmp dword [0x651eb4], 0
jne 0x40b220
call fcn.0040ae67
call fcn.0040ab80
mov edi, dword [0x6622f8]
test edi, edi
je 0x40b253
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.0056e998
mov edi, esi
pop ecx
pop ecx
test esi, esi
jne 0x40b22f
and dword [0x6622f8], 0
and dword [0x6622e8], 0
pop edi
pop esi
pop ebx
mov eax, dword [0x6622e4]
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0056e987
leave
ret