Function at 0x10040e540
Capabilities:
Query environment variable
Set environment variable

Disassembly:
sub rsp, 0x318
mov rax, qword [0x100422010]
xor rax, rsp
mov qword [rsp + 0x300], rax
mov qword [rsp + 0x70], 0
mov dword [rsp + 0x30], 0x104
mov dword [rsp + 0x40], 0
mov eax, dword [rsp + 0x30]
shl rax, 1
mov dword [rsp + 0x78], eax
mov qword [rsp + 0x38], 0
mov qword [rsp + 0x50], 0
mov qword [rsp + 0xa0], 0
mov qword [rsp + 0x88], 0
mov dword [rsp + 0x48], 0
mov dword [rsp + 0x58], 0
mov dword [rsp + 0x90], 0x409
lea rax, [rsp + 0x70]
mov qword [rsp + 0x20], rax
mov r9d, 0x20019
xor r8d, r8d
lea rdx, str.SoftwareMicrosoftMicrosoft_SQL_Server150
mov rcx, 0xffffffff80000002
call fcn.100410700
mov dword [rsp + 0x64], eax
cmp dword [rsp + 0x64], 0
je 0x10040e5f8
jmp 0x10040ec16
lea rax, [rsp + 0x78]
mov qword [rsp + 0x28], rax
lea rax, [rsp + 0xf0]
mov qword [rsp + 0x20], rax
xor r9d, r9d
xor r8d, r8d
lea rdx, str.SharedCode
mov rcx, qword [rsp + 0x70]
call fcn.100410780
mov dword [rsp + 0x64], eax
cmp dword [rsp + 0x64], 0
je 0x10040e636
jmp 0x10040ec16
mov eax, dword [rsp + 0x78]
xor edx, edx
mov ecx, 2
div rcx
mov dword [rsp + 0x30], eax
lea rcx, str.kernel32.dll
call qword [sym.imp.KERNEL32.dll_GetModuleHandleW]
lea rdx, str.SetDllDirectoryW
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov qword [rsp + 0xa0], rax
lea rcx, str.kernel32.dll
call qword [sym.imp.KERNEL32.dll_GetModuleHandleW]
lea rdx, str.GetDllDirectoryW
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov qword [rsp + 0x88], rax
cmp qword [rsp + 0xa0], 0
je 0x10040e6a8
cmp qword [rsp + 0x88], 0
jne 0x10040e6b5
mov dword [rsp + 0x58], 1
jmp 0x10040e8be
mov rax, qword [rsp + 0x88]
mov qword [rsp + 0xb0], rax
xor edx, edx
xor ecx, ecx
mov rax, qword [rsp + 0xb0]
call qword [0x100414618]
mov dword [rsp + 0x40], eax
mov eax, dword [rsp + 0x40]
mov dword [rsp + 0x30], eax
lea rcx, [rsp + 0xf0]
call qword [sym.imp.KERNEL32.dll_lstrlenW]
mov ecx, dword [rsp + 0x30]
lea eax, [rcx + rax + 2]
mov dword [rsp + 0x30], eax
cmp qword [rsp + 0x38], 0
je 0x10040e78b
mov qword [rsp + 0x98], 0
mov eax, dword [rsp + 0x30]
shl rax, 1
mov qword [rsp + 0xb8], rax
call qword [sym.imp.KERNEL32.dll_GetProcessHeap]
mov rcx, qword [rsp + 0xb8]
mov r9, rcx
mov r8, qword [rsp + 0x38]
mov edx, 8
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_HeapReAlloc]
mov qword [rsp + 0x98], rax
cmp qword [rsp + 0x98], 0
jne 0x10040e77c
call qword [sym.imp.KERNEL32.dll_GetProcessHeap]
mov r8, qword [rsp + 0x38]
xor edx, edx
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_HeapFree]
mov qword [rsp + 0x38], 0
jmp 0x10040e789
mov rax, qword [rsp + 0x98]
mov qword [rsp + 0x38], rax
jmp 0x10040e7be
mov eax, dword [rsp + 0x30]
shl rax, 1
mov qword [rsp + 0xc0], rax
call qword [sym.imp.KERNEL32.dll_GetProcessHeap]
mov rcx, qword [rsp + 0xc0]
mov r8, rcx
mov edx, 8
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_HeapAlloc]
mov qword [rsp + 0x38], rax
cmp qword [rsp + 0x38], 0
je 0x10040e7f1
mov rax, qword [rsp + 0x88]
mov qword [rsp + 0xc8], rax
mov rdx, qword [rsp + 0x38]
mov ecx, dword [rsp + 0x30]
mov rax, qword [rsp + 0xc8]
call qword [0x100414618]
mov dword [rsp + 0x40], eax
cmp qword [rsp + 0x38], 0
je 0x10040e807
mov eax, dword [rsp + 0x30]
cmp dword [rsp + 0x40], eax
jae 0x10040e6b5
cmp qword [rsp + 0x38], 0
je 0x10040e81b
mov rax, qword [rsp + 0x38]
movzx eax, word [rax]
test eax, eax
jne 0x10040e856
mov rax, qword [rsp + 0xa0]
mov qword [rsp + 0xd0], rax
lea rcx, [rsp + 0xf0]
mov rax, qword [rsp + 0xd0]
call qword [0x100414618]
mov dword [rsp + 0x48], eax
cmp dword [rsp + 0x48], 0
jne 0x10040e854
mov dword [rsp + 0x58], 1
jmp 0x10040e8be
mov dword [rsp + 0x28], 0xffffffff
lea rax, [rsp + 0xf0]
mov qword [rsp + 0x20], rax
mov r9d, 0xffffffff
mov r8, qword [rsp + 0x38]
mov edx, 1
mov ecx, dword [rsp + 0x90]
call qword [sym.imp.KERNEL32.dll_CompareStringW]
cmp eax, 2
je 0x10040e8b6
mov dword [rsp + 0x58], 1
call qword [sym.imp.KERNEL32.dll_GetProcessHeap]
mov r8, qword [rsp + 0x38]
xor edx, edx
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_HeapFree]
mov qword [rsp + 0x38], 0
jmp 0x10040e8be
mov dword [rsp + 0x48], 1
cmp dword [rsp + 0x58], 0
je 0x10040ec16
xor r8d, r8d
xor edx, edx
lea rcx, str.Path
call qword [sym.imp.KERNEL32.dll_GetEnvironmentVariableW]
mov dword [rsp + 0x40], eax
mov eax, dword [rsp + 0x40]
mov dword [rsp + 0x30], eax
cmp dword [rsp + 0x30], 0
jne 0x10040e90c
lea rdx, [rsp + 0xf0]
lea rcx, str.Path
call qword [sym.imp.KERNEL32.dll_SetEnvironmentVariableW]
mov dword [rsp + 0x48], eax
jmp 0x10040ec16
mov dword [rsp + 0x60], 0
mov qword [rsp + 0x80], 0
mov dword [rsp + 0x5c], 0
lea rcx, [rsp + 0xf0]
call qword [sym.imp.KERNEL32.dll_lstrlenW]
inc eax
mov dword [rsp + 0x6c], eax
mov eax, dword [rsp + 0x40]
mov dword [rsp + 0x30], eax
lea rcx, [rsp + 0xf0]
call qword [sym.imp.KERNEL32.dll_lstrlenW]
mov ecx, dword [rsp + 0x30]
lea eax, [rcx + rax + 2]
mov dword [rsp + 0x30], eax
cmp qword [rsp + 0x38], 0
je 0x10040e9ec
mov qword [rsp + 0xa8], 0
mov eax, dword [rsp + 0x30]
shl rax, 1
mov qword [rsp + 0xd8], rax
call qword [sym.imp.KERNEL32.dll_GetProcessHeap]
mov rcx, qword [rsp + 0xd8]
mov r9, rcx
mov r8, qword [rsp + 0x38]
mov edx, 8
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_HeapReAlloc]
mov qword [rsp + 0xa8], rax
cmp qword [rsp + 0xa8], 0
jne 0x10040e9dd
call qword [sym.imp.KERNEL32.dll_GetProcessHeap]
mov r8, qword [rsp + 0x38]
xor edx, edx
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_HeapFree]
mov qword [rsp + 0x38], 0
jmp 0x10040e9ea
mov rax, qword [rsp + 0xa8]
mov qword [rsp + 0x38], rax
jmp 0x10040ea1f
mov eax, dword [rsp + 0x30]
shl rax, 1
mov qword [rsp + 0xe0], rax
call qword [sym.imp.KERNEL32.dll_GetProcessHeap]
mov rcx, qword [rsp + 0xe0]
mov r8, rcx
mov edx, 8
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_HeapAlloc]
mov qword [rsp + 0x38], rax
cmp qword [rsp + 0x38], 0
je 0x10040ea42
mov r8d, dword [rsp + 0x30]
mov rdx, qword [rsp + 0x38]
lea rcx, str.Path
call qword [sym.imp.KERNEL32.dll_GetEnvironmentVariableW]
mov dword [rsp + 0x40], eax
cmp qword [rsp + 0x38], 0
je 0x10040ea58
mov eax, dword [rsp + 0x30]
cmp dword [rsp + 0x40], eax
jae 0x10040e93c
mov rax, qword [rsp + 0x38]
mov qword [rsp + 0x80], rax
mov eax, dword [rsp + 0x40]
inc eax
mov dword [rsp + 0x5c], eax
cmp qword [rsp + 0x80], 0
je 0x10040eb65
cmp dword [rsp + 0x60], 0
jne 0x10040eb65
mov eax, dword [rsp + 0x6c]
cmp dword [rsp + 0x5c], eax
jb 0x10040eb65
mov dword [rsp + 0x4c], 0
mov dword [rsp + 0x68], 0
xor eax, eax
mov word [rsp + 0x44], ax
mov eax, dword [rsp + 0x4c]
mov rcx, qword [rsp + 0x80]
movzx eax, word [rcx + rax*2]
mov word [rsp + 0x44], ax
movzx eax, word [rsp + 0x44]
mov ecx, dword [rsp + 0x4c]
movzx ecx, word [rsp + rcx*2 + 0xf0]
cmp eax, ecx
jne 0x10040eae2
mov dword [rsp + 0x7c], 1
jmp 0x10040eaea
mov dword [rsp + 0x7c], 0
mov eax, dword [rsp + 0x7c]
mov dword [rsp + 0x68], eax
cmp dword [rsp + 0x68], 0
je 0x10040eb13
mov eax, dword [rsp + 0x6c]
dec eax
cmp dword [rsp + 0x4c], eax
jne 0x10040eb07
jmp 0x10040eb13
mov eax, dword [rsp + 0x4c]
inc eax
mov dword [rsp + 0x4c], eax
jmp 0x10040eaae
cmp dword [rsp + 0x68], 0
je 0x10040eb24
mov dword [rsp + 0x60], 1
jmp 0x10040eb42
mov eax, dword [rsp + 0x6c]
dec eax
cmp dword [rsp + 0x4c], eax
jne 0x10040eb42
movzx eax, word [rsp + 0x44]
cmp eax, 0x3b
jne 0x10040eb42
mov dword [rsp + 0x60], 1
mov rax, qword [rsp + 0x80]
add rax, 2
mov qword [rsp + 0x80], rax
mov eax, dword [rsp + 0x5c]
dec eax
mov dword [rsp + 0x5c], eax
jmp 0x10040ea7e
cmp dword [rsp + 0x60], 0
je 0x10040eb79
mov dword [rsp + 0x48], 1
jmp 0x10040ec16
mov eax, dword [rsp + 0x30]
shl rax, 1
mov qword [rsp + 0xe8], rax
call qword [sym.imp.KERNEL32.dll_GetProcessHeap]
mov rcx, qword [rsp + 0xe8]
mov r8, rcx
mov edx, 8
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_HeapAlloc]
mov qword [rsp + 0x50], rax
cmp qword [rsp + 0x38], 0
je 0x10040ec16
cmp qword [rsp + 0x50], 0
je 0x10040ec16
mov eax, dword [rsp + 0x30]
lea r8, [rsp + 0xf0]
mov edx, eax
mov rcx, qword [rsp + 0x50]
call fcn.10040e1d0
mov eax, dword [rsp + 0x30]
lea r8, [0x10041c724]
mov edx, eax
mov rcx, qword [rsp + 0x50]
call fcn.10040e250
mov eax, dword [rsp + 0x30]
mov r8, qword [rsp + 0x38]
mov edx, eax
mov rcx, qword [rsp + 0x50]
call fcn.10040e250
mov rdx, qword [rsp + 0x50]
lea rcx, str.Path
call qword [sym.imp.KERNEL32.dll_SetEnvironmentVariableW]
mov dword [rsp + 0x48], eax
cmp qword [rsp + 0x38], 0
je 0x10040ec3d
call qword [sym.imp.KERNEL32.dll_GetProcessHeap]
mov r8, qword [rsp + 0x38]
xor edx, edx
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_HeapFree]
mov qword [rsp + 0x38], 0
cmp qword [rsp + 0x50], 0
je 0x10040ec64
call qword [sym.imp.KERNEL32.dll_GetProcessHeap]
mov r8, qword [rsp + 0x50]
xor edx, edx
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_HeapFree]
mov qword [rsp + 0x50], 0
cmp qword [rsp + 0x70], 0
je 0x10040ec76
mov rcx, qword [rsp + 0x70]
call fcn.1004101e0
mov eax, dword [rsp + 0x48]
mov rcx, qword [rsp + 0x300]
xor rcx, rsp
call fcn.1004119e0
add rsp, 0x318
ret