Function at 0x1064391
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 0x10643d0
mov eax, 0x80004003
jmp 0x1064602
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 0x10645fc
mov ecx, dword [ebp + 0xc]
mov eax, 0x208
mov dword [ebp - 0x424], ecx
mov dword [ebp - 0x41c], 1
cmp ecx, eax
jbe 0x1064414
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 0x106451c
cmp dword [ebp - 0x41c], 1
je 0x1064465
cmp dword [ebp - 0x41c], 2
jne 0x106451c
cmp dword [ebp - 0x41c], 2
jne 0x106449f
push esi
lea eax, [ebp - 0x414]
push eax
lea eax, [ebp - 0x20c]
push eax
call edi
test eax, eax
je 0x106451c
lea eax, [ebp - 0x414]
push eax
push 0x103
lea eax, [ebp - 0x20c]
push eax
call fcn.01035811
lea eax, [ebp - 0x20c]
push eax
call fcn.010587c1
test eax, eax
je 0x10644f3
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 0x10644bf
mov ecx, dword [ebp + 0xc]
sub eax, edx
sar eax, 1
shr ecx, 1
inc eax
cmp ecx, eax
jbe 0x10645dd
lea eax, [ebp - 0x20c]
push eax
push ecx
push dword [ebp - 0x428]
call fcn.01035811
jmp 0x10645ef
push 0
lea eax, [ebp - 0x20c]
push eax
call dword [sym.imp.KERNEL32.dll_CreateDirectoryW]
lea eax, [ebp - 0x20c]
push eax
call fcn.010587c1
test eax, eax
jne 0x10644af
mov dword [ebp - 0x418], 0x80004005
push esi
lea eax, [ebp - 0x414]
push eax
call dword [sym.imp.KERNEL32.dll_GetWindowsDirectoryW]
test eax, eax
je 0x10645ef
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 0x10645ef
mov ecx, eax
lea edi, [ecx + 2]
mov dx, word [ecx]
inc ecx
inc ecx
test dx, dx
jne 0x1064564
sub ecx, edi
sar ecx, 1
cmp ecx, 4
jbe 0x10645ef
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 0x10645ef
lea eax, [ebp - 0x414]
push eax
push esi
lea eax, [ebp - 0x20c]
push eax
call fcn.01035886
push 0
lea eax, [ebp - 0x20c]
push eax
call dword [sym.imp.KERNEL32.dll_CreateDirectoryW]
lea eax, [ebp - 0x20c]
push eax
call fcn.010587c1
test eax, eax
jne 0x10644af
mov dword [ebp - 0x418], 0x80004005
jmp 0x10645ef
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.01047464
leave
ret 8