Module: RubySMB::Dcerpc::Ndr::StringClassPlugin

Overview

Strings

Defined Under Namespace

Modules: ExtendConfStringPlugin, ExtendVarStringPlugin

Class Method Summary collapse

Class Method Details

.extended(target) ⇒ Object



496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
# File 'lib/ruby_smb/dcerpc/ndr.rb', line 496

def self.extended(target)
  target.default_parameters byte_align: 4
  char_size = 1
  char_size = 2 if target < RubySMB::Field::String16 || target < RubySMB::Field::Stringz16
  if target < BinData::Stringz
    target.default_parameters(:max_length => lambda { @obj.actual_count * char_size })
  else
    target.default_parameters(:length => lambda { @obj.actual_count * char_size })
  end
  target.include ExtendVarStringPlugin
  class_name = target.to_s.split('::').last
  if class_name.include?('NdrConfVar')
    target.include ExtendConfStringPlugin
    target.extend ConfClassPlugin
  end
end