Class: RubySMB::Dcerpc::Svcctl::OpenSCManagerWRequest

Inherits:
BinData::Record
  • Object
show all
Defined in:
lib/ruby_smb/dcerpc/svcctl/open_sc_manager_w_request.rb

Overview

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#opnumObject (readonly)

Returns the value of attribute opnum.



9
10
11
# File 'lib/ruby_smb/dcerpc/svcctl/open_sc_manager_w_request.rb', line 9

def opnum
  @opnum
end

Instance Method Details

#initialize_instanceObject



19
20
21
22
# File 'lib/ruby_smb/dcerpc/svcctl/open_sc_manager_w_request.rb', line 19

def initialize_instance
  super
  @opnum = OPEN_SC_MANAGER_W
end

#pad_length(prev_element) ⇒ Object

Determines the correct length for the padding, so that the next field is 4-byte aligned.



26
27
28
29
# File 'lib/ruby_smb/dcerpc/svcctl/open_sc_manager_w_request.rb', line 26

def pad_length(prev_element)
  offset = (prev_element.abs_offset + prev_element.to_binary_s.length) % 4
  (4 - offset) % 4
end