Class: FilesHunter::Decoders::M2V
- Inherits:
-
BeginPatternDecoder
- Object
- FilesHunter::Decoder
- BeginPatternDecoder
- FilesHunter::Decoders::M2V
- Defined in:
- lib/fileshunter/Decoders/M2V.rb
Constant Summary collapse
- BEGIN_PATTERN_M2V =
"\x00\x00\x01\xBA\x44\x00\x04\x00\x14\x01".force_encoding(Encoding::ASCII_8BIT)
- END_PATTERN_M2V =
"\x00\x00\x01\xB9".force_encoding(Encoding::ASCII_8BIT)
Instance Method Summary collapse
Methods inherited from BeginPatternDecoder
Methods inherited from FilesHunter::Decoder
Instance Method Details
#decode(offset) ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/fileshunter/Decoders/M2V.rb', line 14 def decode(offset) ending_offset = nil found_relevant_data(:m2v) end_pattern_offset = @data.index(END_PATTERN_M2V, offset + 10) log_debug "=== @#{offset} - Found ending offset: #{end_pattern_offset.inspect}" truncated_data if ((end_pattern_offset == nil) or (end_pattern_offset + 4 > @end_offset)) ending_offset = end_pattern_offset + 4 return ending_offset end |
#get_begin_pattern ⇒ Object
10 11 12 |
# File 'lib/fileshunter/Decoders/M2V.rb', line 10 def get_begin_pattern return BEGIN_PATTERN_M2V, { :offset_inc => 10 } end |