Module: RubySMB::Dcerpc::Ndr::TopLevelPlugin
- Defined in:
- lib/ruby_smb/dcerpc/ndr.rb
Defined Under Namespace
Modules: TopLevelClassMethods
Class Method Summary
collapse
Instance Method Summary
collapse
Class Method Details
.extended(target) ⇒ Object
916
917
918
919
|
# File 'lib/ruby_smb/dcerpc/ndr.rb', line 916
def self.extended(target)
target.class.extend(TopLevelClassMethods)
target.class.reset_pos
end
|
Instance Method Details
#do_write(io, is_deferred: false) ⇒ Object
926
927
928
929
930
931
932
933
934
935
936
937
938
|
# File 'lib/ruby_smb/dcerpc/ndr.rb', line 926
def do_write(io, is_deferred: false)
self.class.reset_pos if is_top_level_ptr || @standalone_ptr
if is_deferred
super(io, is_deferred: is_deferred)
else
super(io)
end
self.class.reset_pos if is_top_level_ptr || @standalone_ptr
end
|
#initialize_instance ⇒ Object
921
922
923
924
|
# File 'lib/ruby_smb/dcerpc/ndr.rb', line 921
def initialize_instance
super
@standalone_ptr = false
end
|
#is_top_level_ptr ⇒ Object
956
957
958
|
# File 'lib/ruby_smb/dcerpc/ndr.rb', line 956
def is_top_level_ptr
!!@top_level_ptr
end
|
#num_bytes ⇒ Object
960
961
962
963
964
965
|
# File 'lib/ruby_smb/dcerpc/ndr.rb', line 960
def num_bytes
@standalone_ptr = true
res = super
@standalone_ptr = false
res
end
|
#set_top_level_ptr ⇒ Object
947
948
949
950
|
# File 'lib/ruby_smb/dcerpc/ndr.rb', line 947
def set_top_level_ptr
@top_level_ptr = true
end
|
#to_binary_s ⇒ Object
940
941
942
943
944
945
|
# File 'lib/ruby_smb/dcerpc/ndr.rb', line 940
def to_binary_s
@standalone_ptr = true
res = super
@standalone_ptr = false
res
end
|
#unset_top_level_ptr ⇒ Object
952
953
954
|
# File 'lib/ruby_smb/dcerpc/ndr.rb', line 952
def unset_top_level_ptr
@top_level_ptr = false
end
|