Function at 0x40b120
Capabilities:
Resume thread

Disassembly:
sub esp, 0x2d8
mov eax, dword [0x425054]
xor eax, esp
mov dword [esp + 0x2d4], eax
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
cmp dword [0x43c65c], eax
je 0x40b15c
mov eax, 0x10dd
mov ecx, dword [esp + 0x2d4]
xor ecx, esp
call fcn.0040c4ff
add esp, 0x2d8
ret
cmp dword [0x43c660], 0
je 0x40b16f
call fcn.0040b050
jmp 0x40b3e7
push ebx
push ebp
push esi
mov esi, dword [0x43c66c]
test esi, esi
push edi
mov dword [esp + 0x10], 0
je 0x40b1ef
cmp dword [esi + 4], 0
je 0x40b1ad
mov eax, dword [esi + 0x10]
movzx ecx, byte [eax + 0x36]
mov edx, dword [esi + 0xc]
push ecx
add eax, 0x20
push eax
push edx
call fcn.004105c0
mov eax, dword [esi + 8]
mov ecx, dword [esi + 0xc]
add esp, 0xc
mov dword [eax], ecx
jmp 0x40b1e9
mov edx, dword [esi + 0x10]
mov eax, dword [esi + 0xc]
mov ecx, dword [edx + 0x44]
mov byte [eax], 0xe9
lea edx, [eax + 5]
sub ecx, edx
add eax, 1
mov dword [eax], ecx
mov ecx, dword [esi + 0x10]
mov ecx, dword [ecx + 0x40]
add eax, 4
cmp eax, ecx
jae 0x40b1e1
sub ecx, eax
push ecx
push 0xcc
push eax
call fcn.0040c7b0
add esp, 0xc
mov edx, dword [esi + 8]
mov eax, dword [esi + 0x10]
mov dword [edx], eax
mov esi, dword [esi]
test esi, esi
jne 0x40b185
mov eax, dword [0x43c668]
test eax, eax
mov ebp, eax
je 0x40b2f9
mov ebx, dword [sym.imp.KERNEL32.dll_SetThreadContext]
mov edx, dword [ebp + 4]
lea ecx, [esp + 0x18]
push ecx
push edx
mov dword [esp + 0x20], 0x10001
call dword [sym.imp.KERNEL32.dll_GetThreadContext]
test eax, eax
je 0x40b2ee
mov edi, dword [0x43c66c]
test edi, edi
je 0x40b2ee
mov ecx, dword [esp + 0xd0]
cmp dword [edi + 4], 0
je 0x40b295
mov esi, dword [edi + 0x10]
cmp ecx, esi
jb 0x40b2e4
lea eax, [esi + 4]
cmp ecx, eax
jae 0x40b2e4
xor eax, eax
sub cl, byte [edi + 0x10]
lea esp, [esp]
mov dl, byte [esi + eax + 0x38]
shr dl, 3
cmp dl, cl
je 0x40b28d
add eax, 1
cmp eax, 8
jb 0x40b260
xor al, al
mov edx, dword [ebp + 4]
movzx eax, al
add eax, dword [edi + 0xc]
lea ecx, [esp + 0x18]
push ecx
mov dword [esp + 0xd4], eax
push edx
jmp 0x40b2db
mov al, byte [eax + esi + 0x38]
and al, 7
jmp 0x40b275
mov eax, dword [edi + 0xc]
cmp ecx, eax
jb 0x40b2e4
mov esi, dword [edi + 0x10]
movzx edx, byte [esi + 0x36]
add edx, eax
cmp ecx, edx
jae 0x40b2e4
xor eax, eax
sub cl, byte [edi + 0xc]
mov edi, edi
mov dl, byte [esi + eax + 0x38]
and dl, 7
cmp dl, cl
je 0x40b401
add eax, 1
cmp eax, 8
jb 0x40b2b0
xor eax, eax
mov ecx, dword [ebp + 4]
add esi, eax
lea eax, [esp + 0x18]
push eax
mov dword [esp + 0xd4], esi
push ecx
call ebx
mov ecx, dword [esp + 0xd0]
mov edi, dword [edi]
test edi, edi
jne 0x40b238
mov ebp, dword [ebp]
test ebp, ebp
jne 0x40b204
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
mov esi, dword [0x43c66c]
test esi, esi
mov ebx, eax
je 0x40b389
nop
mov ecx, dword [esi + 0x10]
mov eax, dword [esi + 0x14]
lea edx, [esp + 0x14]
push edx
movzx edx, byte [ecx + 0x36]
push eax
mov eax, dword [esi + 0xc]
push edx
push eax
call dword [sym.imp.KERNEL32.dll_VirtualProtect]
mov ecx, dword [esi + 0x10]
movzx edx, byte [ecx + 0x36]
mov eax, dword [esi + 0xc]
push edx
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_FlushInstructionCache]
cmp dword [esi + 4], 0
je 0x40b378
mov ebp, dword [esi + 0x10]
test ebp, ebp
je 0x40b378
push 0x48
push 0
mov edi, ebp
push ebp
and edi, 0xffff0000
call fcn.0040c7b0
mov ecx, dword [edi + 8]
mov dword [ebp + 0x40], ecx
mov dword [edi + 8], ebp
add esp, 0xc
mov dword [esi + 0x10], 0
mov dword [esp + 0x10], 1
mov edi, dword [esi]
push esi
call fcn.0040c4fa
add esp, 4
test edi, edi
mov esi, edi
jne 0x40b310
cmp dword [esp + 0x10], 0
mov dword [0x43c66c], 0
je 0x40b3a8
cmp dword [0x43c658], 0
jne 0x40b3a8
call fcn.0040af40
call fcn.0040abb0
mov esi, dword [0x43c668]
test esi, esi
je 0x40b3d7
mov ebp, dword [sym.imp.KERNEL32.dll_ResumeThread]
lea ecx, [ecx]
mov edx, dword [esi + 4]
push edx
call ebp
mov edi, dword [esi]
push esi
call fcn.0040c4fa
add esp, 4
test edi, edi
mov esi, edi
jne 0x40b3c0
pop edi
pop esi
xor eax, eax
pop ebp
mov dword [0x43c668], eax
mov dword [0x43c65c], eax
pop ebx
mov ecx, dword [esp + 0x2d4]
mov eax, dword [0x43c660]
xor ecx, esp
call fcn.0040c4ff
add esp, 0x2d8
ret
movzx eax, byte [eax + esi + 0x38]
shr eax, 3
jmp 0x40b2c9