Function at 0x10643af
Capabilities:
Create directory
Get common file path
Query environment variable
Query or enumerate registry value

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x428
mov eax, dword [0x1072c48]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 8]
push esi
xor esi, esi
mov dword [ebp - 0x428], eax
mov dword [ebp - 0x420], esi
mov dword [ebp - 0x418], 0x80004005
cmp eax, esi
jne 0x10643ee
mov eax, 0x80004003
jmp 0x1064620
lea eax, [ebp - 0x420]
push eax
push 1
push esi
push 0x10095f8
push 0x80000002
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
test eax, eax
jne 0x106461a
mov ecx, dword [ebp + 0xc]
mov eax, 0x208
mov dword [ebp - 0x424], ecx
mov dword [ebp - 0x41c], 1
cmp ecx, eax
jbe 0x1064432
mov dword [ebp - 0x424], eax
push edi
lea eax, [ebp - 0x424]
push eax
lea eax, [ebp - 0x20c]
push eax
lea eax, [ebp - 0x41c]
push eax
push esi
push 0x100da84
push dword [ebp - 0x420]
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
mov edi, dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
mov esi, 0x104
test eax, eax
jne 0x106453a
cmp dword [ebp - 0x41c], 1
je 0x1064483
cmp dword [ebp - 0x41c], 2
jne 0x106453a
cmp dword [ebp - 0x41c], 2
jne 0x10644bd
push esi
lea eax, [ebp - 0x414]
push eax
lea eax, [ebp - 0x20c]
push eax
call edi
test eax, eax
je 0x106453a
lea eax, [ebp - 0x414]
push eax
push 0x103
lea eax, [ebp - 0x20c]
push eax
call fcn.01035831
lea eax, [ebp - 0x20c]
push eax
call fcn.010587e2
test eax, eax
je 0x1064511
and dword [ebp - 0x418], 0
lea eax, [ebp - 0x20c]
lea edx, [eax + 2]
mov cx, word [eax]
inc eax
inc eax
test cx, cx
jne 0x10644dd
mov ecx, dword [ebp + 0xc]
sub eax, edx
sar eax, 1
shr ecx, 1
inc eax
cmp ecx, eax
jbe 0x10645fb
lea eax, [ebp - 0x20c]
push eax
push ecx
push dword [ebp - 0x428]
call fcn.01035831
jmp 0x106460d
push 0
lea eax, [ebp - 0x20c]
push eax
call dword [sym.imp.KERNEL32.dll_CreateDirectoryW]
lea eax, [ebp - 0x20c]
push eax
call fcn.010587e2
test eax, eax
jne 0x10644cd
mov dword [ebp - 0x418], 0x80004005
push esi
lea eax, [ebp - 0x414]
push eax
call dword [sym.imp.KERNEL32.dll_GetWindowsDirectoryW]
test eax, eax
je 0x106460d
push esi
lea eax, [ebp - 0x20c]
push eax
lea eax, [ebp - 0x414]
push eax
call edi
lea eax, [ebp - 0x20c]
push 0x1007db0
push eax
call dword [sym.imp.msvcrt.dll_wcsstr]
pop ecx
pop ecx
test eax, eax
je 0x106460d
mov ecx, eax
lea edi, [ecx + 2]
mov dx, word [ecx]
inc ecx
inc ecx
test dx, dx
jne 0x1064582
sub ecx, edi
sar ecx, 1
cmp ecx, 4
jbe 0x106460d
xor ecx, ecx
mov word [eax + 4], cx
push esi
lea eax, [ebp - 0x414]
push eax
push 0x26fc
push dword [0x1073960]
call dword [sym.imp.USER32.dll_LoadStringW]
test eax, eax
je 0x106460d
lea eax, [ebp - 0x414]
push eax
push esi
lea eax, [ebp - 0x20c]
push eax
call fcn.010358a6
push 0
lea eax, [ebp - 0x20c]
push eax
call dword [sym.imp.KERNEL32.dll_CreateDirectoryW]
lea eax, [ebp - 0x20c]
push eax
call fcn.010587e2
test eax, eax
jne 0x10644cd
mov dword [ebp - 0x418], 0x80004005
jmp 0x106460d
mov eax, 0x8007007a
push eax
mov dword [ebp - 0x418], eax
call dword [sym.imp.KERNEL32.dll_SetLastError]
push dword [ebp - 0x420]
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
pop edi
mov eax, dword [ebp - 0x418]
mov ecx, dword [ebp - 4]
xor ecx, ebp
pop esi
call fcn.01047480
leave
ret 8