Function at 0x105a98a
Capabilities:
Create directory
Get common file path
Query environment variable

Disassembly:
mov eax, reloc.ADVAPI32.dll_AddAccessAllowedAce
call fcn.01077868
sub esp, 0xa64
mov eax, dword [0x10de03c]
push ebx
push esi
push edi
mov dword [ebp - 0x10], eax
call fcn.01026b3b
test eax, eax
mov edi, dword [sym.imp.KERNEL32.dll_CreateDirectoryW]
mov esi, 0x104
jne 0x105a9c6
call fcn.01026b4b
test eax, eax
je 0x105ae47
mov ebx, dword [sym.imp.msvcrt.dll_wcscpy]
and word [ebp - reloc.ADVAPI32.dll_RegDeleteValueW], 0
lea eax, [ebp - 0x21c]
push 0x1005db4
push eax
call ebx
pop ecx
pop ecx
lea eax, [ebp - 0xa4c]
push eax
xor eax, eax
push eax
push eax
push CloseServiceHandle
push eax
call dword [sym.imp.SHELL32.dll_SHGetFolderPathW]
test eax, eax
je 0x105aa1f
lea eax, [ebp - 0xa4c]
push 0x100c690
push eax
call ebx
pop ecx
pop ecx
push esi
lea eax, [ebp - 0xa4c]
push eax
push 0x100c670
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
mov ebx, dword [sym.imp.msvcrt.dll_wcslen]
lea eax, [ebp - 0x21c]
push eax
call ebx
mov ecx, esi
sub ecx, eax
push ecx
lea eax, [ebp - 0xa4c]
push eax
lea eax, [ebp - 0x21c]
push eax
call dword [sym.imp.msvcrt.dll_wcsncat]
add esp, 0x10
lea eax, [ebp - 0x634]
push eax
xor eax, eax
push eax
push eax
push reloc.KERNEL32.dll_GetLocaleInfoW
push eax
call dword [sym.imp.SHELL32.dll_SHGetFolderPathW]
test eax, eax
je 0x105aa89
lea eax, [ebp - 0x634]
push 0x1005360
push eax
call dword [sym.imp.msvcrt.dll_wcscpy]
pop ecx
pop ecx
push esi
lea eax, [ebp - 0x634]
push eax
push 0x100c670
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
call fcn.01098db3
call fcn.01098dc3
and dword [ebp - 0xa54], 0
lea eax, [ebp - 0xa70]
mov dword [ebp - 0xa58], eax
push 0
lea eax, [ebp - 0xa5c]
push eax
mov dword [ebp - 0xa5c], LoadLibraryW
call fcn.01059f3c
test eax, eax
jl 0x105ae47
lea eax, [ebp - 0x21c]
push eax
call ebx
mov ecx, esi
sub ecx, eax
push ecx
lea eax, [ebp - 0x21c]
push 0x100c658
push eax
call dword [sym.imp.msvcrt.dll_wcsncat]
add esp, 0x10
push 0
lea eax, [ebp - 0x21c]
push eax
call edi
test eax, eax
jne 0x105ab09
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0xb7
jne 0x105adab
lea eax, [ebp - 0x21c]
push eax
call ebx
mov ecx, esi
sub ecx, eax
push ecx
lea eax, [ebp - 0x21c]
push 0x100c640
push eax
call dword [sym.imp.msvcrt.dll_wcsncat]
add esp, 0x10
push 0
lea eax, [ebp - 0x21c]
push eax
call edi
test eax, eax
jne 0x105ab4c
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0xb7
jne 0x105adab
lea eax, [ebp - 0x21c]
push eax
call ebx
mov ecx, esi
sub ecx, eax
push ecx
lea eax, [ebp - 0x21c]
push 0x100c62c
push eax
call dword [sym.imp.msvcrt.dll_wcsncat]
add esp, 0x10
lea eax, [ebp - 0xa5c]
push eax
lea eax, [ebp - 0x21c]
push eax
call edi
test eax, eax
jne 0x105abb2
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0xb7
jne 0x105adab
lea eax, [ebp - 0xa70]
push eax
push 4
lea eax, [ebp - 0x21c]
push eax
call dword [sym.imp.ADVAPI32.dll_SetFileSecurityW]
test eax, eax
je 0x105adab
lea eax, [ebp - 0x21c]
push eax
push 0x100c610
lea eax, [ebp - 0x428]
push esi
push eax
call dword [sym.imp.msvcrt.dll__snwprintf]
add esp, 0x10
lea eax, [ebp - 0xa5c]
push eax
lea eax, [ebp - 0x428]
push eax
call edi
test eax, eax
jne 0x105ac12
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0xb7
jne 0x105adab
lea eax, [ebp - 0xa70]
push eax
push 4
lea eax, [ebp - 0x428]
push eax
call dword [sym.imp.ADVAPI32.dll_SetFileSecurityW]
test eax, eax
je 0x105adab
lea eax, [ebp - 0x428]
push eax
call ebx
mov ecx, esi
sub ecx, eax
push ecx
lea eax, [ebp - 0x428]
push 0x1004204
push eax
call dword [sym.imp.msvcrt.dll_wcsncat]
add esp, 0x10
lea eax, [ebp - 0x420]
push eax
call fcn.01021576
lea eax, [ebp - 0x634]
push eax
call ebx
mov ecx, esi
sub ecx, eax
push ecx
lea eax, [ebp - 0x634]
push 0x100c658
push eax
call dword [sym.imp.msvcrt.dll_wcsncat]
add esp, 0x10
push 0
lea eax, [ebp - 0x634]
push eax
call edi
test eax, eax
jne 0x105ac84
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0xb7
jne 0x105adab
lea eax, [ebp - 0x634]
push eax
call ebx
mov ecx, esi
sub ecx, eax
push ecx
lea eax, [ebp - 0x634]
push 0x100c640
push eax
call dword [sym.imp.msvcrt.dll_wcsncat]
add esp, 0x10
push 0
lea eax, [ebp - 0x634]
push eax
call edi
test eax, eax
jne 0x105acc7
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0xb7
jne 0x105adab
lea eax, [ebp - 0x634]
push eax
call ebx
mov ecx, esi
sub ecx, eax
push ecx
lea eax, [ebp - 0x634]
push 0x100c62c
push eax
call dword [sym.imp.msvcrt.dll_wcsncat]
add esp, 0x10
push 0
lea eax, [ebp - 0x634]
push eax
call edi
test eax, eax
jne 0x105ad0a
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0xb7
jne 0x105adab
lea eax, [ebp - 0x634]
push eax
push 0x100c600
lea eax, [ebp - 0x840]
push esi
push eax
call dword [sym.imp.msvcrt.dll__snwprintf]
add esp, 0x10
push 0
lea eax, [ebp - 0x840]
push eax
call edi
test eax, eax
jne 0x105ad43
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0xb7
jne 0x105adab
lea eax, [ebp - 0x840]
push eax
call ebx
mov ecx, esi
sub ecx, eax
push ecx
lea eax, [ebp - 0x840]
push 0x1004204
push eax
call dword [sym.imp.msvcrt.dll_wcsncat]
add esp, 0x10
lea eax, [ebp - 0x840]
push eax
call fcn.01021523
lea eax, [ebp - 0x634]
push eax
push 0x100c5f0
lea eax, [ebp - 0x840]
push esi
push eax
call dword [sym.imp.msvcrt.dll__snwprintf]
add esp, 0x10
push 0
lea eax, [ebp - 0x840]
push eax
call edi
test eax, eax
jne 0x105ae09
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0xb7
je 0x105ae09
lea eax, [ebp - 0xa5c]
push eax
call fcn.0105a0c7
lea ecx, [ebp - 0xa50]
call fcn.01075f2c
lea eax, [ebp - 0x21c]
push eax
lea eax, [ebp - 0xa50]
push 0x80f6
xor ebx, ebx
push eax
mov dword [ebp - 4], ebx
call fcn.010762e0
add esp, 0xc
push 1
push ebx
push 0x30
push ebx
push dword [ebp - 0xa50]
push 0xfa6
call fcn.01054b96
or dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0xa50]
call fcn.01075ef0
jmp 0x105ae49
lea eax, [ebp - 0x840]
push eax
call ebx
sub esi, eax
push esi
lea eax, [ebp - 0x840]
push 0x1004204
push eax
call dword [sym.imp.msvcrt.dll_wcsncat]
add esp, 0x10
lea eax, [ebp - 0x840]
push eax
call fcn.01021547
lea eax, [ebp - 0xa5c]
push eax
call fcn.0105a0c7
jmp 0x105b018
xor ebx, ebx
lea eax, [ebp - 0x21c]
push eax
push ebx
push ebx
push reloc.KERNEL32.dll_GetLocaleInfoW
push ebx
call dword [sym.imp.SHELL32.dll_SHGetFolderPathW]
test eax, eax
je 0x105ae86
lea eax, [ebp - 0x21c]
push 0x1005360
push eax
call dword [sym.imp.msvcrt.dll_wcscpy]
pop ecx
pop ecx
push esi
lea eax, [ebp - 0x21c]
push eax
push 0x100c670
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
mov esi, dword [sym.imp.msvcrt.dll_wcscat]
lea eax, [ebp - 0x21c]
push 0x100c658
push eax
call esi
pop ecx
pop ecx
push ebx
lea eax, [ebp - 0x21c]
push eax
call edi
test eax, eax
jne 0x105aebf
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ebx, AddAccessAllowedAce
cmp eax, ebx
jne 0x105b018
jmp 0x105aec4
mov ebx, AddAccessAllowedAce
lea eax, [ebp - 0x21c]
push 0x100c640
push eax
call esi
pop ecx
pop ecx
push 0
lea eax, [ebp - 0x21c]
push eax
call edi
test eax, eax
jne 0x105aef1
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, ebx
jne 0x105b018
lea eax, [ebp - 0x21c]
push 0x100c62c
push eax
call esi
pop ecx
pop ecx
push 0
lea eax, [ebp - 0x21c]
push eax
call edi
test eax, eax
jne 0x105af1e
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, ebx
jne 0x105b018
mov ebx, dword [sym.imp.msvcrt.dll_swprintf]
lea eax, [ebp - 0x21c]
push eax
lea eax, [ebp - 0x428]
push 0x100c610
push eax
call ebx
add esp, 0xc
push 0
lea eax, [ebp - 0x428]
push eax
call edi
test eax, eax
jne 0x105af5c
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0xb7
jne 0x105b018
lea eax, [ebp - 0x428]
push 0x1004204
push eax
call esi
pop ecx
pop ecx
lea eax, [ebp - 0x428]
push eax
call fcn.01021576
lea eax, [ebp - 0x21c]
push eax
lea eax, [ebp - 0x428]
push 0x100c600
push eax
call ebx
add esp, 0xc
push 0
lea eax, [ebp - 0x428]
push eax
call edi
test eax, eax
jne 0x105afac
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0xb7
jne 0x105b018
lea eax, [ebp - 0x428]
push 0x1004204
push eax
call esi
pop ecx
pop ecx
lea eax, [ebp - 0x428]
push eax
call fcn.01021523
lea eax, [ebp - 0x21c]
push eax
lea eax, [ebp - 0x428]
push 0x100c5f0
push eax
call ebx
add esp, 0xc
push 0
lea eax, [ebp - 0x428]
push eax
call edi
test eax, eax
jne 0x105affc
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0xb7
jne 0x105b018
lea eax, [ebp - 0x428]
push 0x1004204
push eax
call esi
pop ecx
pop ecx
lea eax, [ebp - 0x428]
push eax
call fcn.01021547
mov ecx, dword [ebp - 0xc]
pop edi
pop esi
mov dword fs:[0], ecx
mov ecx, dword [ebp - 0x10]
pop ebx
call fcn.01075bbb
leave
ret