Class: RubySMB::SMB1::Packet::Trans2::FindNext2Response
- Inherits:
-
GenericPacket
- Object
- BinData::Record
- GenericPacket
- RubySMB::SMB1::Packet::Trans2::FindNext2Response
- Defined in:
- lib/ruby_smb/smb1/packet/trans2/find_next2_response.rb
Overview
This class represents an SMB1 Trans2 FIND_NEXT2 Response Packet as defined in 2.2.6.3.2 Response
Defined Under Namespace
Classes: DataBlock, ParameterBlock, Trans2Data, Trans2Parameters
Instance Method Summary collapse
- #initialize_instance ⇒ Object
-
#results(klass, unicode:) ⇒ array<BinData::Record>
Returns the File Information in an array of appropriate structs for the given FileInformationClass.
Methods inherited from GenericPacket
describe, #display, fields_hashed, format_field, #packet_smb_version, read, #status_code, walk_fields
Instance Method Details
#initialize_instance ⇒ Object
51 52 53 54 55 56 |
# File 'lib/ruby_smb/smb1/packet/trans2/find_next2_response.rb', line 51 def initialize_instance super smb_header.command = RubySMB::SMB1::Commands::SMB_COM_TRANSACTION2 parameter_block.setup << RubySMB::SMB1::Packet::Trans2::Subcommands::FIND_NEXT2 smb_header.flags.reply = 1 end |
#results(klass, unicode:) ⇒ array<BinData::Record>
Returns the File Information in an array of appropriate structs for the given FileInformationClass. Pulled out of the string buffer.
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 |
# File 'lib/ruby_smb/smb1/packet/trans2/find_next2_response.rb', line 64 def results(klass, unicode:) information_classes = [] blob = data_block.trans2_data.buffer.to_binary_s.dup until blob.empty? length = blob[0, 4].unpack('V').first data = if length.zero? blob.slice!(0, blob.length) else blob.slice!(0, length) end file_info = klass.new file_info.unicode = unicode information_classes << file_info.read(data) end information_classes end |