Function at 0x140001510
Capabilities:
Extract resource via kernel32 functions
Get common file path
Query environment variable

Disassembly:
push rbp
push rbx
push rsi
push rdi
push r14
lea rbp, [rsp - 0x6c0]
sub rsp, 0x7c0
mov rsi, rdx
mov edi, ecx
call qword [sym.imp.KERNEL32.dll_GetCurrentProcess]
mov ecx, 0x80000c02
mov rbx, rax
call qword [sym.imp.dbghelp.dll_SymSetOptions]
xor r8d, r8d
lea rcx, str._NT_SYMBOL_PATH
xor edx, edx
xor r14d, r14d
call qword [sym.imp.KERNEL32.dll_GetEnvironmentVariableW]
call qword [sym.imp.KERNEL32.dll_GetLastError]
lea rdx, str.cache_srvhttps:__msdl.microsoft.com_download_symbols
mov rcx, rbx
cmp eax, 0xcb
cmovne rdx, r14
xor r8d, r8d
call qword [sym.imp.dbghelp.dll_SymInitializeW]
test eax, eax
jne 0x14000158c
lea eax, [r14 - 1]
add rsp, 0x7c0
pop r14
pop rdi
pop rsi
pop rbx
pop rbp
ret
lea rcx, [rbp - 0x40]
cmp edi, 2
jl 0x14000159b
mov rdx, qword [rsi + 8]
jmp 0x1400015b6
mov edx, 0x104
call qword [sym.imp.KERNEL32.dll_GetSystemDirectoryA]
mov eax, eax
lea rcx, [rbp - 0x40]
add rcx, rax
lea rdx, str._termsrv.dll
call qword [sym.imp.KERNEL32.dll_lstrcpyA]
xor edx, edx
lea rcx, [rbp - 0x40]
lea r8d, [rdx + 2]
call qword [sym.imp.KERNEL32.dll_LoadLibraryExA]
mov rdi, rax
test rax, rax
jne 0x1400015e5
lea eax, [rdi - 2]
add rsp, 0x7c0
pop r14
pop rdi
pop rsi
pop rbx
pop rbp
ret
mov qword [rsp + 0x7f0], r12
lea rsi, [0x140003670]
mov r12, rdi
and r12, 0xfffffffffffffffc
movsxd rdx, dword [r12 + 0x3c]
add rdx, r12
movzx eax, word [rdx + 0x14]
mov ecx, dword [rax + rdx + 0x2c]
mov eax, dword [rax + rdx + 0x24]
sub rcx, rax
mov eax, 0x20b
add r12, rcx
lea rcx, [rbp - 0x60]
cmp word [rdx + 0x18], ax
jne 0x140001632
xor edx, edx
lea r8d, [rdx + 2]
call qword [sym.imp.Zydis.dll_ZydisDecoderInit]
jmp 0x140001647
mov edx, 1
mov r8d, edx
call qword [sym.imp.Zydis.dll_ZydisDecoderInit]
lea rsi, [0x140003674]
mov dword [rsp + 0x38], r14d
lea r8, [rbp - 0x40]
mov qword [rsp + 0x30], r14
xor r9d, r9d
mov dword [rsp + 0x28], r14d
xor edx, edx
mov rcx, rbx
mov qword [rsp + 0x20], r14
call qword [sym.imp.dbghelp.dll_SymLoadModuleEx]
test rax, rax
jne 0x14000167c
mov eax, 0xfffffffd
jmp 0x140001ca0
mov edx, 1
mov rcx, rdi
lea r8d, [rdx + 0xf]
call qword [sym.imp.KERNEL32.dll_FindResourceW]
test rax, rax
jne 0x14000169d
mov eax, 0xfffffffc
jmp 0x140001ca0
mov rdx, rax
mov qword [rsp + 0x7b0], r15
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_LoadResource]
mov qword [rbp - 0x48], rax
mov r15, rax
test rax, rax
jne 0x1400016c6
lea eax, [r15 - 5]
jmp 0x140001c98
mov dword [rsp + 0x40], 0x58
lea rcx, str.__hu._hu._hu._hu__n
mov dword [rbp - 0x70], r14d
movzx eax, word [rax + 0x34]
movzx r9d, word [r15 + 0x36]
movzx r8d, word [r15 + 0x30]
movzx edx, word [r15 + 0x32]
mov dword [rsp + 0x20], eax
call fcn.140001010
lea r8, [rsp + 0x40]
mov rcx, rbx
lea rdx, [0x140003690]
call qword [sym.imp.dbghelp.dll_SymFromNameW]
test eax, eax
jne 0x14000172b
lea r8, [rsp + 0x40]
mov rcx, rbx
lea rdx, str._memset
call qword [sym.imp.dbghelp.dll_SymFromNameW]
test eax, eax
je 0x1400017ae
mov rdi, qword [rsp + 0x78]
lea r8, [rsp + 0x40]
sub rdi, qword [rsp + 0x60]
lea rdx, str.CSessionArbitrationHelper::IsSingleSessionPerUserEnabled
mov rcx, rbx
call qword [sym.imp.dbghelp.dll_SymFromNameW]
test eax, eax
je 0x14000176b
mov rdx, qword [rsp + 0x78]
lea rcx, [rbp - 0x60]
sub rdx, qword [rsp + 0x60]
mov r9, rdi
mov r8, r12
call fcn.140001350
test eax, eax
jne 0x1400017ae
lea r8, [rsp + 0x40]
mov rcx, rbx
lea rdx, str.CUtils::IsSingleSessionPerUser
call qword [sym.imp.dbghelp.dll_SymFromNameW]
test eax, eax
je 0x1400017ae
mov rdx, qword [rsp + 0x78]
lea rcx, [rbp - 0x60]
sub rdx, qword [rsp + 0x60]
mov r9, rdi
mov r8, r12
call fcn.140001350
test eax, eax
jne 0x1400017ae
lea rcx, str.ERROR:_SingleUserPatch_not_found
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_puts]
lea r8, [rsp + 0x40]
mov qword [rsp + 0x7b8], r13
lea rdx, str.CDefPolicy::Query
mov rcx, rbx
call qword [sym.imp.dbghelp.dll_SymFromNameW]
test eax, eax
je 0x140001958
mov rdi, qword [rsp + 0x78]
lea r9, [rbp + 0xd0]
sub rdi, qword [rsp + 0x60]
lea rcx, [rbp - 0x60]
add rdi, r12
mov r15d, 0x80
mov rdx, rdi
mov r8d, r15d
call qword [sym.imp.Zydis.dll_ZydisDecoderDecodeBuffer]
test eax, eax
js 0x140001876
cmp byte [rbp + 0xe8], 3
jne 0x14000184d
cmp dword [rbp + 0xd4], 0x67
jne 0x14000184d
mov ecx, dword [rbp + 0xf4]
mov eax, dword [rbp + 0x15c]
cmp ecx, 2
jne 0x140001836
cmp qword [rbp + 0x138], 0x63c
jne 0x140001836
cmp eax, 1
je 0x14000188c
cmp eax, 2
jne 0x14000184d
cmp qword [rbp + 0x1a0], 0x320
jne 0x14000184d
cmp ecx, 1
je 0x1400018a0
movzx r14d, byte [rbp + 0xd8]
lea r9, [rbp + 0xd0]
add rdi, r14
lea rcx, [rbp - 0x60]
sub r15, r14
mov rdx, rdi
mov r8, r15
call qword [sym.imp.Zydis.dll_ZydisDecoderDecodeBuffer]
test eax, eax
jns 0x140001801
lea rcx, str.ERROR:_DefPolicyPatch_patten_not_found
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_puts]
mov r15, qword [rbp - 0x48]
jmp 0x140001965
mov ecx, dword [rbp + 0x17c]
call qword [sym.imp.Zydis.dll_ZydisRegisterGetString]
mov ecx, dword [rbp + 0x120]
jmp 0x1400018b2
mov ecx, dword [rbp + 0x114]
call qword [sym.imp.Zydis.dll_ZydisRegisterGetString]
mov ecx, dword [rbp + 0x188]
mov qword [rbp + 0x708], rax
call qword [sym.imp.Zydis.dll_ZydisRegisterGetString]
mov qword [rbp + 0x700], rax
lea r9, [rbp + 0xd0]
movzx eax, byte [rbp + 0xd8]
lea rcx, [rbp - 0x60]
sub r15, rax
lea r13, [0x1400032b0]
mov r8, r15
lea rdx, [rax + rdi]
call qword [sym.imp.Zydis.dll_ZydisDecoderDecodeBuffer]
test eax, eax
js 0x140001876
mov eax, dword [rbp + 0xd4]
cmp eax, 0x13b
jne 0x14000190c
sub rdi, r14
lea r13, str._jmp
jmp 0x14000191e
cmp eax, 0x140
je 0x14000191e
cmp eax, 0x25b
jne 0x140001876
mov r9, qword [rbp + 0x700]
lea rax, str.DefPolicyPatch.x641_nDefPolicyOffset.x64_llX_nDefPolicyCode.x64CDefPolicy_Query__s__s_s_n
mov r8, qword [rbp + 0x708]
lea rcx, str.DefPolicyPatch.x861_nDefPolicyOffset.x86_llX_nDefPolicyCode.x86CDefPolicy_Query__s__s_s_n
sub rdi, r12
mov qword [rsp + 0x20], r13
cmp dword [rbp - 0x5c], 2
mov rdx, rdi
cmove rcx, rax
call fcn.140001010
mov r15, qword [rbp - 0x48]
jmp 0x140001965
lea rcx, str.ERROR:_CDefPolicy_Query_not_found
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_puts]
mov eax, dword [r15 + 0x30]
mov r13, qword [rsp + 0x7b8]
cmp eax, 0x60001
jbe 0x140001c96
lea r8, [rsp + 0x40]
mov rcx, rbx
cmp eax, 0x60002
jne 0x1400019c6
lea rdx, str.SLGetWindowsInformationDWORDWrapper
call qword [sym.imp.dbghelp.dll_SymFromNameW]
test eax, eax
je 0x1400019ba
mov r8, qword [rsp + 0x78]
lea rcx, str.SLPolicyInternal._1_s1_nSLPolicyOffset._1_s_2_llX_nSLPolicyFunc._1_sNew_Win8SL_n
sub r8, qword [rsp + 0x60]
mov rdx, rsi
call fcn.140001070
jmp 0x140001c96
lea rcx, str.ERROR:_SLGetWindowsInformationDWORDWrapper_not_found
jmp 0x140001c90
lea rdx, str.CEnforcementCore::GetInstanceOfTSLicense
call qword [sym.imp.dbghelp.dll_SymFromNameW]
test eax, eax
je 0x140001a1e
mov rdi, qword [rsp + 0x78]
lea r8, [rsp + 0x40]
sub rdi, qword [rsp + 0x60]
lea rdx, str.CSLQuery::IsLicenseTypeLocalOnly
mov rcx, rbx
call qword [sym.imp.dbghelp.dll_SymFromNameW]
test eax, eax
je 0x140001a15
mov r9, qword [rsp + 0x78]
lea rcx, [rbp - 0x60]
sub r9, qword [rsp + 0x60]
mov r8, r12
mov rdx, rdi
call fcn.1400010d0
jmp 0x140001a2b
lea rcx, str.ERROR:_IsLicenseTypeLocalOnly_not_found
jmp 0x140001a25
lea rcx, str.ERROR:_GetInstanceOfTSLicense_not_found
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_puts]
lea r8, [rsp + 0x40]
mov rcx, rbx
lea rdx, str.CSLQuery::Initialize
call qword [sym.imp.dbghelp.dll_SymFromNameW]
test eax, eax
je 0x140001c89
mov r8, qword [rsp + 0x78]
lea rcx, str.SLInitHook._1_s1_nSLInitOffset._1_s_2_llX_nSLInitFunc._1_sNew_CSLQuery_Initialize_n
sub r8, qword [rsp + 0x60]
mov rdx, rsi
call fcn.140001070
movzx eax, word [r15 + 0x34]
lea rcx, str._n__hu._hu._hu._hu_SLInit__n
movzx r9d, word [r15 + 0x36]
movzx r8d, word [r15 + 0x30]
movzx edx, word [r15 + 0x32]
mov dword [rsp + 0x20], eax
call fcn.140001010
lea r8, [rsp + 0x40]
mov rcx, rbx
lea rdx, str.CSLQuery::bServerSku
call qword [sym.imp.dbghelp.dll_SymFromNameW]
test eax, eax
je 0x140001ab9
mov r8, qword [rsp + 0x78]
lea rcx, str.bServerSku._s_llX_n
sub r8, qword [rsp + 0x60]
mov rdx, rsi
call fcn.140001010
jmp 0x140001ac6
lea rcx, str.ERROR:_bServerSku_not_found
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_puts]
lea r8, [rsp + 0x40]
mov rcx, rbx
lea rdx, str.CSLQuery::bRemoteConnAllowed
call qword [sym.imp.dbghelp.dll_SymFromNameW]
test eax, eax
je 0x140001afa
mov r8, qword [rsp + 0x78]
lea rcx, str.bRemoteConnAllowed._s_llX_n
sub r8, qword [rsp + 0x60]
mov rdx, rsi
call fcn.140001010
jmp 0x140001b07
lea rcx, str.ERROR:_bRemoteConnAllowed_not_found
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_puts]
lea r8, [rsp + 0x40]
mov rcx, rbx
lea rdx, str.CSLQuery::bFUSEnabled
call qword [sym.imp.dbghelp.dll_SymFromNameW]
test eax, eax
je 0x140001b3b
mov r8, qword [rsp + 0x78]
lea rcx, str.bFUSEnabled._s_llX_n
sub r8, qword [rsp + 0x60]
mov rdx, rsi
call fcn.140001010
jmp 0x140001b48
lea rcx, str.ERROR:_bFUSEnabled_not_found
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_puts]
lea r8, [rsp + 0x40]
mov rcx, rbx
lea rdx, str.CSLQuery::bAppServerAllowed
call qword [sym.imp.dbghelp.dll_SymFromNameW]
test eax, eax
je 0x140001b7c
mov r8, qword [rsp + 0x78]
lea rcx, str.bAppServerAllowed._s_llX_n
sub r8, qword [rsp + 0x60]
mov rdx, rsi
call fcn.140001010
jmp 0x140001b89
lea rcx, str.ERROR:_bAppServerAllowed_not_found
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_puts]
lea r8, [rsp + 0x40]
mov rcx, rbx
lea rdx, str.CSLQuery::bMultimonAllowed
call qword [sym.imp.dbghelp.dll_SymFromNameW]
test eax, eax
je 0x140001bbd
mov r8, qword [rsp + 0x78]
lea rcx, str.bMultimonAllowed._s_llX_n
sub r8, qword [rsp + 0x60]
mov rdx, rsi
call fcn.140001010
jmp 0x140001bca
lea rcx, str.ERROR:_bMultimonAllowed_not_found
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_puts]
lea r8, [rsp + 0x40]
mov rcx, rbx
lea rdx, str.CSLQuery::lMaxUserSessions
call qword [sym.imp.dbghelp.dll_SymFromNameW]
test eax, eax
je 0x140001bfe
mov r8, qword [rsp + 0x78]
lea rcx, str.lMaxUserSessions._s_llX_n
sub r8, qword [rsp + 0x60]
mov rdx, rsi
call fcn.140001010
jmp 0x140001c0b
lea rcx, str.ERROR:_lMaxUserSessions_not_found
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_puts]
lea r8, [rsp + 0x40]
mov rcx, rbx
lea rdx, str.CSLQuery::ulMaxDebugSessions
call qword [sym.imp.dbghelp.dll_SymFromNameW]
test eax, eax
je 0x140001c3f
mov r8, qword [rsp + 0x78]
lea rcx, str.ulMaxDebugSessions._s_llX_n
sub r8, qword [rsp + 0x60]
mov rdx, rsi
call fcn.140001010
jmp 0x140001c4c
lea rcx, str.ERROR:_ulMaxDebugSessions_not_found
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_puts]
lea r8, [rsp + 0x40]
mov rcx, rbx
lea rdx, str.CSLQuery::bInitialized
call qword [sym.imp.dbghelp.dll_SymFromNameW]
test eax, eax
je 0x140001c80
mov r8, qword [rsp + 0x78]
lea rcx, str.bInitialized._s_llX_n
sub r8, qword [rsp + 0x60]
mov rdx, rsi
call fcn.140001010
jmp 0x140001c96
lea rcx, str.ERROR:_bInitialized_not_found
jmp 0x140001c90
lea rcx, str.ERROR:_CSLQuery_Initialize_not_found
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_puts]
xor eax, eax
mov r15, qword [rsp + 0x7b0]
mov r12, qword [rsp + 0x7f0]
add rsp, 0x7c0
pop r14
pop rdi
pop rsi
pop rbx
pop rbp
ret