Function at 0x496950
Capabilities:
Create service
Modify service

Disassembly:
push 0xffffffffffffffff
push 0x57e054
mov eax, dword fs:[0]
push eax
sub esp, 0x348
mov eax, dword [0x62d414]
xor eax, esp
mov dword [esp + 0x344], eax
push ebx
push ebp
push esi
push edi
mov eax, dword [0x62d414]
xor eax, esp
push eax
lea eax, [esp + 0x35c]
mov dword fs:[0], eax
mov edi, ecx
call fcn.004968f0
test eax, eax
jne 0x496baa
push 0xf003f
push eax
push eax
call dword [sym.imp.ADVAPI32.dll_OpenSCManagerW]
mov ebp, eax
test ebp, ebp
jne 0x4969f9
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
lea eax, [esp + 0x54]
push str.Couldnt_open_service_manager._Error__d_occurred.
push eax
mov edx, 0x80
call fcn.004db430
add esp, 0xc
cmp dword [edi + 0xf0], 8
jb 0x4969dc
mov edi, dword [edi + 0xdc]
jmp 0x4969e2
add edi, 0xdc
push 0
push edi
lea ecx, [esp + 0x58]
push ecx
push 0
call dword [sym.imp.USER32.dll_MessageBoxW]
xor eax, eax
jmp 0x496baf
push 0x102
lea edx, [esp + 0x154]
push edx
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
push 0x598a18
lea ecx, [esp + 0x38]
call dword [sym.imp.MSVCP90.dll_public:_void___thiscall_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t__::constructor_wchar_t_const__]
mov dword [esp + 0x364], 0
mov esi, dword [sym.imp.MSVCP90.dll_class_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t_____cdecl_std::operator_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t___class_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t___const___wchar_t_const__]
lea eax, [esp + 0x150]
push eax
lea ecx, [esp + 0x38]
push ecx
lea edx, [esp + 0x20]
push edx
call esi
add esp, 0xc
mov byte [esp + 0x364], 1
push eax
lea ecx, [esp + 0x38]
call dword [sym.imp.MSVCP90.dll_public:_class_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t______thiscall_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t__::operator_class_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t___const__]
mov byte [esp + 0x364], 0
lea ecx, [esp + 0x18]
call dword [sym.imp.MSVCP90.dll_public:_void___thiscall_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t__::destructor_void_]
push 0x598a18
lea eax, [esp + 0x38]
push eax
lea ecx, [esp + 0x20]
push ecx
call esi
add esp, 0xc
mov byte [esp + 0x364], 2
push eax
lea ecx, [esp + 0x38]
call dword [sym.imp.MSVCP90.dll_public:_class_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t______thiscall_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t__::operator_class_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t___const__]
mov byte [esp + 0x364], 0
lea ecx, [esp + 0x18]
call dword [sym.imp.MSVCP90.dll_public:_void___thiscall_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t__::destructor_void_]
mov edx, dword [esp + 0x38]
mov ebx, 8
cmp dword [esp + 0x4c], ebx
jae 0x496ab6
lea edx, [esp + 0x38]
cmp dword [edi + 0xf0], ebx
jb 0x496ac6
mov ecx, dword [edi + 0xdc]
jmp 0x496acc
lea ecx, [edi + 0xdc]
cmp dword [edi + 0xf0], ebx
jb 0x496adc
mov eax, dword [edi + 0xdc]
jmp 0x496ae2
lea eax, [edi + 0xdc]
push 0
push 0
push str.RPCSS
push 0
push 0
push edx
push 1
push 3
push 0x110
push 0xf01ff
push ecx
push eax
push ebp
call dword [sym.imp.ADVAPI32.dll_CreateServiceW]
mov esi, eax
test esi, esi
jne 0x496b71
push ebp
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
lea edx, [esp + 0x54]
push str.Couldnt_create_service._Error__d_occurred.
push edx
mov edx, 0x80
call fcn.004db430
add esp, 0xc
cmp dword [edi + 0xf0], ebx
jb 0x496b42
mov edi, dword [edi + 0xdc]
jmp 0x496b48
add edi, 0xdc
push 0
push edi
lea eax, [esp + 0x58]
push eax
push 0
call dword [sym.imp.USER32.dll_MessageBoxW]
mov dword [esp + 0x364], 0xffffffff
lea ecx, [esp + 0x34]
call dword [sym.imp.MSVCP90.dll_public:_void___thiscall_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t__::destructor_void_]
xor eax, eax
jmp 0x496baf
mov ecx, dword [str.Acts_as_an_OPC_server_exposing_remote_HDA_servers_as_local.__Client_side_component_of_MatrikonOPC_Tunneller.]
lea edx, [esp + 0x14]
push edx
push 1
push esi
mov dword [esp + 0x20], ecx
call dword [sym.imp.ADVAPI32.dll_ChangeServiceConfig2W]
push esi
mov esi, dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
call esi
push ebp
call esi
mov dword [esp + 0x364], 0xffffffff
lea ecx, [esp + 0x34]
call dword [sym.imp.MSVCP90.dll_public:_void___thiscall_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t__::destructor_void_]
mov eax, 1
mov ecx, dword [esp + 0x35c]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
mov ecx, dword [esp + 0x344]
xor ecx, esp
call fcn.0051ed00
add esp, 0x354
ret