Function at 0x401650
Capabilities:
Delete registry key
Persist via windows service
Set registry value

Disassembly:
sub esp, 0x534
push ebx
push esi
push edi
mov edi, edx
mov ebx, ecx
call fcn.004014a0
lea eax, [esp + 0x2c]
push ebx
push str.SystemCurrentControlSetServices_s
push eax
call sub.MSVCRT.dll_sprintf
add esp, 0xc
lea ecx, [esp + 0xc]
lea edx, [esp + 0x2c]
mov dword [esp + 0xc], 0
push ecx
push edx
push 0x80000002
call dword [sym.imp.ADVAPI32.dll_RegCreateKeyA]
test eax, eax
je 0x4016a4
pop edi
pop esi
xor eax, eax
pop ebx
add esp, 0x534
ret 4
mov ecx, dword [esp + 0xc]
mov esi, dword [sym.imp.ADVAPI32.dll_RegSetValueExA]
push ebp
lea eax, [esp + 0x14]
push 4
push eax
push 4
push 0
push str.Type
push ecx
mov dword [esp + 0x2c], 1
call esi
lea edx, [esp + 0x14]
mov eax, dword [esp + 0x10]
push 4
push edx
push 4
push 0
push str.ErrorControl
push eax
call esi
lea ecx, [esp + 0x14]
mov edx, dword [esp + 0x10]
push 4
push ecx
push 4
push 0
push str.Start
push edx
call esi
lea eax, [esp + 0x33c]
push edi
push str.___s
push eax
call sub.MSVCRT.dll_sprintf
lea edi, [esp + 0x348]
or ecx, 0xffffffff
xor eax, eax
add esp, 0xc
repne scasb al, byte es:[edi]
not ecx
mov edx, dword [esp + 0x10]
dec ecx
push ecx
lea ecx, [esp + 0x340]
push ecx
push 1
push eax
push str.ImagePath
push edx
call esi
mov eax, dword [esp + 0x10]
push eax
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
push str.ntdll.dll
call dword [sym.imp.KERNEL32.dll_GetModuleHandleA]
mov edi, dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov esi, eax
push str.RtlNtStatusToDosError
push esi
call edi
push str.RtlAnsiStringToUnicodeString
push esi
mov dword [esp + 0x24], eax
call edi
mov ebp, eax
push str.NtLoadDriver
push esi
call edi
push str.RtlFreeUnicodeString
push esi
mov dword [esp + 0x20], eax
call edi
lea ecx, [esp + 0x440]
mov esi, eax
push ebx
push str.RegistryMachineSystemCurrentControlSetServices_s
push ecx
call sub.MSVCRT.dll_sprintf
add esp, 0xc
lea edx, [esp + 0x440]
lea edi, [esp + 0x440]
or ecx, 0xffffffff
xor eax, eax
push 1
repne scasb al, byte es:[edi]
not ecx
dec ecx
lea eax, [esp + 0x2c]
mov word [esp + 0x2c], cx
lea ecx, [esp + 0x24]
push eax
push ecx
mov dword [esp + 0x38], edx
call ebp
lea edx, [esp + 0x20]
push edx
call dword [esp + 0x1c]
mov edi, eax
lea eax, [esp + 0x20]
push eax
call esi
lea ecx, [esp + 0x30]
lea edx, [esp + 0x134]
push ecx
push str._sEnum
push edx
call sub.MSVCRT.dll_sprintf
mov esi, dword [sym.imp.ADVAPI32.dll_RegDeleteKeyA]
add esp, 0xc
lea eax, [esp + 0x134]
push eax
push 0x80000002
call esi
lea ecx, [esp + 0x30]
lea edx, [esp + 0x134]
push ecx
push str._sSecurity
push edx
call sub.MSVCRT.dll_sprintf
add esp, 0xc
lea eax, [esp + 0x134]
push eax
push 0x80000002
call esi
lea ecx, [esp + 0x30]
lea edx, [esp + 0x134]
push ecx
push str._sEnum
push edx
call sub.MSVCRT.dll_sprintf
add esp, 0xc
lea eax, [esp + 0x134]
push eax
push 0x80000002
call esi
lea ecx, [esp + 0x30]
push ecx
push 0x80000002
call esi
test edi, edi
pop ebp
je 0x40188c
cmp edi, 0xc000010e
je 0x40188c
push edi
call dword [esp + 0x1c]
push eax
call dword [sym.imp.KERNEL32.dll_SetLastError]
xor eax, eax
pop edi
pop esi
pop ebx
add esp, 0x534
ret 4
push ebx
lea edx, [esp + 0x238]
push str.._s
push edx
call sub.MSVCRT.dll_sprintf
add esp, 0xc
mov esi, dword [sym.imp.KERNEL32.dll_CreateFileA]
lea eax, [esp + 0x234]
push 0
push 0x80
push 3
push 0
push 0
push 0xc0000000
push eax
call esi
cmp eax, 0xffffffff
jne 0x4018fb
push ebx
lea ecx, [esp + 0x238]
push str..Global_s
push ecx
call sub.MSVCRT.dll_sprintf
add esp, 0xc
lea edx, [esp + 0x234]
push 0
push 0x80
push 3
push 0
push 0
push 0xc0000000
push edx
call esi
mov ecx, dword [esp + 0x544]
xor edx, edx
cmp eax, 0xffffffff
pop edi
setne dl
mov dword [ecx], eax
pop esi
mov eax, edx
pop ebx
add esp, 0x534
ret 4