Function at 0x401670
Capabilities:
Get common file path
Get program files directory
Set registry value

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x431ba1
mov eax, dword fs:[0]
push eax
sub esp, 0x11c
mov eax, dword [0x445230]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov dword [ebp - method.Profile.virtual_0], vtable.Profile.0
mov dword [ebp - 0x11c], 0
push 0
lea eax, [ebp - 0x11c]
push eax
push 0
push 0xf003f
push 0
push 0
push 0
push 0x43ba08
push SysStringLen
mov dword [ebp - 4], 0
call dword [sym.imp.ADVAPI32.dll_RegCreateKeyExA]
mov edi, eax
test edi, edi
je 0x401700
push edi
push edi
push str.profile_open_error__d__0x_X_
push 0x54
push 0x438fb8
call fcn.004064b0
add esp, 0x14
jmp 0x4018a7
mov esi, dword [sym.imp.ADVAPI32.dll_RegSetValueExA]
push 7
push 0x438fc4
push 1
push 0
push 0x43ba40
push dword [ebp - 0x11c]
call esi
mov edi, eax
test edi, edi
je 0x40173f
push edi
push edi
push str.profile_set_version_error__d__0x_X_
push 0x5a
push 0x438ff0
call fcn.004064b0
add esp, 0x14
jmp 0x4018a7
push 0xb
push 0x438ffc
push 1
push 0
push 0x43ba80
push dword [ebp - 0x11c]
call esi
mov edi, eax
test edi, edi
je 0x401778
push edi
push edi
push str.profile_set_appid_error__d__0x_X_
push 0x60
push 0x43902c
call fcn.004064b0
add esp, 0x14
jmp 0x4018a7
call fcn.00409bb2
mov ecx, eax
xor eax, eax
test ecx, ecx
setne al
test eax, eax
jne 0x401794
push 0x80004005
call fcn.00401010
mov eax, dword [ecx]
call dword [eax + 0xc]
lea esi, [eax + 0x10]
mov dword [ebp - 0x124], esi
push 0x104
lea eax, [ebp - 0x118]
push 0
push eax
mov byte [ebp - 4], 1
call fcn.0041deb0
add esp, 0xc
lea eax, [ebp - 0x118]
push 0
push 0x26
push eax
push 0
call dword [sym.imp.SHELL32.dll_SHGetSpecialFolderPathA]
or ebx, 0xffffffff
test eax, eax
jne 0x4017de
lea edi, [ebx + 4]
jmp 0x40188c
lea eax, [ebp - 0x118]
push eax
lea ecx, [ebp - 0x128]
call fcn.00402040
push eax
lea ecx, [ebp - 0x124]
mov byte [ebp - 4], 2
call fcn.00402110
mov byte [ebp - 4], 1
mov edx, dword [ebp - 0x128]
add edx, 0xfffffff0
mov ecx, ebx
lea eax, [edx + 0xc]
lock xadd dword [eax], ecx
dec ecx
test ecx, ecx
jg 0x401823
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
push 0x439038
lea ecx, [ebp - 0x124]
call fcn.004021c0
push dword [ebp - 0x124]
call fcn.0041abf2
add esp, 4
lea ecx, [ebp - 0x124]
push str.KCase
call fcn.004021c0
mov esi, dword [ebp - 0x124]
push esi
call fcn.0041abf2
add esp, 4
lea ecx, [ebp - 0x120]
push esi
call fcn.004066f0
mov edi, eax
test edi, edi
je 0x40188a
push edi
push edi
push str.profile_set_path_error__d__0x_X_
push 0x7b
push 0x43906c
call fcn.004064b0
add esp, 0x14
jmp 0x40188c
xor edi, edi
add esi, 0xfffffff0
mov byte [ebp - 4], 0
lea eax, [esi + 0xc]
lock xadd dword [eax], ebx
dec ebx
test ebx, ebx
jg 0x4018a7
mov ecx, dword [esi]
push esi
mov eax, dword [ecx]
call dword [eax + 4]
mov ecx, dword [ebp - 0x11c]
mov dword [ebp - method.Profile.virtual_0], vtable.Profile.0
test ecx, ecx
je 0x4018c2
push ecx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov eax, edi
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.0041a1d7
mov esp, ebp
pop ebp
ret