Function at 0x427db5
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, 0x42c
mov eax, dword [0x42b004]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
mov eax, ecx
mov ebx, edx
push edi
xor edi, edi
mov dword [ebp - 0x42c], eax
mov dword [ebp - 0x428], edi
mov esi, 0x80004005
mov dword [ebp - 0x41c], edi
test eax, eax
jne 0x427df6
lea eax, [esi - 2]
jmp 0x428039
lea eax, [ebp - 0x41c]
push eax
push 1
push edi
push 0x4068d8
push reloc.OLEAUT32.dll_SysReAllocString
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
test eax, eax
jne 0x428037
mov eax, 0x208
mov dword [ebp - 0x424], ebx
mov dword [ebp - 0x418], 1
cmp ebx, eax
jbe 0x427e37
mov dword [ebp - 0x424], eax
lea eax, [ebp - 0x424]
push eax
lea eax, [ebp - 0x20c]
push eax
lea eax, [ebp - 0x418]
push eax
push edi
push 0x409584
push dword [ebp - 0x41c]
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
mov edi, 0x104
test eax, eax
jne 0x427eeb
cmp dword [ebp - 0x418], 1
je 0x427e7d
cmp dword [ebp - 0x418], 2
jne 0x427eeb
cmp dword [ebp - 0x418], 2
jne 0x427eb6
push edi
lea eax, [ebp - 0x414]
push eax
lea eax, [ebp - 0x20c]
push eax
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
test eax, eax
je 0x427eeb
lea eax, [ebp - 0x414]
mov edx, 0x103
push eax
lea ecx, [ebp - 0x20c]
call fcn.00418392
lea ecx, [ebp - 0x20c]
call fcn.00424fe2
test eax, eax
je 0x427ecc
xor edi, edi
jmp 0x427fdf
xor eax, eax
push eax
lea eax, [ebp - 0x20c]
push eax
call dword [sym.imp.KERNEL32.dll_CreateDirectoryW]
lea ecx, [ebp - 0x20c]
call fcn.00424fe2
test eax, eax
jne 0x427ec5
push edi
lea eax, [ebp - 0x414]
push eax
call dword [sym.imp.KERNEL32.dll_GetWindowsDirectoryW]
test eax, eax
je 0x42802b
push edi
lea eax, [ebp - 0x20c]
push eax
lea eax, [ebp - 0x414]
push eax
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
lea eax, [ebp - 0x20c]
push 0x406848
push eax
call dword [sym.imp.msvcrt.dll_wcsstr]
mov edx, eax
pop ecx
pop ecx
test edx, edx
je 0x42802b
mov ecx, edx
lea eax, [ecx + 2]
mov dword [ebp - 0x420], eax
mov ax, word [ecx]
add ecx, 2
cmp ax, word [ebp - 0x428]
jne 0x427f3f
sub ecx, dword [ebp - 0x420]
sar ecx, 1
cmp ecx, 4
jbe 0x42802b
xor eax, eax
push edi
mov word [edx + 4], ax
lea eax, [ebp - 0x414]
push eax
push 0x26fc
push dword [0x42c790]
call dword [sym.imp.USER32.dll_LoadStringW]
test eax, eax
je 0x42802b
push ecx
lea eax, [ebp - 0x420]
mov edx, edi
push eax
lea ecx, [ebp - 0x20c]
call fcn.00418514
test eax, eax
js 0x427fc0
push ecx
lea eax, [ebp - 0x414]
push eax
mov eax, dword [ebp - 0x420]
sub edi, eax
push ecx
lea ecx, [ebp - 0x20c]
mov edx, edi
lea ecx, [ecx + eax*2]
call fcn.00418577
xor edi, edi
lea eax, [ebp - 0x20c]
push edi
push eax
call dword [sym.imp.KERNEL32.dll_CreateDirectoryW]
lea ecx, [ebp - 0x20c]
call fcn.00424fe2
test eax, eax
je 0x428026
lea edx, [ebp - 0x20c]
mov esi, edi
lea ecx, [edx + 2]
mov ax, word [edx]
add edx, 2
cmp ax, di
jne 0x427fea
sub edx, ecx
shr ebx, 1
sar edx, 1
lea eax, [edx + 1]
cmp ebx, eax
jbe 0x428018
mov ecx, dword [ebp - 0x42c]
lea eax, [ebp - 0x20c]
push eax
mov edx, ebx
call fcn.00418392
jmp 0x42802b
mov esi, 0x8007007a
push esi
call dword [sym.imp.KERNEL32.dll_SetLastError]
jmp 0x42802b
mov esi, 0x80004005
push dword [ebp - 0x41c]
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov eax, esi
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.00429770
mov esp, ebp
pop ebp
ret