Function at 0x140051320
Capabilities:
Get system information on windows
Get windows directory from kuser_shared_data

Disassembly:
push rbp
push rbx
push rsi
push r13
push r15
lea rbp, [rsp - 0x160]
sub rsp, 0x260
mov rax, qword [0x140237008]
xor rax, rsp
mov qword [rbp + 0x148], rax
mov eax, dword [0x14023e1a4]
mov r13, rdx
mov dword [rsp + 0x34], eax
mov r8d, eax
mov r15, rcx
mov byte [rsp + 0x30], 0
mov rcx, qword [0x140241998]
mov edx, 4
call qword [sym.imp.ntdll.dll_RtlAllocateHeap]
mov r8d, dword [rsp + 0x34]
lea r9, [rsp + 0x34]
mov rdx, rax
mov ecx, 0x39
mov rsi, rax
call qword [sym.imp.ntdll.dll_NtQuerySystemInformation]
mov ebx, eax
cmp eax, 0xc0000023
je 0x14005139d
cmp eax, 0xc0000004
jne 0x1400513b6
mov rcx, qword [0x140241998]
mov r8, rsi
xor edx, edx
call qword [sym.imp.ntdll.dll_RtlFreeHeap]
mov r8d, dword [rsp + 0x34]
jmp 0x140051360
mov qword [rsp + 0x60], rsi
test ebx, ebx
jns 0x1400513db
mov rcx, qword [0x140241998]
mov r8, rsi
xor edx, edx
call qword [sym.imp.ntdll.dll_RtlFreeHeap]
lfence
mov eax, ebx
jmp 0x140051e8c
mov ecx, dword [0x14023e1a4]
cmp dword [rsp + 0x34], 0x100000
mov qword [rsp + 0x2a0], rdi
mov rdi, rsi
cmovbe ecx, dword [rsp + 0x34]
mov dword [0x14023e1a4], ecx
mov rcx, qword [r15]
cmp qword [rdi + 0x50], rcx
je 0x140051430
mov eax, dword [rdi]
test eax, eax
je 0x140051413
add rdi, rax
jne 0x140051402
mov rcx, qword [0x140241998]
mov r8, rsi
xor edx, edx
call qword [sym.imp.ntdll.dll_RtlFreeHeap]
mov eax, 0xc0000225
jmp 0x140051e84
mov qword [rsp + 0x258], r12
mov edx, 0x7ffe0000
mov rcx, r15
mov qword [rsp + 0x250], r14
call sym.ProcessHacker.exe_PhLookupMemoryItemList
test rax, rax
je 0x140051470
mov rcx, qword [rax + 0x68]
test rcx, rcx
cmovne rax, rcx
cmp dword [rax + 0xa8], 0
jne 0x140051470
mov dword [rax + 0xa8], 4
cmp dword [0x140237d34], 0x69
jb 0x14005151c
test byte [0x14023aa98], 1
jne 0x1400514e5
lock bts qword [0x14023aa98], 0x1f
jb 0x1400514cb
xor r9d, r9d
lea rdx, [rbp - 0x80]
mov ecx, 0xc5
lea r8d, [r9 + 8]
call qword [sym.imp.ntdll.dll_NtQuerySystemInformation]
mov rcx, qword [0x140242078]
test eax, eax
cmovns rcx, qword [rbp - 0x80]
mov qword [0x140242078], rcx
lea rcx, [0x14023aa98]
call sym.ProcessHacker.exe_PhfSetEvent
jmp 0x1400514e5
test byte [0x14023aa98], 1
jne 0x1400514e5
xor edx, edx
lea rcx, [0x14023aa98]
call sym.ProcessHacker.exe_PhfWaitForEvent
mov rdx, qword [0x140242078]
test rdx, rdx
je 0x14005151c
mov rcx, r15
call sym.ProcessHacker.exe_PhLookupMemoryItemList
test rax, rax
je 0x14005151c
mov rcx, qword [rax + 0x68]
test rcx, rcx
cmovne rax, rcx
cmp dword [rax + 0xa8], 0
jne 0x14005151c
mov dword [rax + 0xa8], 0x12
xor r12d, r12d
lea r8, [rbp - 0x68]
xor edx, edx
mov qword [rsp + 0x20], r12
mov rcx, r13
lea r9d, [r12 + 0x30]
call qword [sym.imp.ntdll.dll_NtQueryInformationProcess]
nop dword [rax + rax]
test eax, eax
js 0x1400516d9
cmp qword [rbp - 0x60], r12
je 0x1400516d9
lfence
cmp dword [0x140237d34], 0x67
lea r9d, [r12 + 5]
mov rdx, qword [rbp - 0x60]
mov rcx, r15
setb r8b
call fcn.1400512b0
mov rdx, qword [rbp - 0x60]
lea r9d, [r12 + 4]
add rdx, 0xe8
mov qword [rsp + 0x20], r12
lea r8, [rsp + 0x68]
mov rcx, r13
call qword [sym.imp.ntdll.dll_NtReadVirtualMemory]
test eax, eax
js 0x140051686
cmp dword [rsp + 0x68], 0x3e8
jae 0x140051686
lfence
mov r8d, dword [rsp + 0x68]
lea edx, [r12 + 4]
mov rcx, qword [0x140241998]
shl r8, 3
call qword [sym.imp.ntdll.dll_RtlAllocateHeap]
mov rdx, qword [rbp - 0x60]
lea r9d, [r12 + 8]
add rdx, 0xf0
mov qword [rsp + 0x20], r12
lea r8, [rbp - 0x78]
mov rcx, r13
mov rsi, rax
call qword [sym.imp.ntdll.dll_NtReadVirtualMemory]
test eax, eax
js 0x140051671
lfence
mov r9d, dword [rsp + 0x68]
mov r8, rsi
mov rdx, qword [rbp - 0x78]
mov rcx, r13
shl r9, 3
mov qword [rsp + 0x20], r12
call qword [sym.imp.ntdll.dll_NtReadVirtualMemory]
test eax, eax
js 0x140051671
lfence
mov ebx, r12d
cmp dword [rsp + 0x68], ebx
jbe 0x140051671
nop word [rax + rax]
mov eax, ebx
mov rcx, r15
mov rdx, qword [rsi + rax*8]
call sym.ProcessHacker.exe_PhLookupMemoryItemList
nop
test rax, rax
je 0x140051669
mov rcx, qword [rax + 0x68]
test rcx, rcx
cmovne rax, rcx
cmp dword [rax + 0xa8], r12d
jne 0x140051669
mov dword [rax + 0xa8], 0xb
mov dword [rax + 0xb0], ebx
inc ebx
cmp ebx, dword [rsp + 0x68]
jb 0x140051630
mov rcx, qword [0x140241998]
mov r8, rsi
xor edx, edx
call qword [sym.imp.ntdll.dll_RtlFreeHeap]
mov rdx, qword [rbp - 0x60]
lea r8, [rbp - 0x70]
add rdx, 0x68
mov qword [rsp + 0x20], r12
mov r9d, 8
mov rcx, r13
call qword [sym.imp.ntdll.dll_NtReadVirtualMemory]
test eax, eax
js 0x1400516d9
mov rdx, qword [rbp - 0x70]
mov rcx, r15
call sym.ProcessHacker.exe_PhLookupMemoryItemList
test rax, rax
je 0x1400516d9
mov rcx, qword [rax + 0x68]
test rcx, rcx
cmovne rax, rcx
cmp dword [rax + 0xa8], r12d
jne 0x1400516d9
mov dword [rax + 0xa8], 0x11
mov r9d, 8
mov qword [rsp + 0x20], r12
lea r8, [rsp + 0x78]
mov rcx, r13
lea edx, [r9 + 0x12]
call qword [sym.imp.ntdll.dll_NtQueryInformationProcess]
test eax, eax
js 0x1400518a8
mov r14, qword [rsp + 0x78]
test r14, r14
je 0x1400518a8
lfence
mov rdx, qword [rsp + 0x78]
mov rcx, r15
mov byte [rsp + 0x30], 1
call sym.ProcessHacker.exe_PhLookupMemoryItemList
test rax, rax
je 0x140051748
mov rcx, qword [rax + 0x68]
test rcx, rcx
cmovne rax, rcx
cmp dword [rax + 0xa8], r12d
jne 0x140051748
mov dword [rax + 0xa8], 6
lea rdx, [r14 + 0x88]
mov qword [rsp + 0x20], r12
mov r9d, 4
lea r8, [rsp + 0x68]
mov rcx, r13
call qword [sym.imp.ntdll.dll_NtReadVirtualMemory]
test eax, eax
js 0x140051858
cmp dword [rsp + 0x68], 0x3e8
jae 0x140051858
lfence
mov r8d, dword [rsp + 0x68]
mov edx, 4
mov rcx, qword [0x140241998]
shl r8, 2
call qword [sym.imp.ntdll.dll_RtlAllocateHeap]
lea rdx, [r14 + 0x90]
mov qword [rsp + 0x20], r12
mov r9d, 4
lea r8, [rsp + 0x6c]
mov rcx, r13
mov rsi, rax
call qword [sym.imp.ntdll.dll_NtReadVirtualMemory]
nop
test eax, eax
js 0x140051846
lfence
mov r9d, dword [rsp + 0x68]
mov r8, rsi
mov edx, dword [rsp + 0x6c]
mov rcx, r13
shl r9, 2
mov qword [rsp + 0x20], r12
call qword [sym.imp.ntdll.dll_NtReadVirtualMemory]
test eax, eax
js 0x140051846
lfence
mov ebx, r12d
cmp dword [rsp + 0x68], ebx
jbe 0x140051846
nop dword [rax]
mov eax, ebx
mov rcx, r15
mov edx, dword [rsi + rax*4]
call sym.ProcessHacker.exe_PhLookupMemoryItemList
test rax, rax
je 0x140051839
mov rcx, qword ds:[rax + 0x68]
test rcx, rcx
cmovne rax, rcx
cmp dword [rax + 0xa8], r12d
jne 0x140051839
mov dword [rax + 0xa8], 0xc
mov dword [rax + 0xb0], ebx
inc ebx
cmp ebx, dword [rsp + 0x68]
jb 0x140051800
mov rcx, qword [0x140241998]
mov r8, rsi
xor edx, edx
call qword [sym.imp.ntdll.dll_RtlFreeHeap]
lea rdx, [r14 + 0x38]
mov qword [rsp + 0x20], r12
mov r9d, 4
lea r8, [rsp + 0x70]
mov rcx, r13
call qword [sym.imp.ntdll.dll_NtReadVirtualMemory]
test eax, eax
js 0x1400518a8
mov edx, dword [rsp + 0x70]
mov rcx, r15
call sym.ProcessHacker.exe_PhLookupMemoryItemList
test rax, rax
je 0x1400518a8
mov rcx, qword [rax + 0x68]
test rcx, rcx
cmovne rax, rcx
cmp dword [rax + 0xa8], r12d
jne 0x1400518a8
mov dword [rax + 0xa8], 0x11
mov esi, r12d
cmp dword [rdi + 4], r12d
jbe 0x140051a4c
movzx r12d, byte [rsp + 0x30]
nop dword [rax + rax]
mov eax, esi
imul rbx, rax, 0x88
add rbx, rdi
mov rdx, qword [rbx + 0x168]
test rdx, rdx
je 0x140051a3b
cmp dword [0x140237d34], 0x67
mov rcx, r15
setb r14b
call sym.ProcessHacker.exe_PhLookupMemoryItemList
mov rdx, rax
test rax, rax
je 0x140051928
test r14b, r14b
je 0x140051907
mov rcx, qword [rax + 0x68]
test rcx, rcx
cmovne rdx, rcx
cmp dword [rdx + 0xa8], 0
jne 0x140051928
mov dword [rdx + 0xa8], 7
mov rax, qword [rbx + 0x130]
mov qword [rdx + 0xb0], rax
mov rdx, qword [rbx + 0x168]
lea rax, [rbp + 0x110]
mov r9d, 0x38
mov qword [rsp + 0x20], rax
lea r8, [rbp - 0x18]
mov rcx, r13
call qword [sym.imp.ntdll.dll_NtReadVirtualMemory]
test eax, eax
js 0x140051a3b
cmp qword ds:[rbp + 0x110], 0x38
jne 0x140051a3b
mov rdx, qword [rbp - 8]
cmp rdx, qword [rbp - 0x10]
jae 0x1400519b1
mov rcx, r15
call sym.ProcessHacker.exe_PhLookupMemoryItemList
mov rdx, rax
test rax, rax
je 0x1400519b1
mov rcx, qword [rax + 0x68]
test rcx, rcx
cmovne rdx, rcx
cmp dword [rdx + 0xa8], 0
jne 0x1400519b1
mov dword [rdx + 0xa8], 9
mov rax, qword [rbx + 0x130]
mov qword [rdx + 0xb0], rax
test r12b, r12b
je 0x140051a3b
cmp qword ds:[rbp - 0x18], 0
je 0x140051a3b
lfence
mov edx, dword [rbp - 0x18]
lea rax, [rbp + 0x110]
mov r9d, 0x1c
mov qword [rsp + 0x20], rax
lea r8, [rbp - 0x38]
mov rcx, r13
call qword [sym.imp.ntdll.dll_NtReadVirtualMemory]
test eax, eax
js 0x140051a3b
cmp qword [rbp + 0x110], 0x1c
jne 0x140051a3b
mov eax, dword [rbp - 0x30]
cmp eax, dword [rbp - 0x34]
jae 0x140051a3b
mov edx, eax
mov rcx, r15
call sym.ProcessHacker.exe_PhLookupMemoryItemList
mov rdx, rax
test rax, rax
je 0x140051a3b
mov rcx, qword [rax + 0x68]
test rcx, rcx
cmovne rdx, rcx
cmp dword [rdx + 0xa8], 0
jne 0x140051a3b
mov dword [rdx + 0xa8], 0xa
mov rax, qword [rbx + 0x130]
mov qword [rdx + 0xb0], rax
inc esi
cmp esi, dword [rdi + 4]
jb 0x1400518c0
xor r12d, r12d
mov rbx, qword ds:[r15 + 0x38]
lea rsi, [r15 + 0x38]
mov r14, 0xffffffffffffffff
cmp rbx, rsi
je 0x140051bec
nop dword [rax]
cmp dword [rbx + 0xa8], 0
jne 0x140051be0
test dword [rbx + 0x58], 0x1040000
je 0x140051af7
cmp qword [rbx + 0x68], rbx
jne 0x140051af7
mov rdx, qword [rbx + 0x30]
lea r8, [rsp + 0x38]
mov rcx, r13
call sym.ProcessHacker.exe_PhGetProcessMappedFileName
nop dword [rax]
test eax, eax
js 0x140051af7
mov rdi, qword [rsp + 0x38]
mov rcx, rdi
call sym.ProcessHacker.exe_PhResolveDevicePrefix
test rax, rax
je 0x140051ae1
mov rcx, rdi
mov qword [rsp + 0x38], rax
mov rdi, rax
test rcx, rcx
je 0x140051ae1
add rcx, 0xfffffffffffffff0
mov eax, r14d
lock xadd dword [rcx + 8], eax
cmp eax, 1
jne 0x140051adc
call fcn.1400fbcc0
mov rdi, qword [rsp + 0x38]
mov dword [rbx + 0xa8], 3
mov qword [rbx + 0xb0], rdi
jmp 0x140051be0
test dword ds:[rbx + 0x50], 0x1000
je 0x140051be0
movzx eax, byte [rbx + 0x60]
test al, 1
je 0x140051be0
test al, 2
jne 0x140051be0
mov rdx, qword [rbx + 0x30]
lea r8, [rbp + 0x118]
mov r9d, 0x30
mov qword [rsp + 0x20], r12
mov rcx, r13
call qword [sym.imp.ntdll.dll_NtReadVirtualMemory]
nop dword [rax]
test eax, eax
js 0x140051be0
cmp dword [rbp + 0x128], 0xffeeffee
mov rdi, r12
mov eax, r12d
cmove rdi, qword [rbp + 0x140]
cmp dword [rbp + 0x120], 0xffeeffee
cmove eax, dword [rbp + 0x130]
test rdi, rdi
je 0x140051ba5
mov rdx, rdi
mov rcx, r15
call sym.ProcessHacker.exe_PhLookupMemoryItemList
test rax, rax
je 0x140051be0
cmp qword [rax + 0x30], rdi
jne 0x140051be0
cmp dword [rax + 0xa8], 0xb
jne 0x140051be0
mov dword [rbx + 0xa8], 0xd
jmp 0x140051bd9
test eax, eax
je 0x140051be0
mov edx, eax
mov rcx, r15
mov edi, eax
call sym.ProcessHacker.exe_PhLookupMemoryItemList
test rax, rax
je 0x140051be0
nop word [rax + rax]
cmp qword [rax + 0x30], rdi
jne 0x140051be0
cmp dword [rax + 0xa8], 0xc
jne 0x140051be0
mov dword [rbx + 0xa8], 0xe
mov qword [rbx + 0xb0], rax
mov rbx, qword [rbx]
cmp rbx, rsi
jne 0x140051a70
xor edx, edx
lea rcx, [rbp + 0x20]
mov r8d, 0xf0
call fcn.1401868c0
cmp qword [0x1402447d8], 0
mov qword [rsp + 0x48], r12
je 0x140051c1d
movups xmm0, xmmword [0x1402447d0]
movaps xmmword [rsp + 0x50], xmm0
jmp 0x140051ccc
cmp byte [0x140244611], 1
mov r8d, 0x7ffe0030
mov qword [rsp + 0x58], r8
jb 0x140051c7d
xorps xmm0, xmm0
mov ecx, r8d
pcmpeqw xmm0, xmmword [r8]
xorps xmm1, xmm1
pmovmskb eax, xmm0
bsf edx, eax
mov dword [rsp + 0x40], edx
jne 0x140051c69
nop dword [rax]
add rcx, 0x10
movdqa xmm0, xmm1
pcmpeqw xmm0, xmmword [rcx]
pmovmskb eax, xmm0
bsf edx, eax
mov dword [rsp + 0x40], edx
je 0x140051c50
add rcx, 0xffffffff8001ffd0
mov eax, edx
sar rcx, 1
shr rax, 1
add rcx, rax
jmp 0x140051c8b
mov rcx, r14
inc rcx
cmp word [r8 + rcx*2], 0
jne 0x140051c80
add rcx, rcx
mov qword [rsp + 0x50], rcx
cmp word [rcx + 0x7ffe002e], 0x5c
jne 0x140051ca6
lea rax, [rcx - 2]
mov qword [rsp + 0x50], rax
movaps xmm0, xmmword [rsp + 0x50]
lea rax, [rcx - 2]
cmovne rax, rcx
movdqa xmmword [rsp + 0x50], xmm0
mov qword [0x1402447d0], rax
lock or dword [rsp], 0
mov qword [0x1402447d8], r8
mov rdi, qword [rsp + 0x50]
mov rdx, qword [0x1402418e8]
lea rbx, [rdi + 0x26]
lea rcx, [rbx + 0x12]
call sym.ProcessHacker.exe_PhCreateObject
mov rdx, qword [rsp + 0x58]
mov r8, rdi
mov rsi, rax
lea rcx, [rax + 0x10]
mov qword [rax], rbx
mov qword [rax + 8], rcx
mov word [rbx + rcx], r12w
mov rcx, qword [rax + 8]
call fcn.140188690
mov rcx, qword [rsi + 8]
lea r8, str.LdrSystemDllInitBlock
movups xmm0, xmmword [str.System32_ntdll.dll]
mov qword [rsp + 0x28], r12
xor r9d, r9d
movups xmmword [rdi + rcx], xmm0
movups xmm1, xmmword [0x1401dcd88]
movups xmmword [rdi + rcx + 0x10], xmm1
mov eax, dword [0x1401dcd98]
mov dword [rdi + rcx + 0x20], eax
movzx eax, word [0x1401dcd9c]
mov word [rdi + rcx + 0x24], ax
lea rax, [rsp + 0x48]
mov rdx, qword [rsi + 8]
mov rcx, r13
mov qword [rsp + 0x20], rax
call sym.ProcessHacker.exe_PhGetProcedureAddressRemote
mov ebx, eax
test eax, eax
js 0x140051d8f
cmp qword [rsp + 0x48], 0
je 0x140051d8f
lfence
mov rdx, qword [rsp + 0x48]
lea r8, [rbp + 0x20]
mov r9d, 0xf0
mov qword [rsp + 0x20], r12
mov rcx, r13
call qword [sym.imp.ntdll.dll_NtReadVirtualMemory]
mov ebx, eax
lea rcx, [rsi - 0x10]
lock xadd dword [rcx + 8], r14d
cmp r14d, 1
mov r14, qword [rsp + 0x250]
jne 0x140051dac
call fcn.1400fbcc0
test ebx, ebx
js 0x140051e66
mov eax, dword [rbp + 0x20]
test eax, eax
je 0x140051e66
lea rcx, [rbp + 0x20]
add rcx, rax
lea rax, [rbp + 0xf0]
cmp rax, rcx
ja 0x140051e16
mov rdx, qword [rbp + 0xd8]
mov r12, qword [rbp + 0xe8]
test rdx, rdx
je 0x140051e16
mov rcx, r15
call sym.ProcessHacker.exe_PhLookupMemoryItemList
test rax, rax
je 0x140051e16
mov r8, rax
mov rcx, rax
cmp qword [rax + 0x68], rax
jne 0x140051e16
nop
mov dword [rcx + 0xa8], 0xf
mov r8, qword [r8]
mov rcx, r8
cmp qword [r8 + 0x68], rax
je 0x140051e00
cmp byte [rsp + 0x30], 0
je 0x140051e66
nop dword [rax]
test r12, r12
je 0x140051e66
mov rdx, r12
mov rcx, r15
call sym.ProcessHacker.exe_PhLookupMemoryItemList
test rax, rax
je 0x140051e66
mov rcx, rax
mov rdx, rax
cmp qword [rax + 0x68], rax
jne 0x140051e66
nop word [rax + rax]
mov dword [rdx + 0xa8], 0x10
mov rcx, qword [rcx]
mov rdx, rcx
cmp qword [rcx + 0x68], rax
je 0x140051e50
mov r8, qword [rsp + 0x60]
xor edx, edx
mov rcx, qword [0x140241998]
call qword [sym.imp.ntdll.dll_RtlFreeHeap]
mov r12, qword [rsp + 0x258]
xor eax, eax
mov rdi, qword [rsp + 0x2a0]
mov rcx, qword [rbp + 0x148]
xor rcx, rsp
call fcn.1401848a0
add rsp, 0x260
pop r15
pop r13
pop rsi
pop rbx
pop rbp
ret