Function at 0x4358e8
Capabilities:
Check if file exists
Create directory
Get common file path
Get file attributes
Query environment variable
Query or enumerate registry value

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0xa40
mov eax, dword [0x4434f4]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
push edi
lea eax, [ebp - 0xa38]
mov dword [ebp - 0xa34], ecx
push eax
xor ecx, ecx
mov edi, edx
push 1
push ecx
push 0x4044a8
push reloc.OLEAUT32.dll_SysReAllocString
mov dword [ebp - 0xa3c], ecx
mov esi, 0x80004005
mov dword [ebp - 0xa38], ecx
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
test eax, eax
jne 0x435c8f
xor esi, esi
mov dword [ebp - 0xa40], edi
inc esi
mov eax, 0x208
mov dword [ebp - 0xa30], esi
cmp edi, eax
jbe 0x43595b
mov dword [ebp - 0xa40], eax
lea eax, [ebp - 0xa40]
push eax
lea eax, [ebp - 0x20c]
push eax
lea eax, [ebp - 0xa30]
push eax
xor eax, eax
push eax
push 0x409864
push dword [ebp - 0xa38]
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
test eax, eax
jne 0x435ad6
cmp dword [ebp - 0xa30], esi
je 0x4359a1
cmp dword [ebp - 0xa30], 2
jne 0x435ad6
cmp dword [ebp - 0xa30], 2
jne 0x4359e2
push 0x104
lea eax, [ebp - 0x414]
push eax
lea eax, [ebp - 0x20c]
push eax
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
test eax, eax
je 0x435ad6
lea eax, [ebp - 0x414]
mov edx, 0x103
push eax
lea ecx, [ebp - 0x20c]
call fcn.0040c010
lea eax, [ebp - 0x20c]
mov edx, 0x104
push eax
lea ecx, [ebp - 0x61c]
call fcn.0040c010
xor esi, esi
test eax, eax
js 0x435a56
push 0x5c
pop ebx
lea ecx, [ebp - 0x61c]
lea edx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
cmp ax, si
jne 0x435a0b
sub ecx, edx
sar ecx, 1
je 0x435a36
cmp word [ebp + ecx*2 - 0x61e], bx
jne 0x435a36
test ecx, ecx
je 0x435a36
xor eax, eax
mov word [ebp + ecx*2 - 0x61e], ax
jmp 0x435a02
lea eax, [ebp - 0x61c]
push eax
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
mov ebx, dword [ebp - 0xa34]
cmp eax, 0xffffffff
je 0x435a56
test al, 0x10
jne 0x435c3d
push esi
lea eax, [ebp - 0x20c]
push eax
call dword [sym.imp.KERNEL32.dll_CreateDirectoryW]
lea eax, [ebp - 0x20c]
mov edx, 0x104
push eax
lea ecx, [ebp - 0x824]
call fcn.0040c010
test eax, eax
js 0x435ad6
push 0x5c
pop ebx
lea ecx, [ebp - 0x824]
lea edx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
cmp ax, si
jne 0x435a8b
sub ecx, edx
sar ecx, 1
je 0x435ab6
cmp word [ebp + ecx*2 - 0x826], bx
jne 0x435ab6
test ecx, ecx
je 0x435ab6
xor eax, eax
mov word [ebp + ecx*2 - 0x826], ax
jmp 0x435a82
lea eax, [ebp - 0x824]
push eax
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
mov ebx, dword [ebp - 0xa34]
cmp eax, 0xffffffff
je 0x435ad6
test al, 0x10
jne 0x435c3d
push 0x104
lea eax, [ebp - 0x414]
mov esi, 0x80004005
push eax
call dword [sym.imp.KERNEL32.dll_GetWindowsDirectoryW]
test eax, eax
je 0x435c83
push 0x104
lea eax, [ebp - 0x20c]
push eax
lea eax, [ebp - 0x414]
push eax
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
lea eax, [ebp - 0x20c]
push 0x4043d8
push eax
call dword [sym.imp.msvcrt.dll_wcsstr]
mov edx, eax
pop ecx
pop ecx
test edx, edx
je 0x435c83
mov ecx, edx
lea esi, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
cmp ax, word [ebp - 0xa3c]
jne 0x435b31
sub ecx, esi
mov esi, 0x80004005
sar ecx, 1
cmp ecx, 4
jbe 0x435c83
xor eax, eax
push 0x104
mov word [edx + 4], ax
lea eax, [ebp - 0x414]
push eax
push 0x26fc
push dword [0x443af0]
call dword [sym.imp.USER32.dll_LoadStringW]
test eax, eax
je 0x435c83
push ecx
lea eax, [ebp - 0xa3c]
mov esi, 0x104
push eax
mov edx, esi
lea ecx, [ebp - 0x20c]
call fcn.0040c131
test eax, eax
js 0x435bbc
push ecx
lea eax, [ebp - 0x414]
mov edx, esi
push eax
mov eax, dword [ebp - 0xa3c]
sub edx, eax
push ecx
lea ecx, [ebp - 0x20c]
lea ecx, [ecx + eax*2]
call fcn.0040c197
xor eax, eax
push eax
lea eax, [ebp - 0x20c]
push eax
call dword [sym.imp.KERNEL32.dll_CreateDirectoryW]
lea eax, [ebp - 0x20c]
mov edx, esi
push eax
lea ecx, [ebp - 0xa2c]
call fcn.0040c010
test eax, eax
js 0x435c7e
push 0x5c
xor esi, esi
pop ebx
lea ecx, [ebp - 0xa2c]
lea edx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
cmp ax, si
jne 0x435bf6
sub ecx, edx
sar ecx, 1
je 0x435c21
cmp word [ebp + ecx*2 - 0xa2e], bx
jne 0x435c21
test ecx, ecx
je 0x435c21
xor eax, eax
mov word [ebp + ecx*2 - 0xa2e], ax
jmp 0x435bed
lea eax, [ebp - 0xa2c]
push eax
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
mov ebx, dword [ebp - 0xa34]
cmp eax, 0xffffffff
je 0x435c7e
test al, 0x10
je 0x435c7e
lea edx, [ebp - 0x20c]
lea ecx, [edx + 2]
mov ax, word [edx]
add edx, 2
cmp ax, si
jne 0x435c46
sub edx, ecx
shr edi, 1
sar edx, 1
lea eax, [edx + 1]
cmp edi, eax
jbe 0x435c70
lea eax, [ebp - 0x20c]
mov edx, edi
push eax
mov ecx, ebx
call fcn.0040c010
jmp 0x435c83
mov esi, 0x8007007a
push esi
call dword [sym.imp.KERNEL32.dll_SetLastError]
jmp 0x435c83
mov esi, 0x80004005
push dword [ebp - 0xa38]
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov ecx, dword [ebp - 4]
mov eax, esi
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.00441b90
mov esp, ebp
pop ebp
ret