Function at 0x140001a90
Capabilities:
Check if file exists
Extract resource via kernel32 functions
Get common file path
Query environment variable

Disassembly:
push rbp
push rbx
push rsi
push rdi
push r13
lea rbp, [rsp - 0x410]
sub rsp, 0x510
mov rsi, rdx
mov edi, ecx
call qword [sym.imp.KERNEL32.dll_GetCurrentProcess]
mov ecx, 0x80004000
mov rbx, rax
call qword [sym.imp.dbghelp.dll_SymSetOptions]
xor r8d, r8d
lea rcx, str._NT_SYMBOL_PATH
xor edx, edx
call qword [sym.imp.KERNEL32.dll_GetEnvironmentVariableW]
call qword [sym.imp.KERNEL32.dll_GetLastError]
xor r13d, r13d
lea rdx, str.cache_srvhttps:__msdl.microsoft.com_download_symbols
cmp eax, 0xcb
mov rcx, rbx
cmovne rdx, r13
xor r8d, r8d
call qword [sym.imp.dbghelp.dll_SymInitializeW]
test eax, eax
jne 0x140001b0c
lea rax, [r13 - 1]
add rsp, 0x510
pop r13
pop rdi
pop rsi
pop rbx
pop rbp
ret
mov qword [rsp + 0x550], r15
lea rcx, [rbp - 0x40]
cmp edi, 2
jl 0x140001b23
mov rdx, qword [rsi + 8]
jmp 0x140001b3e
mov edx, 0x105
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 r15, rax
test rax, rax
jne 0x140001b65
lea eax, [r15 - 2]
jmp 0x1400021a5
mov qword [rsp + 0x540], r12
lea rdi, [0x1400036c0]
mov qword [rsp + 0x548], r14
mov r14, r15
and r14, 0xfffffffffffffffc
movsxd rsi, dword [r14 + 0x3c]
add rsi, r14
movzx eax, word [rsi + 0x14]
mov ecx, dword [rax + rsi + 0x2c]
mov eax, dword [rax + rsi + 0x24]
sub rcx, rax
mov eax, 0x20b
add r14, rcx
lea rcx, [rbp - 0x50]
cmp word [rsi + 0x18], ax
jne 0x140001bbd
xor edx, edx
lea r8d, [rdx + 2]
call qword [sym.imp.Zydis.dll_ZydisDecoderInit]
mov r12, qword [rsi + 0x30]
jmp 0x140001bd6
mov edx, 1
mov r8d, edx
call qword [sym.imp.Zydis.dll_ZydisDecoderInit]
mov r12d, dword [rsi + 0x34]
lea rdi, [0x1400036c4]
mov esi, dword [rsi + 0x50]
lea rcx, [rbp + 0xd4]
xor edx, edx
mov dword [rbp + 0xd0], 0x33c
mov r8d, 0x338
call sub.VCRUNTIME140.dll_memset
xor r8d, r8d
lea rdx, [rbp + 0xd0]
lea rcx, [rbp - 0x40]
call qword [sym.imp.dbghelp.dll_SymSrvGetFileIndexInfo]
test eax, eax
jne 0x140001c19
mov eax, 0xfffffffa
jmp 0x140002195
mov qword [rsp + 0x48], r13
lea rax, [rbp - 0x40]
mov qword [rsp + 0x40], r13
lea r9, [rbp + 0x3f4]
mov qword [rsp + 0x38], rax
lea r8, [rbp + 0x2ed]
mov eax, dword [rbp + 0x408]
xor edx, edx
mov dword [rsp + 0x30], 8
mov rcx, rbx
mov dword [rsp + 0x28], r13d
mov dword [rsp + 0x20], eax
call qword [sym.imp.dbghelp.dll_SymFindFileInPath]
test eax, eax
jne 0x140001c82
call qword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 2
jne 0x140001c78
lea rcx, str.Symbol_not_found
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_puts]
mov eax, 0xfffffff9
jmp 0x140002195
mov dword [rsp + 0x38], r13d
lea r8, [rbp - 0x40]
mov qword [rsp + 0x30], r13
xor r9d, r9d
mov dword [rsp + 0x28], esi
xor edx, edx
mov rcx, rbx
mov qword [rsp + 0x20], r12
call qword [sym.imp.dbghelp.dll_SymLoadModuleEx]
test rax, rax
jne 0x140001cb6
mov eax, 0xfffffffd
jmp 0x140002195
mov edx, 1
mov rcx, r15
lea r8d, [rdx + 0xf]
call qword [sym.imp.KERNEL32.dll_FindResourceW]
test rax, rax
jne 0x140001cd7
mov eax, 0xfffffffc
jmp 0x140002195
mov rdx, rax
mov rcx, r15
call qword [sym.imp.KERNEL32.dll_LoadResource]
mov r15, rax
test rax, rax
jne 0x140001cf4
lea eax, [r15 - 5]
jmp 0x140002195
mov dword [rsp + 0x50], 0x58
lea rcx, str.__hu._hu._hu._hu__n
mov dword [rbp - 0x60], r13d
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 + 0x50]
mov rcx, rbx
lea rdx, str.__imp_VerifyVersionInfoW
mov rsi, 0xffffffffffffffff
call qword [sym.imp.dbghelp.dll_SymFromNameW]
test eax, eax
jne 0x140001d5c
lea r8, [rsp + 0x50]
mov rcx, rbx
lea rdx, str.__imp__VerifyVersionInfoW_16
call qword [sym.imp.dbghelp.dll_SymFromNameW]
test eax, eax
je 0x140001d65
mov rsi, qword [rbp - 0x78]
sub rsi, qword [rsp + 0x70]
cmp dword [rbp - 0x4c], 1
jne 0x140001d6e
add rsi, r12
mov ecx, 0x80000002
call qword [sym.imp.dbghelp.dll_SymSetOptions]
lea r8, [rsp + 0x50]
mov rcx, rbx
lea rdx, [0x140003770]
call qword [sym.imp.dbghelp.dll_SymFromNameW]
test eax, eax
jne 0x140001daf
lea r8, [rsp + 0x50]
mov rcx, rbx
lea rdx, str._memset
call qword [sym.imp.dbghelp.dll_SymFromNameW]
test eax, eax
je 0x140001e39
mov r12, qword [rbp - 0x78]
lea r8, [rsp + 0x50]
sub r12, qword [rsp + 0x70]
lea rdx, str.CSessionArbitrationHelper::IsSingleSessionPerUserEnabled
mov rcx, rbx
call qword [sym.imp.dbghelp.dll_SymFromNameW]
test eax, eax
je 0x140001df2
mov rdx, qword [rbp - 0x78]
lea rcx, [rbp - 0x50]
sub rdx, qword [rsp + 0x70]
mov r9, r12
mov r8, r14
mov qword [rsp + 0x20], rsi
call fcn.140001770
test eax, eax
jne 0x140001e39
lea r8, [rsp + 0x50]
mov rcx, rbx
lea rdx, str.CUtils::IsSingleSessionPerUser
call qword [sym.imp.dbghelp.dll_SymFromNameW]
test eax, eax
je 0x140001e39
mov rdx, qword [rbp - 0x78]
lea rcx, [rbp - 0x50]
sub rdx, qword [rsp + 0x70]
mov r9, r12
mov r8, r14
mov qword [rsp + 0x20], rsi
call fcn.140001770
test eax, eax
jne 0x140001e39
lea rcx, str.ERROR:_SingleUserPatch_not_found
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_puts]
lea r8, [rsp + 0x50]
mov rcx, rbx
lea rdx, str.CDefPolicy::Query
call qword [sym.imp.dbghelp.dll_SymFromNameW]
test eax, eax
je 0x140001e69
mov rdx, qword [rbp - 0x78]
lea rcx, [rbp - 0x50]
sub rdx, qword [rsp + 0x70]
mov r8, r14
call fcn.1400013c0
jmp 0x140001e76
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]
cmp eax, 0x60001
jbe 0x140002193
lea r8, [rsp + 0x50]
mov rcx, rbx
cmp eax, 0x60002
jne 0x140001ece
lea rdx, str.SLGetWindowsInformationDWORDWrapper
call qword [sym.imp.dbghelp.dll_SymFromNameW]
test eax, eax
je 0x140001ec2
mov r8, qword [rbp - 0x78]
lea rcx, str.SLPolicyInternal._1_s1_nSLPolicyOffset._1_s_2_llX_nSLPolicyFunc._1_sNew_Win8SL_n
sub r8, qword [rsp + 0x70]
mov rdx, rdi
call fcn.140001a30
jmp 0x140002193
lea rcx, str.ERROR:_SLGetWindowsInformationDWORDWrapper_not_found
jmp 0x14000218d
lea rdx, str.CEnforcementCore::GetInstanceOfTSLicense
call qword [sym.imp.dbghelp.dll_SymFromNameW]
test eax, eax
je 0x140001f24
mov rsi, qword [rbp - 0x78]
lea r8, [rsp + 0x50]
sub rsi, qword [rsp + 0x70]
lea rdx, str.CSLQuery::IsLicenseTypeLocalOnly
mov rcx, rbx
call qword [sym.imp.dbghelp.dll_SymFromNameW]
test eax, eax
je 0x140001f1b
mov r9, qword [rbp - 0x78]
lea rcx, [rbp - 0x50]
sub r9, qword [rsp + 0x70]
mov r8, r14
mov rdx, rsi
call fcn.140001070
jmp 0x140001f31
lea rcx, str.ERROR:_IsLicenseTypeLocalOnly_not_found
jmp 0x140001f2b
lea rcx, str.ERROR:_GetInstanceOfTSLicense_not_found
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_puts]
lea r8, [rsp + 0x50]
mov rcx, rbx
lea rdx, str.CSLQuery::Initialize
call qword [sym.imp.dbghelp.dll_SymFromNameW]
test eax, eax
je 0x140002186
mov r8, qword [rbp - 0x78]
lea rcx, str.SLInitHook._1_s1_nSLInitOffset._1_s_2_llX_nSLInitFunc._1_sNew_CSLQuery_Initialize_n
sub r8, qword [rsp + 0x70]
mov rdx, rdi
call fcn.140001a30
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 + 0x50]
mov rcx, rbx
lea rdx, str.CSLQuery::bServerSku
call qword [sym.imp.dbghelp.dll_SymFromNameW]
test eax, eax
je 0x140001fbd
mov r8, qword [rbp - 0x78]
lea rcx, str.bServerSku._s_llX_n
sub r8, qword [rsp + 0x70]
mov rdx, rdi
call fcn.140001010
jmp 0x140001fca
lea rcx, str.ERROR:_bServerSku_not_found
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_puts]
lea r8, [rsp + 0x50]
mov rcx, rbx
lea rdx, str.CSLQuery::bRemoteConnAllowed
call qword [sym.imp.dbghelp.dll_SymFromNameW]
test eax, eax
je 0x140001ffd
mov r8, qword [rbp - 0x78]
lea rcx, str.bRemoteConnAllowed._s_llX_n
sub r8, qword [rsp + 0x70]
mov rdx, rdi
call fcn.140001010
jmp 0x14000200a
lea rcx, str.ERROR:_bRemoteConnAllowed_not_found
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_puts]
lea r8, [rsp + 0x50]
mov rcx, rbx
lea rdx, str.CSLQuery::bFUSEnabled
call qword [sym.imp.dbghelp.dll_SymFromNameW]
test eax, eax
je 0x14000203d
mov r8, qword [rbp - 0x78]
lea rcx, str.bFUSEnabled._s_llX_n
sub r8, qword [rsp + 0x70]
mov rdx, rdi
call fcn.140001010
jmp 0x14000204a
lea rcx, str.ERROR:_bFUSEnabled_not_found
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_puts]
lea r8, [rsp + 0x50]
mov rcx, rbx
lea rdx, str.CSLQuery::bAppServerAllowed
call qword [sym.imp.dbghelp.dll_SymFromNameW]
test eax, eax
je 0x14000207d
mov r8, qword [rbp - 0x78]
lea rcx, str.bAppServerAllowed._s_llX_n
sub r8, qword [rsp + 0x70]
mov rdx, rdi
call fcn.140001010
jmp 0x14000208a
lea rcx, str.ERROR:_bAppServerAllowed_not_found
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_puts]
lea r8, [rsp + 0x50]
mov rcx, rbx
lea rdx, str.CSLQuery::bMultimonAllowed
call qword [sym.imp.dbghelp.dll_SymFromNameW]
test eax, eax
je 0x1400020bd
mov r8, qword [rbp - 0x78]
lea rcx, str.bMultimonAllowed._s_llX_n
sub r8, qword [rsp + 0x70]
mov rdx, rdi
call fcn.140001010
jmp 0x1400020ca
lea rcx, str.ERROR:_bMultimonAllowed_not_found
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_puts]
lea r8, [rsp + 0x50]
mov rcx, rbx
lea rdx, str.CSLQuery::lMaxUserSessions
call qword [sym.imp.dbghelp.dll_SymFromNameW]
test eax, eax
je 0x1400020fd
mov r8, qword [rbp - 0x78]
lea rcx, str.lMaxUserSessions._s_llX_n
sub r8, qword [rsp + 0x70]
mov rdx, rdi
call fcn.140001010
jmp 0x14000210a
lea rcx, str.ERROR:_lMaxUserSessions_not_found
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_puts]
lea r8, [rsp + 0x50]
mov rcx, rbx
lea rdx, str.CSLQuery::ulMaxDebugSessions
call qword [sym.imp.dbghelp.dll_SymFromNameW]
test eax, eax
je 0x14000213d
mov r8, qword [rbp - 0x78]
lea rcx, str.ulMaxDebugSessions._s_llX_n
sub r8, qword [rsp + 0x70]
mov rdx, rdi
call fcn.140001010
jmp 0x14000214a
lea rcx, str.ERROR:_ulMaxDebugSessions_not_found
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_puts]
lea r8, [rsp + 0x50]
mov rcx, rbx
lea rdx, str.CSLQuery::bInitialized
call qword [sym.imp.dbghelp.dll_SymFromNameW]
test eax, eax
je 0x14000217d
mov r8, qword [rbp - 0x78]
lea rcx, str.bInitialized._s_llX_n
sub r8, qword [rsp + 0x70]
mov rdx, rdi
call fcn.140001010
jmp 0x140002193
lea rcx, str.ERROR:_bInitialized_not_found
jmp 0x14000218d
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 r14, qword [rsp + 0x548]
mov r12, qword [rsp + 0x540]
mov r15, qword [rsp + 0x550]
add rsp, 0x510
pop r13
pop rdi
pop rsi
pop rbx
pop rbp
ret