Function at 0x10006850
Capabilities:
Allocate or change rwx memory
Execute shellcode via indirect call
Hook routines via microsoft detours

Disassembly:
sub esp, 0x38
push ebx
push ebp
push esi
mov esi, dword [esp + 0x48]
push edi
cmp esi, 0x7ff80000
jbe 0x10006878
lea ebx, [esi - 0x7ff80000]
cmp esi, 0x80000000
jb 0x1000687d
mov ebp, 0xfff80000
jmp 0x10006883
mov ebx, 0x80000
lea ebp, [esi + 0x7ff80000]
cmp byte [esi], 0xe9
jne 0x100068bc
mov eax, dword [esi + 1]
add eax, 5
add eax, esi
cmp eax, esi
jae 0x100068aa
cmp eax, 0x80000000
jae 0x100068a3
lea ebp, [eax + 0x7ff80000]
jmp 0x100068bc
mov ebp, 0xfff80000
jmp 0x100068bc
lea ebx, [eax - 0x7ff80000]
cmp eax, 0x7ff80000
ja 0x100068bc
mov ebx, 0x80000
mov edx, dword [0x1002bfe4]
mov eax, dword [0x1002bfe0]
test edx, edx
jne 0x100068d7
test eax, eax
je 0x100068ea
mov edx, eax
mov dword [0x1002bfe4], edx
mov ecx, dword [edx + 8]
test ecx, ecx
je 0x100068ea
cmp ecx, ebx
jb 0x100068ea
cmp ecx, ebp
jbe 0x10006ac0
mov edx, eax
mov dword [0x1002bfe4], edx
test eax, eax
je 0x10006920
mov ecx, eax
test eax, eax
je 0x1000690f
mov eax, dword [ecx + 8]
test eax, eax
je 0x1000690f
cmp eax, ebx
jb 0x1000690f
cmp eax, ebp
jbe 0x10006ac0
mov edx, dword [edx + 4]
mov ecx, edx
mov dword [0x1002bfe4], edx
mov eax, edx
test ecx, ecx
jne 0x100068f8
and esi, 0xffff0000
lea edi, [esi - 0x10000]
cmp edi, ebx
jbe 0x100069cb
cmp edi, dword [section..data]
jb 0x1000694c
cmp edi, dword [0x1002b004]
ja 0x1000694c
sub edi, 0x8000000
jmp 0x100069c3
push 0x1c
lea eax, [esp + 0x14]
mov dword [esp + 0x2c], 0
xorps xmm0, xmm0
push eax
push edi
movups xmmword [esp + 0x1c], xmm0
movq qword [esp + 0x2c], xmm0
call dword [sym.imp.KERNEL32.dll_VirtualQuery]
test eax, eax
je 0x100069cb
cmp dword [esp + 0x20], 0x10000
jne 0x100069ad
cmp dword [esp + 0x1c], 0x10000
jb 0x100069ad
push 0x40
push 0x3000
push 0x10000
push edi
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov edx, eax
test edx, edx
jne 0x10006a7b
sub edi, 0x10000
jmp 0x100069c3
mov ecx, dword [esp + 0x14]
add ecx, 0xffff0000
mov edi, ecx
movzx eax, di
sub edi, eax
test eax, eax
cmove edi, ecx
cmp edi, ebx
ja 0x10006934
cmp esi, ebp
jae 0x10006a71
mov edi, dword [sym.imp.KERNEL32.dll_VirtualQuery]
nop dword [eax]
cmp esi, dword [section..data]
jb 0x100069f8
cmp esi, dword [0x1002b004]
ja 0x100069f8
add esi, 0x8000000
jmp 0x10006a69
push 0x1c
lea eax, [esp + 0x30]
mov dword [esp + 0x48], 0
xorps xmm0, xmm0
push eax
push esi
movups xmmword [esp + 0x38], xmm0
movq qword [esp + 0x48], xmm0
call edi
test eax, eax
je 0x10006a71
cmp dword [esp + 0x3c], 0x10000
mov ecx, dword [esp + 0x38]
jne 0x10006a53
cmp ecx, 0x10000
jb 0x10006a53
push 0x40
push 0x3000
push 0x10000
push esi
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov edx, eax
test edx, edx
jne 0x10006a7b
add esi, 0x10000
jmp 0x10006a69
mov esi, dword [esp + 0x2c]
add esi, ecx
movzx ecx, si
test ecx, ecx
je 0x10006a69
mov eax, 0x10000
sub eax, ecx
add esi, eax
cmp esi, ebp
jb 0x100069e0
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x38
ret
mov dword [edx], 0x52727464
xor ecx, ecx
mov dword [edx + 8], 0
mov esi, 0x38b
mov eax, dword [0x1002bfe0]
mov dword [edx + 4], eax
lea eax, [edx + 0xffa8]
mov dword [0x1002bfe4], edx
mov dword [0x1002bfe0], edx
nop dword [eax]
mov dword [eax + 0x40], ecx
mov ecx, eax
sub eax, 0x48
sub esi, 1
jne 0x10006ab0
mov dword [edx + 8], ecx
mov esi, dword [edx + 8]
cmp esi, ebx
jb 0x10006a71
cmp esi, ebp
ja 0x10006a71
mov ecx, dword [esi + 0x40]
push 0x48
push 0xcc
push esi
mov dword [edx + 8], ecx
call fcn.1000ab40
add esp, 0xc
mov eax, esi
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x38
ret