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

Disassembly:
mov eax, reloc.ADVAPI32.dll_AddAccessAllowedAce
call fcn.01077798
sub esp, 0xa64
mov eax, dword [0x10de03c]
push ebx
push esi
push edi
mov dword [ebp - 0x10], eax
call fcn.01026a9b
test eax, eax
mov edi, dword [sym.imp.KERNEL32.dll_CreateDirectoryW]
mov esi, 0x104
jne 0x105a9b3
call fcn.01026aab
test eax, eax
je 0x105ae34
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 0x105aa0c
lea eax, [ebp - 0xa4c]
push 0x100c688
push eax
call ebx
pop ecx
pop ecx
push esi
lea eax, [ebp - 0xa4c]
push eax
push 0x100c668
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 0x105aa76
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 0x100c668
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
call fcn.01098c25
call fcn.01098c35
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.01059f29
test eax, eax
jl 0x105ae34
lea eax, [ebp - 0x21c]
push eax
call ebx
mov ecx, esi
sub ecx, eax
push ecx
lea eax, [ebp - 0x21c]
push 0x100c650
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 0x105aaf6
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0xb7
jne 0x105ad98
lea eax, [ebp - 0x21c]
push eax
call ebx
mov ecx, esi
sub ecx, eax
push ecx
lea eax, [ebp - 0x21c]
push 0x100c638
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 0x105ab39
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0xb7
jne 0x105ad98
lea eax, [ebp - 0x21c]
push eax
call ebx
mov ecx, esi
sub ecx, eax
push ecx
lea eax, [ebp - 0x21c]
push 0x100c624
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 0x105ab9f
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0xb7
jne 0x105ad98
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 0x105ad98
lea eax, [ebp - 0x21c]
push eax
push 0x100c608
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 0x105abff
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0xb7
jne 0x105ad98
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 0x105ad98
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.010214d6
lea eax, [ebp - 0x634]
push eax
call ebx
mov ecx, esi
sub ecx, eax
push ecx
lea eax, [ebp - 0x634]
push 0x100c650
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 0x105ac71
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0xb7
jne 0x105ad98
lea eax, [ebp - 0x634]
push eax
call ebx
mov ecx, esi
sub ecx, eax
push ecx
lea eax, [ebp - 0x634]
push 0x100c638
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 0x105acb4
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0xb7
jne 0x105ad98
lea eax, [ebp - 0x634]
push eax
call ebx
mov ecx, esi
sub ecx, eax
push ecx
lea eax, [ebp - 0x634]
push 0x100c624
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 0x105acf7
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0xb7
jne 0x105ad98
lea eax, [ebp - 0x634]
push eax
push 0x100c5f8
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 0x105ad30
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0xb7
jne 0x105ad98
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.01021483
lea eax, [ebp - 0x634]
push eax
push 0x100c5e8
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 0x105adf6
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0xb7
je 0x105adf6
lea eax, [ebp - 0xa5c]
push eax
call fcn.0105a0b4
lea ecx, [ebp - 0xa50]
call fcn.01075e60
lea eax, [ebp - 0x21c]
push eax
lea eax, [ebp - 0xa50]
push 0x80f6
xor ebx, ebx
push eax
mov dword [ebp - 4], ebx
call fcn.01076214
add esp, 0xc
push 1
push ebx
push 0x30
push ebx
push dword [ebp - 0xa50]
push 0xfa6
call fcn.01054b83
or dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0xa50]
call fcn.01075e24
jmp 0x105ae36
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.010214a7
lea eax, [ebp - 0xa5c]
push eax
call fcn.0105a0b4
jmp 0x105b005
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 0x105ae73
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 0x100c668
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
mov esi, dword [sym.imp.msvcrt.dll_wcscat]
lea eax, [ebp - 0x21c]
push 0x100c650
push eax
call esi
pop ecx
pop ecx
push ebx
lea eax, [ebp - 0x21c]
push eax
call edi
test eax, eax
jne 0x105aeac
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ebx, AddAccessAllowedAce
cmp eax, ebx
jne 0x105b005
jmp 0x105aeb1
mov ebx, AddAccessAllowedAce
lea eax, [ebp - 0x21c]
push 0x100c638
push eax
call esi
pop ecx
pop ecx
push 0
lea eax, [ebp - 0x21c]
push eax
call edi
test eax, eax
jne 0x105aede
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, ebx
jne 0x105b005
lea eax, [ebp - 0x21c]
push 0x100c624
push eax
call esi
pop ecx
pop ecx
push 0
lea eax, [ebp - 0x21c]
push eax
call edi
test eax, eax
jne 0x105af0b
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, ebx
jne 0x105b005
mov ebx, dword [sym.imp.msvcrt.dll_swprintf]
lea eax, [ebp - 0x21c]
push eax
lea eax, [ebp - 0x428]
push 0x100c608
push eax
call ebx
add esp, 0xc
push 0
lea eax, [ebp - 0x428]
push eax
call edi
test eax, eax
jne 0x105af49
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0xb7
jne 0x105b005
lea eax, [ebp - 0x428]
push 0x1004204
push eax
call esi
pop ecx
pop ecx
lea eax, [ebp - 0x428]
push eax
call fcn.010214d6
lea eax, [ebp - 0x21c]
push eax
lea eax, [ebp - 0x428]
push 0x100c5f8
push eax
call ebx
add esp, 0xc
push 0
lea eax, [ebp - 0x428]
push eax
call edi
test eax, eax
jne 0x105af99
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0xb7
jne 0x105b005
lea eax, [ebp - 0x428]
push 0x1004204
push eax
call esi
pop ecx
pop ecx
lea eax, [ebp - 0x428]
push eax
call fcn.01021483
lea eax, [ebp - 0x21c]
push eax
lea eax, [ebp - 0x428]
push 0x100c5e8
push eax
call ebx
add esp, 0xc
push 0
lea eax, [ebp - 0x428]
push eax
call edi
test eax, eax
jne 0x105afe9
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0xb7
jne 0x105b005
lea eax, [ebp - 0x428]
push 0x1004204
push eax
call esi
pop ecx
pop ecx
lea eax, [ebp - 0x428]
push eax
call fcn.010214a7
mov ecx, dword [ebp - 0xc]
pop edi
pop esi
mov dword fs:[0], ecx
mov ecx, dword [ebp - 0x10]
pop ebx
call fcn.01075aef
leave
ret