Function at 0x4e0940
Capabilities:
Create service
Delete service
Modify service
Persist via windows service

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x5d4f35
mov eax, dword fs:[0]
push eax
push ecx
sub esp, 0x6f4
mov eax, dword [0x671330]
xor eax, ebp
mov dword [ebp - 0x14], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov dword [ebp - 0x10], esp
mov dword [ebp - 0x504], 0
mov dword [ebp - 0x500], 0
xor eax, eax
mov word [ebp - 0x21c], ax
push 0x206
push 0
lea ecx, [ebp - 0x21a]
push ecx
call sub.VCRUNTIME140.dll_memset
add esp, 0xc
push 0x104
lea edx, [ebp - 0x21c]
push edx
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
test eax, eax
jne 0x4e09e8
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x50c], eax
mov eax, dword [ebp - 0x50c]
push eax
push str.Error__Failed_to_install_service__0x_x__n
call fcn.004e3e20
add esp, 8
mov eax, dword [ebp - 0x50c]
jmp 0x4e1491
push 0xf003f
push 0
push 0
call dword [sym.imp.ADVAPI32.dll_OpenSCManagerW]
mov dword [ebp - 0x504], eax
cmp dword [ebp - 0x504], 0
jne 0x4e0a31
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x510], eax
mov ecx, dword [ebp - 0x510]
push ecx
push 0x5ef570
call fcn.004e3e20
add esp, 8
mov eax, dword [ebp - 0x510]
jmp 0x4e1491
mov dword [ebp - 0x524], 0
lea edx, [ebp - 0x24c]
push edx
call fcn.00473f30
add esp, 4
mov dword [ebp - 4], 0
cmp dword [ebp + 8], 0
jne 0x4e136c
push 0
push 0
push 0
push 0
push 0
lea eax, [ebp - 0x21c]
push eax
push 1
push 2
push 0x10
push 0xf01ff
lea ecx, [ebp - 0x24c]
call fcn.0040bfe0
push eax
lea ecx, [ebp - 0x24c]
call fcn.0040bfe0
push eax
mov ecx, dword [ebp - 0x504]
push ecx
call dword [sym.imp.ADVAPI32.dll_CreateServiceW]
mov dword [ebp - 0x500], eax
cmp dword [ebp - 0x500], 0
jne 0x4e0b01
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x514], eax
mov edx, dword [ebp - 0x514]
push edx
push 0x5ef5b8
call fcn.004e3e20
add esp, 8
mov eax, dword [ebp - 0x504]
push eax
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov ecx, dword [ebp - 0x514]
mov dword [ebp - 0x57c], ecx
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x24c]
call fcn.0040a7f0
mov eax, dword [ebp - 0x57c]
jmp 0x4e1491
mov dword [ebp - 0x4e8], 0
mov dword [ebp - 0x4e8], str.TsmSvc_system_service
lea edx, [ebp - 0x4e8]
push edx
push 1
mov eax, dword [ebp - 0x500]
push eax
call dword [sym.imp.ADVAPI32.dll_ChangeServiceConfig2W]
mov ecx, 8
imul edx, ecx, 0
mov dword [ebp + edx - 0x234], 1
mov eax, 8
imul ecx, eax, 0
mov dword [ebp + ecx - 0x230], 0x1d4c0
mov edx, 8
shl edx, 0
mov dword [ebp + edx - 0x234], 1
mov eax, 8
shl eax, 0
mov dword [ebp + eax - 0x230], 0x1d4c0
mov ecx, 8
shl ecx, 1
mov dword [ebp + ecx - 0x234], 0
mov edx, 8
shl edx, 1
mov dword [ebp + edx - 0x230], 0x1d4c0
mov dword [ebp - 0x4fc], 0
xor eax, eax
mov dword [ebp - 0x4f8], eax
mov dword [ebp - 0x4f4], eax
mov dword [ebp - 0x4f0], eax
mov dword [ebp - 0x4ec], eax
mov dword [ebp - 0x4fc], 0x15180
mov dword [ebp - 0x4f8], 0
mov dword [ebp - 0x4f4], 0
mov dword [ebp - 0x4f0], 3
mov ecx, 8
imul edx, ecx, 0
lea eax, [ebp + edx - 0x234]
mov dword [ebp - 0x4ec], eax
lea ecx, [ebp - 0x4fc]
push ecx
push 2
mov edx, dword [ebp - 0x500]
push edx
call dword [sym.imp.ADVAPI32.dll_ChangeServiceConfig2W]
mov dword [ebp - 0x518], 0
mov dword [ebp - 0x4e4], 0
mov byte [ebp - 4], 1
mov dword [ebp - 0x4e0], 0
xor eax, eax
mov dword [ebp - 0x260], eax
mov dword [ebp - 0x25c], eax
mov dword [ebp - 0x258], eax
mov dword [ebp - 0x254], eax
mov dword [ebp - 0x250], eax
lea ecx, [ebp - 0x4e0]
push ecx
push 0
lea edx, [ebp - 0x260]
push edx
push 4
mov eax, dword [ebp - 0x500]
push eax
call dword [sym.imp.ADVAPI32.dll_QueryServiceObjectSecurity]
cmp dword [ebp - 0x4e0], 0
jne 0x4e0d7c
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x584], eax
push 0x98
lea ecx, [ebp - 0x310]
call fcn.004029d0
push 1
push 2
lea ecx, [ebp - 0x310]
call fcn.00416190
mov dword [ebp - 0x5b0], eax
mov byte [ebp - 4], 2
push str.Failed_to_get_service_security_information_length__0x
lea ecx, [ebp - 0x310]
push ecx
call fcn.00414ff0
add esp, 8
mov dword [ebp - 0x580], eax
push 0x416260
mov ecx, dword [ebp - 0x580]
call dword [sym.imp.MSVCP140.dll_public:_class_std::basic_ostream_char__struct_std::char_traits_char______thiscall_std::basic_ostream_char__struct_std::char_traits_char__::operator___class_std::ios_base_____cdecl___class_std::ios_base___]
mov dword [ebp - 0x588], eax
mov edx, dword [ebp - 0x584]
push edx
mov ecx, dword [ebp - 0x588]
call dword [sym.imp.MSVCP140.dll_public:_class_std::basic_ostream_char__struct_std::char_traits_char______thiscall_std::basic_ostream_char__struct_std::char_traits_char__::operator___unsigned_long_int_]
mov dword [ebp - 0x58c], eax
push 0x5ef56c
mov eax, dword [ebp - 0x58c]
push eax
call fcn.00414ff0
add esp, 8
lea ecx, [ebp - 0x5fc]
push ecx
lea ecx, [ebp - 0x310]
call fcn.00414da0
mov dword [ebp - 0x590], eax
mov edx, dword [ebp - 0x590]
mov dword [ebp - 0x594], edx
mov byte [ebp - 4], 3
mov eax, dword [ebp - 0x594]
push eax
lea ecx, [ebp - 0x5c0]
call fcn.0040b380
push 0x638088
lea ecx, [ebp - 0x5c0]
push ecx
call sub.VCRUNTIME140.dll__CxxThrowException
mov byte [ebp - 4], 2
lea ecx, [ebp - 0x5fc]
call fcn.0040b3b0
mov byte [ebp - 4], 1
lea ecx, [ebp - 0x310]
call fcn.00415390
mov edx, dword [ebp - 0x4e0]
push edx
push 0x40
call dword [sym.imp.KERNEL32.dll_LocalAlloc]
mov dword [ebp - 0x4dc], eax
lea eax, [ebp - 0x4e0]
push eax
mov ecx, dword [ebp - 0x4e0]
push ecx
mov edx, dword [ebp - 0x4dc]
push edx
push 4
mov eax, dword [ebp - 0x500]
push eax
call dword [sym.imp.ADVAPI32.dll_QueryServiceObjectSecurity]
mov dword [ebp - 0x508], eax
cmp dword [ebp - 0x508], 0
jne 0x4e0ec4
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x59c], eax
push 0x98
lea ecx, [ebp - 0x3a8]
call fcn.004029d0
push 1
push 2
lea ecx, [ebp - 0x3a8]
call fcn.00416190
mov dword [ebp - 0x5b4], eax
mov byte [ebp - 4], 4
push str.QueryServiceObjectSecurity_failed__0x
lea ecx, [ebp - 0x3a8]
push ecx
call fcn.00414ff0
add esp, 8
mov dword [ebp - 0x598], eax
push 0x416260
mov ecx, dword [ebp - 0x598]
call dword [sym.imp.MSVCP140.dll_public:_class_std::basic_ostream_char__struct_std::char_traits_char______thiscall_std::basic_ostream_char__struct_std::char_traits_char__::operator___class_std::ios_base_____cdecl___class_std::ios_base___]
mov dword [ebp - 0x5a0], eax
mov edx, dword [ebp - 0x59c]
push edx
mov ecx, dword [ebp - 0x5a0]
call dword [sym.imp.MSVCP140.dll_public:_class_std::basic_ostream_char__struct_std::char_traits_char______thiscall_std::basic_ostream_char__struct_std::char_traits_char__::operator___unsigned_long_int_]
mov dword [ebp - 0x528], eax
push 0x5ef5b4
mov eax, dword [ebp - 0x528]
push eax
call fcn.00414ff0
add esp, 8
lea ecx, [ebp - 0x614]
push ecx
lea ecx, [ebp - 0x3a8]
call fcn.00414da0
mov dword [ebp - 0x52c], eax
mov edx, dword [ebp - 0x52c]
mov dword [ebp - 0x530], edx
mov byte [ebp - 4], 5
mov eax, dword [ebp - 0x530]
push eax
lea ecx, [ebp - 0x5d8]
call fcn.0040b380
push 0x638088
lea ecx, [ebp - 0x5d8]
push ecx
call sub.VCRUNTIME140.dll__CxxThrowException
mov byte [ebp - 4], 4
lea ecx, [ebp - 0x614]
call fcn.0040b3b0
mov byte [ebp - 4], 1
lea ecx, [ebp - 0x3a8]
call fcn.00415390
push 0
lea edx, [ebp - 0x4e4]
push edx
push 4
push 1
mov eax, dword [ebp - 0x4dc]
push eax
call sub.ADVAPI32.dll_ConvertSecurityDescriptorToStringSecurityDescriptorW
mov dword [ebp - 0x508], eax
cmp dword [ebp - 0x4dc], 0
je 0x4e0f03
mov ecx, dword [ebp - 0x4dc]
push ecx
call dword [sym.imp.KERNEL32.dll_LocalFree]
mov dword [ebp - 0x4dc], 0
mov edx, dword [ebp - 0x4e4]
push edx
lea ecx, [ebp - 0x278]
call fcn.0040b2a0
mov dword [ebp - 0x5a4], eax
mov byte [ebp - 4], 6
mov eax, dword [0x683e50]
mov ecx, dword fs:[0x2c]
mov edx, dword [ecx + eax*4]
mov eax, dword [0x6836c4]
cmp eax, dword [edx + 4]
jle 0x4e0f90
push 0x6836c4
call fcn.00544650
add esp, 4
cmp dword [0x6836c4], 0xffffffff
jne 0x4e0f90
mov byte [ebp - 4], 7
push 8
mov ecx, 0x6836bc
call fcn.004029d0
push 0
push str._A_________:IAP_U_
mov ecx, 0x6836bc
call fcn.0045d8f0
push 0x5df4f0
call fcn.005444ea
add esp, 4
mov byte [ebp - 4], 6
push 0x6836c4
call fcn.00544611
add esp, 4
push 0
push 0x5ef6a0
push 0x6836bc
lea ecx, [ebp - 0x278]
push ecx
lea edx, [ebp - 0x65c]
push edx
call fcn.004df750
add esp, 0x14
mov dword [ebp - 0x534], eax
mov eax, dword [ebp - 0x534]
push eax
lea ecx, [ebp - 0x278]
call fcn.00421880
lea ecx, [ebp - 0x65c]
call fcn.0040a7f0
push 0
lea ecx, [ebp - 0x4dc]
push ecx
push 1
lea ecx, [ebp - 0x278]
call fcn.0040bfe0
push eax
call sub.ADVAPI32.dll_ConvertStringSecurityDescriptorToSecurityDescriptorW
mov dword [ebp - 0x508], eax
cmp dword [ebp - 0x508], 0
jne 0x4e1100
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x53c], eax
push 0x98
lea ecx, [ebp - 0x440]
call fcn.004029d0
push 1
push 2
lea ecx, [ebp - 0x440]
call fcn.00416190
mov dword [ebp - 0x5a8], eax
mov byte [ebp - 4], 8
push str.ConvertStringSecurityDescriptorToSecurityDescriptor_failed__0x
lea edx, [ebp - 0x440]
push edx
call fcn.00414ff0
add esp, 8
mov dword [ebp - 0x538], eax
push 0x416260
mov ecx, dword [ebp - 0x538]
call dword [sym.imp.MSVCP140.dll_public:_class_std::basic_ostream_char__struct_std::char_traits_char______thiscall_std::basic_ostream_char__struct_std::char_traits_char__::operator___class_std::ios_base_____cdecl___class_std::ios_base___]
mov dword [ebp - 0x540], eax
mov eax, dword [ebp - 0x53c]
push eax
mov ecx, dword [ebp - 0x540]
call dword [sym.imp.MSVCP140.dll_public:_class_std::basic_ostream_char__struct_std::char_traits_char______thiscall_std::basic_ostream_char__struct_std::char_traits_char__::operator___unsigned_long_int_]
mov dword [ebp - 0x544], eax
push 0x5ef6a4
mov ecx, dword [ebp - 0x544]
push ecx
call fcn.00414ff0
add esp, 8
lea edx, [ebp - 0x62c]
push edx
lea ecx, [ebp - 0x440]
call fcn.00414da0
mov dword [ebp - 0x548], eax
mov eax, dword [ebp - 0x548]
mov dword [ebp - 0x54c], eax
mov byte [ebp - 4], 9
mov ecx, dword [ebp - 0x54c]
push ecx
lea ecx, [ebp - 0x5e4]
call fcn.0040b380
push 0x638088
lea edx, [ebp - 0x5e4]
push edx
call sub.VCRUNTIME140.dll__CxxThrowException
mov byte [ebp - 4], 8
lea ecx, [ebp - 0x62c]
call fcn.0040b3b0
mov byte [ebp - 4], 6
lea ecx, [ebp - 0x440]
call fcn.00415390
mov eax, dword [ebp - 0x4dc]
push eax
push 4
mov ecx, dword [ebp - 0x500]
push ecx
call dword [sym.imp.ADVAPI32.dll_SetServiceObjectSecurity]
mov dword [ebp - 0x508], eax
cmp dword [ebp - 0x508], 0
jne 0x4e1225
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x554], eax
push 0x98
lea ecx, [ebp - 0x4d8]
call fcn.004029d0
push 1
push 2
lea ecx, [ebp - 0x4d8]
call fcn.00416190
mov dword [ebp - 0x5ac], eax
mov byte [ebp - 4], 0xa
push str.SetServiceObjectSecurity_failed__0x
lea edx, [ebp - 0x4d8]
push edx
call fcn.00414ff0
add esp, 8
mov dword [ebp - 0x550], eax
push 0x416260
mov ecx, dword [ebp - 0x550]
call dword [sym.imp.MSVCP140.dll_public:_class_std::basic_ostream_char__struct_std::char_traits_char______thiscall_std::basic_ostream_char__struct_std::char_traits_char__::operator___class_std::ios_base_____cdecl___class_std::ios_base___]
mov dword [ebp - 0x558], eax
mov eax, dword [ebp - 0x554]
push eax
mov ecx, dword [ebp - 0x558]
call dword [sym.imp.MSVCP140.dll_public:_class_std::basic_ostream_char__struct_std::char_traits_char______thiscall_std::basic_ostream_char__struct_std::char_traits_char__::operator___unsigned_long_int_]
mov dword [ebp - 0x55c], eax
push 0x5ef6e8
mov ecx, dword [ebp - 0x55c]
push ecx
call fcn.00414ff0
add esp, 8
lea edx, [ebp - 0x644]
push edx
lea ecx, [ebp - 0x4d8]
call fcn.00414da0
mov dword [ebp - 0x560], eax
mov eax, dword [ebp - 0x560]
mov dword [ebp - 0x564], eax
mov byte [ebp - 4], 0xb
mov ecx, dword [ebp - 0x564]
push ecx
lea ecx, [ebp - 0x5cc]
call fcn.0040b380
push 0x638088
lea edx, [ebp - 0x5cc]
push edx
call sub.VCRUNTIME140.dll__CxxThrowException
mov byte [ebp - 4], 0xa
lea ecx, [ebp - 0x644]
call fcn.0040b3b0
mov byte [ebp - 4], 6
lea ecx, [ebp - 0x4d8]
call fcn.00415390
push 1
lea eax, [ebp - 0x21c]
push eax
lea ecx, [ebp - 0x24c]
push ecx
call fcn.004e0410
add esp, 0xc
push str.Service_installed_successfully_n
call fcn.004e3e20
add esp, 4
mov byte [ebp - 4], 1
lea ecx, [ebp - 0x278]
call fcn.0040a7f0
jmp 0x4e132b
mov dword [ebp - 4], 0
jmp 0x4e133b
cmp dword [ebp - 0x4e4], 0
je 0x4e1351
mov eax, dword [ebp - 0x4e4]
push eax
call dword [sym.imp.KERNEL32.dll_LocalFree]
cmp dword [ebp - 0x518], 0
je 0x4e1367
mov ecx, dword [ebp - 0x518]
push ecx
call dword [sym.imp.KERNEL32.dll_LocalFree]
jmp 0x4e1453
push 0xf003f
lea ecx, [ebp - 0x24c]
call fcn.0040bfe0
push eax
mov edx, dword [ebp - 0x504]
push edx
call dword [sym.imp.ADVAPI32.dll_OpenServiceW]
mov dword [ebp - 0x500], eax
cmp dword [ebp - 0x500], 0
jne 0x4e13ef
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x51c], eax
mov eax, dword [ebp - 0x51c]
push eax
push str.Error__Failed_to_OpenService__0x_x__n
call fcn.004e3e20
add esp, 8
mov ecx, dword [ebp - 0x504]
push ecx
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov edx, dword [ebp - 0x51c]
mov dword [ebp - 0x574], edx
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x24c]
call fcn.0040a7f0
mov eax, dword [ebp - 0x574]
jmp 0x4e1491
mov eax, dword [ebp - 0x500]
push eax
call dword [sym.imp.ADVAPI32.dll_DeleteService]
test eax, eax
jne 0x4e142e
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x520], eax
mov ecx, dword [ebp - 0x520]
push ecx
push str.Error__Failed_to_DeleteService__0x_x__n
call fcn.004e3e20
add esp, 8
mov edx, dword [ebp - 0x520]
mov dword [ebp - 0x524], edx
jmp 0x4e1453
push 0
lea eax, [ebp - 0x21c]
push eax
lea ecx, [ebp - 0x24c]
push ecx
call fcn.004e0410
add esp, 0xc
push str.Service_uninstalled_successfully_n
call fcn.004e3e20
add esp, 4
mov edx, dword [ebp - 0x500]
push edx
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov eax, dword [ebp - 0x504]
push eax
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov ecx, dword [ebp - 0x524]
mov dword [ebp - 0x578], ecx
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x24c]
call fcn.0040a7f0
mov eax, dword [ebp - 0x578]
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x14]
xor ecx, ebp
call fcn.00544286
mov esp, ebp
pop ebp
ret