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

Disassembly:
mov eax, dword [esp + 4]
sub esp, 0x2d4
test eax, eax
je 0x407ec6
mov ecx, dword [0x571e88]
mov dword [eax], ecx
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
cmp dword [0x571e80], eax
je 0x407ee2
mov eax, 0x10dd
add esp, 0x2d4
ret 4
mov eax, dword [0x571e84]
test eax, eax
je 0x407efe
call fcn.00407da0
mov eax, dword [0x571e84]
add esp, 0x2d4
ret 4
mov edx, dword [0x571e90]
test edx, edx
push ebx
push ebp
push esi
push edi
mov dword [esp + 0x10], 0
je 0x407f84
mov eax, dword [edx + 4]
test eax, eax
je 0x407f40
mov eax, dword [edx + 0x10]
movzx ecx, byte [eax + 0x36]
mov edi, dword [edx + 0xc]
lea esi, [eax + 0x20]
mov eax, ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov ecx, dword [edx + 8]
mov eax, dword [edx + 0xc]
mov dword [ecx], eax
jmp 0x407f7e
mov eax, dword [edx + 0xc]
mov ecx, dword [edx + 0x10]
mov ecx, dword [ecx + 0x44]
mov byte [eax], 0xe9
lea esi, [eax + 5]
sub ecx, esi
inc eax
mov dword [eax], ecx
mov ecx, dword [edx + 0x10]
mov ecx, dword [ecx + 0x40]
lea edi, [eax + 4]
cmp edi, ecx
jae 0x407f76
sub ecx, edi
mov esi, ecx
shr ecx, 2
mov eax, 0xcccccccc
rep stosd dword es:[edi], eax
mov ecx, esi
and ecx, 3
rep stosb byte es:[edi], al
mov eax, dword [edx + 8]
mov ecx, dword [edx + 0x10]
mov dword [eax], ecx
mov edx, dword [edx]
test edx, edx
jne 0x407f14
mov eax, dword [0x571e8c]
test eax, eax
mov ebp, eax
je 0x40808f
mov ebx, dword [sym.imp.KERNEL32.dll_SetThreadContext]
lea esp, [esp]
mov eax, dword [ebp + 4]
lea edx, [esp + 0x18]
push edx
push eax
mov dword [esp + 0x20], 0x10001
call dword [sym.imp.KERNEL32.dll_GetThreadContext]
test eax, eax
je 0x408084
mov edi, dword [0x571e90]
test edi, edi
je 0x408084
mov ecx, dword [esp + 0xd0]
mov eax, dword [edi + 4]
test eax, eax
je 0x40802d
mov esi, dword [edi + 0x10]
cmp ecx, esi
jb 0x40807a
lea edx, [esi + 4]
cmp ecx, edx
jae 0x40807a
mov dl, byte [edi + 0x10]
xor eax, eax
sub cl, dl
mov dl, byte [esi + eax + 0x38]
shr dl, 3
cmp dl, cl
je 0x408025
inc eax
cmp eax, 8
jb 0x407ff8
xor al, al
mov esi, dword [edi + 0xc]
mov edx, dword [ebp + 4]
movzx eax, al
lea ecx, [esp + 0x18]
add eax, esi
push ecx
mov dword [esp + 0xd4], eax
push edx
jmp 0x408071
mov al, byte [eax + esi + 0x38]
and al, 7
jmp 0x40800b
mov eax, dword [edi + 0xc]
cmp ecx, eax
jb 0x40807a
mov esi, dword [edi + 0x10]
movzx edx, byte [esi + 0x36]
add edx, eax
cmp ecx, edx
jae 0x40807a
mov dl, byte [edi + 0xc]
xor eax, eax
sub cl, dl
mov dl, byte [esi + eax + 0x38]
and dl, 7
cmp dl, cl
je 0x408195
inc eax
cmp eax, 8
jb 0x408048
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 0x407fd4
mov ebp, dword [ebp]
test ebp, ebp
jne 0x407fa0
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
mov esi, dword [0x571e90]
test esi, esi
mov ebx, eax
je 0x408115
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]
mov eax, dword [esi + 4]
test eax, eax
je 0x408104
mov ebp, dword [esi + 0x10]
test ebp, ebp
je 0x408104
mov edx, ebp
and edx, 0xffff0000
xor eax, eax
mov ecx, 0x12
mov edi, ebp
rep stosd dword es:[edi], eax
mov ecx, dword [edx + 8]
mov dword [ebp + 0x40], ecx
mov dword [edx + 8], ebp
mov dword [esi + 0x10], eax
mov dword [esp + 0x10], 1
mov edi, dword [esi]
push esi
call sub.MSVCRT.dll_void___cdecl_operator_delete_void__
add esp, 4
test edi, edi
mov esi, edi
jne 0x4080a1
mov eax, dword [esp + 0x10]
test eax, eax
mov dword [0x571e90], 0
je 0x4081ab
mov eax, dword [0x571e7c]
test eax, eax
jne 0x4081ab
mov eax, dword [0x571e70]
test eax, eax
mov ebx, 0x571e70
je 0x4081ab
mov ebp, dword [sym.imp.KERNEL32.dll_VirtualFree]
cmp dword [eax], 0x52727464
jne 0x4081a2
lea edi, [eax + 0x10000]
xor esi, esi
lea edx, [eax + 0x88]
mov edi, edi
mov ecx, dword [edx]
test ecx, ecx
je 0x40816e
cmp ecx, eax
jb 0x4081a2
cmp ecx, edi
jae 0x4081a2
inc esi
add edx, 0x48
cmp esi, 0x38d
jb 0x408160
mov edx, dword [eax + 4]
push 0x8000
push 0
push eax
mov dword [ebx], edx
call ebp
mov dword [0x571e74], 0
jmp 0x4081a5
movzx eax, byte [eax + esi + 0x38]
shr eax, 3
jmp 0x40805f
lea ebx, [eax + 4]
mov eax, dword [ebx]
test eax, eax
jne 0x408148
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
mov esi, dword [0x571e70]
test esi, esi
mov edi, eax
je 0x4081e7
lea ecx, [ecx]
lea eax, [esp + 0x14]
push eax
push 0x20
push 0x10000
push esi
call dword [sym.imp.KERNEL32.dll_VirtualProtect]
push 0x10000
push esi
push edi
call dword [sym.imp.KERNEL32.dll_FlushInstructionCache]
mov esi, dword [esi + 4]
test esi, esi
jne 0x4081c0
mov esi, dword [0x571e8c]
test esi, esi
je 0x40820e
mov ebp, dword [sym.imp.KERNEL32.dll_ResumeThread]
mov ecx, dword [esi + 4]
push ecx
call ebp
mov edi, dword [esi]
push esi
call sub.MSVCRT.dll_void___cdecl_operator_delete_void__
add esp, 4
test edi, edi
mov esi, edi
jne 0x4081f7
mov eax, dword [esp + 0x2e8]
pop edi
xor ecx, ecx
cmp eax, ecx
pop esi
pop ebp
mov dword [0x571e8c], ecx
mov dword [0x571e80], ecx
pop ebx
je 0x408233
mov edx, dword [0x571e88]
mov dword [eax], edx
mov eax, dword [0x571e84]
add esp, 0x2d4
ret 4