Function at 0x515520
Capabilities:
Create service
Modify service
Persist via windows service

Disassembly:
push 0xffffffffffffffff
push 0x755bc0
mov eax, dword fs:[0]
push eax
sub esp, 0x44
mov eax, dword [0x81f390]
xor eax, esp
mov dword [esp + 0x40], eax
push ebx
push ebp
push esi
push edi
mov eax, dword [0x81f390]
xor eax, esp
push eax
lea eax, [esp + 0x58]
mov dword fs:[0], eax
mov esi, ecx
mov eax, dword [esi]
push 3
mov eax, dword [eax]
call eax
test al, al
je 0x51577b
mov ecx, dword [esi + 0x68]
xor edi, edi
mov eax, ecx
and eax, 3
cmp eax, 3
ja case.default.0x515573
jmp dword [eax*4 + 0x5157b4]
mov edi, 3
jmp case.default.0x515573
mov edi, 2
jmp case.default.0x515573
mov edi, 1
jmp case.default.0x515573
xor edi, edi
test cl, 8
je 0x51559d
mov ebx, 1
jmp 0x5155ad
test cl, 4
mov ebx, 0x10
mov eax, 0x110
cmovne ebx, eax
mov eax, dword [esi + 0x118]
test eax, eax
je 0x5155d1
test byte [esi + 0x12c], 2
jne 0x5155fa
push eax
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov dword [esi + 0x118], 0
lea eax, [esi + 0x90]
mov dword [esi + 0x12c], 2
cmp dword [eax + 0x14], 0x10
jb 0x5155e9
mov eax, dword [eax]
push 2
push 0
push eax
call dword [sym.imp.ADVAPI32.dll_OpenSCManagerA]
mov dword [esi + 0x118], eax
cmp dword [esi + 0x118], 0
mov ecx, esi
jne 0x515611
push 0
push 0x45c
call fcn.00516420
lea eax, [esp + 0x38]
push eax
call fcn.00514bc0
mov eax, dword [esi + 0x68]
mov ecx, esi
shr eax, 3
and al, 1
mov dword [esp + 0x60], 0
mov byte [esp + 0x14], al
lea eax, [esp + 0x18]
push dword [esp + 0x14]
push eax
call fcn.00515130
cmp dword [esp + 0x50], 0x10
lea ebp, [esp + 0x3c]
lea edx, [eax + 4]
mov byte [esp + 0x60], 1
cmovae ebp, dword [esp + 0x3c]
cmp dword [edx + 0x14], 0x10
jb 0x51565d
mov edx, dword [edx]
cmp dword [esi + 0xdc], 0x10
lea eax, [esi + 0xc8]
jb 0x51566e
mov eax, dword [eax]
cmp dword [esi + 0xc0], 0x10
lea ecx, [esi + 0xac]
jb 0x51567f
mov ecx, dword [ecx]
push 0
push 0
push ebp
push 0
push 0
push edx
push 1
push edi
push ebx
push 2
push eax
push ecx
push dword [esi + 0x118]
call dword [sym.imp.ADVAPI32.dll_CreateServiceA]
cmp dword [esp + 0x30], 0x10
mov dword [esi + 0x11c], eax
mov byte [esp + 0x60], 0
mov dword [esp + 0x18], vtable.wbs::StringBase_char_.0
jb 0x5156c3
push dword [esp + 0x1c]
call fcn.006f75a9
add esp, 4
cmp dword [esi + 0x11c], 0
jne 0x5156da
push 0
push 0x460
mov ecx, esi
call fcn.00516420
cmp dword [esi + 0x110], 0
mov dword [esp + 0x34], 0
jne 0x5156fd
lea eax, [esi + 0xc4]
push eax
lea ecx, [esi + 0xfc]
call fcn.004f59b0
cmp dword [esi + 0x114], 0x10
lea eax, [esi + 0x100]
jb 0x51570e
mov eax, dword [eax]
push eax
call fcn.00702ecc
add esp, 4
mov dword [esp + 0x34], eax
lea eax, [esp + 0x34]
push eax
push 1
push dword [esi + 0x11c]
call dword [sym.imp.ADVAPI32.dll_ChangeServiceConfig2A]
test eax, eax
jne 0x515738
call dword [sym.imp.KERNEL32.dll_GetLastError]
push dword [esp + 0x34]
call fcn.006f8852
add esp, 4
test byte [esi + 0x68], 0x10
je 0x515752
lea ecx, [esi + 4]
call fcn.005270d0
mov eax, dword [esi]
mov ecx, esi
push 4
mov eax, dword [eax]
call eax
mov dword [esp + 0x38], vtable.wbs::StringBase_char_.0
test al, al
jne 0x51577f
cmp dword [esp + 0x50], 0x10
jb 0x51577b
push dword [esp + 0x3c]
call fcn.006f75a9
add esp, 4
xor al, al
jmp 0x515794
cmp dword [esp + 0x50], 0x10
jb 0x515792
push dword [esp + 0x3c]
call fcn.006f75a9
add esp, 4
mov al, 1
mov ecx, dword [esp + 0x58]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
mov ecx, dword [esp + 0x40]
xor ecx, esp
call fcn.006f7ca4
add esp, 0x50
ret