Class: Tassadar::MPQ::EncryptedHashTable
- Inherits:
-
BinData::BasePrimitive
- Object
- BinData::BasePrimitive
- Tassadar::MPQ::EncryptedHashTable
- Defined in:
- lib/tassadar/mpq/hash_table.rb
Instance Method Summary collapse
- #read_and_return_value(io) ⇒ Object
- #sensible_default ⇒ Object
- #value_to_binary_string(value) ⇒ Object
Instance Method Details
#read_and_return_value(io) ⇒ Object
32 33 34 35 |
# File 'lib/tassadar/mpq/hash_table.rb', line 32 def read_and_return_value(io) value = BlockEncryptor.new("(hash table)", 0x300, io, eval_parameter(:entries) * 16).decrypt HashTable.read(value) end |
#sensible_default ⇒ Object
46 47 48 |
# File 'lib/tassadar/mpq/hash_table.rb', line 46 def sensible_default [0,0,0,0,0,0].pack("VVvCCV") end |
#value_to_binary_string(value) ⇒ Object
37 38 39 40 41 42 43 44 |
# File 'lib/tassadar/mpq/hash_table.rb', line 37 def value_to_binary_string(value) packed_string = "" value.hashes.each do |hash| packed_string += [hash.file_path_hash_a, hash.file_path_hash_b, hash.language, hash.platform, 0, hash.file_block_index].pack("VVvCCV") end BlockEncryptor.new("(hash table)", 0x300, value, eval_parameter(:entries) * 16).encrypt end |