Function at 0x40f5ce
Capabilities:
Check if file exists
Delete directory
Delete file
Get common file path
Get file attributes
Get session user name
Persist via run registry key
Query or enumerate registry value

Disassembly:
mov eax, 0x410948
call fcn.00410160
sub esp, 0x7bc
push ebx
push esi
push edi
mov esi, 0x114
mov dword [ebp - 0x10], esp
xor ebx, ebx
push esi
lea eax, [ebp - 0x3b8]
push ebx
push eax
mov dword [ebp - 4], ebx
mov dword [ebp - 0x14], ebx
call sub.MSVCRT.dll_memset
add esp, 0xc
lea eax, [ebp - 0x3b8]
mov dword [ebp - 0x3b8], esi
push eax
call dword [sym.imp.KERNEL32.dll_GetVersionExW]
test eax, eax
je 0x40f78d
cmp dword [ebp - 0x3a8], 2
jne 0x40f78d
push str.shell32
call dword [sym.imp.KERNEL32.dll_LoadLibraryW]
mov edi, eax
cmp edi, ebx
je 0x40f6dc
push str.SHGetFolderPathW
push edi
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov esi, eax
cmp esi, ebx
je 0x40f6cc
push ebx
call dword [sym.imp.ole32.dll_CoInitialize]
lea eax, [ebp - 0x224]
push eax
push ebx
push ebx
push 0x1a
push ebx
call esi
cmp eax, ebx
jne 0x40f6c6
lea eax, [ebp - 0x224]
push eax
call sub.MSVCRT.dll_wcslen
dec eax
pop ecx
mov dword [ebp - 0x18], eax
cmp word [ebp + eax*2 - 0x224], 0x5c
mov eax, 0x41afe4
je 0x40f690
mov eax, 0x4140b8
push eax
lea eax, [ebp - 0x224]
push eax
lea eax, [ebp - 0x5c0]
push str._s_sDMCache
push eax
call dword [sym.imp.USER32.dll_wsprintfW]
add esp, 0x10
lea eax, [ebp - 0x5c0]
push eax
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
je 0x40f6c6
mov dword [ebp - 0x14], 1
call dword [sym.imp.ole32.dll_CoUninitialize]
push edi
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
cmp dword [ebp - 0x14], ebx
jne 0x40f86b
lea eax, [ebp - 0x1c]
push eax
push 1
pop esi
push esi
push ebx
push str.SoftwareMicrosoftWindowsCurrentVersionExplorerShell_Folders
push 0x80000001
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
test eax, eax
jne 0x40f78d
lea eax, [ebp - 0x18]
mov dword [ebp - 0x18], 0x104
push eax
lea eax, [ebp - 0x224]
push eax
push ebx
push ebx
push str.AppData
push dword [ebp - 0x1c]
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
test eax, eax
jne 0x40f77b
lea eax, [ebp - 0x224]
push eax
call sub.MSVCRT.dll_wcslen
dec eax
pop ecx
mov dword [ebp - 0x18], eax
cmp word [ebp + eax*2 - 0x224], 0x5c
mov eax, 0x41afe4
je 0x40f749
mov eax, 0x4140b8
push eax
lea eax, [ebp - 0x224]
push eax
lea eax, [ebp - 0x5c0]
push str._s_sDMCache
push eax
call dword [sym.imp.USER32.dll_wsprintfW]
add esp, 0x10
lea eax, [ebp - 0x5c0]
push eax
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
je 0x40f77b
mov dword [ebp - 0x14], esi
push dword [ebp - 0x1c]
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
cmp dword [ebp - 0x14], ebx
jne 0x40f86b
lea eax, [ebp - 0x224]
push 0x104
push eax
call dword [sym.imp.KERNEL32.dll_GetWindowsDirectoryW]
test eax, eax
je 0x40f8b3
lea eax, [ebp - 0x224]
push eax
call sub.MSVCRT.dll_wcslen
dec eax
pop ecx
mov dword [ebp - 0x18], eax
cmp word [ebp + eax*2 - 0x224], 0x5c
mov eax, 0x41afe4
je 0x40f7cd
mov eax, 0x4140b8
mov esi, dword [sym.imp.USER32.dll_wsprintfW]
push eax
lea eax, [ebp - 0x224]
push eax
lea eax, [ebp - 0x5c0]
push str._s_sDMCache
push eax
call esi
add esp, 0x10
cmp dword [ebp - 0x3a8], 2
jne 0x40f859
lea eax, [ebp - 0x14]
mov dword [ebp - 0x14], 0x40
push eax
lea eax, [ebp - 0x2a4]
push eax
call dword [sym.imp.ADVAPI32.dll_GetUserNameW]
test eax, eax
jne 0x40f821
lea eax, [ebp - 0x2a4]
push str.default_user
push eax
call esi
pop ecx
pop ecx
mov eax, dword [ebp - 0x18]
cmp word [ebp + eax*2 - 0x224], 0x5c
mov eax, 0x41afe4
je 0x40f839
mov eax, 0x4140b8
lea ecx, [ebp - 0x2a4]
push ecx
push eax
lea eax, [ebp - 0x224]
push eax
lea eax, [ebp - 0x5c0]
push str._s_sDMCache_s
push eax
call esi
add esp, 0x14
lea eax, [ebp - 0x5c0]
push eax
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
je 0x40f8b3
lea eax, [ebp - 0x5c0]
push eax
lea eax, [ebp - 0x7c8]
push str._s_settings.bak
push eax
call dword [sym.imp.USER32.dll_wsprintfW]
add esp, 0xc
lea eax, [ebp - 0x7c8]
push eax
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
je 0x40f8a6
lea eax, [ebp - 0x7c8]
push eax
call dword [sym.imp.KERNEL32.dll_DeleteFileW]
lea eax, [ebp - 0x5c0]
push eax
call dword [sym.imp.KERNEL32.dll_RemoveDirectoryW]
mov ecx, dword [ebp - 0xc]
pop edi
pop esi
mov dword fs:[0], ecx
pop ebx
leave
ret