Class: RubySMB::SMB1::Packet::Trans2::FindFirst2Response
- Inherits:
-
GenericPacket
- Object
- BinData::Record
- GenericPacket
- RubySMB::SMB1::Packet::Trans2::FindFirst2Response
- Includes:
- Win9xFraming
- Defined in:
- lib/ruby_smb/smb1/packet/trans2/find_first2_response.rb
Overview
This class represents an SMB1 Trans2 FIND_FIRST2 Response Packet as defined in 2.2.6.2.2 Response
Defined Under Namespace
Classes: ParameterBlock
Constant Summary collapse
- COMMAND =
RubySMB::SMB1::Commands::SMB_COM_TRANSACTION2
Instance Method Summary collapse
- #initialize_instance ⇒ Object
-
#results(klass, unicode:, buffer: nil) ⇒ array<BinData::Record>
Returns the File Information in an array of appropriate structs for the given FileInformationClass.
Methods included from Win9xFraming
Methods inherited from GenericPacket
describe, #display, fields_hashed, format_field, from_hex, #packet_smb_version, read, #status_code, #valid?, walk_fields
Instance Method Details
#initialize_instance ⇒ Object
55 56 57 58 59 |
# File 'lib/ruby_smb/smb1/packet/trans2/find_first2_response.rb', line 55 def initialize_instance super parameter_block.setup << RubySMB::SMB1::Packet::Trans2::Subcommands::FIND_FIRST2 smb_header.flags.reply = 1 end |
#results(klass, unicode:, buffer: nil) ⇒ array<BinData::Record>
Returns the File Information in an array of appropriate structs for the given FileInformationClass. Pulled out of the string buffer.
Info levels that carry a leading NextEntryOffset (e.g. FindFileFullDirectoryInfo) are framed by that field. Info levels without one (e.g. SMB_INFO_STANDARD, used by Win95/98/ME) are packed sequentially; each entry's length is derived from the record itself, and servers may insert an optional single NULL pad byte between entries (see MS-CIFS Appendix A, note <153>).
80 81 82 83 84 85 86 87 |
# File 'lib/ruby_smb/smb1/packet/trans2/find_first2_response.rb', line 80 def results(klass, unicode:, buffer: nil) blob = (buffer || data_block.trans2_data.buffer.to_binary_s).dup if klass.new.respond_to?(:next_offset) read_next_offset_entries(klass, blob, unicode: unicode) else read_sequential_entries(klass, blob, unicode: unicode) end end |