Function at 0x409f90
Capabilities:
Check if file exists
Delete file
Delete registry key
Enumerate files on windows
Get common file path
Get file attributes
Move file
Persist via run registry key
Query or enumerate registry value
Set file attributes

Disassembly:
sub esp, 0x254
push ebx
push ebp
push esi
push edi
lea eax, [esp + 0x160]
push 0x104
push eax
mov dword [esp + 0x1c], 0
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryA]
mov ebp, dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
lea ebx, [esp + eax + 0x160]
mov edi, 0x41a554
mov byte [ebx], 0x5c
inc ebx
mov ecx, dword [edi]
mov esi, 0x104
mov eax, ebx
mov dl, byte [ecx]
test dl, dl
je 0x409fe3
mov byte [eax], dl
inc eax
inc ecx
dec esi
jne 0x409fd4
jmp 0x409fe7
test esi, esi
jne 0x409fe8
dec eax
lea ecx, [esp + 0x160]
mov byte [eax], 0
push ecx
call ebp
cmp eax, 0xffffffff
je 0x40a01f
mov eax, dword [esp + 0x268]
mov dword [esp + 0x14], 1
test eax, eax
je 0x40a01f
push 4
lea edx, [esp + 0x164]
push 0
push edx
call dword [sym.imp.KERNEL32.dll_MoveFileExA]
add edi, 4
cmp edi, str.com_services.exe
jb 0x409fcb
mov eax, dword [esp + 0x14]
test eax, eax
je 0x40a041
mov eax, dword [esp + 0x268]
test eax, eax
je 0x40a0fd
lea eax, [esp + 0x10]
push eax
push 0x20019
push 0
push str.IFOBJ.IfObjCtrl.1CLSID
push 0x80000000
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExA]
test eax, eax
jne 0x40a0fd
lea ecx, [esp + 0x18]
lea edx, [esp + 0x20]
push ecx
mov ecx, dword [esp + 0x14]
lea eax, [esp + 0x20]
push edx
push eax
push 0
push 0
push ecx
mov dword [esp + 0x30], 0x104
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExA]
mov edx, dword [esp + 0x10]
mov esi, eax
push edx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
test esi, esi
jne 0x40a0fd
cmp dword [esp + 0x18], 0x27
jne 0x40a0fd
mov eax, dword [esp + 0x268]
mov ebp, 1
test eax, eax
mov dword [esp + 0x14], ebp
je 0x40a3e6
mov esi, dword [sym.imp.SHLWAPI.dll_SHDeleteKeyA]
push str.IFOBJ.IfObjCtrl.1
push 0x80000000
call esi
lea eax, [esp + 0x20]
lea ecx, [esp + 0x160]
push eax
push str.CLSID_s
push 0x104
push ecx
call fcn.00409880
add esp, 0x10
lea edx, [esp + 0x160]
push edx
push 0x80000000
call esi
jmp 0x40a105
mov ebp, dword [esp + 0x14]
test ebp, ebp
je 0x40a114
mov eax, dword [esp + 0x268]
test eax, eax
je 0x40a1de
lea eax, [esp + 0x160]
push eax
push 0x104
call dword [sym.imp.KERNEL32.dll_GetTempPathA]
lea edi, [esp + eax + 0x160]
mov edx, str.del.tmp
mov esi, 0x104
mov byte [edi], 0x5c
inc edi
mov eax, edi
sub edx, edi
mov cl, byte [edx + eax]
test cl, cl
je 0x40a14f
mov byte [eax], cl
inc eax
dec esi
jne 0x40a140
jmp 0x40a153
test esi, esi
jne 0x40a154
dec eax
lea ecx, [esp + 0x20]
lea edx, [esp + 0x160]
push ecx
push edx
mov byte [eax], 0
call dword [sym.imp.KERNEL32.dll_FindFirstFileA]
mov ebx, eax
cmp ebx, 0xffffffff
je 0x40a1de
mov ebp, dword [sym.imp.KERNEL32.dll_FindNextFileA]
test byte [esp + 0x20], 0x10
jne 0x40a1c7
mov eax, dword [esp + 0x268]
mov dword [esp + 0x14], 1
test eax, eax
je 0x40a1c7
lea edx, [esp + 0x4c]
mov esi, 0x104
mov eax, edi
sub edx, edi
mov cl, byte [edx + eax]
test cl, cl
je 0x40a1ad
mov byte [eax], cl
inc eax
dec esi
jne 0x40a19e
jmp 0x40a1b1
test esi, esi
jne 0x40a1b2
dec eax
mov byte [eax], 0
push 4
lea eax, [esp + 0x164]
push 0
push eax
call dword [sym.imp.KERNEL32.dll_MoveFileExA]
lea ecx, [esp + 0x20]
push ecx
push ebx
call ebp
test eax, eax
jne 0x40a177
push ebx
call dword [sym.imp.KERNEL32.dll_FindClose]
mov ebp, dword [esp + 0x14]
test ebp, ebp
je 0x40a1f1
mov eax, dword [esp + 0x268]
test eax, eax
je 0x40a3e6
mov edi, dword [sym.imp.SHLWAPI.dll_SHGetValueA]
lea edx, [esp + 0x18]
lea eax, [esp + 0x20]
push edx
lea ecx, [esp + 0x14]
push eax
push ecx
push str.Common_Startup
push str.SOFTWAREMicrosoftWindowsCurrentVersionExplorerShell_Folders
push 0x80000002
mov dword [esp + 0x30], 0x104
call edi
mov ebx, dword [sym.imp.KERNEL32.dll_SetFileAttributesA]
mov ebp, dword [sym.imp.KERNEL32.dll_DeleteFileA]
test eax, eax
jne 0x40a2e8
cmp dword [esp + 0x10], 1
jne 0x40a2e8
mov ecx, 0x104
lea eax, [esp + 0x20]
cmp byte [eax], 0
je 0x40a252
inc eax
dec ecx
jne 0x40a247
jmp 0x40a296
test ecx, ecx
je 0x40a296
lea edx, [esp + 0x10]
test edx, edx
je 0x40a267
mov eax, 0x104
sub eax, ecx
jmp 0x40a26b
mov eax, dword [esp + 0x10]
mov edx, 0x104
sub edx, eax
lea eax, [esp + eax + 0x20]
je 0x40a296
mov esi, 0x41a5d4
sub esi, eax
mov cl, byte [esi + eax]
test cl, cl
je 0x40a28e
mov byte [eax], cl
inc eax
dec edx
jne 0x40a27f
jmp 0x40a292
test edx, edx
jne 0x40a293
dec eax
mov byte [eax], 0
lea eax, [esp + 0x20]
push eax
call dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
cmp eax, 0xffffffff
je 0x40a2e8
mov eax, dword [esp + 0x268]
mov dword [esp + 0x14], 1
test eax, eax
je 0x40a2e8
lea ecx, [esp + 0x20]
push 0x80
push ecx
call ebx
push 4
lea edx, [esp + 0x24]
push 0
push edx
call dword [sym.imp.KERNEL32.dll_MoveFileExA]
lea eax, [esp + 0x20]
push eax
call ebp
lea ecx, [esp + 0x20]
push ecx
call fcn.00408360
add esp, 4
lea edx, [esp + 0x18]
lea eax, [esp + 0x20]
push edx
lea ecx, [esp + 0x14]
push eax
push ecx
push str.Startup
push str.SOFTWAREMicrosoftWindowsCurrentVersionExplorerShell_Folders
push 0x80000001
mov dword [esp + 0x30], 0x104
call edi
test eax, eax
jne 0x40a3d7
cmp dword [esp + 0x10], 1
jne 0x40a3d7
mov ecx, 0x104
lea eax, [esp + 0x20]
cmp byte [eax], 0
je 0x40a337
inc eax
dec ecx
jne 0x40a32c
jmp 0x40a37b
test ecx, ecx
je 0x40a37b
lea edx, [esp + 0x10]
test edx, edx
je 0x40a34c
mov eax, 0x104
sub eax, ecx
jmp 0x40a350
mov eax, dword [esp + 0x10]
mov edx, 0x104
sub edx, eax
lea eax, [esp + eax + 0x20]
je 0x40a37b
mov esi, 0x41a5d4
sub esi, eax
mov cl, byte [esi + eax]
test cl, cl
je 0x40a373
mov byte [eax], cl
inc eax
dec edx
jne 0x40a364
jmp 0x40a377
test edx, edx
jne 0x40a378
dec eax
mov byte [eax], 0
lea eax, [esp + 0x20]
push eax
call dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
cmp eax, 0xffffffff
je 0x40a3d7
mov eax, dword [esp + 0x268]
mov esi, 1
test eax, eax
je 0x40a3ca
lea ecx, [esp + 0x20]
push 0x80
push ecx
call ebx
push 4
lea edx, [esp + 0x24]
push 0
push edx
call dword [sym.imp.KERNEL32.dll_MoveFileExA]
lea eax, [esp + 0x20]
push eax
call ebp
lea ecx, [esp + 0x20]
push ecx
call fcn.00408360
add esp, 4
mov eax, esi
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x254
ret
mov eax, dword [esp + 0x14]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x254
ret
pop edi
mov eax, ebp
pop esi
pop ebp
pop ebx
add esp, 0x254
ret