Function at 0x40f8e5
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, 0x410c70
call fcn.00410480
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 0x40faa4
cmp dword [ebp - 0x3a8], 2
jne 0x40faa4
push str.shell32
call dword [sym.imp.KERNEL32.dll_LoadLibraryW]
mov edi, eax
cmp edi, ebx
je 0x40f9f3
push str.SHGetFolderPathW
push edi
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov esi, eax
cmp esi, ebx
je 0x40f9e3
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 0x40f9dd
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, 0x41b124
je 0x40f9a7
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 0x40f9dd
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 0x40fb82
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 0x40faa4
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 0x40fa92
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, 0x41b124
je 0x40fa60
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 0x40fa92
mov dword [ebp - 0x14], esi
push dword [ebp - 0x1c]
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
cmp dword [ebp - 0x14], ebx
jne 0x40fb82
lea eax, [ebp - 0x224]
push 0x104
push eax
call dword [sym.imp.KERNEL32.dll_GetWindowsDirectoryW]
test eax, eax
je 0x40fbca
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, 0x41b124
je 0x40fae4
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 0x40fb70
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 0x40fb38
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, 0x41b124
je 0x40fb50
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 0x40fbca
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 0x40fbbd
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