Function at 0x100434450
Capabilities:
Set environment variable

Disassembly:
push rbp
lea rbp, [rsp - 0x390]
sub rsp, 0x490
mov rax, qword [0x100499010]
xor rax, rsp
mov qword [rbp + 0x380], rax
cmp dword [0x1004a9184], 0
jne 0x100434482
xor eax, eax
jmp 0x100434a3f
mov qword [rsp + 0x4a0], rbx
lea rdx, str.SQL.Config
mov qword [rsp + 0x4a8], rsi
lea rcx, [rsp + 0x50]
mov qword [rsp + 0x4b0], rdi
mov qword [rsp + 0x4b8], r14
call qword [sym.imp.hostregdll.dll_HostReg_Initialize]
mov dword [rsp + 0x30], eax
test eax, eax
js 0x100434a1f
lea r9, [rsp + 0x30]
lea r8, str.InstanceName
lea rdx, [0x100478d28]
lea rcx, str.SQL.Config
call qword [sym.imp.hostregdll.dll_HostReg_ReadConfigurationSetting]
mov rdi, rax
mov eax, dword [rsp + 0x30]
test eax, eax
js 0x100434a1f
lea r14, str.MSSQLSERVER
xor esi, esi
mov ebx, 0x84
mov r8, rdi
mov edx, ebx
mov rcx, r14
mov r9d, esi
sub r8, r14
nop dword [rax + rax]
lea rax, [rdx + 0x7fffff7a]
test rax, rax
je 0x100434535
movzx eax, word [r8 + rcx]
test ax, ax
je 0x100434535
mov word [rcx], ax
add rcx, 2
sub rdx, 1
jne 0x100434510
jmp 0x10043453a
test rdx, rdx
jne 0x100434544
sub rcx, 2
mov r9d, 0x8007007a
mov word [rcx], si
mov rdx, rdi
lea rcx, str.Instance_name__s_n
mov dword [rsp + 0x30], r9d
call fcn.100434360
call qword [sym.imp.KERNEL32.dll_GetProcessHeap]
mov r8, rdi
xor edx, edx
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_HeapFree]
mov eax, dword [rsp + 0x30]
test eax, eax
js 0x100434a1f
mov rdx, rbx
mov rcx, r14
call qword [sym.imp.api_ms_win_crt_string_l1_1_0.dll__wcsupr_s]
mov rdx, r14
lea rcx, str.SQLSERVR_INSTNAME
call qword [sym.imp.KERNEL32.dll_SetEnvironmentVariableW]
test eax, eax
jne 0x1004345a6
call qword [sym.imp.KERNEL32.dll_GetLastError]
jmp 0x100434a1f
or dword [0x1004a916c], 0x400
lea rcx, [rsp + 0x48]
mov qword [rsp + 0x48], rsi
call qword [sym.imp.hostregdll.dll_HostReg_GetNodeName]
mov dword [rsp + 0x30], eax
test eax, eax
js 0x100434a1f
mov r9, qword [rsp + 0x48]
lea rcx, [0x1004a9cf0]
mov rdx, r9
mov r8d, esi
sub rdx, rcx
lea rax, [rbx + 0x7fffff7a]
test rax, rax
je 0x100434605
movzx eax, word [rdx + rcx]
test ax, ax
je 0x100434605
mov word [rcx], ax
add rcx, 2
sub rbx, 1
jne 0x1004345e1
jmp 0x10043460a
test rbx, rbx
jne 0x100434614
sub rcx, 2
mov r8d, 0x8007007a
mov word [rcx], si
mov dword [rsp + 0x30], r8d
test r8d, r8d
jns 0x100434629
mov eax, r8d
jmp 0x100434a1f
lea r8, str.np:.pipe_s__s_sqlquery
mov qword [rsp + 0x20], r14
mov edx, 0x104
lea rcx, [rbp + 0x170]
call fcn.10040b460
mov dword [rsp + 0x30], eax
test eax, eax
js 0x100434a1f
lea rdx, [rbp + 0x170]
lea rcx, str.SQLSERVR_NAMED_PIPE
call qword [sym.imp.KERNEL32.dll_SetEnvironmentVariableW]
test eax, eax
je 0x1004347c9
lea rdx, [rbp + 0x170]
lea rcx, str.Sql_server_pipe_name:__s_n
call fcn.100434360
lea r9, [rsp + 0x30]
mov word [rsp + 0x60], si
lea r8, str.Port
lea rdx, [0x100478d28]
lea rcx, str.SQL.Config
call qword [sym.imp.hostregdll.dll_HostReg_ReadConfigurationSetting]
mov rbx, rax
mov eax, dword [rsp + 0x30]
test eax, eax
js 0x100434a1f
lea rdx, [rsp + 0x38]
lea rcx, [0x100478dd8]
call qword [sym.imp.hostregdll.dll_HostReg_GetPort]
mov ecx, dword [rsp + 0x38]
test eax, eax
mov dword [rsp + 0x30], eax
cmovs ecx, esi
mov dword [rsp + 0x38], ecx
test rbx, rbx
je 0x100434754
mov rdx, rbx
lea rcx, str.Configuration_port:__s_n
call fcn.100434360
mov edx, dword [rsp + 0x38]
lea rcx, str.Fabric_TDS_port:__d_n
call fcn.100434360
movzx ecx, word [rbx]
mov eax, esi
cmp si, cx
je 0x100434723
mov rcx, rbx
call qword [sym.imp.api_ms_win_crt_convert_l1_1_0.dll__wtol]
movzx ecx, word [rbx]
cmp si, cx
je 0x100434723
test eax, eax
jne 0x100434727
mov eax, dword [rsp + 0x38]
test eax, eax
je 0x100434740
test eax, eax
je 0x100434740
mov r9d, eax
lea r8, str.tcp:localhost__d
mov edx, 0x104
lea rcx, [rsp + 0x60]
call fcn.10040b460
call qword [sym.imp.KERNEL32.dll_GetProcessHeap]
mov r8, rbx
xor edx, edx
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_HeapFree]
lea rcx, str.SQLSERVR_HOST
cmp si, word [rsp + 0x60]
je 0x100434778
lea rdx, [rsp + 0x60]
call qword [sym.imp.KERNEL32.dll_SetEnvironmentVariableW]
test eax, eax
je 0x1004347c9
lea rdx, [rsp + 0x60]
jmp 0x100434790
lea rdx, [rbp + 0x170]
call qword [sym.imp.KERNEL32.dll_SetEnvironmentVariableW]
test eax, eax
je 0x1004347c9
lea rdx, [rbp + 0x170]
lea rcx, str.Sql_server_host:__s_n
call fcn.100434360
lea rcx, [rsp + 0x40]
call qword [sym.imp.hostregdll.dll_HostReg_GetLogDirectory]
mov dword [rsp + 0x30], eax
test eax, eax
js 0x100434a1f
mov rdx, qword [rsp + 0x40]
lea rcx, str.SQLAGENT_LOGDIR
call qword [sym.imp.KERNEL32.dll_SetEnvironmentVariableW]
test eax, eax
jne 0x1004347e4
call qword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jle 0x100434a1f
movzx eax, ax
or eax, 0x80070000
jmp 0x100434a1f
mov rdx, qword [rsp + 0x40]
lea rcx, str.Log_directory_name:__s_n
call fcn.100434360
lea r9, str.SqlAgent
lea r8, str.Data
lea rdx, str.SQL.Config
lea rcx, [rsp + 0x50]
call qword [sym.imp.RgThinClient.dll_RgClient_Initialize]
mov dword [rsp + 0x30], eax
test eax, eax
js 0x100434a1f
xor r8d, r8d
xor edx, edx
xor ecx, ecx
call qword [sym.imp.RgThinClient.dll_RgClient_RegisterResourceGovernance]
mov dword [rsp + 0x30], eax
test eax, eax
js 0x100434a1f
mov rcx, qword [rsp + 0x40]
call qword [sym.imp.XESQLAGENT.dll_InitXESqlAgent]
mov dword [rsp + 0x30], eax
test eax, eax
jns 0x100434860
mov edx, eax
lea rcx, str.Initialization_of_XE_package_failed_with_error__x_n
call fcn.100434360
jmp 0x100434a1b
call qword [sym.imp.XESQLAGENT.dll_CreateXESessions]
test al, al
jne 0x100434880
lea rcx, str.XE_session_failed_to_load_n
call fcn.100434360
mov eax, 0x80004005
jmp 0x100434a1f
lea r8, [rsp + 0x34]
mov byte [rsp + 0x34], sil
lea rdx, str.UseLocalTimeInManagedInstance
lea rcx, str.SQL.Config
call qword [sym.imp.hostregdll.dll_HostReg_IsFeatureSwitchOn]
cmp byte [rsp + 0x34], sil
je 0x100434a0e
test al, al
je 0x100434a0e
lea r9, [rsp + 0x30]
mov byte [0x10049b9aa], 1
lea r8, str.ManagedInstanceTimezoneName
lea rdx, [0x100478d28]
lea rcx, str.SQL.Config
call qword [sym.imp.hostregdll.dll_HostReg_ReadConfigurationSetting]
mov rbx, rax
mov rcx, 0xffffffffffffffff
inc rcx
cmp word [rax + rcx*2], si
jne 0x1004348e2
lea r8, [0x100478f00]
test rcx, rcx
je 0x100434915
mov rcx, rsi
nop word [rax + rax]
movzx eax, word [rbx + rcx*2]
inc rcx
cmp ax, word [r8 + rcx*2 - 2]
jne 0x100434955
cmp rcx, 4
jne 0x100434900
lea rdi, [0x1004a93a0]
mov ecx, 0x105
mov rdx, rdi
sub r8, rdi
mov r9d, esi
nop word [rax + rax]
lea rax, [rcx + 0x7ffffef9]
test rax, rax
je 0x1004349b0
movzx eax, word [r8 + rdx]
test ax, ax
je 0x1004349b0
mov word [rdx], ax
add rdx, 2
sub rcx, 1
jne 0x100434930
jmp 0x1004349b5
lea rdi, [0x1004a93a0]
mov r8, rbx
mov rdx, rdi
sub r8, rdi
mov ecx, 0x105
mov r9d, esi
nop dword [rax]
lea rax, [rcx + 0x7ffffef9]
test rax, rax
je 0x10043499f
movzx eax, word [r8 + rdx]
test ax, ax
je 0x10043499f
mov word [rdx], ax
add rdx, 2
sub rcx, 1
jne 0x100434970
sub rdx, 2
mov r9d, 0x8007007a
jmp 0x1004349c6
test rcx, rcx
jne 0x1004349c6
sub rdx, 2
mov r9d, 0x8007007a
jmp 0x1004349c6
test rcx, rcx
jne 0x1004349bf
sub rdx, 2
mov r9d, 0x8007007a
mov byte [0x10049b9aa], sil
mov word [rdx], si
mov dword [rsp + 0x30], r9d
call qword [sym.imp.KERNEL32.dll_GetProcessHeap]
mov r8, rbx
xor edx, edx
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_HeapFree]
cmp dword [rsp + 0x30], esi
jge 0x1004349fd
lea rcx, str.InitFabric___Setting_Managed_Instance_timezone_failed._r_n
call fcn.100434360
mov byte [0x10049b9aa], sil
jmp 0x100434a1b
mov rdx, rdi
lea rcx, str.InitFabric___TimeZoneName___s._r_n
call fcn.100434360
jmp 0x100434a15
mov byte [0x10049b9aa], sil
mov dword [0x100499398], esi
mov eax, dword [rsp + 0x30]
mov rdi, qword [rsp + 0x4b0]
mov rsi, qword [rsp + 0x4a8]
mov rbx, qword [rsp + 0x4a0]
mov r14, qword [rsp + 0x4b8]
mov rcx, qword [rbp + 0x380]
xor rcx, rsp
call fcn.100469360
add rsp, 0x490
pop rbp
ret