Function at 0x527330
Capabilities:
Create service
Delete registry value
Persist via windows service
Set registry value

Disassembly:
push 0xffffffffffffffff
push 0x5d2954
mov eax, dword fs:[0]
push eax
sub esp, 0xc8
push ebx
push ebp
push esi
push edi
mov eax, dword [0x65b4e4]
xor eax, esp
push eax
lea eax, [esp + 0xdc]
mov dword fs:[0], eax
xor ebp, ebp
push 0xf003f
push ebp
push ebp
mov dword [esp + 0x28], ebp
call dword [sym.imp.ADVAPI32.dll_OpenSCManagerA]
mov edi, eax
mov dword [esp + 0x20], edi
cmp edi, ebp
mov dword [esp + 0xe4], ebp
jne 0x527454
push 1
push 2
lea ecx, [esp + 0x64]
call fcn.0040b160
mov byte [esp + 0xe4], 1
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
lea eax, [esp + 0x60]
push str.OpenSCManager:
push eax
call fcn.00409c80
add esp, 8
mov ecx, eax
call fcn.004024e0
lea ecx, [esp + 0x24]
push ecx
lea ecx, [esp + 0x60]
call fcn.00409610
mov esi, 0x10
cmp dword [eax + 0x18], esi
mov byte [esp + 0xe4], 2
jb 0x5273df
mov eax, dword [eax + 4]
jmp 0x5273e2
add eax, 4
push eax
push str.BaseLib::CNTServiceManager::Install
push 0x145
push str..commonNTServiceManager.cpp
push 0xf0000000
call fcn.00409980
mov ecx, eax
call fcn.004fa910
cmp dword [esp + 0x3c], esi
jb 0x527416
mov edx, dword [esp + 0x28]
push edx
call fcn.00594e98
add esp, 4
lea ecx, [esp + 0xa8]
mov byte [esp + 0xe4], 0
call fcn.00409f20
lea eax, [esp + 0xa8]
push eax
mov dword [esp + 0xac], vtable.std::ios_base.0
call fcn.005cccbe
add esp, 4
push ebp
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
or eax, 0xffffffff
jmp 0x5279e4
mov ecx, dword [esp + 0x104]
mov edx, dword [esp + 0x100]
mov ebx, dword [esp + 0xfc]
mov eax, dword [esp + 0xf8]
push ebp
mov esi, dword [esp + 0xf0]
push ebp
push ecx
mov ecx, dword [esp + 0x100]
push ebp
push edx
mov edx, dword [esp + 0x104]
push ebx
push 1
push eax
push ecx
push 0xf01ff
push edx
push esi
push edi
call dword [sym.imp.ADVAPI32.dll_CreateServiceA]
cmp eax, ebp
mov ebp, dword [sym.imp.KERNEL32.dll_GetLastError]
jne 0x5275a1
call ebp
push 1
push 2
lea ecx, [esp + 0x64]
mov edi, eax
call fcn.0040b160
push edi
push 0x5f4b88
push esi
lea eax, [esp + 0x68]
push str.CreateService
push eax
mov byte [esp + 0xf8], 3
call fcn.00409c80
add esp, 8
push eax
call fcn.00409c80
add esp, 8
push eax
call fcn.00409c80
add esp, 8
mov ecx, eax
call fcn.004024e0
lea ecx, [esp + 0x24]
push ecx
lea ecx, [esp + 0x60]
call fcn.00409610
cmp dword [eax + 0x18], 0x10
mov byte [esp + 0xe4], 4
jb 0x527517
mov eax, dword [eax + 4]
jmp 0x52751a
add eax, 4
push eax
push str.BaseLib::CNTServiceManager::Install
push 0x15a
push str..commonNTServiceManager.cpp
push 0xf0000000
call fcn.00409980
mov ecx, eax
call fcn.004fa910
cmp dword [esp + 0x3c], 0x10
jb 0x52754f
mov edx, dword [esp + 0x28]
push edx
call fcn.00594e98
add esp, 4
lea ecx, [esp + 0xa8]
mov byte [esp + 0xe4], 0
call fcn.00409f20
lea eax, [esp + 0xa8]
push eax
mov dword [esp + 0xac], vtable.std::ios_base.0
call fcn.005cccbe
add esp, 4
cmp edi, 0x431
je 0x5275aa
cmp edi, 0x430
je 0x5275aa
mov ecx, dword [esp + 0x20]
push ecx
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
or eax, 0xffffffff
jmp 0x5279e4
push eax
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
jmp 0x5275ae
mov edi, dword [esp + 0x20]
lea edx, [esp + 0x1c]
push edx
push 0xf003f
push 0
push str.SYSTEMCurrentControlSetServices
push reloc.WS2_32.dll_bind
mov dword [esp + 0x30], 0
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExA]
test eax, eax
jne 0x52791f
mov ecx, dword [esp + 0x1c]
push eax
lea eax, [esp + 0x1c]
push eax
push 0
push 0xf003f
push 0
push 0
push 0
push esi
push ecx
call dword [sym.imp.ADVAPI32.dll_RegCreateKeyExA]
test eax, eax
jne 0x52783b
mov esi, dword [sym.imp.ADVAPI32.dll_RegSetValueExA]
push 4
lea edx, [esp + 0xfc]
push edx
push 4
push eax
mov eax, dword [esp + 0x28]
push str.Start
push eax
call esi
mov edx, dword [esp + 0x18]
push 4
lea ecx, [esp + 0xf8]
push ecx
push 4
push 0
push 0x5f6ec4
push edx
call esi
mov eax, dword [esp + 0x18]
push str.DeleteFlag
push eax
call dword [sym.imp.ADVAPI32.dll_RegDeleteValueA]
push 1
push 2
lea ecx, [esp + 0x64]
call fcn.0040b160
lea ecx, [esp + 0x5c]
push ebx
push ecx
mov byte [esp + 0xec], 5
call fcn.00409c80
add esp, 8
lea edx, [esp + 0x40]
push edx
lea ecx, [esp + 0x60]
call fcn.00409610
cmp dword [eax + 0x14], 3
jbe 0x52768c
cmp byte [ebx + 1], 0x3a
mov byte [esp + 0x17], 1
je 0x527691
mov byte [esp + 0x17], 0
lea ecx, [esp + 0x40]
call fcn.0040c050
cmp byte [esp + 0x17], 0
je 0x52772f
push 0x2e
push ebx
call fcn.005b1cb0
add esp, 8
test eax, eax
je 0x52772f
mov ecx, str..sys
lea edi, [ecx + 1]
lea esp, [esp]
mov dl, byte [ecx]
add ecx, 1
test dl, dl
jne 0x5276c0
sub ecx, edi
push ecx
push str..sys
push eax
call fcn.005b5c16
add esp, 0xc
test eax, eax
jne 0x52772f
push 0x62a4a0
lea ecx, [esp + 0x28]
call fcn.0040bf50
lea eax, [esp + 0x24]
push eax
lea ecx, [esp + 0x60]
mov byte [esp + 0xe8], 6
call fcn.0047f6c0
lea ecx, [esp + 0x24]
mov byte [esp + 0xe4], 5
call fcn.0040c050
push ebx
lea ecx, [esp + 0x60]
push 0x5f398c
push ecx
call fcn.00409c80
add esp, 8
push eax
call fcn.00409c80
add esp, 8
lea edx, [esp + 0x40]
push edx
lea ecx, [esp + 0x60]
call fcn.00409610
mov edi, eax
lea eax, [esp + 0x24]
push eax
lea ecx, [esp + 0x60]
mov byte [esp + 0xe8], 7
call fcn.00409610
mov edi, dword [edi + 0x14]
mov ebx, 0x10
cmp dword [eax + 0x18], ebx
jb 0x527767
mov eax, dword [eax + 4]
jmp 0x52776a
add eax, 4
mov ecx, dword [esp + 0x18]
push edi
push eax
push 2
push 0
push str.ImagePath
push ecx
call esi
cmp dword [esp + 0x3c], ebx
jb 0x52778f
mov edx, dword [esp + 0x28]
push edx
call fcn.00594e98
add esp, 4
cmp dword [esp + 0x58], ebx
mov dword [esp + 0x3c], 0xf
mov dword [esp + 0x38], 0
mov byte [esp + 0x28], 0
jb 0x5277b7
mov eax, dword [esp + 0x44]
push eax
call fcn.00594e98
add esp, 4
mov edx, dword [esp + 0x100]
test edx, edx
je 0x5277ed
cmp byte [edx], 0
je 0x5277ed
mov eax, edx
lea edi, [eax + 1]
lea esp, [esp]
mov cl, byte [eax]
add eax, 1
test cl, cl
jne 0x5277d0
mov ecx, dword [esp + 0x18]
sub eax, edi
push eax
push edx
push 1
push 0
push str.Group
push ecx
call esi
mov edx, dword [esp + 0x18]
push edx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
lea ecx, [esp + 0xa8]
mov byte [esp + 0xe4], 0
call fcn.00409f20
lea eax, [esp + 0xa8]
push eax
mov dword [esp + 0xac], vtable.std::ios_base.0
call fcn.005cccbe
mov edx, dword [esp + 0x20]
mov edi, dword [esp + 0x24]
add esp, 4
push edx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
jmp 0x5279db
push 1
push 2
lea ecx, [esp + 0x64]
call fcn.0040b160
mov byte [esp + 0xe4], 8
call ebp
push eax
push 0x5f6cac
push esi
lea ecx, [esp + 0x68]
push str.RegCreateKey
push ecx
call fcn.00409c80
add esp, 8
push eax
call fcn.00409c80
add esp, 8
push eax
call fcn.00409c80
add esp, 8
mov ecx, eax
call fcn.004024e0
lea edx, [esp + 0x40]
push edx
lea ecx, [esp + 0x60]
call fcn.00409610
mov esi, 0x10
cmp dword [eax + 0x18], esi
mov byte [esp + 0xe4], 9
jb 0x5278a9
mov eax, dword [eax + 4]
jmp 0x5278ac
add eax, 4
push eax
push str.BaseLib::CNTServiceManager::Install
push 0x18f
push str..commonNTServiceManager.cpp
push 0xf0000000
call fcn.00409980
mov ecx, eax
call fcn.004fa910
cmp dword [esp + 0x58], esi
jb 0x5278e0
mov eax, dword [esp + 0x44]
push eax
call fcn.00594e98
add esp, 4
lea ecx, [esp + 0xa8]
mov byte [esp + 0xe4], 0
call fcn.00409f20
lea ecx, [esp + 0xa8]
push ecx
mov dword [esp + 0xac], vtable.std::ios_base.0
call fcn.005cccbe
mov edx, dword [esp + 0x20]
add esp, 4
push edx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
jmp 0x5279db
push 1
push 2
lea ecx, [esp + 0x64]
call fcn.0040b160
mov byte [esp + 0xe4], 0xa
call ebp
push eax
lea eax, [esp + 0x60]
push str.RegOpenKey
push eax
call fcn.00409c80
add esp, 8
mov ecx, eax
call fcn.004024e0
lea ecx, [esp + 0x40]
push ecx
lea ecx, [esp + 0x60]
call fcn.00409610
mov esi, 0x10
cmp dword [eax + 0x18], esi
mov byte [esp + 0xe4], 0xb
jb 0x527975
mov eax, dword [eax + 4]
jmp 0x527978
add eax, 4
push eax
push str.BaseLib::CNTServiceManager::Install
push 0x196
push str..commonNTServiceManager.cpp
push 0xf0000000
call fcn.00409980
mov ecx, eax
call fcn.004fa910
cmp dword [esp + 0x58], esi
jb 0x5279ac
mov edx, dword [esp + 0x44]
push edx
call fcn.00594e98
add esp, 4
lea ecx, [esp + 0xa8]
mov byte [esp + 0xe4], 0
call fcn.00409f20
lea eax, [esp + 0xa8]
push eax
mov dword [esp + 0xac], vtable.std::ios_base.0
call fcn.005cccbe
add esp, 4
push edi
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
xor eax, eax
mov ecx, dword [esp + 0xdc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xd4
ret 0x1c