Function at 0x497550
Capabilities:
Create service
Delete service
Modify service
Persist via windows service
Query service status
Start service

Disassembly:
push 0xffffffffffffffff
push 0x5890a2
mov eax, dword fs:[0]
push eax
sub esp, 0x250
mov eax, dword [0x5f4760]
xor eax, esp
mov dword [esp + 0x24c], eax
push ebp
push esi
push edi
mov eax, dword [0x5f4760]
xor eax, esp
push eax
lea eax, [esp + 0x260]
mov dword fs:[0], eax
lea eax, [esp + 0x14]
push eax
call fcn.004030f0
xor ebp, ebp
mov dword [esp + 0x268], ebp
lea ecx, [esp + 0x18]
push ecx
call fcn.004030f0
mov byte [esp + 0x268], 1
push 0x104
lea edx, [esp + 0x58]
push edx
push ebp
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
test eax, eax
jne 0x4975f3
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebx], eax
mov byte [esp + 0x268], 0
lea eax, [esp + 0x18]
push eax
call fcn.00403090
mov dword [esp + 0x268], 0xffffffff
lea ecx, [esp + 0x14]
push ecx
jmp 0x497b33
lea edx, [esp + 0x24]
push edx
lea eax, [esp + 0x58]
call fcn.0049c790
add esp, 4
test eax, eax
je 0x497615
mov eax, dword [esp + 0x24]
cmp eax, ebp
je 0x497615
cmp eax, 1
jne 0x497620
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebx + 4], eax
jmp 0x4975cc
lea edx, [esp + 0x54]
lea edi, [esp + 0x18]
call fcn.00408470
mov esi, edi
call fcn.00493970
mov edx, dword [esp + 0x18]
push str._service
push edx
push str.__s___s
lea edi, [esp + 0x20]
call fcn.00413090
add esp, 0xc
lea edi, [ebx + 0x34]
mov eax, esi
call fcn.004963c0
mov eax, dword [esp + 0x14]
mov eax, dword [eax - 0xc]
cmp eax, ebp
jle 0x497b0a
cmp eax, 0x104
jg 0x497b0a
push 0xf003f
push ebp
push ebp
call dword [sym.imp.ADVAPI32.dll_OpenSCManagerW]
mov edi, eax
mov dword [esp + 0x2c], edi
cmp edi, ebp
jne 0x4976b8
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebx + 0xc], eax
mov byte [esp + 0x268], 0
mov ecx, esi
push ecx
call fcn.00403090
mov dword [esp + 0x268], 0xffffffff
lea edx, [esp + 0x14]
push edx
jmp 0x497b33
push 0xf003f
push str.360EntPublishSrv
push edi
mov dword [esp + 0x2c], ebp
call dword [sym.imp.ADVAPI32.dll_OpenServiceW]
mov ebp, eax
xor eax, eax
cmp ebp, eax
je 0x497975
mov dword [esp + 0x38], eax
mov dword [esp + 0x3c], eax
mov dword [esp + 0x40], eax
mov dword [esp + 0x44], eax
mov dword [esp + 0x48], eax
mov dword [esp + 0x4c], eax
mov dword [esp + 0x50], eax
lea eax, [esp + 0x38]
push eax
mov esi, 1
push ebp
mov dword [ebx + 0x10], esi
call dword [sym.imp.ADVAPI32.dll_QueryServiceStatus]
test eax, eax
je 0x497950
mov eax, dword [esp + 0x38]
mov dword [ebx + 0x14], esi
mov dword [ebx + 0x18], eax
cmp eax, 0x10
je 0x49778c
cmp eax, 0x20
je 0x49778c
push ecx
mov ecx, esp
mov dword [esp + 0x28], esp
lea edx, [esp + 0x18]
push edx
push ecx
call fcn.00492a00
mov byte [esp + 0x26c], 7
mov byte [esp + 0x26c], 1
call fcn.00497430
mov eax, dword [esp + 0x18]
add esp, 4
push str.this_is_360EntPublishSrv
push 0
push 0
push 0
push 0
push 0
push eax
push esi
push 2
push 0x10
push ebp
mov dword [esp + 0x4c], esi
call dword [sym.imp.ADVAPI32.dll_ChangeServiceConfigW]
mov esi, dword [sym.imp.KERNEL32.dll_GetLastError]
call esi
push ebp
mov dword [ebx + 0x3c], eax
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
xor ebp, ebp
jmp 0x497988
lea ecx, [esp + 0x1c]
push ecx
mov ecx, ebp
call fcn.00497010
add esp, 4
mov byte [esp + 0x268], 2
lea esi, [esp + 0x1c]
call fcn.00493970
lea edi, [ebx + 0x38]
mov eax, esi
call fcn.004963c0
mov ecx, dword [esp + 0x1c]
mov eax, dword [ecx - 0xc]
test eax, eax
je 0x497811
jge 0x4977cd
push 0x80070057
call fcn.00401e70
movzx eax, word [ecx]
cmp ax, 0x22
jne 0x497811
lea edx, [esp + 0x24]
push edx
lea eax, [esp + 0x20]
push eax
mov edx, 1
call fcn.00497be0
mov byte [esp + 0x268], 3
lea edi, [esp + 0x1c]
call fcn.004963c0
mov byte [esp + 0x268], 2
lea ecx, [esp + 0x24]
push ecx
call fcn.00403090
mov ecx, dword [esp + 0x1c]
mov ecx, dword [ecx - 0xc]
mov eax, dword [esp + 0x18]
mov esi, dword [sym.imp.KERNEL32.dll_GetLastError]
xor edi, edi
cmp ecx, dword [eax - 0xc]
jl 0x4978d8
mov ecx, dword [eax - 0xc]
lea edx, [esp + 0x24]
push edx
lea edx, [esp + 0x20]
call fcn.00497c50
mov byte [esp + 0x268], 4
mov eax, dword [esp + 0x18]
mov edx, dword [eax - 0xc]
lea ecx, [esp + 0x30]
push ecx
lea eax, [esp + 0x20]
push eax
call fcn.00497be0
mov byte [esp + 0x268], 5
mov ecx, dword [esp + 0x18]
xor eax, eax
test ecx, ecx
setne al
test eax, eax
jne 0x497879
push 0x80004005
call fcn.00401e70
push ecx
mov ecx, dword [esp + 0x28]
push ecx
call fcn.004aa763
add esp, 8
test eax, eax
jne 0x4978b0
mov ecx, dword [esp + 0x30]
mov eax, dword [ecx - 0xc]
test eax, eax
jle 0x4978b0
jge 0x4978a2
push 0x80070057
call fcn.00401e70
movzx eax, word [ecx]
cmp ax, 0x22
jne 0x4978b0
mov edi, 1
mov byte [esp + 0x268], 4
lea edx, [esp + 0x30]
push edx
call fcn.00403090
mov byte [esp + 0x268], 2
lea eax, [esp + 0x24]
push eax
call fcn.00403090
test edi, edi
jne 0x497938
push ecx
mov ecx, esp
mov dword [esp + 0x28], esp
lea edx, [esp + 0x18]
push edx
push ecx
mov dword [ebx + 0x1c], 1
call fcn.00492a00
mov byte [esp + 0x26c], 6
mov byte [esp + 0x26c], 2
call fcn.00497430
mov eax, dword [esp + 0x18]
add esp, 4
push str.this_is_360EntPublishSrv
push 0
push 0
push 0
push 0
push 0
push eax
push 1
push 2
push 0x10
push ebp
call dword [sym.imp.ADVAPI32.dll_ChangeServiceConfigW]
call esi
push ebp
mov dword [ebx + 0x3c], eax
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
xor ebp, ebp
mov byte [esp + 0x268], 1
lea ecx, [esp + 0x1c]
push ecx
call fcn.00403090
mov edi, dword [esp + 0x2c]
jmp 0x497988
mov esi, dword [sym.imp.KERNEL32.dll_GetLastError]
call esi
push ebp
mov dword [ebx + 0x2c], eax
mov dword [esp + 0x24], 1
call dword [sym.imp.ADVAPI32.dll_DeleteService]
push ebp
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
xor ebp, ebp
jmp 0x497988
mov esi, dword [sym.imp.KERNEL32.dll_GetLastError]
call esi
mov dword [ebx + 0x30], eax
mov dword [esp + 0x20], 1
mov eax, dword [esp + 0x20]
mov dword [ebx + 0x20], eax
test eax, eax
je 0x497a24
mov edi, dword [sym.imp.ADVAPI32.dll_CreateServiceW]
mov dword [esp + 0x20], 0
cmp dword [esp + 0x20], 0
jle 0x4979d6
push ecx
mov edx, esp
mov dword [esp + 0x28], esp
lea eax, [esp + 0x18]
push eax
push edx
call fcn.00492a00
mov byte [esp + 0x26c], 8
mov byte [esp + 0x26c], 1
call fcn.00497430
add esp, 4
mov ecx, dword [esp + 0x14]
push 0
mov edx, dword [esp + 0x30]
push 0
push 0
push 0
push 0
push ecx
push 1
push 2
push 0x10
push 0xf01ff
push str.this_is_360EntPublishSrv
push str.360EntPublishSrv
push edx
call edi
mov ebp, eax
call esi
mov dword [ebx + 0x44], eax
test ebp, ebp
jne 0x497a56
push 0x320
call dword [sym.imp.KERNEL32.dll_Sleep]
cmp dword [esp + 0x20], 5
jge 0x497a42
inc dword [esp + 0x20]
jmp 0x4979a5
test ebp, ebp
jne 0x497a5a
push 0xf003f
push str.360EntPublishSrv
push edi
call dword [sym.imp.ADVAPI32.dll_OpenServiceW]
mov ebp, eax
call esi
mov dword [ebx + 0x48], eax
jmp 0x497a46
mov edi, dword [esp + 0x2c]
test ebp, ebp
jne 0x497a5a
mov dword [ebx + 0x4c], 1
jmp 0x4975cc
mov edi, dword [esp + 0x2c]
lea edx, [esp + 0x28]
push edx
mov ecx, str.360
call fcn.00408390
mov byte [esp + 0x268], 9
mov eax, dword [esp + 0x28]
lea ecx, [esp + 0x34]
push ecx
push 1
push ebp
mov dword [esp + 0x40], eax
call dword [sym.imp.ADVAPI32.dll_ChangeServiceConfig2W]
call fcn.00497180
push 0
push 0
push ebp
call dword [sym.imp.ADVAPI32.dll_StartServiceW]
test eax, eax
je 0x497ae7
mov esi, dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
push ebp
call esi
push edi
call esi
mov byte [esp + 0x268], 1
lea edx, [esp + 0x28]
push edx
call fcn.00403090
mov byte [esp + 0x268], 0
lea eax, [esp + 0x18]
push eax
call fcn.00403090
mov dword [esp + 0x268], 0xffffffff
lea ecx, [esp + 0x14]
push ecx
call fcn.00403090
mov eax, 1
jmp 0x497b3a
call esi
mov dword [ebx + 0x28], eax
cmp eax, 0x420
je 0x497aa7
mov byte [esp + 0x268], 1
lea edx, [esp + 0x28]
push edx
call fcn.00403090
jmp 0x4975cc
mov dword [ebx + 8], 1
mov byte [esp + 0x268], 0
lea edx, [esp + 0x18]
push edx
call fcn.00403090
mov dword [esp + 0x268], 0xffffffff
lea eax, [esp + 0x14]
push eax
call fcn.00403090
xor eax, eax
mov ecx, dword [esp + 0x260]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
mov ecx, dword [esp + 0x24c]
xor ecx, esp
call fcn.004a314d
add esp, 0x25c
ret