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
906
907
908
909
|
# File 'lib/ruby_smb/dcerpc/ndr.rb', line 906
def self.extended(target)
target.class.extend(TopLevelClassMethods)
target.class.reset_pos
end
|
Instance Method Details
#do_write(io, is_deferred: false) ⇒ Object
916
917
918
919
920
921
922
923
924
925
926
927
928
|
# File 'lib/ruby_smb/dcerpc/ndr.rb', line 916
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
911
912
913
914
|
# File 'lib/ruby_smb/dcerpc/ndr.rb', line 911
def initialize_instance
super
@standalone_ptr = false
end
|
#is_top_level_ptr ⇒ Object
946
947
948
|
# File 'lib/ruby_smb/dcerpc/ndr.rb', line 946
def is_top_level_ptr
!!@top_level_ptr
end
|
#num_bytes ⇒ Object
950
951
952
953
954
955
|
# File 'lib/ruby_smb/dcerpc/ndr.rb', line 950
def num_bytes
@standalone_ptr = true
res = super
@standalone_ptr = false
res
end
|
#set_top_level_ptr ⇒ Object
937
938
939
940
|
# File 'lib/ruby_smb/dcerpc/ndr.rb', line 937
def set_top_level_ptr
@top_level_ptr = true
end
|
#to_binary_s ⇒ Object
930
931
932
933
934
935
|
# File 'lib/ruby_smb/dcerpc/ndr.rb', line 930
def to_binary_s
@standalone_ptr = true
res = super
@standalone_ptr = false
res
end
|
#unset_top_level_ptr ⇒ Object
942
943
944
|
# File 'lib/ruby_smb/dcerpc/ndr.rb', line 942
def unset_top_level_ptr
@top_level_ptr = false
end
|