Function at 0x478940
Capabilities:
Get common file path
Persist via run registry key
Query environment variable

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x4dfe91
mov eax, dword fs:[0]
push eax
sub esp, 0x244
mov eax, dword [0x520078]
xor eax, ebp
mov dword [ebp - 0x14], eax
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov esi, edx
mov edi, ecx
mov dword [ebp - 0x24c], edi
lea eax, [ebp - 0x21c]
mov dword [ebp - 0x250], 0
push eax
push 0
push 0
push esi
push 0
call dword [sym.imp.SHELL32.dll_SHGetFolderPathW]
mov ecx, eax
test ecx, ecx
jns 0x478c58
mov eax, esi
and eax, 0xffff00ff
cmp eax, 0x24
jne 0x478a24
push 0x104
lea eax, [ebp - 0x21c]
push eax
call dword [sym.imp.KERNEL32.dll_GetWindowsDirectoryW]
test eax, eax
jne 0x4789ee
push esi
push str.Unable_to_retrieve_a_path_of_the_known_folder___d__
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
lea eax, [ebp - 0x248]
push eax
call fcn.0047e3f0
add esp, 0x10
lea eax, [ebp - 0x248]
push 0x51d3f8
push eax
call fcn.004acc20
cmp eax, 0x104
jbe 0x478c58
push esi
push str.Unable_to_retrieve_a_path_of_the_known_folder___d__
lea eax, [ebp - 0x248]
push 0xea
push eax
call fcn.0047e3f0
add esp, 0x10
lea eax, [ebp - 0x248]
push 0x51d3f8
push eax
call fcn.004acc20
cmp eax, 0x23
jne 0x478a8a
xor eax, eax
mov dword [ebp - 0x220], 7
mov dword [ebp - 0x224], 0
mov word [ebp - 0x234], ax
push ecx
push eax
mov dword [ebp - 4], eax
mov edx, str.SOFTWAREMicrosoftWindowsCurrentVersionExplorerShell_Folders
lea eax, [ebp - 0x234]
mov ecx, 0x80000002
push eax
push str.Common_AppData
call fcn.00479890
add esp, 0x10
test al, al
je 0x4789c1
cmp dword [ebp - 0x220], 8
lea eax, [ebp - 0x234]
cmovae eax, dword [ebp - 0x234]
jmp 0x478c31
cmp eax, 0x1a
jne 0x478b7c
xor eax, eax
mov dword [ebp - 0x220], 7
mov dword [ebp - 0x224], 0
mov word [ebp - 0x234], ax
push ecx
push eax
lea eax, [ebp - 0x234]
mov dword [ebp - 4], 1
push eax
push str.AppData
mov edx, str.SOFTWAREMicrosoftWindowsCurrentVersionExplorerShell_Folders
mov ecx, 0x80000001
call fcn.00479890
add esp, 0x10
test al, al
jne 0x478c19
push 0x104
lea ecx, [ebp - 0x234]
call fcn.0041db60
cmp dword [ebp - 0x220], 8
lea eax, [ebp - 0x234]
push dword [ebp - 0x224]
cmovae eax, dword [ebp - 0x234]
push eax
push str._APPDATA_
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
test eax, eax
jne 0x478b32
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
je 0x478c19
push esi
push str.Unable_to_retrieve_a_path_of_the_known_folder___d__
jmp 0x4789cd
cmp eax, dword [ebp - 0x224]
jbe 0x478b4a
push esi
mov eax, 0xea
push str.Unable_to_retrieve_a_path_of_the_known_folder___d__
jmp 0x4789cd
mov ecx, dword [ebp - 0x220]
lea eax, [ebp - 0x234]
mov edx, dword [ebp - 0x234]
cmp ecx, 8
cmovae eax, edx
cmp word [eax], 0x25
jne 0x478c25
mov eax, 3
push esi
push str.Unable_to_retrieve_a_path_of_the_known_folder___d__
jmp 0x4789cd
cmp eax, 0x1c
jne 0x478c78
xor eax, eax
mov dword [ebp - 0x220], 7
mov dword [ebp - 0x224], 0
mov word [ebp - 0x234], ax
push ecx
push eax
lea eax, [ebp - 0x234]
mov dword [ebp - 4], 2
push eax
push str.Local_AppData
mov edx, str.SOFTWAREMicrosoftWindowsCurrentVersionExplorerShell_Folders
mov ecx, 0x80000001
call fcn.00479890
add esp, 0x10
test al, al
jne 0x478c19
push 0x104
lea ecx, [ebp - 0x234]
call fcn.0041db60
cmp dword [ebp - 0x220], 8
lea eax, [ebp - 0x234]
push dword [ebp - 0x224]
cmovae eax, dword [ebp - 0x234]
push eax
push str._LOCALAPPDATA_
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
test eax, eax
jne 0x478b32
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jne 0x478b71
mov ecx, dword [ebp - 0x220]
mov edx, dword [ebp - 0x234]
cmp ecx, 8
lea eax, [ebp - 0x234]
cmovae eax, edx
push eax
lea eax, [ebp - 0x21c]
push 0x104
push eax
call fcn.004bf400
add esp, 0xc
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x234]
call fcn.00415b40
xor eax, eax
mov dword [edi + 0x14], 7
mov dword [edi + 0x10], 0
mov word [edi], ax
cmp word [ebp - 0x21c], ax
jne 0x478c9e
xor ecx, ecx
jmp 0x478cb6
push esi
push str.Unable_to_retrieve_a_path_of_the_known_folder___d__
push ecx
lea eax, [ebp - 0x230]
push eax
call fcn.0047e3f0
add esp, 0x10
lea eax, [ebp - 0x230]
push 0x51d3f8
jmp 0x4789e8
lea ecx, [ebp - 0x21c]
lea edx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x478ca7
sub ecx, edx
sar ecx, 1
push ecx
lea eax, [ebp - 0x21c]
mov ecx, edi
push eax
call fcn.00415880
mov eax, edi
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
mov ecx, dword [ebp - 0x14]
xor ecx, ebp
call fcn.00493bec
mov esp, ebp
pop ebp
ret