Function at 0x40a510
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 ebx, dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
lea ebp, [esp + eax + 0x160]
mov edi, 0x41b6fc
mov byte [ebp], 0x5c
inc ebp
mov ecx, dword [edi]
mov esi, 0x104
mov eax, ebp
mov dl, byte [ecx]
test dl, dl
je 0x40a564
mov byte [eax], dl
inc eax
inc ecx
dec esi
jne 0x40a555
jmp 0x40a568
test esi, esi
jne 0x40a569
dec eax
lea ecx, [esp + 0x160]
mov byte [eax], 0
push ecx
call ebx
cmp eax, 0xffffffff
je 0x40a5a4
test al, 0x10
jne 0x40a5a4
mov eax, dword [esp + 0x268]
mov dword [esp + 0x14], 1
test eax, eax
je 0x40a5a4
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 0x40a54c
mov eax, dword [esp + 0x14]
test eax, eax
je 0x40a5c6
mov eax, dword [esp + 0x268]
test eax, eax
je 0x40a682
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 0x40a682
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 0x40a682
cmp dword [esp + 0x18], 0x27
jne 0x40a682
mov eax, dword [esp + 0x268]
mov ebx, 1
test eax, eax
mov dword [esp + 0x14], ebx
je 0x40a96b
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.00406680
add esp, 0x10
lea edx, [esp + 0x160]
push edx
push 0x80000000
call esi
jmp 0x40a68a
mov ebx, dword [esp + 0x14]
test ebx, ebx
je 0x40a699
mov eax, dword [esp + 0x268]
test eax, eax
je 0x40a763
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 0x40a6d4
mov byte [eax], cl
inc eax
dec esi
jne 0x40a6c5
jmp 0x40a6d8
test esi, esi
jne 0x40a6d9
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 ebp, eax
cmp ebp, 0xffffffff
je 0x40a763
mov ebx, dword [sym.imp.KERNEL32.dll_FindNextFileA]
test byte [esp + 0x20], 0x10
jne 0x40a74c
mov eax, dword [esp + 0x268]
mov dword [esp + 0x14], 1
test eax, eax
je 0x40a74c
lea edx, [esp + 0x4c]
mov esi, 0x104
mov eax, edi
sub edx, edi
mov cl, byte [edx + eax]
test cl, cl
je 0x40a732
mov byte [eax], cl
inc eax
dec esi
jne 0x40a723
jmp 0x40a736
test esi, esi
jne 0x40a737
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 ebp
call ebx
test eax, eax
jne 0x40a6fc
push ebp
call dword [sym.imp.KERNEL32.dll_FindClose]
mov ebx, dword [esp + 0x14]
test ebx, ebx
je 0x40a776
mov eax, dword [esp + 0x268]
test eax, eax
je 0x40a96b
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 ebp, dword [sym.imp.KERNEL32.dll_SetFileAttributesA]
mov ebx, dword [sym.imp.KERNEL32.dll_DeleteFileA]
test eax, eax
jne 0x40a86d
cmp dword [esp + 0x10], 1
jne 0x40a86d
mov ecx, 0x104
lea eax, [esp + 0x20]
cmp byte [eax], 0
je 0x40a7d7
inc eax
dec ecx
jne 0x40a7cc
jmp 0x40a81b
test ecx, ecx
je 0x40a81b
lea edx, [esp + 0x10]
test edx, edx
je 0x40a7ec
mov eax, 0x104
sub eax, ecx
jmp 0x40a7f0
mov eax, dword [esp + 0x10]
mov edx, 0x104
sub edx, eax
lea eax, [esp + eax + 0x20]
je 0x40a81b
mov esi, 0x41b77c
sub esi, eax
mov cl, byte [esi + eax]
test cl, cl
je 0x40a813
mov byte [eax], cl
inc eax
dec edx
jne 0x40a804
jmp 0x40a817
test edx, edx
jne 0x40a818
dec eax
mov byte [eax], 0
lea eax, [esp + 0x20]
push eax
call dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
cmp eax, 0xffffffff
je 0x40a86d
mov eax, dword [esp + 0x268]
mov dword [esp + 0x14], 1
test eax, eax
je 0x40a86d
lea ecx, [esp + 0x20]
push 0x80
push ecx
call ebp
push 4
lea edx, [esp + 0x24]
push 0
push edx
call dword [sym.imp.KERNEL32.dll_MoveFileExA]
lea eax, [esp + 0x20]
push eax
call ebx
lea ecx, [esp + 0x20]
push ecx
call fcn.00408540
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 0x40a95c
cmp dword [esp + 0x10], 1
jne 0x40a95c
mov ecx, 0x104
lea eax, [esp + 0x20]
cmp byte [eax], 0
je 0x40a8bc
inc eax
dec ecx
jne 0x40a8b1
jmp 0x40a900
test ecx, ecx
je 0x40a900
lea edx, [esp + 0x10]
test edx, edx
je 0x40a8d1
mov eax, 0x104
sub eax, ecx
jmp 0x40a8d5
mov eax, dword [esp + 0x10]
mov edx, 0x104
sub edx, eax
lea eax, [esp + eax + 0x20]
je 0x40a900
mov esi, 0x41b77c
sub esi, eax
mov cl, byte [esi + eax]
test cl, cl
je 0x40a8f8
mov byte [eax], cl
inc eax
dec edx
jne 0x40a8e9
jmp 0x40a8fc
test edx, edx
jne 0x40a8fd
dec eax
mov byte [eax], 0
lea eax, [esp + 0x20]
push eax
call dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
cmp eax, 0xffffffff
je 0x40a95c
mov eax, dword [esp + 0x268]
mov esi, 1
test eax, eax
je 0x40a94f
lea ecx, [esp + 0x20]
push 0x80
push ecx
call ebp
push 4
lea edx, [esp + 0x24]
push 0
push edx
call dword [sym.imp.KERNEL32.dll_MoveFileExA]
lea eax, [esp + 0x20]
push eax
call ebx
lea ecx, [esp + 0x20]
push ecx
call fcn.00408540
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
pop esi
mov eax, ebx
pop ebp
pop ebx
add esp, 0x254
ret