Function at 0x1402140
Capabilities:
Hook routines via microsoft detours

Disassembly:
push ebp
mov ebp, esp
sub esp, 0xc
push esi
mov esi, dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
call esi
cmp dword [0x159e0c0], eax
je 0x1402161
mov eax, 0x10dd
pop esi
mov esp, ebp
pop ebp
ret
cmp dword [0x159e0bc], 0
push ebx
push edi
je 0x140223b
call esi
cmp dword [0x159e0c0], eax
jne 0x1402426
mov edi, dword [0x159e0d4]
mov ebx, dword [sym.imp.KERNEL32.dll_VirtualProtect]
test edi, edi
je 0x14021ef
nop
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 ebx
cmp dword [edi + 4], 0
jne 0x14021dc
mov ebx, dword [edi + 0x10]
test ebx, ebx
je 0x14021d6
push 0x48
push 0
mov esi, ebx
push ebx
and esi, 0xffff0000
call fcn.01420890
mov eax, dword [esi + 8]
add esp, 0xc
mov dword [ebx + 0x40], eax
mov dword [esi + 8], ebx
mov dword [edi + 0x10], 0
mov ebx, dword [sym.imp.KERNEL32.dll_VirtualProtect]
mov esi, dword [edi]
push 0x18
push edi
call fcn.0141e43b
add esp, 8
mov edi, esi
test esi, esi
jne 0x1402190
mov dword [0x159e0d4], 0
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
mov esi, dword [0x159e0cc]
mov dword [ebp - 4], eax
test esi, esi
je 0x1402412
mov edi, dword [sym.imp.KERNEL32.dll_FlushInstructionCache]
lea eax, [ebp - 8]
push eax
push 0x20
push 0x10000
push esi
call ebx
push 0x10000
push esi
push dword [ebp - 4]
call edi
mov esi, dword [esi + 4]
test esi, esi
jne 0x1402216
jmp 0x1402412
mov esi, dword [0x159e0d4]
xor ebx, ebx
mov dword [ebp - 4], ebx
test esi, esi
je 0x14022b9
nop word [eax + eax]
mov ecx, dword [esi + 0x10]
cmp dword [esi + 4], ebx
je 0x1402276
movzx eax, byte [ecx + 0x36]
push eax
lea eax, [ecx + 0x20]
push eax
push dword [esi + 0xc]
call fcn.01420aa0
mov ecx, dword [esi + 8]
add esp, 0xc
mov eax, dword [esi + 0xc]
mov dword [ecx], eax
jmp 0x14022b3
mov edx, dword [esi + 0xc]
mov ecx, dword [ecx + 0x44]
lea eax, [edx + 5]
mov byte [edx], 0xe9
sub ecx, eax
lea edi, [edx + 5]
mov dword [edx + 1], ecx
mov ecx, dword [esi + 0x10]
mov edx, dword [ecx + 0x40]
sub edx, edi
cmp edi, dword [ecx + 0x40]
cmova edx, ebx
test edx, edx
je 0x14022ae
push edx
push 0xcc
push edi
call fcn.01420890
mov ecx, dword [esi + 0x10]
add esp, 0xc
mov eax, dword [esi + 8]
mov dword [eax], ecx
mov esi, dword [esi]
test esi, esi
jne 0x1402250
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
mov edi, dword [0x159e0d4]
mov esi, eax
mov dword [ebp - 8], esi
test edi, edi
je 0x1402351
lea eax, [ebp - 0xc]
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 esi
call dword [sym.imp.KERNEL32.dll_FlushInstructionCache]
cmp dword [edi + 4], 0
je 0x140233b
mov ebx, dword [edi + 0x10]
test ebx, ebx
je 0x1402338
push 0x48
push 0
mov esi, ebx
push ebx
and esi, 0xffff0000
call fcn.01420890
mov eax, dword [esi + 8]
add esp, 0xc
mov dword [ebx + 0x40], eax
mov dword [esi + 8], ebx
mov ebx, 1
mov dword [edi + 0x10], 0
mov dword [ebp - 4], ebx
jmp 0x140233b
mov ebx, dword [ebp - 4]
mov esi, dword [edi]
push 0x18
push edi
call fcn.0141e43b
add esp, 8
mov edi, esi
test esi, esi
mov esi, dword [ebp - 8]
jne 0x14022d2
mov dword [0x159e0d4], 0
test ebx, ebx
je 0x14023d2
cmp dword [0x159e034], 0
jne 0x14023d2
mov ecx, dword [0x159e0cc]
mov ebx, 0x159e0cc
test ecx, ecx
je 0x14023d2
cmp dword [ecx], 0x52727464
jne 0x14023c9
lea edi, [ecx + 0x10000]
xor esi, esi
lea edx, [ecx + 0x88]
nop dword [eax]
mov eax, dword [edx]
test eax, eax
je 0x140239e
cmp eax, ecx
jb 0x14023c9
cmp eax, edi
jae 0x14023c9
inc esi
add edx, 0x48
cmp esi, 0x38d
jb 0x1402390
mov eax, dword [ecx + 4]
push 0x8000
push 0
push ecx
mov dword [ebx], eax
call dword [sym.imp.KERNEL32.dll_VirtualFree]
mov dword [0x159e0c4], 0
jmp 0x14023cc
lea ebx, [ecx + 4]
mov ecx, dword [ebx]
test ecx, ecx
jne 0x1402377
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
mov esi, dword [0x159e0cc]
mov edi, eax
test esi, esi
je 0x1402412
mov ebx, dword [sym.imp.KERNEL32.dll_VirtualProtect]
nop word [eax + eax]
lea eax, [ebp - 0xc]
push eax
push 0x20
push 0x10000
push esi
call ebx
push 0x10000
push esi
push edi
call dword [sym.imp.KERNEL32.dll_FlushInstructionCache]
mov esi, dword [esi + 4]
test esi, esi
jne 0x14023f0
mov dword [0x159e0d0], 0
mov dword [0x159e0c0], 0
mov eax, dword [0x159e0bc]
pop edi
pop ebx
pop esi
mov esp, ebp
pop ebp
ret