Function at 0x100434fa0
Capabilities:
Check if file exists
Get file attributes
Get system information on windows
Impersonate user
Query environment variable
Set environment variable

Disassembly:
mov rax, rsp
push rbp
push r12
push r13
push r14
push r15
lea rbp, [rax - 0xe68]
sub rsp, 0xf40
mov qword [rbp - 0x80], 0xfffffffffffffffe
mov qword [rax + 8], rbx
mov qword [rax + 0x18], rsi
mov qword [rax + 0x20], rdi
mov rax, qword [0x100499010]
xor rax, rsp
mov qword [rbp + 0xe30], rax
mov rbx, rdx
mov esi, ecx
xor r9d, r9d
xor r8d, r8d
mov r13d, 1
mov edx, r13d
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_HeapSetInformation]
xor edx, edx
mov r8d, 0x400
lea rcx, [rbp + 0x620]
call sub.VCRUNTIME140.dll_memset
xor edx, edx
mov r8d, 0x108
lea rcx, [rbp + 0x410]
call sub.VCRUNTIME140.dll_memset
xor edx, edx
mov r8d, 0x108
lea rcx, [rbp + 0xa20]
call sub.VCRUNTIME140.dll_memset
lea r12, str.SQLServerAgent
mov qword [rsp + 0x60], r12
lea rax, [0x10044b760]
mov qword [rsp + 0x68], rax
xor r15d, r15d
mov qword [rsp + 0x70], r15
mov qword [rsp + 0x78], r15
mov r14d, r15d
call fcn.100463030
test eax, eax
jne 0x10043506f
xor eax, eax
jmp 0x100435f85
mov dword [0x1004a8ebc], r15d
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_GetModuleHandleW]
mov qword [0x1004a9c80], rax
mov rcx, rax
call qword [sym.imp.SqlResourceLoader.dll_LoadResourceLibrary]
mov qword [0x1004a90d8], rax
test rax, rax
je 0x100435068
lea rdx, str.KERNEL32.DLL
mov ecx, 3
call fcn.10042b4a0
mov rdi, rax
test rax, rax
je 0x1004350cf
lea rdx, str.TryEnterCriticalSection
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov qword [0x1004a90d0], rax
test rax, rax
je 0x100435068
xor edx, edx
xor ecx, ecx
call qword [sym.imp.ole32.dll_CoInitializeEx]
mov qword [rsp + 0x40], r15
mov dword [rsp + 0x38], r15d
mov qword [rsp + 0x30], r15
mov dword [rsp + 0x28], 2
mov dword [rsp + 0x20], 2
xor r9d, r9d
xor r8d, r8d
lea edx, [r9 - 1]
xor ecx, ecx
call qword [sym.imp.ole32.dll_CoInitializeSecurity]
lea rcx, [fcn.10042cfa0]
call qword [sym.imp.KERNEL32.dll_SetUnhandledExceptionFilter]
mov dword [0x1004a8ebc], r15d
lea rcx, str.ntdll.dll
call qword [sym.imp.KERNEL32.dll_GetModuleHandleW]
test rax, rax
je 0x100435209
lea rdx, str.NtQuerySystemInformation
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
test rax, rax
je 0x1004351ae
xor r9d, r9d
mov r8d, 0x440
lea rdx, [rbp - 0x40]
mov ecx, 0x1388
call qword [case.0x10044bd0b.0]
cmp eax, 0xc0000003
je 0x1004351ae
mov dword [0x1004a9180], r13d
lea rax, [rbp + 0x200]
mov qword [rsp + 0x30], rax
lea rax, [rbp + 0x100]
mov qword [rsp + 0x28], rax
lea rax, [rbp]
mov qword [rsp + 0x20], rax
lea r9, [rbp - 0x40]
lea r8, str._s__s___s___s_
mov edx, 0x100
lea rcx, [0x1004a9700]
call fcn.10040b460
jmp 0x1004351ba
mov dword [0x1004a9180], r15d
call fcn.10043b910
cmp dword [0x1004a9180], r14d
je 0x100435218
lea rcx, str._var_opt_mssql_
call qword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0x10
jne 0x100435218
lea rcx, str._var_opt_mssql_log_
call qword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
je 0x1004351ec
cmp eax, 0x10
jne 0x100435218
lea rdx, str.wc_ccsUTF_8
lea rcx, str._var_opt_mssql_log_sqlagentstartup.log
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll__wfopen]
mov qword [0x1004a9370], rax
jmp 0x100435218
mov dword [0x1004a9180], r15d
mov word [0x1004a9700], r15w
mov r9d, 0x200
lea r8, [rbp + 0x620]
mov edx, 0x12
mov rcx, qword [0x1004a90d8]
call qword [sym.imp.USER32.dll_LoadStringW]
lea r8, [0x1004793e8]
mov rdx, r12
lea rcx, [rbp + 0x620]
call fcn.10043bdc0
lea rcx, [0x1004a9338]
call qword [sym.imp.KERNEL32.dll_InitializeCriticalSection]
lea rcx, [0x1004a9048]
call qword [sym.imp.KERNEL32.dll_InitializeCriticalSection]
lea rcx, [0x1004a9278]
call qword [sym.imp.KERNEL32.dll_InitializeCriticalSection]
lea rcx, [0x1004a9188]
call qword [sym.imp.KERNEL32.dll_InitializeCriticalSection]
lea rcx, [0x1004a92b8]
call qword [sym.imp.KERNEL32.dll_InitializeCriticalSection]
lea rcx, [0x1004a8f18]
call qword [sym.imp.KERNEL32.dll_InitializeCriticalSection]
lea rcx, [0x1004a8ef0]
call qword [sym.imp.KERNEL32.dll_InitializeCriticalSection]
lea rcx, [0x1004a9c58]
call qword [sym.imp.KERNEL32.dll_InitializeCriticalSection]
lea rcx, [0x1004a9c30]
call qword [sym.imp.KERNEL32.dll_InitializeCriticalSection]
lea rcx, [0x1004a9310]
call qword [sym.imp.KERNEL32.dll_InitializeCriticalSection]
lea rcx, [0x1004a9c08]
call qword [sym.imp.KERNEL32.dll_InitializeCriticalSection]
lea rcx, [0x1004a9b88]
call qword [sym.imp.KERNEL32.dll_InitializeCriticalSection]
lea rcx, [0x1004a9b08]
call qword [sym.imp.KERNEL32.dll_InitializeCriticalSection]
lea rcx, [0x1004a8d88]
call qword [sym.imp.KERNEL32.dll_InitializeCriticalSection]
mov edx, r13d
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_SetConsoleCtrlHandler]
lea rcx, [rbp - 0x78]
call qword [sym.imp.KERNEL32.dll_GetSystemInfo]
mov eax, dword [rbp - 0x58]
mov dword [0x1004a9df8], eax
lea rax, [rbp + 0xa20]
mov qword [rsp + 0x20], rax
lea r9, [rbp + 0x410]
mov rdx, rbx
mov ecx, esi
call fcn.100436430
mov ebx, 4
test eax, eax
je 0x100435a0c
cmp dword [0x1004a9180], r14d
je 0x1004354f9
cmp dword [0x1004a9184], r14d
jne 0x1004354f9
mov qword [rsp + 0x58], r15
mov dword [rsp + 0x54], r15d
mov dword [rsp + 0x50], reloc.OLEAUT32.dll_VariantTimeToDosDateTime
xor bl, bl
cmp dword [0x1004add50], r14d
jne 0x1004353b4
cmp dword [0x1004adcdc], r14d
jne 0x1004353b4
lea rax, [rsp + 0x58]
mov qword [rsp + 0x20], rax
mov r9d, 0x20019
xor r8d, r8d
lea rdx, str.SOFTWAREMicrosoftMicrosoft_SQL_ServerMSSQLSQLServerAgent
mov rcx, 0xffffffff80000002
call qword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
jmp 0x1004353cc
lea r8, [rsp + 0x58]
lea rdx, str.SOFTWAREMicrosoftMicrosoft_SQL_ServerMSSQLSQLServerAgent
mov rcx, 0xffffffff80000002
call fcn.100454a30
test eax, eax
jne 0x1004354c2
lea rax, [rsp + 0x50]
mov qword [rsp + 0x28], rax
lea rax, [rbp + 0x400]
mov qword [rsp + 0x20], rax
lea r9, [rsp + 0x54]
xor r8d, r8d
lea rdx, str.Enabled
mov rcx, qword [rsp + 0x58]
call fcn.100454d90
test eax, eax
jne 0x1004354b4
mov eax, dword [rsp + 0x54]
cmp eax, 4
jne 0x100435423
cmp dword [rbp + 0x400], r14d
setne bl
jmp 0x1004354b4
cmp eax, r13d
jne 0x1004354b4
mov word [rbp + 0x40a], r15w
mov edx, 6
lea rcx, [rbp + 0x400]
call qword [sym.imp.api_ms_win_crt_string_l1_1_0.dll__wcsupr_s]
mov rcx, r15
lea rdx, [rbp + 0x400]
lea r8, str.TRUE
nop word [rax + rax]
movzx eax, word [rdx + rcx*2]
inc rcx
cmp ax, word [r8 + rcx*2 - 2]
jne 0x10043547b
cmp rcx, 5
jne 0x100435460
movzx ebx, r13b
jmp 0x1004354b4
movzx ecx, word [rbp + 0x400]
call qword [sym.imp.api_ms_win_crt_string_l1_1_0.dll_isdigit]
test eax, eax
je 0x1004354b2
movzx eax, word [rbp + 0x400]
cmp ax, word [0x100476f14]
jne 0x1004354ac
movzx eax, word [rbp + 0x402]
cmp ax, word [0x100476f16]
je 0x1004354b2
movzx ebx, r13b
jmp 0x1004354b4
xor bl, bl
mov rcx, qword [rsp + 0x58]
call fcn.100454920
test bl, bl
jne 0x1004354f9
mov edx, 0x1fa
lea r8, [rbp + 0x620]
mov r9d, 0x200
mov rcx, qword [0x1004a90d8]
call qword [sym.imp.USER32.dll_LoadStringW]
lea rdx, [rbp + 0x620]
lea rcx, [0x1004725a8]
call fcn.10043bdc0
jmp 0x100435a07
mov edx, r13d
lea rbx, [0x1004a9378]
mov rcx, rbx
call qword [sym.imp.ADVAPI32.dll_InitializeSecurityDescriptor]
test eax, eax
je 0x100435a07
xor r9d, r9d
xor r8d, r8d
mov edx, r13d
mov rcx, rbx
call qword [sym.imp.ADVAPI32.dll_SetSecurityDescriptorDacl]
test eax, eax
je 0x100435a07
mov dword [0x1004a9660], 0x18
mov qword [0x1004a9668], rbx
mov dword [0x1004a9670], r15d
lea rax, [0x1004a9660]
mov qword [0x1004a9678], rax
call qword [sym.imp.SQLSVC.dll_SQLSvcInit]
test eax, eax
je 0x100435a07
lea rcx, [0x1004a9680]
call qword [sym.imp.KERNEL32.dll_InitializeCriticalSection]
mov dword [0x1004a96ec], r15d
mov dword [0x1004a96e8], r15d
mov dword [0x1004a965c], r13d
mov edx, 0x50
lea r8d, [rdx + 0x78]
lea rcx, [0x1004a96a8]
call qword [sym.imp.SQLSVC.dll_SHRecMemInit]
mov qword [0x1004a96d8], r15
cmp dword [0x1004a965c], 2
jne 0x1004355b4
mov edx, 0x78
jmp 0x1004354c7
cmp dword [0x1004a9184], r14d
je 0x100435776
cmp dword [0x1004a9180], r14d
jne 0x1004355ea
call fcn.100434450
test eax, eax
jns 0x100435776
mov edx, eax
lea rcx, str.Init_fabric_failed_with_error__x_n
call fcn.100434360
jmp 0x100435a07
or dword [0x1004a916c], 0x400
mov r8d, 0x84
lea rdx, str.MSSQLSERVER
lea rcx, str.SQLSERVR_INSTNAME
call qword [sym.imp.KERNEL32.dll_GetEnvironmentVariableW]
mov r8d, 0x84
lea rdx, [0x1004a9cf0]
lea rcx, str.Fabric_NodeName
call qword [sym.imp.KERNEL32.dll_GetEnvironmentVariableW]
xor edx, edx
mov r8d, 0x208
lea rcx, [rbp + 0xa20]
call sub.VCRUNTIME140.dll_memset
lea r9, str.MSSQLSERVER
lea r8, str.np:.pipeSQLLocal_s
mov edx, 0x104
lea rcx, [rbp + 0xa20]
call fcn.10040b460
mov ebx, eax
test eax, eax
js 0x10043568e
lea rdx, [rbp + 0xa20]
lea rcx, str.SQLSERVR_NAMED_PIPE
call qword [sym.imp.KERNEL32.dll_SetEnvironmentVariableW]
test eax, eax
jne 0x1004356a9
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov ebx, eax
test eax, eax
jle 0x10043568e
movzx ebx, ax
or ebx, 0x80070000
test ebx, ebx
jns 0x100435776
mov edx, ebx
lea rcx, str.Init_of_SqlPal_environment_failed_with__x_n
call fcn.10043bdc0
jmp 0x100435a07
lea rdx, [rbp + 0xa20]
lea rcx, str.SQLSERVR_HOST
call qword [sym.imp.KERNEL32.dll_SetEnvironmentVariableW]
test eax, eax
je 0x100435679
xor edx, edx
mov r8d, 0x208
lea rcx, [rbp + 0x410]
call sub.VCRUNTIME140.dll_memset
mov r8d, 0x104
lea rdx, [rbp + 0x410]
lea rcx, str.Fabric_Folder_App_Log
call qword [sym.imp.KERNEL32.dll_GetEnvironmentVariableW]
lea rdx, [rbp + 0x410]
lea rcx, str.SQLAGENT_LOGDIR
call qword [sym.imp.KERNEL32.dll_SetEnvironmentVariableW]
test eax, eax
je 0x100435679
lea rdx, [rbp + 0x410]
lea rcx, str.Log_directory_name:__s_n
call fcn.10043bdc0
lea rcx, [rbp + 0x410]
call qword [sym.imp.XESQLAGENT.dll_InitXESqlAgent]
mov ebx, eax
test eax, eax
jns 0x100435744
mov edx, eax
lea rcx, str.Initialization_of_XE_package_failed_with_error__x_n
call fcn.10043bdc0
jmp 0x10043568e
call qword [sym.imp.XESQLAGENT.dll_CreateXESessions]
test al, al
jne 0x10043568e
lea rcx, str.XE_session_failed_to_load_n
call fcn.10043bdc0
mov ebx, 0x80004005
mov edx, ebx
lea rcx, str.Init_of_SqlPal_environment_failed_with__x_n
call fcn.10043bdc0
jmp 0x100435a07
cmp byte [0x10049b9aa], r14b
je 0x100435794
call fcn.100464220
test eax, eax
je 0x100435794
mov ecx, eax
call fcn.100463790
jmp 0x100435a07
mov r8d, 0x104
lea r12, [0x1004a9e00]
mov rdx, r12
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
mov word [0x1004aa006], r15w
mov rbx, r15
mov edx, 0x5c
mov rcx, r12
call qword [sym.imp.VCRUNTIME140.dll_wcschr]
test rax, rax
jne 0x1004357e5
lea edx, [rax + 0x3a]
mov rcx, r12
call qword [sym.imp.VCRUNTIME140.dll_wcschr]
test rax, rax
jne 0x1004357e5
mov word [0x1004a9e00], r15w
jmp 0x10043582a
mov rcx, r12
mov rax, 0xffffffffffffffff
nop
inc rax
cmp word [r12 + rax*2], bx
jne 0x1004357f0
cdqe
lea rdx, [r12 + rax*2]
cmp r12, rdx
jae 0x10043582a
movzx eax, word [rcx]
cmp ax, 0x5c
je 0x100435814
cmp ax, 0x3a
jne 0x100435817
mov rbx, rcx
add rcx, 2
cmp rcx, rdx
jb 0x100435805
test rbx, rbx
je 0x10043582a
mov word [rbx + 2], r15w
cmp dword [0x1004a9184], r14d
je 0x100435884
mov rdx, r12
lea rcx, str.SQLAGENT_ROOT
call qword [sym.imp.KERNEL32.dll_SetEnvironmentVariableW]
test eax, eax
je 0x100435a00
mov rdx, r12
lea rcx, str.SQLSERVR_ROOT
call qword [sym.imp.KERNEL32.dll_SetEnvironmentVariableW]
test eax, eax
je 0x100435a00
mov rdx, r12
lea rcx, str.PSModulePath
call qword [sym.imp.KERNEL32.dll_SetEnvironmentVariableW]
test eax, eax
je 0x100435a00
cmp dword [0x1004a9184], r14d
jne 0x100435896
test byte [0x1004a916c], 0x20
je 0x10043589f
cmp dword [0x1004a8ebc], r14d
jne 0x10043589f
mov dword [0x1004a8eb8], r15d
jmp 0x1004358a6
mov dword [0x1004a8eb8], r13d
call fcn.100434250
test al, al
je 0x100435a00
test byte [0x1004a916c], r13b
jne 0x1004358c2
call qword [sym.imp.KERNEL32.dll_AllocConsole]
xor edx, edx
mov ecx, 0x3ff
call qword [sym.imp.KERNEL32.dll_SetProcessShutdownParameters]
mov edx, 0x12e8
mov r8d, 0xa
lea rcx, [0x1004a8ec0]
call qword [sym.imp.SQLSVC.dll_SHRecMemInit]
mov edx, 0x148
mov r8d, 0xa
lea rcx, [0x1004a91e0]
call qword [sym.imp.SQLSVC.dll_SHRecMemInit]
mov edx, 0x28
lea r8d, [rdx - 0x1e]
lea rcx, [0x1004a91b0]
call qword [sym.imp.SQLSVC.dll_SHRecMemInit]
mov edx, 0x1450
mov r8d, 0xa
lea rcx, [0x1004a90a0]
call qword [sym.imp.SQLSVC.dll_SHRecMemInit]
mov edx, 0x590
mov r8d, 8
lea rcx, [0x1004a9cc0]
call qword [sym.imp.SQLSVC.dll_SHRecMemInit]
mov edx, 0x20
lea r8d, [rdx - 0x16]
lea rcx, [0x1004a9210]
call qword [sym.imp.SQLSVC.dll_SHRecMemInit]
mov edx, 0x40
lea r8d, [rdx - 0x36]
lea rcx, [0x1004a92e0]
call qword [sym.imp.SQLSVC.dll_SHRecMemInit]
mov edx, 0x30
lea r8d, [rdx - 0x2b]
lea rcx, [0x1004a9c90]
call qword [sym.imp.SQLSVC.dll_SHRecMemInit]
mov edx, 0x104
mov r8d, 0xa
lea rcx, [0x1004a9248]
call qword [sym.imp.SQLSVC.dll_SHRecMemInit]
mov edx, 0xce0
mov r8d, 0xa
lea rcx, [0x1004a9070]
call qword [sym.imp.SQLSVC.dll_SHRecMemInit]
xor edx, edx
mov r8d, 0x200
lea rcx, [rbp + 0xc30]
call sub.VCRUNTIME140.dll_memset
lea rcx, [rbp + 0xc30]
call fcn.10042f1c0
mov ecx, dword [0x1004a9184]
test eax, eax
jne 0x100435cee
test ecx, ecx
jne 0x100435cee
lea rdx, [rbp + 0xc30]
lea rcx, [0x100479508]
call fcn.10043bdc0
lea r12, str.SQLServerAgent
mov ebx, 4
lea rcx, str.SQLAgent_is_exiting_n
call fcn.10043bdc0
mov rcx, qword [0x100499288]
cmp rcx, 0xffffffffffffffff
je 0x100435a36
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov qword [0x100499288], 0xffffffffffffffff
test r14d, r14d
jne 0x100435a40
call fcn.100436080
call qword [sym.imp.SQLSVC.dll_SQLSvcExit]
mov r9d, 0x200
lea r8, [rbp + 0x620]
mov edx, 0xf2
mov rcx, qword [0x1004a90d8]
call qword [sym.imp.USER32.dll_LoadStringW]
lea rax, [rbp + 0x620]
mov qword [rsp + 0x20], rax
mov r9, r12
xor edx, edx
lea r8d, [rdx + 0x62]
mov ecx, ebx
call fcn.100432180
mov rcx, qword [0x1004a9368]
test rcx, rcx
je 0x100435a9a
call qword [sym.imp.ADVAPI32.dll_DeregisterEventSource]
mov qword [0x1004a9368], r15
mov rcx, qword [0x1004a92a0]
test rcx, rcx
je 0x100435ab3
call qword [sym.imp.KERNEL32.dll_FreeLibrary]
mov qword [0x1004a92a0], r15
mov rcx, qword [0x1004a9360]
test rcx, rcx
je 0x100435acc
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fclose]
mov qword [0x1004a9360], r15
lea rcx, [0x1004a9338]
call qword [sym.imp.KERNEL32.dll_DeleteCriticalSection]
mov rbx, qword [0x1004a96d8]
lea rcx, [0x1004a9680]
call qword [sym.imp.KERNEL32.dll_DeleteCriticalSection]
lea rcx, [0x1004a96a8]
call qword [sym.imp.SQLSVC.dll_SHRecMemFree]
cmp dword [0x1004a965c], 2
jne 0x100435b11
test rbx, rbx
je 0x100435b11
mov rcx, rbx
call qword [sym.imp.SQLSVC.dll_SHMemCleanUp]
lea rcx, [0x1004a9048]
call qword [sym.imp.KERNEL32.dll_DeleteCriticalSection]
lea rcx, [0x1004a9278]
call qword [sym.imp.KERNEL32.dll_DeleteCriticalSection]
lea rcx, [0x1004a9188]
call qword [sym.imp.KERNEL32.dll_DeleteCriticalSection]
lea rcx, [0x1004a92b8]
call qword [sym.imp.KERNEL32.dll_DeleteCriticalSection]
lea rcx, [0x1004a8f18]
call qword [sym.imp.KERNEL32.dll_DeleteCriticalSection]
lea rcx, [0x1004a8ef0]
call qword [sym.imp.KERNEL32.dll_DeleteCriticalSection]
lea rcx, [0x1004a9c58]
call qword [sym.imp.KERNEL32.dll_DeleteCriticalSection]
lea rcx, [0x1004a9c30]
call qword [sym.imp.KERNEL32.dll_DeleteCriticalSection]
lea rcx, [0x1004a9310]
call qword [sym.imp.KERNEL32.dll_DeleteCriticalSection]
lea rcx, [0x1004a9c08]
call qword [sym.imp.KERNEL32.dll_DeleteCriticalSection]
lea rcx, [0x1004a9b08]
call qword [sym.imp.KERNEL32.dll_DeleteCriticalSection]
lea rcx, [0x1004a8d88]
call qword [sym.imp.KERNEL32.dll_DeleteCriticalSection]
call fcn.1004342d0
movzx ebx, al
lea rcx, [0x1004a9b88]
mov rax, qword [0x1004a90d0]
call qword [case.0x10044bd0b.0]
test eax, eax
jne 0x100435bfa
cmp dword [0x1004a8ebc], r15d
je 0x100435bed
test bl, bl
je 0x100435bed
lea rdx, str.wmain
lea rcx, str.__s_____Waiting_for_CritSec__n
call fcn.10043bdc0
lea rcx, [0x1004a9b88]
call qword [sym.imp.KERNEL32.dll_EnterCriticalSection]
cmp dword [0x1004a8ebc], r15d
je 0x100435c1a
test bl, bl
je 0x100435c1a
lea rdx, str.wmain
lea rcx, str.__s_____Enters_CritSec__n
call fcn.10043bdc0
call fcn.1004342d0
movzx ebx, al
lea rcx, [0x1004a9b88]
call qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
cmp dword [0x1004a8ebc], r15d
je 0x100435c4f
test bl, bl
je 0x100435c4f
lea rdx, str.wmain
lea rcx, str.__s_____Leaves_CritSec__n
call fcn.10043bdc0
lea rcx, [0x1004a9b88]
call qword [sym.imp.KERNEL32.dll_DeleteCriticalSection]
mov rcx, qword [0x1004a90d8]
call qword [sym.imp.SqlResourceLoader.dll_FreeResourceLibrary]
test rdi, rdi
je 0x100435c77
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_FreeLibrary]
call fcn.10044da70
mov r8, rax
mov byte [rax + 0xa8], r15b
mov qword [0x1004aa048], r15
mov rcx, qword [rax]
mov rax, qword [rcx + 8]
mov edx, r13d
mov rcx, r8
call qword [case.0x10044bd0b.0]
mov rax, qword [0x10049bbd8]
test rax, rax
jne 0x100435f18
lea ecx, [rax + 0x38]
call fcn.100469314
mov qword [rsp + 0x58], rax
test rax, rax
je 0x100435f0e
lea rcx, vtable.MPTSqlDumperWrapper.0
mov qword [rax], rcx
mov dword [rax + 8], r15d
mov qword [rax + 0x10], r15
mov qword [rax + 0x28], r15
mov qword [rax + 0x30], 7
mov word [rax + 0x18], r15w
jmp 0x100435f11
cmp dword [0x1004a9180], r14d
je 0x100435d4f
test ecx, ecx
jne 0x100435d4f
lea rax, [0x100499288]
mov qword [rsp + 0x28], rax
mov dword [rsp + 0x20], r15d
lea r9d, [rcx + 5]
xor r8d, r8d
lea rdx, str.NT_AUTHORITY
lea rcx, str.NetworkService
call qword [sym.imp.ADVAPI32.dll_LogonUserW]
test eax, eax
jne 0x100435d4f
mov qword [0x100499288], 0xffffffffffffffff
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, eax
lea rcx, str.LoginUser_failed__error__d_n
call fcn.10043bdc0
jmp 0x100435a00
call fcn.1004614a0
mov rcx, rax
call fcn.100461880
test byte [0x1004a916c], r13b
jne 0x100435e7c
call fcn.10044da70
cmp byte [rax + 0xc8], r14b
jne 0x100435da3
mov dword [rsp + 0x50], 0x84
lea r9, [rsp + 0x50]
lea rbx, [0x1004a8c80]
mov r8, rbx
mov edx, r13d
lea rcx, str.MSSQLSERVER
call qword [sym.imp.instapi150.dll_GetSQLServiceByName]
mov qword [rsp + 0x60], rbx
lea rcx, [rsp + 0x60]
call qword [sym.imp.ADVAPI32.dll_StartServiceCtrlDispatcherW]
mov ebx, eax
mov rcx, qword [0x1004a90e0]
test rcx, rcx
je 0x100435dc2
call qword [sym.imp.KERNEL32.dll_SetEvent]
xor r9d, r9d
mov eax, 4
mov r8d, 0x40000066
movzx edx, ax
mov ecx, r13d
call fcn.100431c20
test ebx, ebx
je 0x100435dee
mov r14d, r13d
mov dword [0x100499398], r15d
jmp 0x100435a00
mov r9d, 0x200
lea r8, [rbp + 0x620]
mov rcx, qword [0x1004a90d8]
cmp esi, r13d
jne 0x100435e2d
mov edx, SQLFreeStmt
call qword [sym.imp.USER32.dll_LoadStringW]
lea r12, str.SQLServerAgent
mov rdx, r12
lea rcx, [rbp + 0x620]
call fcn.10043bdc0
jmp 0x100435a07
mov edx, reloc.ODBC32.dll_SQLFreeStmt
call qword [sym.imp.USER32.dll_LoadStringW]
call qword [sym.imp.KERNEL32.dll_GetLastError]
movzx edx, ax
lea rcx, [rbp + 0x620]
call fcn.10043bdc0
call qword [sym.imp.KERNEL32.dll_GetLastError]
movzx ecx, ax
mov dword [rsp + 0x28], ecx
mov dword [rsp + 0x20], r13d
mov r9d, 2
mov r8d, 0xc0000064
movzx edx, r13w
mov ecx, r13d
call fcn.100431c20
jmp 0x100435a00
call fcn.100436900
lea r12, str.SQLServerAgent
mov ebx, 4
test eax, eax
je 0x100435a0c
mov r9, r12
xor edx, edx
lea r8d, [rbx + 0x5a]
mov ecx, ebx
call fcn.100432180
xor edx, edx
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_SetConsoleCtrlHandler]
mov edx, r13d
lea rcx, [0x100439600]
call qword [sym.imp.KERNEL32.dll_SetConsoleCtrlHandler]
call fcn.100434b60
test eax, eax
je 0x100435a0c
call fcn.100437240
test eax, eax
je 0x100435a0c
call fcn.100438c00
test eax, eax
je 0x100435a0c
mov edx, 0xffffffff
mov rcx, qword [0x1004a90e0]
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
call fcn.10041e120
mov dword [0x100499398], r15d
call fcn.100435fc0
jmp 0x100435a0c
mov rax, r15
mov qword [0x10049bbd8], rax
mov rbx, rax
mov rcx, qword [rax + 0x10]
test rcx, rcx
je 0x100435f3c
mov rax, qword [rcx]
mov rax, qword [rax + 0x10]
call qword [case.0x10044bd0b.0]
mov qword [rbx + 0x10], r15
mov rax, qword [0x10049bbd8]
mov dword [rbx + 8], r15d
test rax, rax
je 0x100435f5e
mov qword [0x10049bbd8], r15
mov rax, qword [rbx]
mov edx, r13d
mov rcx, rbx
mov rax, qword [rax]
call qword [case.0x10044bd0b.0]
cmp dword [0x1004a9184], 0
je 0x100435f6d
call qword [sym.imp.XESQLAGENT.dll_CloseXESqlAgent]
mov rcx, qword [0x1004a9370]
test rcx, rcx
je 0x100435f7f
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fclose]
mov eax, dword [0x100499398]
mov rcx, qword [rbp + 0xe30]
xor rcx, rsp
call fcn.100469360
lea r11, [rsp + 0xf40]
mov rbx, qword [r11 + 0x30]
mov rsi, qword [r11 + 0x40]
mov rdi, qword [r11 + 0x48]
mov rsp, r11
pop r15
pop r14
pop r13
pop r12
pop rbp
ret