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

Disassembly:
push 0xffffffffffffffff
push 0x406ea2
mov eax, dword fs:[0]
push eax
sub esp, 0x24
push ebx
push ebp
push esi
push edi
mov eax, dword [0x40d02c]
xor eax, esp
push eax
lea eax, [esp + 0x38]
mov dword fs:[0], eax
mov ebx, ecx
mov esi, dword [sym.imp.NCRRetailFoundation.dll_public:_void___thiscall_NCRRetailCommon::NCRString::constructor_void_]
lea ecx, [esp + 0x28]
call esi
push str.InstallService
push 0x409dc6
push 0x408ec8
mov dword [esp + 0x4c], 0
mov eax, dword [ebx + 0x68]
mov ebp, dword [sym.imp.NCRRetailFoundation.dll_public:_void___cdecl_NCRRetailCommon::NCRSystemTrace::Trace_unsigned_int__unsigned_int__char_const___char_const___char_const__]
push 7
push 0xffffffffffffffff
push eax
call ebp
add esp, 0x18
push 0xf003f
push 0
push 0
call dword [sym.imp.ADVAPI32.dll_OpenSCManagerA]
mov dword [esp + 0x14], eax
test eax, eax
jne 0x40417d
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
lea eax, [esp + 0x2c]
push str.Install_Failed:_Couldnt_open_the_Microsoft_Service_Control_Manager__GetLastError_____d
push eax
call dword [sym.imp.NCRRetailFoundation.dll_public:_void___cdecl_NCRRetailCommon::NCRString::Format_char_const__]
add esp, 0xc
lea ecx, [esp + 0x28]
call dword [sym.imp.NCRRetailFoundation.dll_public:_char_const____thiscall_NCRRetailCommon::NCRString::operator_char_const__void_const]
mov ebx, dword [ebx + 0x68]
push eax
push 0x409dc6
push 0x408ec8
push 0x200
push 0xffffffffffffffff
push ebx
call ebp
add esp, 0x18
lea ecx, [esp + 0x28]
mov dword [esp + 0x40], 0xffffffff
call dword [sym.imp.NCRRetailFoundation.dll_public_virtual:_void___thiscall_NCRRetailCommon::NCRString::destructor_void_]
xor eax, eax
mov ecx, dword [esp + 0x38]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x30
ret
lea ecx, [esp + 0x18]
call esi
push 0x104
lea ecx, [esp + 0x1c]
mov byte [esp + 0x44], 1
call dword [sym.imp.NCRRetailFoundation.dll_public:_char____thiscall_NCRRetailCommon::NCRString::GetBuffer_unsigned_int_]
push 0x104
push eax
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
push 0xffffffffffffffff
lea ecx, [esp + 0x1c]
call dword [sym.imp.NCRRetailFoundation.dll_public:_void___thiscall_NCRRetailCommon::NCRString::ReleaseBuffer_unsigned_int_]
mov ecx, dword [esp + 0x18]
mov edx, dword [esp + 0x1c]
sub esp, 0x10
mov eax, esp
mov dword [eax], ecx
mov ecx, dword [esp + 0x30]
mov dword [eax + 4], edx
mov edx, dword [esp + 0x34]
lea esi, [ebx + 0x58]
push str...InstallService:_File_Pathe___s
mov dword [eax + 8], ecx
push esi
mov dword [eax + 0xc], edx
call dword [sym.imp.NCRRetailFoundation.dll_public:_void___cdecl_NCRRetailCommon::NCRString::Format_char_const__]
mov edi, dword [sym.imp.NCRRetailFoundation.dll_public:_char_const____thiscall_NCRRetailCommon::NCRString::operator_char_const__void_const]
add esp, 0x18
mov ecx, esi
call edi
mov ecx, dword [ebx + 0x68]
push eax
push 0x409dc6
push 0x408ec8
push 0x200
push 0xffffffffffffffff
push ecx
call ebp
add esp, 0x18
lea ecx, [esp + 0x18]
call edi
cmp byte [eax], 0x22
je 0x404227
lea ecx, [esp + 0x18]
call edi
add eax, 0x44
push eax
lea ecx, [esp + 0x1c]
call dword [sym.imp.NCRRetailFoundation.dll_public:_class_NCRRetailCommon::NCRString____thiscall_NCRRetailCommon::NCRString::operator_char_const__]
call fcn.00405000
test eax, eax
je 0x40428b
mov eax, dword [esp + 0x14]
push 3
push 0x408ec8
push eax
call dword [sym.imp.ADVAPI32.dll_OpenServiceA]
push 0x408ec8
push 0
push 0
push 0
push 0
push 0
lea ecx, [esp + 0x30]
mov esi, eax
call edi
push eax
push 0xffffffffffffffff
push 0xffffffffffffffff
push 0xffffffffffffffff
push esi
call dword [sym.imp.ADVAPI32.dll_ChangeServiceConfigA]
test eax, eax
jne 0x4042fb
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
lea ecx, [esp + 0x2c]
push str.Install_Failed:_Couldnt_Change_service_configuration_information__GetLastError_____d
push ecx
call dword [sym.imp.NCRRetailFoundation.dll_public:_void___cdecl_NCRRetailCommon::NCRString::Format_char_const__]
add esp, 0xc
jmp 0x4042fb
push 0xf01ff
push str.NCR_Loader_Service
push 0x408ec8
push str...InstallService:_CreateService_name_s_displayname_s_access_x
push esi
call dword [sym.imp.NCRRetailFoundation.dll_public:_void___cdecl_NCRRetailCommon::NCRString::Format_char_const__]
add esp, 0x14
mov ecx, esi
call edi
mov ecx, dword [ebx + 0x68]
push eax
push 0x409dc6
push 0x408ec8
push 0x200
push 0xffffffffffffffff
push ecx
call ebp
add esp, 0x18
push 0
push 0
push 0
push 0
push 0
lea ecx, [esp + 0x2c]
call edi
mov edx, dword [esp + 0x28]
push eax
push 1
push 2
push 0x10
push 0xf01ff
push str.NCR_Loader_Service
push 0x408ec8
push edx
call dword [sym.imp.ADVAPI32.dll_CreateServiceA]
xor esi, esi
push esi
mov esi, dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
call esi
mov eax, dword [esp + 0x14]
push eax
call esi
lea ecx, [esp + 0x28]
call dword [sym.imp.NCRRetailFoundation.dll_public:_int___thiscall_NCRRetailCommon::NCRString::IsEmpty_void_const]
test eax, eax
jne 0x40436f
lea ecx, [esp + 0x28]
call edi
mov ebx, dword [ebx + 0x68]
push eax
push 0x409dc6
push 0x408ec8
push 0x200
push 0xffffffffffffffff
push ebx
call ebp
mov byte [esp + 0x58], 0
mov esi, dword [sym.imp.NCRRetailFoundation.dll_public_virtual:_void___thiscall_NCRRetailCommon::NCRString::destructor_void_]
add esp, 0x18
lea ecx, [esp + 0x18]
call esi
lea ecx, [esp + 0x28]
mov dword [esp + 0x40], 0xffffffff
call esi
xor eax, eax
mov ecx, dword [esp + 0x38]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x30
ret
mov ebx, dword [ebx + 0x68]
push str.InstallService
push 0x409dc6
push 0x408ec8
push 8
push 0xffffffffffffffff
push ebx
call ebp
mov byte [esp + 0x58], 0
mov esi, dword [sym.imp.NCRRetailFoundation.dll_public_virtual:_void___thiscall_NCRRetailCommon::NCRString::destructor_void_]
add esp, 0x18
lea ecx, [esp + 0x18]
call esi
lea ecx, [esp + 0x28]
mov dword [esp + 0x40], 0xffffffff
call esi
mov eax, 1
mov ecx, dword [esp + 0x38]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x30
ret