Function at 0x4022f0
Capabilities:
Check if file exists
Create service
Delete file
Get common file path
Get file attributes
Persist via windows service
Query or enumerate registry value

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x405090
mov eax, dword fs:[0]
push eax
sub esp, 0xc3c
mov eax, dword [0x4010c0]
xor eax, ebp
mov dword [ebp - 0x14], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov dword [ebp - 0x10], esp
mov eax, dword [ebp + 8]
xor edi, edi
mov dword [ebp - 0xc18], eax
mov eax, dword [ebp + 0xc]
mov dword [ebp - 0xc28], eax
mov eax, dword [ebp + 0x10]
mov dword [ebp - 0xc2c], eax
lea eax, [ebp - 0xc14]
push eax
push 1
push edi
push 0x4012a0
mov dword [ebp - 0xc14], 0x80000002
push dword [ebp - 0xc14]
mov dword [ebp - 0xc20], 0
mov dword [ebp - 0xc1c], 0
mov dword [ebp - 0xc24], edi
mov dword [ebp - 4], edi
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExA]
test eax, eax
jne 0x40274f
lea eax, [ebp - 0xc34]
mov dword [ebp - 0xc34], 0x400
push eax
lea eax, [ebp - 0x61c]
push eax
lea eax, [ebp - 0xc44]
push eax
push edi
push 0x4012d8
push dword [ebp - 0xc14]
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExA]
push dword [ebp - 0xc14]
mov esi, eax
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
push esi
call dword [sym.imp.KERNEL32.dll_SetLastError]
test esi, esi
jne 0x40276a
push 0xf003f
push esi
push esi
call dword [sym.imp.ADVAPI32.dll_OpenSCManagerA]
mov ebx, eax
mov dword [ebp - 0xc1c], ebx
test ebx, ebx
je 0x402785
push 0x104
lea eax, [ebp - 0x21c]
push eax
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryA]
cmp byte [ebp - 0x61c], 0
lea esi, [ebp - 0x61c]
je 0x402550
nop dword [eax + eax]
push esi
lea eax, [ebp - 0x810]
push 0x401354
push eax
call fcn.00403900
add esp, 0xc
lea eax, [ebp - 0xc14]
push eax
push 1
push 0
lea eax, [ebp - 0x810]
push eax
push 0x80000002
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExA]
test eax, eax
jne 0x402467
push dword [ebp - 0xc14]
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
jmp 0x4024fe
push 0x104
lea eax, [ebp - 0x118]
push 0
push eax
call sub.VCRUNTIME140.dll_memset
push esi
lea eax, [ebp - 0x21c]
push eax
lea eax, [ebp - 0x118]
push 0x40137c
push eax
call fcn.00403900
add esp, 0x1c
lea eax, [ebp - 0x118]
push eax
call dword [sym.imp.KERNEL32.dll_DeleteFileA]
lea eax, [ebp - 0x118]
push eax
call dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
cmp eax, 0xffffffff
jne 0x4024fe
push esi
lea eax, [ebp - 0xc10]
push 0x401388
push eax
call fcn.00403900
add esp, 0xc
push 0
push 0
push 0
push 0
push 0
push 0x401324
push 1
push 2
push 0x20
push 0xf01ff
push dword [ebp - 0xc18]
push esi
push ebx
call dword [sym.imp.ADVAPI32.dll_CreateServiceA]
mov edi, eax
mov dword [ebp - 0xc24], edi
test edi, edi
jne 0x40251a
push 0
push esi
call sub.VCRUNTIME140.dll_strchr
add esp, 8
cmp byte [eax + 1], 0
lea esi, [eax + 1]
jne 0x402420
test edi, edi
je 0x402550
push esi
mov dword [ebp - 0xc18], 0x20
call dword [sym.imp.KERNEL32.dll_lstrlenA]
inc eax
push eax
call fcn.00403b07
add esp, 4
mov ebx, eax
mov dword [ebp - 0xc20], ebx
push esi
push ebx
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
mov esi, dword [ebp - 0xc1c]
jmp 0x4025de
call fcn.00402010
push 0x104
mov ebx, eax
mov dword [ebp - 0xc20], eax
lea eax, [ebp - 0x118]
push 0
push eax
call sub.VCRUNTIME140.dll_memset
push ebx
lea eax, [ebp - 0x21c]
push eax
lea eax, [ebp - 0x118]
push 0x40137c
push eax
call fcn.00403900
push ebx
lea eax, [ebp - 0xc10]
push 0x401388
push eax
call fcn.00403900
add esp, 0x28
mov esi, dword [ebp - 0xc1c]
push 0
push 0
push 0
push 0
push 0
push 0x401324
push 1
push 2
push 0x10
push 0xf01ff
push dword [ebp - 0xc18]
push ebx
push esi
call dword [sym.imp.ADVAPI32.dll_CreateServiceA]
mov edi, eax
mov dword [ebp - 0xc18], 0x10
mov dword [ebp - 0xc24], edi
test edi, edi
je 0x4027a0
push edi
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
push esi
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
push ebx
lea eax, [ebp - 0x61c]
mov dword [ebp - 0xc14], 0x80000002
push 0x401354
push eax
call fcn.00403900
add esp, 0xc
cmp dword [ebp - 0xc18], 0x20
jne 0x40264c
push 0
push 4
lea eax, [ebp - 0xc18]
mov dword [ebp - 0xc18], 0x120
push eax
push 4
push 0x4013d4
lea eax, [ebp - 0x61c]
push eax
push 0x80000002
call fcn.00403390
add esp, 0x1c
push 0
push dword [ebp - 0xc28]
call dword [sym.imp.KERNEL32.dll_lstrlenA]
push eax
push dword [ebp - 0xc28]
lea eax, [ebp - 0x61c]
push 1
push 0x4013dc
push eax
push 0x80000002
call fcn.00403390
add esp, 0x1c
lea eax, [ebp - 0x61c]
push 0x4013e8
push eax
call dword [sym.imp.KERNEL32.dll_lstrcatA]
push 0
lea eax, [ebp - 0x118]
push eax
call dword [sym.imp.KERNEL32.dll_lstrlenA]
push eax
lea eax, [ebp - 0x118]
push eax
push 2
push 0x4013f4
lea eax, [ebp - 0x61c]
push eax
push 0x80000002
call fcn.00403390
add esp, 0x1c
jmp 0x4026ef
push dword [ebp - 0xc14]
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
push 0
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
push edi
mov edi, dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
call edi
push esi
call edi
test ebx, ebx
je 0x402731
push dword [ebp - 0xc2c]
lea eax, [ebp - 0x118]
push eax
push 0x401400
push 0x65
push 0
call fcn.00402dd0
add esp, 0x14
mov eax, ebx
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x14]
xor ecx, ebp
call fcn.00403e22
mov esp, ebp
pop ebp
ret
push 0x405194
lea eax, [ebp - 0xc30]
mov dword [ebp - 0xc30], 0x4012ed
push eax
call sub.VCRUNTIME140.dll__CxxThrowException
push 0x405194
lea eax, [ebp - 0xc38]
mov dword [ebp - 0xc38], 0x4012f0
push eax
call sub.VCRUNTIME140.dll__CxxThrowException
push 0x405194
lea eax, [ebp - 0xc3c]
mov dword [ebp - 0xc3c], 0x401314
push eax
call sub.VCRUNTIME140.dll__CxxThrowException
push 0x405194
lea eax, [ebp - 0xc40]
mov dword [ebp - 0xc40], 0x4013b8
push eax
call sub.VCRUNTIME140.dll__CxxThrowException
int3