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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x2d8
mov eax, dword [0x44c074]
xor eax, ebp
mov dword [ebp - 4], eax
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
cmp dword [0x44deac], eax
je 0x404004
mov eax, 0x10dd
jmp 0x404297
cmp dword [0x44deb0], 0
je 0x404017
call fcn.00403f16
jmp 0x404292
and dword [ebp - 0x2d8], 0
push ebx
push esi
mov esi, dword [0x44de90]
push edi
jmp 0x40408b
cmp dword [esi + 4], 0
je 0x40404b
mov ecx, dword [esi + 0x10]
movzx eax, byte [ecx + 0x36]
push eax
lea eax, [ecx + 0x20]
push eax
push dword [esi + 0xc]
call fcn.0041da90
mov eax, dword [esi + 0xc]
add esp, 0xc
jmp 0x404084
mov eax, dword [esi + 0x10]
xor ebx, ebx
mov edx, dword [esi + 0xc]
mov ecx, dword [eax + 0x44]
lea eax, [edx + 5]
mov byte [edx], 0xe9
sub ecx, eax
mov dword [edx + 1], ecx
add edx, 5
mov eax, dword [esi + 0x10]
xor ecx, ecx
mov edi, dword [eax + 0x40]
sub edi, edx
cmp edx, dword [eax + 0x40]
cmova edi, ebx
test edi, edi
je 0x404081
mov byte [edx], 0xcc
inc edx
inc ecx
cmp ecx, edi
jb 0x404078
mov eax, dword [esi + 0x10]
mov ecx, dword [esi + 8]
mov dword [ecx], eax
mov esi, dword [esi]
test esi, esi
jne 0x404029
mov edi, dword [0x44de98]
jmp 0x40416d
lea eax, [ebp - 0x2d4]
mov dword [ebp - 0x2d4], 0x10001
push eax
push dword [edi + 4]
call dword [sym.imp.KERNEL32.dll_GetThreadContext]
test eax, eax
je 0x40416b
mov esi, dword [0x44de90]
test esi, esi
je 0x40416b
mov ecx, dword [ebp - 0x21c]
cmp dword [esi + 4], 0
je 0x40410f
mov ebx, dword [esi + 0x10]
cmp ecx, ebx
jb 0x404161
lea eax, [ebx + 4]
cmp ecx, eax
jae 0x404161
xor edx, edx
sub cl, bl
mov al, byte [ebx + edx + 0x38]
shr al, 3
cmp al, cl
je 0x404101
inc edx
cmp edx, 8
jb 0x4040ec
xor al, al
jmp 0x404107
mov al, byte [edx + ebx + 0x38]
and al, 7
movzx eax, al
add eax, dword [esi + 0xc]
jmp 0x404145
cmp ecx, dword [esi + 0xc]
jb 0x404161
mov ebx, dword [esi + 0x10]
movzx eax, byte [ebx + 0x36]
add eax, dword [esi + 0xc]
cmp ecx, eax
jae 0x404161
xor edx, edx
sub cl, byte [esi + 0xc]
mov al, byte [ebx + edx + 0x38]
and al, 7
cmp al, cl
je 0x40413b
inc edx
cmp edx, 8
jb 0x404127
xor eax, eax
jmp 0x404143
movzx eax, byte [edx + ebx + 0x38]
shr eax, 3
add eax, ebx
mov dword [ebp - 0x21c], eax
lea eax, [ebp - 0x2d4]
push eax
push dword [edi + 4]
call dword [sym.imp.KERNEL32.dll_SetThreadContext]
mov ecx, dword [ebp - 0x21c]
mov esi, dword [esi]
test esi, esi
jne 0x4040d0
mov edi, dword [edi]
test edi, edi
jne 0x40409a
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
mov edi, dword [0x44de90]
mov ebx, eax
test edi, edi
je 0x4041e3
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]
mov eax, dword [edi + 0x10]
movzx eax, byte [eax + 0x36]
push eax
push dword [edi + 0xc]
push ebx
call dword [sym.imp.KERNEL32.dll_FlushInstructionCache]
cmp dword [edi + 4], 0
je 0x4041d1
mov ecx, dword [edi + 0x10]
test ecx, ecx
je 0x4041d1
call fcn.00403e41
and dword [edi + 0x10], 0
mov dword [ebp - 0x2d8], 1
mov esi, dword [edi]
push 0x18
push edi
call fcn.0041ac94
mov edi, esi
pop ecx
pop ecx
test esi, esi
jne 0x404187
xor ebx, ebx
mov dword [0x44de90], ebx
cmp dword [ebp - 0x2d8], ebx
je 0x404259
cmp dword [0x44de9c], ebx
jne 0x404259
mov ecx, dword [0x44dea0]
mov esi, 0x44dea0
jmp 0x404255
cmp dword [ecx], 0x52727464
jne 0x404250
lea edi, [ecx + 0x10000]
mov edx, ebx
lea eax, [ecx + 0x88]
cmp dword [eax], ebx
je 0x40422a
cmp dword [eax], ecx
jb 0x404250
cmp dword [eax], edi
jae 0x404250
inc edx
add eax, 0x48
cmp edx, 0x38d
jb 0x40421e
mov eax, dword [ecx + 4]
push 0x8000
push ebx
push ecx
mov dword [esi], eax
call dword [sym.imp.KERNEL32.dll_VirtualFree]
mov dword [0x44dea8], ebx
jmp 0x404253
lea esi, [ecx + 4]
mov ecx, dword [esi]
test ecx, ecx
jne 0x404208
call fcn.00403b57
mov edi, dword [0x44de98]
test edi, edi
je 0x404283
push dword [edi + 4]
call dword [sym.imp.KERNEL32.dll_ResumeThread]
mov esi, dword [edi]
push 8
push edi
call fcn.0041ac94
mov edi, esi
pop ecx
pop ecx
test esi, esi
jne 0x404268
pop edi
pop esi
mov dword [0x44de98], ebx
mov dword [0x44deac], ebx
pop ebx
mov eax, dword [0x44deb0]
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0041ac4b
mov esp, ebp
pop ebp
ret