Function at 0x17004a0d0
Capabilities:
Access peb ldr_data
Get kernel32 base address

Disassembly:
push r15
push r14
push r13
push r12
push rsi
push rdi
push rbp
push rbx
sub rsp, 0x78
mov qword [rsp + 0x58], r9
mov qword [rsp + 0x50], r8
mov rdi, rdx
test rcx, rcx
je 0x17004a239
mov rsi, rcx
mov r12d, dword [rcx + 0xc]
mov eax, dword [rdi + 8]
test al, 0x20
jne 0x17004a271
mov edx, dword [rsi + 4]
test al, 0x10
jne 0x17004a37a
cmp edx, 2
je 0x17004a406
cmp edx, 7
jne 0x17004a37a
xor r15d, r15d
mov rbx, qword [rsp + 0x58]
jmp 0x17004a146
mov rax, qword [rsp + 0x60]
add r15d, eax
add r15d, 1
cmp r15d, dword [rsi + 0xc]
ja 0x17004a53b
mov ebp, dword [rsi + 8]
add rbp, rsi
mov eax, r15d
lea rcx, [rax*2]
add rcx, rbp
call sym.ntdll.dll_wcslen
mov qword [rsp + 0x60], rax
lea r14, [rsp + 0x68]
mov rcx, r14
mov rdx, rbp
call sym.ntdll.dll_RtlInitUnicodeString
mov dword [rsp + 0x3c], 0
mov word [rsp + 0x42], 0
mov rcx, rbx
mov rdx, r14
lea rbp, [rsp + 0x40]
mov r8, rbp
lea r13, [rsp + 0x3c]
mov r9, r13
call sym.ntdll.dll_RtlExpandEnvironmentStrings_U
mov word [rsp + 0x40], 0
mov r8d, dword [rsp + 0x3c]
mov word [rsp + 0x42], r8w
mov r12, qword gs:[0x30]
mov rax, qword [r12 + 0x60]
mov rcx, qword [rax + 0x30]
add r8, r8
xor edx, edx
call sym.ntdll.dll_RtlAllocateHeap
mov qword [rsp + 0x48], rax
mov rcx, rbx
mov rdx, r14
mov r8, rbp
mov r9, r13
call sym.ntdll.dll_RtlExpandEnvironmentStrings_U
mov edx, dword [rsi + 4]
mov r8, qword [rsp + 0x48]
movzx r9d, word [rsp + 0x40]
mov rcx, qword [rdi + 0x10]
mov rax, qword [rdi + 0x18]
mov qword [rsp + 0x28], rax
mov rax, qword [rsp + 0x50]
mov qword [rsp + 0x20], rax
call qword [rdi]
mov ebp, eax
mov rax, qword [r12 + 0x60]
mov rcx, qword [rax + 0x30]
mov r8, qword [rsp + 0x48]
xor edx, edx
call sym.ntdll.dll_RtlFreeHeap
test ebp, ebp
je 0x17004a130
cmp ebp, 0xc0000023
je 0x17004a130
jmp 0x17004a53b
mov ebp, 0xc000000d
test byte [rdi + 8], 0x20
jne 0x17004a53b
mov edx, dword [rdi + 0x20]
mov r8, qword [rdi + 0x28]
mov r9d, dword [rdi + 0x30]
mov rcx, qword [rdi + 0x10]
mov rax, qword [rdi + 0x18]
mov qword [rsp + 0x28], rax
mov rax, qword [rsp + 0x50]
mov qword [rsp + 0x20], rax
call qword [rdi]
jmp 0x17004a53d
mov r15, qword [rdi + 0x18]
mov ecx, dword [rsi + 4]
add ecx, 0xffffffff
cmp ecx, 6
ja case.0x17004a294.2
xor ebp, ebp
lea rdx, [0x17004a550]
movsxd rcx, dword [rdx + rcx*4]
add rcx, rdx
jmp rcx
test al, 0x10
jne case.0x17004a294.0
mov edx, dword [rsi + 8]
add rdx, rsi
lea r13, [rsp + 0x68]
mov rcx, r13
call sym.ntdll.dll_RtlInitUnicodeString
mov dword [rsp + 0x3c], 0
mov word [rsp + 0x42], 0
lea r12, [rsp + 0x40]
lea r14, [rsp + 0x3c]
mov rbp, qword [rsp + 0x58]
mov rcx, rbp
mov rdx, r13
mov r8, r12
mov r9, r14
call sym.ntdll.dll_RtlExpandEnvironmentStrings_U
mov word [rsp + 0x40], 0
mov r8d, dword [rsp + 0x3c]
mov word [rsp + 0x42], r8w
mov rbx, qword gs:[0x30]
mov rax, qword [rbx + 0x60]
mov rcx, qword [rax + 0x30]
add r8, r8
xor edx, edx
call sym.ntdll.dll_RtlAllocateHeap
mov qword [rsp + 0x48], rax
mov rcx, rbp
mov rdx, r13
mov r8, r12
mov r9, r14
call sym.ntdll.dll_RtlExpandEnvironmentStrings_U
mov edx, dword [rsi + 4]
mov r8, qword [rsp + 0x48]
movzx r9d, word [rsp + 0x40]
mov rcx, qword [rdi + 0x10]
mov rax, qword [rdi + 0x18]
mov qword [rsp + 0x28], rax
mov rax, qword [rsp + 0x50]
mov qword [rsp + 0x20], rax
call qword [rdi]
mov ebp, eax
mov rax, qword [rbx + 0x60]
mov rcx, qword [rax + 0x30]
mov r8, qword [rsp + 0x48]
xor edx, edx
call sym.ntdll.dll_RtlFreeHeap
mov edx, dword [rsi + 8]
add rdx, rsi
cmp qword [r15 + 8], 0
je 0x17004a3a2
mov rcx, r15
call sym.ntdll.dll_RtlAppendUnicodeToString
jmp 0x17004a53b
mov r8d, dword [rsi + 8]
add r8, rsi
mov rcx, qword [rdi + 0x10]
mov rax, qword [rdi + 0x18]
mov qword [rsp + 0x28], rax
mov rax, qword [rsp + 0x50]
mov qword [rsp + 0x20], rax
mov r9d, r12d
call qword [rdi]
jmp 0x17004a53d
mov rcx, r15
call sym.ntdll.dll_RtlCreateUnicodeString
jmp 0x17004a53b
cmp r12d, 4
jbe 0x17004a4e0
mov r8d, dword [r15]
cmp r8d, 4
ja 0x17004a4ca
add r15, 4
mov edx, dword [rsi + 8]
add rdx, rsi
neg r8d
cmp r12d, r8d
cmovbe r8d, r12d
mov rcx, r15
jmp 0x17004a4ec
mov ebp, 0xc000000d
test al, 0x10
je 0x17004a53b
mov rcx, qword [r15 + 8]
test rcx, rcx
je 0x17004a4f3
movzx eax, word [r15 + 2]
jmp 0x17004a51d
mov edx, dword [rsi + 8]
add rdx, rsi
lea r12, [rsp + 0x68]
mov rcx, r12
call sym.ntdll.dll_RtlInitUnicodeString
mov dword [rsp + 0x3c], 0
mov word [rsp + 0x42], 0
lea r15, [rsp + 0x40]
lea r14, [rsp + 0x3c]
mov rbp, qword [rsp + 0x58]
mov rcx, rbp
mov rdx, r12
mov r8, r15
mov r9, r14
call sym.ntdll.dll_RtlExpandEnvironmentStrings_U
mov word [rsp + 0x40], 0
mov r8d, dword [rsp + 0x3c]
mov word [rsp + 0x42], r8w
mov rbx, qword gs:[0x30]
mov rax, qword [rbx + 0x60]
mov rcx, qword [rax + 0x30]
add r8, r8
xor edx, edx
call sym.ntdll.dll_RtlAllocateHeap
mov qword [rsp + 0x48], rax
mov rcx, rbp
mov rdx, r12
mov r8, r15
mov r9, r14
call sym.ntdll.dll_RtlExpandEnvironmentStrings_U
mov edx, dword [rsi + 4]
mov r8, qword [rsp + 0x48]
movzx r9d, word [rsp + 0x40]
mov rcx, qword [rdi + 0x10]
mov rax, qword [rdi + 0x18]
mov qword [rsp + 0x28], rax
mov rax, qword [rsp + 0x50]
mov qword [rsp + 0x20], rax
call qword [rdi]
mov ebp, eax
mov rax, qword [rbx + 0x60]
mov rcx, qword [rax + 0x30]
mov r8, qword [rsp + 0x48]
xor edx, edx
call sym.ntdll.dll_RtlFreeHeap
jmp 0x17004a53b
cmp r8d, r12d
cmovb r12d, r8d
mov dword [r15 + 4], r12d
mov eax, dword [rsi + 4]
mov dword [r15 + 8], eax
add r15, 0xc
mov edx, dword [rsi + 8]
add rdx, rsi
mov rcx, r15
mov r8, r12
call sym.ntdll.dll_memcpy
jmp 0x17004a539
mov rax, qword gs:[0x30]
mov rax, qword [rax + 0x60]
mov rcx, qword [rax + 0x30]
xor edx, edx
mov r8, r12
call sym.ntdll.dll_RtlAllocateHeap
mov rcx, rax
mov qword [r15 + 8], rax
mov word [r15 + 2], r12w
mov eax, r12d
movzx edi, ax
cmp r12d, edi
cmovb edi, r12d
mov edx, dword [rsi + 8]
add rdx, rsi
mov r8, rdi
call sym.ntdll.dll_memcpy
mov word [r15], di
xor ebp, ebp
mov eax, ebp
add rsp, 0x78
pop rbx
pop rbp
pop rdi
pop rsi
pop r12
pop r13
pop r14
pop r15
ret