Function at 0x40b06c
Capabilities:
Hook routines via microsoft detours
Resume thread

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
push ecx
push ecx
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
cmp dword [0x40f4a4], eax
je 0x40b08b
mov eax, 0x10dd
jmp 0x40b29c
cmp dword [0x40f4a8], 0
je 0x40b09e
call fcn.0040ae87
jmp 0x40b297
push ebx
push esi
mov esi, dword [0x40f484]
xor ebx, ebx
mov dword [ebp - 8], ebx
push edi
test esi, esi
je 0x40b11f
cmp dword [esi + 4], 0
mov ecx, dword [esi + 0x10]
je 0x40b0d7
movzx eax, byte [ecx + 0x36]
push eax
lea eax, [ecx + 0x20]
push eax
push dword [esi + 0xc]
call sub.msvcrt.dll_memcpy
mov ecx, dword [esi + 8]
add esp, 0xc
mov eax, dword [esi + 0xc]
mov dword [ecx], eax
jmp 0x40b116
mov edx, dword [esi + 0xc]
mov ecx, dword [ecx + 0x44]
lea eax, [edx + 5]
mov byte [edx], 0xe9
sub ecx, eax
mov dword [edx + 1], ecx
add edx, 5
mov edi, dword [esi + 0x10]
xor ecx, ecx
mov eax, dword [edi + 0x40]
sub eax, edx
cmp dword [edi + 0x40], edx
sbb ebx, ebx
not ebx
and ebx, eax
mov dword [ebp - 4], ebx
jbe 0x40b111
mov eax, ebx
mov byte [edx], 0xcc
inc edx
inc ecx
cmp ecx, eax
jb 0x40b105
mov edi, dword [esi + 0x10]
mov eax, dword [esi + 8]
mov dword [eax], edi
mov esi, dword [esi]
test esi, esi
jne 0x40b0b0
mov ebx, dword [ebp - 8]
mov esi, dword [0x40f4a0]
jmp 0x40b131
mov ecx, dword [esi + 4]
call fcn.0040af5e
mov esi, dword [esi]
test esi, esi
jne 0x40b127
mov esi, dword [0x40f48c]
jmp 0x40b147
mov ecx, dword [esi + 4]
call fcn.0040af5e
mov esi, dword [esi]
test esi, esi
jne 0x40b13d
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
mov esi, dword [0x40f484]
mov edi, eax
jmp 0x40b16f
mov ecx, dword [esi + 0x10]
movzx ecx, byte [ecx + 0x36]
push ecx
push dword [esi + 0xc]
push edi
call dword [sym.imp.KERNEL32.dll_FlushInstructionCache]
mov esi, dword [esi]
test esi, esi
jne 0x40b15b
mov esi, dword [0x40f4a0]
jmp 0x40b186
push dword [esi + 4]
call dword [sym.imp.KERNEL32.dll_ResumeThread]
mov esi, dword [esi]
test esi, esi
jne 0x40b17b
mov edi, dword [0x40f48c]
test edi, edi
je 0x40b1bc
push dword [edi + 4]
call dword [sym.imp.KERNEL32.dll_ResumeThread]
mov edi, dword [edi]
test edi, edi
jne 0x40b194
mov edi, dword [0x40f48c]
test edi, edi
je 0x40b1bc
mov esi, dword [edi]
mov ecx, edi
call fcn.00403541
mov edi, esi
test esi, esi
jne 0x40b1ad
and dword [0x40f48c], 0
and dword [0x40f4a0], 0
mov edi, dword [0x40f484]
test edi, edi
je 0x40b214
lea eax, [ebp - 8]
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]
cmp dword [edi + 4], 0
je 0x40b205
mov ecx, dword [edi + 0x10]
test ecx, ecx
je 0x40b205
call fcn.0040ad8d
and dword [edi + 0x10], 0
xor ebx, ebx
inc ebx
mov esi, dword [edi]
mov ecx, edi
call fcn.00403541
mov edi, esi
test esi, esi
jne 0x40b1d4
and dword [0x40f484], 0
test ebx, ebx
je 0x40b288
cmp dword [0x40f490], 0
jne 0x40b288
mov ecx, dword [0x40f494]
mov esi, 0x40f494
jmp 0x40b284
cmp dword [ecx], 0x52727464
jne 0x40b27f
lea edi, [ecx + 0x10000]
xor eax, eax
lea edx, [ecx + 0x88]
cmp dword [edx], 0
je 0x40b258
cmp dword [edx], ecx
jb 0x40b27f
cmp dword [edx], edi
jae 0x40b27f
inc eax
add edx, 0x48
cmp eax, 0x38d
jb 0x40b24b
mov eax, dword [ecx + 4]
push 0x8000
push 0
push ecx
mov dword [esi], eax
call dword [sym.imp.KERNEL32.dll_VirtualFree]
and dword [0x40f49c], 0
jmp 0x40b282
lea esi, [ecx + 4]
mov ecx, dword [esi]
test ecx, ecx
jne 0x40b235
call fcn.0040aab0
and dword [0x40f4a4], 0
pop edi
pop esi
pop ebx
mov eax, dword [0x40f4a8]
mov esp, ebp
pop ebp
ret