dcerpc

package
v0.0.0-...-d5d6b14 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 7, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	REASON_NOT_SPECIFIED               = 0x00
	TEMPORARY_CONGESTION               = 0x01 // not used
	LOCAL_LIMIT_EXCEEDED               = 0x02
	PROTOCOL_VERSION_NOT_SPECIFIED     = 0x04
	AUTHENTICATION_TYPE_NOT_RECOGNIZED = 0x08
	INVALID_CHECKSUM                   = 0x09
)

Nack reasons https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-rpce/6f81bffe-8fce-498a-addf-94654a57b329

View Source
const (
	PDURequest = iota
	PDUPing
	PDUResponse
	PDUFault
	PDUWorking
	PDUNoCall
	PDUReject
	PDUAck
	PDUClCancel
	PDUFack
	PDUCancelAck
	PDUBind
	PDUBindAck
	PDUBindNak
	PDUAlterContext
	PDUAlterContextResp
	PDUShutdown
	PDUCoCancel
	PDUOrphaned
)

PDU PacketType https://pubs.opengroup.org/onlinepubs/9629399/chap12.htm

View Source
const (
	FirstFrag         = 0x01
	LastFrag          = 0x02
	PDUFlagPending    = 0x03
	CancelPending     = 0x04
	PDUFlagNoFack     = 0x08
	PDUFlagMayBe      = 0x10
	PDUFlagIdemPotent = 0x20
	PDUFlagBroadcast  = 0x40
	PDUFlagReserved80 = 0x80
)

PDU PacketFlags https://pubs.opengroup.org/onlinepubs/9629399/chap12.htm

View Source
const (
	PDUVersion      = 5
	PDUVersionMinor = 0
)

Supported version is 5.0

View Source
const (
	SERVICE_ALL_ACCESS           = 0x000F01FF
	SERVICE_CHANGE_CONFIG        = 0x00000002
	SERVICE_ENUMERATE_DEPENDENTS = 0x00000008
	SERVICE_INTERROGATE          = 0x00000080
	SERVICE_PAUSE_CONTINUE       = 0x00000040
	SERVICE_QUERY_CONFIG         = 0x00000001
	SERVICE_QUERY_STATUS         = 0x00000004
	SERVICE_START                = 0x00000010
	SERVICE_STOP                 = 0x00000020
	SERVICE_USER_DEFINED_CTRL    = 0x00000100
	SERVICE_SET_STATUS           = 0x00008000
)

Access Codes https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-scmr/0d7a7011-9f41-470d-ad52-8535b47ac282

View Source
const (
	SC_MANAGER_LOCK               = 0x00000008
	SC_MANAGER_CREATE_SERVICE     = 0x00000002
	SC_MANAGER_ENUMERATE_SERVICE  = 0x00000004
	SC_MANAGER_CONNECT            = 0x00000001
	SC_MANAGER_QUERY_LOCK_STATUS  = 0x00000010
	SC_MANAGER_MODIFY_BOOT_CONFIG = 0x00000020
)

SCM Access Codes

View Source
const (
	SERVICE_KERNEL_DRIVER       = 0x00000001
	SERVICE_FILE_SYSTEM_DRIVER  = 0x00000002
	SERVICE_WIN32_OWN_PROCESS   = 0x00000010
	SERVICE_WIN32_SHARE_PROCESS = 0x00000020
	SERVICE_INTERACTIVE_PROCESS = 0x00000100
)

Service Types https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-scmr/6a8ca926-9477-4dd4-b766-692fab07227e

View Source
const (
	SERVICE_BOOT_START   = 0x00000000
	SERVICE_SYSTEM_START = 0x00000001
	SERVICE_AUTO_START   = 0x00000002
	SERVICE_DEMAND_START = 0x00000003
	SERVICE_DISABLED     = 0x00000004
)

Service Start Types

View Source
const (
	SERVICE_ERROR_IGNORE   = 0x00000000
	SERVICE_ERROR_NORMAL   = 0x00000001
	SERVICE_ERROR_SEVERE   = 0x00000002
	SERVICE_ERROR_CRITICAL = 0x00000003
)

Error Control

View Source
const (
	SERVICE_CONTROL_CONTINUE       = 0x00000003
	SERVICE_CONTROL_INTERROGATE    = 0x00000004
	SERVICE_CONTROL_PARAMCHANGE    = 0x00000006
	SERVICE_CONTROL_PAUSE          = 0x00000002
	SERVICE_CONTROL_STOP           = 0x00000001
	SERVICE_CONTROL_NETBINDADD     = 0x00000007
	SERVICE_CONTROL_NETBINDREMOVE  = 0x00000008
	SERVICE_CONTROL_NETBINDENABLE  = 0x00000009
	SERVICE_CONTROL_NETBINDDISABLE = 0x0000000A
)

Service Control Codes

View Source
const (
	SERVICE_ACTIVE    = 0x00000001
	SERVICE_INACTIVE  = 0x00000002
	SERVICE_STATE_ALL = 0x00000003
)

Service State

View Source
const (
	SERVICE_CONTINUE_PENDING = 0x00000005
	SERVICE_PAUSE_PENDING    = 0x00000006
	SERVICE_PAUSED           = 0x00000007
	SERVICE_RUNNING          = 0x00000004
	SERVICE_START_PENDING    = 0x00000002
	SERVICE_STOP_PENDING     = 0x00000003
	SERVICE_STOPPED          = 0x00000001
)

Current State

View Source
const (
	SERVICE_ACCEPT_PARAMCHANGE           = 0x00000008
	SERVICE_ACCEPT_PAUSE_CONTINUE        = 0x00000002
	SERVICE_ACCEPT_SHUTDOWN              = 0x00000004
	SERVICE_ACCEPT_STOP                  = 0x00000001
	SERVICE_ACCEPT_HARDWAREPROFILECHANGE = 0x00000020
	SERVICE_ACCEPT_POWEREVENT            = 0x00000040
	SERVICE_ACCEPT_SESSIONCHANGE         = 0x00000080
	SERVICE_ACCEPT_PRESHUTDOWN           = 0x00000100
	SERVICE_ACCEPT_TIMECHANGE            = 0x00000200
	ERVICE_ACCEPT_TRIGGEREVENT           = 0x00000400
)

Controls Accepted

View Source
const (
	DACL_SECURITY_INFORMATION  = 0x4
	GROUP_SECURITY_INFORMATION = 0x2
	OWNER_SECURITY_INFORMATION = 0x1
	SACL_SECURITY_INFORMATION  = 0x8
)

Security Information https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-scmr/deed7901-ba2b-45ce-ba66-e071928bdfc1

View Source
const (
	SERVICE_CONFIG_DESCRIPTION              = 0x00000001
	SERVICE_CONFIG_FAILURE_ACTIONS          = 0x00000002
	SERVICE_CONFIG_DELAYED_AUTO_START_INFO  = 0x00000003
	SERVICE_CONFIG_FAILURE_ACTIONS_FLAG     = 0x00000004
	SERVICE_CONFIG_SERVICE_SID_INFO         = 0x00000005
	SERVICE_CONFIG_REQUIRED_PRIVILEGES_INFO = 0x00000006
	SERVICE_CONFIG_PRESHUTDOWN_INFO         = 0x00000007
	SERVICE_CONFIG_PREFERRED_NODE           = 0x00000009
	SERVICE_CONFIG_RUNLEVEL_INFO            = 0x0000000A
)

Service Config2 Info Levels

View Source
const (
	SC_ACTION_NONE        = 0
	SC_ACTION_RESTART     = 1
	SC_ACTION_REBOOT      = 2
	SC_ACTION_RUN_COMMAND = 3
)

SC_ACTIONS Types

View Source
const (
	SERVICE_SID_TYPE_NONE         = 0x00000000
	SERVICE_SID_TYPE_RESTRICTED   = 0x00000003
	SERVICE_SID_TYPE_UNRESTRICTED = 0x00000001
)

SERVICE_SID_INFO types

View Source
const (
	SERVICE_NOTIFY_CREATED          = 0x00000080
	SERVICE_NOTIFY_CONTINUE_PENDING = 0x00000010
	SERVICE_NOTIFY_DELETE_PENDING   = 0x00000200
	SERVICE_NOTIFY_DELETED          = 0x00000100
	SERVICE_NOTIFY_PAUSE_PENDING    = 0x00000020
	SERVICE_NOTIFY_PAUSED           = 0x00000040
	SERVICE_NOTIFY_RUNNING          = 0x00000008
	SERVICE_NOTIFY_START_PENDING    = 0x00000002
	SERVICE_NOTIFY_STOP_PENDING     = 0x00000004
	SERVICE_NOTIFY_STOPPED          = 0x00000001
)

Notify Mask

View Source
const (
	SERVICE_STOP_CUSTOM    = 0x20000000
	SERVICE_STOP_PLANNED   = 0x40000000
	SERVICE_STOP_UNPLANNED = 0x10000000
)

SERVICE_CONTROL_STATUS_REASON_IN_PARAMSW Reasons

View Source
const (
	SERVICE_TRIGGER_TYPE_DEVICE_INTERFACE_ARRIVAL = 0x00000001
	SERVICE_TRIGGER_TYPE_IP_ADDRESS_AVAILABILITY  = 0x00000002
	SERVICE_TRIGGER_TYPE_DOMAIN_JOIN              = 0x00000003
	SERVICE_TRIGGER_TYPE_FIREWALL_PORT_EVENT      = 0x00000004
	SERVICE_TRIGGER_TYPE_GROUP_POLICY             = 0x00000005
	SERVICE_TRIGGER_TYPE_CUSTOM                   = 0x00000020
)

SERVICE_TRIGGER triggers

View Source
const (
	SERVICE_TRIGGER_ACTION_SERVICE_START = 0x00000001
	SERVICE_TRIGGER_ACTION_SERVICE_STOP  = 0x00000002
)

SERVICE_TRIGGER actions

View Source
const (
	DOMAIN_JOIN_GUID                              = "1ce20aba-9851-4421-9430-1ddeb766e809"
	DOMAIN_LEAVE_GUID                             = "ddaf516e-58c2-4866-9574-c3b615d42ea1"
	FIREWALL_PORT_OPEN_GUID                       = "b7569e07-8421-4ee0-ad10-86915afdad09"
	FIREWALL_PORT_CLOSE_GUID                      = "a144ed38-8e12-4de4-9d96-e64740b1a524"
	MACHINE_POLICY_PRESENT_GUID                   = "659FCAE6-5BDB-4DA9-B1FF-CA2A178D46E0"
	NETWORK_MANAGER_FIRST_IP_ADDRESS_ARRIVAL_GUID = "4f27f2de-14e2-430b-a549-7cd48cbc8245"
	NETWORK_MANAGER_LAST_IP_ADDRESS_REMOVAL_GUID  = "cc4ba62a-162e-4648-847a-b6bdf993e335"
	USER_POLICY_PRESENT_GUID                      = "54FB46C8-F089-464C-B1FD-59D1B62C3B50"
)

SERVICE_TRIGGER subTypes

View Source
const (
	SERVICE_TRIGGER_DATA_TYPE_BINARY = 0x00000001
	SERVICE_TRIGGER_DATA_TYPE_STRING = 0x00000002
)

SERVICE_TRIGGER_SPECIFIC_DATA_ITEM dataTypes

View Source
const (
	RCloseServiceHandle = iota
	RControlService
	RDeleteService
	RLockServiceDatabase
	RQueryServiceObjectSecurity
	RSetServiceObjectSecurity
	RQueryServiceStatus
	RSetServiceStatus
	RUnlockServiceDatabase
	RNotifyBootConfigStatus

	RChangeServiceConfigW
	RCreateServiceW
	REnumDependentServicesW
	REnumServicesStatusW
	ROpenSCManagerW
	ROpenServiceW
	RQueryServiceConfigW
	RQueryServiceLockStatusW
	RStartServiceW
	RGetServiceDisplayNameW
	RGetServiceKeyNameW

	RChangeServiceConfigA
	RCreateServiceA
	REnumDependentServicesA
	REnumServicesStatusA
	ROpenSCManagerA
	ROpenServiceA
	RQueryServiceConfigA
	RQueryServiceLockStatusA
	RStartServiceA
	RGetServiceDisplayNameA
	RGetServiceKeyNameA

	REnumServiceGroupW
	RChangeServiceConfig2A
	RChangeServiceConfig2W
	RQueryServiceConfig2A
	RQueryServiceConfig2W
	RQueryServiceStatusEx
	REnumServicesStatusExA
	REnumServicesStatusExW

	RCreateServiceWOW64A
	RCreateServiceWOW64W

	RNotifyServiceStatusChange
	RGetNotifyResults
	RCloseNotifyHandle
	RControlServiceExA
	RControlServiceExW

	RQueryServiceConfigEx

	RCreateWowService

	ROpenSCManager2
)

opnum https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-scmr/0d7a7011-9f41-470d-ad52-8535b47ac282

View Source
const (
	ERROR_SUCCESS                   = 0
	ERROR_ACCESS_DENIED             = 5
	ERROR_INVALID_HANDLE            = 6
	ERROR_INVALID_DATA              = 13
	ERROR_INVALID_PARAMETER         = 87
	ERROR_SERVICE_DATABASE_LOCKED   = 1055
	ERROR_INVALID_SERVICE_ACCOUNT   = 1057
	ERROR_CIRCULAR_DEPENDENCY       = 1059
	ERROR_INVALID_SERVICE_LOCK      = 1071
	ERROR_SERVICE_MARKED_FOR_DELETE = 1072
	ERROR_DUPLICATE_SERVICE_NAME    = 1078
	ERROR_SHUTDOWN_IN_PROGRESS      = 1115
)

Return Values for SCMR Operations

View Source
const SC_STATUS_PROCESS_INFO = 0

SC_STATUS_TYPE types

View Source
const SERVICE_NO_CHANGE = 0xFFFFFFFF

ServiceNoChange

Variables

This section is empty.

Functions

func AlignBytes

func AlignBytes(data []byte, x64 bool) []byte

func AlignBytes32

func AlignBytes32(data []byte) []byte

func AlignBytes64

func AlignBytes64(data []byte) []byte

func NackReason

func NackReason(br BindResponse) error

func RpcErrFmt

func RpcErrFmt(ret uint32) error

Types

type AckResponse

type AckResponse struct {
	MaxXmitFrag      uint16
	MaxRecvFrag      uint16
	AssocGroup       uint32
	SecondaryAddrLen uint16
	SecondaryAddr    []byte
	NumResults       uint8
	CtxItems         []AckResult
}

type AckResult

type AckResult struct {
	Result         uint16
	TransferSyntax []byte `smb:"fixed:16"`
	SyntaxVersion  uint32
}

type BindContextEntry

type BindContextEntry struct {
	ContextID             uint16
	TransItemCount        uint16
	InterfaceUUID         []byte `smb:"fixed:16"`
	InterfaceVersion      uint16
	InterfaceVersionMinor uint16
	TransferSyntaxUUID    []byte `smb:"fixed:16"`
	TransferSyntaxVersion uint32
}

type BindResponse

type BindResponse struct {
	HeaderStruct
	Body interface{}
}

func ParseBindResponse

func ParseBindResponse(res []byte) (br BindResponse, err error)

type BindStruct

type BindStruct struct {
	HeaderStruct
	MaxSendFrag  uint16
	MaxRecvFrag  uint16
	AssocGroup   uint32
	ContextCount uint32
	CtxEntries   []byte
}

https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-rpce/a6b7b03c-4ac5-4c25-8c52-f2bec872ac97

func NewBindStruct

func NewBindStruct(syntax string, syntaxVer int, iface string, ifaceVer int, ifaceVerMinor int) *BindStruct

func (*BindStruct) Bytes

func (req *BindStruct) Bytes() []byte

type CharPtr

type CharPtr *byte

Define CharPtr as a pointer to a byte slice

type Client

type Client struct {
	// expose functions like the Conn interface https://pkg.go.dev/net#Conn
	// could also be using a named pipe or NETBIOS, as long as the methods
	// are exposed correctly
	Transport          net.Conn
	Authenticator      *auth.SpnegoClient
	SupportsEncryption bool
	Encrypt            bool
	X64Syntax          bool
}

func (*Client) Authenticate

func (c *Client) Authenticate() error

func (*Client) Send

func (c *Client) Send(pkt []byte) ([]byte, error)

func (*Client) SignPkt

func (c *Client) SignPkt(pkt []byte) ([]byte, error)

type CreateServiceRequest

type CreateServiceRequest struct {
	ContextHandle       []byte `smb:"fixed:20"`
	ServiceName         SCRpcHandle
	Reserved1           uint16
	DisplayName         PointerHeader
	Reserved2           uint16
	AccessMask          uint32
	ServiceType         uint32
	ServiceStartType    uint32
	ServiceErrorControl uint32
	BinaryPathName      SCRpcHandle
	NULLPointer         uint32
	TagId               uint32
	NULLPointer2        uint32
	DependSize          uint32
	NULLPointer3        uint32
	NULLPointer4        uint32
	PasswordSize        uint32
}

type CreateServiceResponse

type CreateServiceResponse struct {
	HeaderStruct
	AllocHint     uint32
	ContextId     uint16
	CancelCount   uint8
	Reserved      uint8
	TagId         uint32
	ContextHandle []byte `smb:"fixed:20"`
	ReturnCode    uint32
}

type DeleteServiceRequest

type DeleteServiceRequest struct {
	ContextHandle []byte `smb:"fixed:20"`
}

type DeleteServiceResponse

type DeleteServiceResponse struct {
	HeaderStruct
	AllocHint   uint32
	ContextId   uint16
	CancelCount uint8
	Reserved    uint8
	ReturnCode  uint32
}

type HeaderStruct

type HeaderStruct struct {
	RpcVersion         uint8
	RpcVersionMinor    uint8
	PacketType         uint8
	PacketFlags        byte
	DataRepresentation []byte `smb:"fixed:4"`
	FragLength         uint16
	AuthLength         uint16
	CallId             uint32
}

func NewHeader

func NewHeader() *HeaderStruct

type LpScRpcHandle

type LpScRpcHandle ScRpcHandle

type LpSecurityDescriptor

type LpSecurityDescriptor struct {
	PointerHeader
	SecurityDescriptor
}

type LpServiceStatus

type LpServiceStatus struct {
	PointerHeader
	ServiceStatus
}

type MsrpcUUID

type MsrpcUUID struct {
	UUID         string
	Version      int
	VersionMinor int
	NamedPipe    string
}
var MSRPC_NDR32 MsrpcUUID = MsrpcUUID{
	UUID:    "8a885d04-1ceb-11c9-9fe8-08002b104860",
	Version: 2,
}

NDR x32: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-rpce/b6090c2b-f44a-47a1-a13b-b82ade0137b2

var MSRPC_NDR64 MsrpcUUID = MsrpcUUID{
	UUID:    "71710533-beba-4937-8319-b5dbef9ccc36",
	Version: 1,
}

NDR x64: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-rpce/dca648a5-42d3-432c-9927-2f22e50fa266

var MSRPC_SCMR MsrpcUUID = MsrpcUUID{
	UUID:         "367abb81-9844-35f1-ad32-98f038001003",
	Version:      2,
	VersionMinor: 0,
	NamedPipe:    "svcctl",
}

https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-scmr/e7a38186-cde2-40ad-90c7-650822bd6333

type NackResponse

type NackResponse struct {
	ProviderRejectReason uint16
	Versions             PrtVersionsSupportedT
	Signature            []byte `smb:"fixed:16"` // optional
	ExtendedErrorInfo    []byte
}

type OpenSCManagerResponse

type OpenSCManagerResponse struct {
	HeaderStruct
	AllocHint     uint32
	ContextId     uint16
	CancelCount   uint8
	Reserved      uint8
	ContextHandle []byte `smb:"fixed:20"`
	ReturnCode    uint32
}

type OpenServiceRequest

type OpenServiceRequest struct {
	ContextHandle []byte `smb:"fixed:20"`
	ServiceName   SCRpcHandle
	Reserved      uint16
	AccessMask    uint32
}

type OpenServiceResponse

type OpenServiceResponse struct {
	HeaderStruct
	AllocHint     uint32
	ContextId     uint16
	CancelCount   uint8
	Reserved      uint8
	ContextHandle []byte `smb:"fixed:20"`
	ReturnCode    uint32
}

type PointerHeader

type PointerHeader struct {
	ReferentId  uint32
	MaxCount    uint32
	Offset      uint32
	ActualCount uint32
}

type PrtVersionsSupportedT

type PrtVersionsSupportedT struct {
	NProtocols uint8
	PProtocols []VersionT
}

type RChangeServiceConfig2ARequest

type RChangeServiceConfig2ARequest struct {
	HService    ScRpcHandle
	DWInfoLevel uint32
	LPInfo      CharPtr
}

Opnum 36

type RChangeServiceConfig2AResponse

type RChangeServiceConfig2AResponse struct{}

type RChangeServiceConfig2WRequest

type RChangeServiceConfig2WRequest struct {
	HService    ScRpcHandle
	DWInfoLevel uint32
	LPInfo      WcharTPtr
}

Opnum 37

type RChangeServiceConfig2WResponse

type RChangeServiceConfig2WResponse struct{}

type RChangeServiceConfigARequest

type RChangeServiceConfigARequest struct {
	HService           ScRpcHandle
	DWServiceType      uint32
	DWStartType        uint32
	DWErrorControl     uint32
	LPBinaryPathName   CharPtr
	LPLoadOrderGroup   CharPtr
	LPDWTagId          CharPtr
	LPDependencies     CharPtr
	DWDependSize       uint32
	LPServiceStartName CharPtr
	LPPassword         CharPtr
	DWPWSize           uint32
	LPDisplayName      CharPtr
}

Opnum 23

type RChangeServiceConfigAResponse

type RChangeServiceConfigAResponse struct{}

type RChangeServiceConfigWRequest

type RChangeServiceConfigWRequest struct {
	HService           ScRpcHandle
	DWServiceType      uint32
	DWStartType        uint32
	DWErrorControl     uint32
	LPBinaryPathName   WcharTPtr
	LPLoadOrderGroup   WcharTPtr
	LPDWTagId          WcharTPtr
	LPDependencies     WcharTPtr
	DWDependSize       uint32
	LPServiceStartName WcharTPtr
	LPPassword         WcharTPtr
	DWPWSize           uint32
	LPDisplayName      WcharTPtr
}

Opnum 11

[in] SC_RPC_HANDLE hService,
[in] DWORD dwServiceType,
[in] DWORD dwStartType,
[in] DWORD dwErrorControl,
[in, string, unique, range(0, SC_MAX_PATH_LENGTH)] wchar_t* lpBinaryPathName,
[in, string, unique, range(0, SC_MAX_NAME_LENGTH)] wchar_t* lpLoadOrderGroup,
[in, out, unique] LPDWORD lpdwTagId,
[in, unique, size_is(dwDependSize)] LPBYTE lpDependencies,
[in, range(0, SC_MAX_DEPEND_SIZE)] DWORD dwDependSize,
[in, string, unique, range(0, SC_MAX_ACCOUNT_NAME_LENGTH)] wchar_t* lpServiceStartName,
[in, unique, size_is(dwPwSize)] LPBYTE lpPassword,
[in, range(0, SC_MAX_PWD_SIZE)] DWORD dwPwSize,
[in, string, unique, range(0, SC_MAX_NAME_LENGTH)] wchar_t* lpDisplayName

https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-scmr/61ea7ed0-c49d-4152-a164-b4830f16c8a4

type RChangeServiceConfigWResponse

type RChangeServiceConfigWResponse struct{}

type RCloseNotifyHandleRequest

type RCloseNotifyHandleRequest struct {
	HService ScRpcHandle
}

Opnum 49

type RCloseServiceHandleRequest

type RCloseServiceHandleRequest struct {
	HSCObject ScRpcHandle
}

Opnum 0

[in, out] LPSC_RPC_HANDLE hSCObject

https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-scmr/a2a4e174-09fb-4e55-bad3-f77c4b13245c

type RCloseServiceHandleResponse

type RCloseServiceHandleResponse struct {
	HSCObject ScRpcHandle
}

type RControlServiceExARequest

type RControlServiceExARequest struct {
	HService      ScRpcHandle
	DWControl     uint32
	DWInfoLevel   uint32
	LPControlInfo CharPtr
}

Opnum 50

type RControlServiceExWRequest

type RControlServiceExWRequest struct {
	HService      ScRpcHandle
	DWControl     uint32
	DWInfoLevel   uint32
	LPControlInfo WcharTPtr
}

Opnum 51

type RControlServiceExWResponse

type RControlServiceExWResponse struct{}

type RControlServiceRequest

type RControlServiceRequest struct {
	HSCObject ScRpcHandle
	DWControl uint32
}

Opnum 1

[in] SC_RPC_HANDLE hService,
[in] DWORD dwControl,
[out] LPSERVICE_STATUS lpServiceStatus

https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-scmr/e1c478be-117f-4512-9b67-17c20a48af97

type RControlServiceResponse

type RControlServiceResponse struct {
	LpServiceStatus LpServiceStatus
}

type RCreateServiceARequest

type RCreateServiceARequest struct {
	HSCManager         ScRpcHandle
	LPServiceName      CharPtr
	LPDisplayName      CharPtr
	DWDesiredAccess    uint32
	DWServiceType      uint32
	DWStartType        uint32
	DWErrorControl     uint32
	LPBinaryPathName   CharPtr
	LPLoadOrderGroup   CharPtr
	LPDWTagId          CharPtr
	LPDependencies     CharPtr
	DWDependSize       uint32
	LPServiceStartName CharPtr
	LPPassword         CharPtr
	DWPWSize           uint32
}

Opnum 24

type RCreateServiceAResponse

type RCreateServiceAResponse struct {
	LpServiceHandle ScRpcHandle
}

type RCreateServiceWOW64ARequest

type RCreateServiceWOW64ARequest struct {
	HSCManager         ScRpcHandle
	LPServiceName      CharPtr
	LPDisplayName      CharPtr
	DWDesiredAccess    uint32
	DWServiceType      uint32
	DWStartType        uint32
	DWErrorControl     uint32
	LPBinaryPathName   CharPtr
	LPLoadOrderGroup   CharPtr
	LPDWTagId          CharPtr
	LPDependencies     CharPtr
	DWDependSize       uint32
	LPServiceStartName CharPtr
	LPPassword         CharPtr
	DWPWSize           uint32
}

Opnum 44

type RCreateServiceWOW64AResponse

type RCreateServiceWOW64AResponse struct {
	LpServiceHandle ScRpcHandle
}

type RCreateServiceWOW64WRequest

type RCreateServiceWOW64WRequest struct {
	HSCManager         ScRpcHandle
	LPServiceName      WcharTPtr
	LPDisplayName      WcharTPtr
	DWDesiredAccess    uint32
	DWServiceType      uint32
	DWStartType        uint32
	DWErrorControl     uint32
	LPBinaryPathName   WcharTPtr
	LPLoadOrderGroup   WcharTPtr
	LPDWTagId          WcharTPtr
	LPDependencies     WcharTPtr
	DWDependSize       uint32
	LPServiceStartName WcharTPtr
	LPPassword         WcharTPtr
	DWPWSize           uint32
}

Opnum 45

type RCreateServiceWOW64WResponse

type RCreateServiceWOW64WResponse struct {
	LpServiceHandle ScRpcHandle
}

type RCreateServiceWRequest

type RCreateServiceWRequest struct {
	HSCManager         ScRpcHandle
	LPServiceName      WcharTPtr
	LPDisplayName      WcharTPtr
	DWDesiredAccess    uint32
	DWServiceType      uint32
	DWStartType        uint32
	DWErrorControl     uint32
	LPBinaryPathName   WcharTPtr
	LPLoadOrderGroup   WcharTPtr
	LPDWTagId          WcharTPtr
	LPDependencies     WcharTPtr
	DWDependSize       uint32
	LPServiceStartName WcharTPtr
	LPPassword         WcharTPtr
	DWPWSize           uint32
}

Opnum 12

[in] SC_RPC_HANDLE hSCManager,
[in, string, range(0, SC_MAX_NAME_LENGTH)] wchar_t* lpServiceName,
[in, string, unique, range(0, SC_MAX_NAME_LENGTH)] wchar_t* lpDisplayName,
[in] DWORD dwDesiredAccess,
[in] DWORD dwServiceType,
[in] DWORD dwStartType,
[in] DWORD dwErrorControl,
[in, string, range(0, SC_MAX_PATH_LENGTH)] wchar_t* lpBinaryPathName,
[in, string, unique, range(0, SC_MAX_NAME_LENGTH)] wchar_t* lpLoadOrderGroup,
[in, out, unique] LPDWORD lpdwTagId,
[in, unique, size_is(dwDependSize)] LPBYTE lpDependencies,
[in, range(0, SC_MAX_DEPEND_SIZE)] DWORD dwDependSize,
[in, string, unique, range(0, SC_MAX_ACCOUNT_NAME_LENGTH)] wchar_t* lpServiceStartName,
[in, unique, size_is(dwPwSize)] LPBYTE lpPassword,
[in, range(0, SC_MAX_PWD_SIZE)] DWORD dwPwSize,
[out] LPSC_RPC_HANDLE lpServiceHandle

https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-scmr/6a8ca926-9477-4dd4-b766-692fab07227e

type RCreateServiceWResponse

type RCreateServiceWResponse struct {
	LpServiceHandle ScRpcHandle
}

type RCreateWowServiceRequest

type RCreateWowServiceRequest struct {
	HSCManager         ScRpcHandle
	LPServiceName      WcharTPtr
	LPDisplayName      WcharTPtr
	DWDesiredAccess    uint32
	DWServiceType      uint32
	DWStartType        uint32
	DWErrorControl     uint32
	LPBinaryPathName   WcharTPtr
	LPLoadOrderGroup   WcharTPtr
	LPDWTagId          WcharTPtr
	LPDependencies     WcharTPtr
	DWDependSize       uint32
	LPServiceStartName WcharTPtr
	LPPassword         WcharTPtr
	DWPWSize           uint32
}

Opnum 60

type RCreateWowServiceResponse

type RCreateWowServiceResponse struct {
	LpServiceHandle ScRpcHandle
}

type RDeleteServiceRequest

type RDeleteServiceRequest struct {
	HSCObject ScRpcHandle
}

Opnum 2

[in] SC_RPC_HANDLE hService

https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-scmr/6744cdb8-f162-4be0-bb31-98996b6495be

type REnumDependentServicesARequest

type REnumDependentServicesARequest struct {
	HService       ScRpcHandle
	DWServiceState uint32
	CBBufSize      uint32
}

Opnum 25

type REnumDependentServicesAResponse

type REnumDependentServicesAResponse struct {
	LpServices         []byte
	PCBBytesNeeded     uint32
	LPServicesReturned uint32
}

type REnumDependentServicesWRequest

type REnumDependentServicesWRequest struct {
	HService       ScRpcHandle
	DWServiceState uint32
	CBBufSize      uint32
}

Opnum 13

[in] SC_RPC_HANDLE hService,
[in] DWORD dwServiceState,
[out, size_is(cbBufSize)] LPBYTE lpServices,
[in, range(0, 1024*256)] DWORD cbBufSize,
[out] LPBOUNDED_DWORD_256K pcbBytesNeeded,
[out] LPBOUNDED_DWORD_256K lpServicesReturned

https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-scmr/6269bea8-9dd3-4092-bd33-67cec685d38e

type REnumDependentServicesWResponse

type REnumDependentServicesWResponse struct {
	LpServices         []byte
	PCBBytesNeeded     uint32
	LPServicesReturned uint32
}

type REnumServiceGroupWRequest

type REnumServiceGroupWRequest struct {
	HSCManager     ScRpcHandle
	DWServiceType  uint32
	DWServiceState uint32
	CBBufSize      uint32
}

Opnum 35

type REnumServiceGroupWResponse

type REnumServiceGroupWResponse struct {
	LPBuffer           []byte
	PCBBytesNeeded     uint32
	LPServicesReturned uint32
}

type REnumServicesStatusARequest

type REnumServicesStatusARequest struct {
	HSCManager     ScRpcHandle
	DWServiceType  uint32
	DWServiceState uint32
	CBBufSize      uint32
}

Opnum 26

type REnumServicesStatusAResponse

type REnumServicesStatusAResponse struct {
	LPBuffer           []byte
	PCBBytesNeeded     uint32
	LPServicesReturned uint32
}

type REnumServicesStatusExARequest

type REnumServicesStatusExARequest struct {
	HSCManager     ScRpcHandle
	InfoLevel      uint32
	DWServiceType  uint32
	DWServiceState uint32
	CBBufSize      uint32
}

Opnum 41

type REnumServicesStatusExAResponse

type REnumServicesStatusExAResponse struct {
	LPBuffer           []byte
	PCBBytesNeeded     uint32
	LPServicesReturned uint32
}

type REnumServicesStatusExWRequest

type REnumServicesStatusExWRequest struct {
	HSCManager     ScRpcHandle
	InfoLevel      uint32
	DWServiceType  uint32
	DWServiceState uint32
	CBBufSize      uint32
}

Opnum 42

type REnumServicesStatusExWResponse

type REnumServicesStatusExWResponse struct {
	LPBuffer           []byte
	PCBBytesNeeded     uint32
	LPServicesReturned uint32
}

type REnumServicesStatusWRequest

type REnumServicesStatusWRequest struct {
	HSCManager     ScRpcHandle
	DWServiceType  uint32
	DWServiceState uint32
	CBBufSize      uint32
}

Opnum 14

[in] SC_RPC_HANDLE hSCManager, [in] DWORD dwServiceType, [in] DWORD dwServiceState, [out, size_is(cbBufSize)] LPBYTE lpBuffer, [in, range(0, 1024*256)] DWORD cbBufSize, [out] LPBOUNDED_DWORD_256K pcbBytesNeeded, [out] LPBOUNDED_DWORD_256K lpServicesReturned

https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-scmr/d5e8a033-8d44-4bc3-a5e5-ac8480d3a942

type REnumServicesStatusWResponse

type REnumServicesStatusWResponse struct {
	LPBuffer           []byte
	PCBBytesNeeded     uint32
	LPServicesReturned uint32
}

type RGetNotifyResultsRequest

type RGetNotifyResultsRequest struct {
	HService       ScRpcHandle
	NotifyMask     uint32
	NotifyCallback WcharTPtr
}

Opnum 48

type RGetServiceDisplayNameARequest

type RGetServiceDisplayNameARequest struct {
	HSCManager    ScRpcHandle
	LPServiceName CharPtr
}

Opnum 32

type RGetServiceDisplayNameAResponse

type RGetServiceDisplayNameAResponse struct {
	LPDisplayName CharPtr
}

type RGetServiceDisplayNameWRequest

type RGetServiceDisplayNameWRequest struct {
	HSCManager    ScRpcHandle
	LPServiceName WcharTPtr
}

Opnum 20

type RGetServiceDisplayNameWResponse

type RGetServiceDisplayNameWResponse struct {
	LPDisplayName WcharTPtr
}

type RGetServiceKeyNameARequest

type RGetServiceKeyNameARequest struct {
	HSCManager    ScRpcHandle
	LPDisplayName CharPtr
}

Opnum 33

type RGetServiceKeyNameAResponse

type RGetServiceKeyNameAResponse struct {
	LPServiceName CharPtr
}

type RGetServiceKeyNameWRequest

type RGetServiceKeyNameWRequest struct {
	HSCManager    ScRpcHandle
	LPDisplayName WcharTPtr
}

Opnum 21

type RGetServiceKeyNameWResponse

type RGetServiceKeyNameWResponse struct {
	LPServiceName WcharTPtr
}

type RLockServiceDatabaseRequest

type RLockServiceDatabaseRequest struct {
	HSCManager ScRpcHandle
}

Opnum 3

[in] SC_RPC_HANDLE hSCManager,
[out] LPSC_RPC_LOCK lpLock

https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-scmr/ff71f732-e91d-4189-8fb9-a410674c63ad

type RLockServiceDatabaseResponse

type RLockServiceDatabaseResponse struct {
	LpLock []byte // RPC context handle
}

type RNotifyBootConfigStatusRequest

type RNotifyBootConfigStatusRequest struct {
	LPMachineName  SvcCtlHandleW
	BootAcceptable uint32
}

Opnum 9

[in, string, unique, range(0, SC_MAX_COMPUTER_NAME_LENGTH)] SVCCTL_HANDLEW lpMachineName,
[in] DWORD BootAcceptable

https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-scmr/624e57ef-772d-45d2-ab99-03455879a424

type RNotifyBootConfigStatusResponse

type RNotifyBootConfigStatusResponse struct{}

type RNotifyServiceStatusChangeRequest

type RNotifyServiceStatusChangeRequest struct {
	HService       ScRpcHandle
	NotifyMask     uint32
	NotifyCallback WcharTPtr
}

Opnum 47

type RNotifyServiceStatusChangeResponse

type RNotifyServiceStatusChangeResponse struct{}

type ROpenSCManager2Request

type ROpenSCManager2Request struct {
	LpMachineName   WcharTPtr
	LpDatabaseName  WcharTPtr
	DwDesiredAccess uint32
}

Opnum 64

type ROpenSCManager2Response

type ROpenSCManager2Response struct {
}

type ROpenSCManagerARequest

type ROpenSCManagerARequest struct {
	LpMachineName   CharPtr
	LpDatabaseName  CharPtr
	DwDesiredAccess uint32
}

Opnum 27

type ROpenSCManagerAResponse

type ROpenSCManagerAResponse struct {
	LpScHandle ScRpcHandle
}

type ROpenServiceARequest

type ROpenServiceARequest struct {
	HSCManager      ScRpcHandle
	LPServiceName   CharPtr
	DWDesiredAccess uint32
}

Opnum 28

type ROpenServiceAResponse

type ROpenServiceAResponse struct {
	LpServiceHandle ScRpcHandle
}

type ROpenServiceWRequest

type ROpenServiceWRequest struct {
	HSCManager      ScRpcHandle
	LPServiceName   WcharTPtr
	DWDesiredAccess uint32
}

Opnum 16

type ROpenServiceWResponse

type ROpenServiceWResponse struct {
	LpServiceHandle ScRpcHandle
}

type RQueryServiceConfig2ARequest

type RQueryServiceConfig2ARequest struct {
	HService    ScRpcHandle
	DWInfoLevel uint32
	CBBufSize   uint32
}

Opnum 38

type RQueryServiceConfig2AResponse

type RQueryServiceConfig2AResponse struct {
}

type RQueryServiceConfig2WRequest

type RQueryServiceConfig2WRequest struct {
	HService    ScRpcHandle
	DWInfoLevel uint32
	CBBufSize   uint32
}

Opnum 39

type RQueryServiceConfig2WResponse

type RQueryServiceConfig2WResponse struct {
}

type RQueryServiceConfigARequest

type RQueryServiceConfigARequest struct {
	HService ScRpcHandle
}

Opnum 29

type RQueryServiceConfigAResponse

type RQueryServiceConfigAResponse struct {
}

type RQueryServiceConfigExRequest

type RQueryServiceConfigExRequest struct {
	HService  ScRpcHandle
	InfoLevel uint32
	CBBufSize uint32
}

Opnum 56

type RQueryServiceConfigExResponse

type RQueryServiceConfigExResponse struct {
}

type RQueryServiceConfigWRequest

type RQueryServiceConfigWRequest struct {
	HService ScRpcHandle
}

Opnum 17

type RQueryServiceConfigWResponse

type RQueryServiceConfigWResponse struct {
}

type RQueryServiceLockStatusARequest

type RQueryServiceLockStatusARequest struct {
	HSCManager ScRpcHandle
}

Opnum 30

type RQueryServiceLockStatusAResponse

type RQueryServiceLockStatusAResponse struct {
}

type RQueryServiceLockStatusWRequest

type RQueryServiceLockStatusWRequest struct {
	HSCManager ScRpcHandle
}

Opnum 18

type RQueryServiceLockStatusWResponse

type RQueryServiceLockStatusWResponse struct {
}

type RQueryServiceObjectSecurityRequest

type RQueryServiceObjectSecurityRequest struct {
	HService              ScRpcHandle
	DWSecurityInformation uint32
	CBBufSize             uint32
}

Opnum 4

[in] SC_RPC_HANDLE hService,
[in] SECURITY_INFORMATION dwSecurityInformation,
[out, size_is(cbBufSize)] LPBYTE lpSecurityDescriptor,
[in, range(0, 1024*256)] DWORD cbBufSize,
[out] LPBOUNDED_DWORD_256K pcbBytesNeeded

https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-scmr/7f339950-ce73-4782-9e10-4e1c5924594e

type RQueryServiceObjectSecurityResponse

type RQueryServiceObjectSecurityResponse struct {
	LPSecurityDescriptor LpSecurityDescriptor
}

type RQueryServiceStatusExRequest

type RQueryServiceStatusExRequest struct {
	HService  ScRpcHandle
	InfoLevel uint32
	CBBufSize uint32
}

Opnum 40

type RQueryServiceStatusExResponse

type RQueryServiceStatusExResponse struct {
}

type RQueryServiceStatusRequest

type RQueryServiceStatusRequest struct {
	HService ScRpcHandle
}

Opnum 6

[in] SC_RPC_HANDLE hService,
[out] LPSERVICE_STATUS lpServiceStatus

https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-scmr/cf94d915-b4e1-40e5-872b-a9cb3ad09b46

type RQueryServiceStatusResponse

type RQueryServiceStatusResponse struct {
	LpServiceStatus LpServiceStatus
}

type RSetServiceObjectSecurityRequest

type RSetServiceObjectSecurityRequest struct {
	HService              ScRpcHandle
	DWSecurityInformation uint32
	LPSecurityDescriptor  LpSecurityDescriptor
	CBBufSize             uint32
}

Opnum 5

[in] SC_RPC_HANDLE hService,
[in] SECURITY_INFORMATION dwSecurityInformation,
[in, size_is(cbBufSize)] LPBYTE lpSecurityDescriptor,
[in] DWORD cbBufSize

https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-scmr/ea93548f-3917-4626-bef7-2f3f8fa39299

type RSetServiceObjectSecurityResponse

type RSetServiceObjectSecurityResponse struct{}

type RSetServiceStatusRequest

type RSetServiceStatusRequest struct {
	HServiceStatus  ScRpcHandle
	LPServiceStatus LpServiceStatus
}

Opnum 7

[in] SC_RPC_HANDLE hServiceStatus,
[in] LPSERVICE_STATUS lpServiceStatus

https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-scmr/df67cf3b-1bae-4359-b684-1b481d27a30c

type RSetServiceStatusResponse

type RSetServiceStatusResponse struct{}

type RStartServiceARequest

type RStartServiceARequest struct {
	HService ScRpcHandle
	Argc     uint32
	Argv     []CharPtr
}

Opnum 31

type RStartServiceAResponse

type RStartServiceAResponse struct {
}

type RStartServiceWRequest

type RStartServiceWRequest struct {
	HService ScRpcHandle
	Argc     uint32
	Argv     []WcharTPtr
}

Opnum 19

type RStartServiceWResponse

type RStartServiceWResponse struct {
}

type RUnlockServiceDatabaseResponse

type RUnlockServiceDatabaseResponse struct{}

type RequestStruct

type RequestStruct struct {
	HeaderStruct
	AllocHint uint32
	ContextID uint16
	OpNum     uint16
	Payload   interface{}
}

func (*RequestStruct) Bytes

func (req *RequestStruct) Bytes() []byte

type ResponseStruct

type ResponseStruct struct {
	HeaderStruct
	AllocHint   uint32 // len of stub
	ContextID   uint16
	CancelCount uint8
	Reserved    uint8
	Stub        []byte
	ReturnCode  uint32
}

func ParseResponse

func ParseResponse(b []byte) (rs ResponseStruct, err error)

type SCRpcHandle

type SCRpcHandle struct {
	MaxCount    uint32
	Offset      uint32
	ActualCount uint32
	Data        []byte
}

type ScRpcHandle

type ScRpcHandle struct {
	Handle []byte `smb:"fixed:20"`
}

type SecurityDescriptor

type SecurityDescriptor struct {
	Revision    uint8
	Sbz1        uint8
	Control     uint16
	OffsetOwner uint32 `smb:"offset:OwnserSid"`
	OffsetGroup uint32 `smb:"offset:GroupSid"`
	OffsetSacl  uint32 `smb:"offset:Sacl"`
	OffsetDacl  uint32 `smb:"offset:Dacl"`
	OwnerSid    []byte
	GroupSid    []byte
	Sacl        []byte
	Dacl        []byte
}

https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-dtyp/7d4dac05-9cef-4563-a058-f108abecce1d

type ServiceStatus

type ServiceStatus struct {
	ServiceType             uint32
	CurrentState            uint32
	ControlsAccepted        uint32
	Win32ExitCode           uint32
	ServiceSpecificExitCode uint32
	CheckPoint              uint32
	WaitHint                uint32
}

type StartServiceRequest

type StartServiceRequest struct {
	ContextHandle []byte `smb:"fixed:20"`
	Argc          uint32
	Argv          []byte `smb:"fixed:4"`
}

type StartServiceResponse

type StartServiceResponse struct {
	HeaderStruct
	AllocHint   uint32
	ContextId   uint16
	CancelCount uint8
	Reserved    uint8
	StubData    uint32
}

type SvcCtlHandleW

type SvcCtlHandleW WcharTPtr

type VersionT

type VersionT struct {
	Major uint8
	Minor uint8
}

type WcharTPtr

type WcharTPtr struct {
	PointerHeader
	UnicodeString []byte
}

func NewWcharTPtr

func NewWcharTPtr(str []byte, x64 bool) WcharTPtr

func NewWcharTPtr32

func NewWcharTPtr32(str []byte) WcharTPtr

func NewWcharTPtr64

func NewWcharTPtr64(str []byte) WcharTPtr

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL