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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x2d8
mov eax, dword [0x57c54c]
xor eax, ebp
mov dword [ebp - 4], eax
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
cmp dword [0x5806b4], eax
je 0x459619
mov eax, 0x10dd
jmp 0x459897
cmp dword [0x5806b0], 0
je 0x45962c
call fcn.0045952d
jmp 0x459892
and dword [ebp - 0x2d8], 0
push ebx
push esi
push edi
mov edi, dword [0x5806c8]
jmp 0x459689
cmp dword [edi + 4], 0
mov ecx, dword [edi + 0x10]
je 0x459660
movzx eax, byte [ecx + 0x36]
push eax
lea eax, [ecx + 0x20]
push eax
push dword [edi + 0xc]
call fcn.00503a80
mov eax, dword [edi + 0xc]
add esp, 0xc
jmp 0x459682
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.00458fb3
mov eax, dword [edi + 0x10]
mov ecx, dword [edi + 8]
mov dword [ecx], eax
mov edi, dword [edi]
test edi, edi
jne 0x45963e
mov edi, dword [0x5806c4]
jmp 0x45976d
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 0x45976b
mov esi, dword [0x5806c8]
test esi, esi
je 0x45976b
mov ecx, dword [ebp - 0x21c]
cmp dword [esi + 4], 0
je 0x45970f
mov edx, dword [esi + 0x10]
cmp ecx, edx
jb 0x459761
lea eax, [edx + 4]
cmp ecx, eax
jae 0x459761
xor ebx, ebx
sub cl, dl
mov dl, byte [edx + ebx + 0x38]
mov al, dl
shr al, 3
cmp al, cl
je 0x459704
mov edx, dword [esi + 0x10]
inc ebx
cmp ebx, 8
jb 0x4596ea
xor dl, dl
jmp 0x459707
and dl, 7
movzx eax, dl
add eax, dword [esi + 0xc]
jmp 0x459745
cmp ecx, dword [esi + 0xc]
jb 0x459761
mov ebx, dword [esi + 0x10]
movzx eax, byte [ebx + 0x36]
add eax, dword [esi + 0xc]
cmp ecx, eax
jae 0x459761
xor edx, edx
sub cl, byte [esi + 0xc]
mov ah, byte [ebx + edx + 0x38]
mov al, ah
and al, 7
cmp al, cl
je 0x45973d
inc edx
cmp edx, 8
jb 0x459727
xor eax, eax
jmp 0x459743
movzx eax, ah
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 0x4596ce
mov edi, dword [edi]
test edi, edi
jne 0x459698
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
mov edi, dword [0x5806c8]
mov ebx, eax
test edi, edi
je 0x4597e3
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 0x4597d1
mov ecx, dword [edi + 0x10]
test ecx, ecx
je 0x4597d1
call fcn.004594a6
and dword [edi + 0x10], 0
mov dword [ebp - 0x2d8], 1
mov esi, dword [edi]
push 0x18
push edi
call fcn.005010b4
mov edi, esi
pop ecx
pop ecx
test esi, esi
jne 0x459787
xor ebx, ebx
mov dword [0x5806c8], ebx
cmp dword [ebp - 0x2d8], ebx
je 0x459859
cmp dword [0x580630], ebx
jne 0x459859
mov ecx, dword [0x5806c0]
mov esi, 0x5806c0
jmp 0x459855
cmp dword [ecx], 0x52727464
jne 0x459850
lea edi, [ecx + 0x10000]
mov edx, ebx
lea eax, [ecx + 0x88]
cmp dword [eax], ebx
je 0x45982a
cmp dword [eax], ecx
jb 0x459850
cmp dword [eax], edi
jae 0x459850
inc edx
add eax, 0x48
cmp edx, 0x38d
jb 0x45981e
mov eax, dword [ecx + 4]
push 0x8000
push ebx
push ecx
mov dword [esi], eax
call dword [sym.imp.KERNEL32.dll_VirtualFree]
mov dword [0x5806b8], ebx
jmp 0x459853
lea esi, [ecx + 4]
mov ecx, dword [esi]
test ecx, ecx
jne 0x459808
call fcn.004591bf
mov edi, dword [0x5806c4]
test edi, edi
je 0x459883
push dword [edi + 4]
call dword [sym.imp.KERNEL32.dll_ResumeThread]
mov esi, dword [edi]
push 8
push edi
call fcn.005010b4
mov edi, esi
pop ecx
pop ecx
test esi, esi
jne 0x459868
pop edi
pop esi
mov dword [0x5806c4], ebx
mov dword [0x5806b4], ebx
pop ebx
mov eax, dword [0x5806b0]
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00500b45
leave
ret