Function at 0x140051fb0
Capabilities:
Get system information on windows
Make suspicious ntquerysysteminformation call
Parse pe header
Query environment variable
Resolve function by parsing pe exports

Disassembly:
mov qword [rsp + 0x10], rbx
mov qword [rsp + 0x18], rsi
mov qword [rsp + 0x20], rdi
push rbp
push r12
push r13
push r14
push r15
lea rbp, [rsp - 0x37]
sub rsp, 0xb0
mov rax, qword [0x14015d080]
xor rax, rsp
mov qword [rbp + 0x2f], rax
mov r13, rdx
mov rdi, rcx
mov qword [rbp - 0x49], rcx
xor r14d, r14d
mov r15d, r14d
mov dword [rbp - 0x19], r14d
lea r9, [rbp - 0x19]
xor r8d, r8d
xor edx, edx
mov ecx, ntohs
call qword [sym.imp.ntdll.dll_NtQuerySystemInformation]
cmp eax, 0xc0000004
jne 0x140052059
xor edx, edx
mov r8d, 0x8000
mov rcx, r15
call qword [sym.imp.KERNEL32.dll_VirtualFree]
mov edx, dword [rbp - 0x19]
xor ecx, ecx
mov r9d, 4
mov r8d, 0x3000
call qword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov r15, rax
lea r9, [rbp - 0x19]
mov r8d, dword [rbp - 0x19]
mov rdx, rax
mov ecx, ntohs
call qword [sym.imp.ntdll.dll_NtQuerySystemInformation]
cmp eax, 0xc0000004
je 0x140052011
test eax, eax
js 0x1400522d5
mov r12d, r14d
cmp dword [r15], r14d
jbe 0x1400522d5
nop dword [rax]
mov eax, r12d
imul rcx, rax, 0x128
lea rbx, [rcx + r15]
mov qword [rbp - 0x41], rbx
movzx edx, word [rbx + 0x2e]
add rdx, 0x30
add rdx, rcx
add rdx, r15
xorps xmm0, xmm0
movups xmmword [rbp + 0xf], xmm0
mov qword [rbp + 0x1f], r14
mov qword [rbp + 0x27], r14
mov r8, 0xffffffffffffffff
inc r8
cmp byte [rdx + r8], 0
jne 0x1400520a6
lea rcx, [rbp + 0xf]
call fcn.1400022b0
nop
lea rcx, [rbp + 0xf]
cmp qword [rbp + 0x27], 0xf
cmova rcx, qword [rbp + 0xf]
mov rdx, rdi
call qword [sym.imp.api_ms_win_crt_string_l1_1_0.dll__stricmp]
test eax, eax
jne 0x1400522c0
lea rdx, [rbx + 0x30]
xorps xmm0, xmm0
movups xmmword [rbp - 0x11], xmm0
mov qword [rbp - 1], r14
mov qword [rbp + 7], r14
mov r8, 0xffffffffffffffff
inc r8
cmp byte [rdx + r8], 0
jne 0x1400520f3
lea rcx, [rbp - 0x11]
call fcn.1400022b0
nop
lea rcx, str.SYSTEMROOT
call qword [sym.imp.api_ms_win_crt_environment_l1_1_0.dll_getenv]
xorps xmm0, xmm0
movups xmmword [rbp - 0x39], xmm0
mov qword [rbp - 0x29], r14
mov qword [rbp - 0x21], r14
mov r8, 0xffffffffffffffff
nop word [rax + rax]
inc r8
cmp byte [rax + r8], 0
jne 0x140052130
mov rdx, rax
lea rcx, [rbp - 0x39]
call fcn.1400022b0
nop
mov r8d, 1
lea rdx, [0x140134704]
lea rcx, [rbp - 0x39]
call fcn.1400053a0
mov rdi, rax
lea rsi, [rbp - 0x11]
cmp qword [rbp + 7], 0xf
cmova rsi, qword [rbp - 0x11]
mov rax, qword [rbp - 1]
cmp rax, 0xc
jb 0x1400521d8
lea rbx, [rax + rsi]
lea r8, [rbx - 0xb]
sub r8, rsi
mov edx, 0x5c
mov rcx, rsi
call sub.VCRUNTIME140.dll_memchr
test rax, rax
je 0x1400521d8
nop word [rax + rax]
movabs rcx, 0x526d65747379535c
cmp qword [rax], rcx
jne 0x1400521bc
cmp dword [rax + 8], 0x5c746f6f
je 0x140052315
inc rax
lea r8, [rbx - 0xb]
sub r8, rax
mov edx, 0x5c
mov rcx, rax
call sub.VCRUNTIME140.dll_memchr
test rax, rax
jne 0x1400521a0
mov rax, 0xffffffffffffffff
mov rcx, qword [rdi + 0x10]
cmp qword [rdi + 0x18], 0xf
jbe 0x1400521ed
mov rdi, qword [rdi]
mov qword [rsp + 0x20], rcx
mov r9, rdi
mov r8d, ntohs
mov rdx, rax
lea rcx, [rbp - 0x11]
call fcn.140005200
nop
lea rcx, [rbp - 0x39]
call fcn.140005930
lea rcx, [rbp - 0x11]
cmp qword [rbp + 7], 0xf
cmova rcx, qword [rbp - 0x11]
xor edx, edx
mov r8d, 1
call qword [sym.imp.KERNEL32.dll_LoadLibraryExA]
mov r11, rax
mov eax, 0x5a4d
cmp word [r11], ax
jne 0x140052342
movsxd rcx, dword [r11 + 0x3c]
cmp dword [rcx + r11], 0x4550
jne 0x140052342
mov edx, dword [rcx + r11 + 0x88]
test edx, edx
je 0x140052342
mov ebx, dword [rdx + r11 + 0x1c]
lea rdi, [r11 + rbx]
mov r9d, dword [rdx + r11 + 0x20]
add r9, r11
mov esi, dword [rdx + r11 + 0x24]
add rsi, r11
mov r10d, r14d
test ebx, ebx
je 0x1400522b3
mov r8d, dword [r9]
add r8, r11
mov rax, r13
sub r8, r13
nop dword [rax]
movzx edx, byte [rax]
movzx ecx, byte [rax + r8]
sub edx, ecx
jne 0x1400522a3
inc rax
test ecx, ecx
jne 0x140052290
test edx, edx
je 0x14005231d
inc r10d
add r9, 4
cmp r10d, ebx
jb 0x140052281
lea rcx, [rbp - 0x11]
call fcn.140005930
mov rdi, qword [rbp - 0x49]
lea rcx, [rbp + 0xf]
call fcn.140005930
inc r12d
cmp r12d, dword [r15]
jb 0x140052070
xor edx, edx
mov r8d, 0x8000
mov rcx, r15
call qword [sym.imp.KERNEL32.dll_VirtualFree]
xor eax, eax
mov rcx, qword [rbp + 0x2f]
xor rcx, rsp
call fcn.1401172d0
lea r11, [rsp + 0xb0]
mov rbx, qword [r11 + 0x38]
mov rsi, qword [r11 + 0x40]
mov rdi, qword [r11 + 0x48]
mov rsp, r11
pop r15
pop r14
pop r13
pop r12
pop rbp
ret
sub rax, rsi
jmp 0x1400521df
movsxd rax, r10d
movzx ecx, word [rsi + rax*2]
mov r14d, dword [rdi + rcx*4]
mov rax, qword [rbp - 0x41]
add r14, qword [rax + 0x18]
xor edx, edx
mov r8d, 0x8000
mov rcx, r15
call qword [sym.imp.KERNEL32.dll_VirtualFree]
nop
lea rcx, [rbp - 0x11]
call fcn.140005930
nop
lea rcx, [rbp + 0xf]
call fcn.140005930
mov rax, r14
jmp 0x1400522e8
mov rcx, qword [rdx]
mov rdx, qword [r8]
jmp 0x140051fb0