Class: FilesHunter::Decoders::M2V

Inherits:
BeginPatternDecoder show all
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

#find_segments

Methods inherited from FilesHunter::Decoder

#segments_found, #setup

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_patternObject



10
11
12
# File 'lib/fileshunter/Decoders/M2V.rb', line 10

def get_begin_pattern
  return BEGIN_PATTERN_M2V, { :offset_inc => 10 }
end