add support for a header of AssetBundle on the last in the file
This commit is contained in:
@@ -73,7 +73,7 @@ module Mikunyan
|
||||
ui_block_size = br.i32u
|
||||
flags = br.i32u
|
||||
|
||||
head = BinaryReader.new(uncompress(br.read(ci_block_size), ui_block_size, flags))
|
||||
head = BinaryReader.new(uncompress(flags & 0x80 == 0 ? br.read(ci_block_size) : br.read_abs(ci_block_size, file_size - ci_block_size), ui_block_size, flags))
|
||||
guid = head.read(16)
|
||||
|
||||
blocks = []
|
||||
|
||||
@@ -51,6 +51,14 @@ module Mikunyan
|
||||
data
|
||||
end
|
||||
|
||||
# Read given size of binary string from specified position. This method does not seek.
|
||||
# @param [Integer] size size
|
||||
# @param [Integer] pos position
|
||||
# @return [String] data
|
||||
def read_abs(size, pos)
|
||||
@data.byteslice(pos, size)
|
||||
end
|
||||
|
||||
# Read string until null character
|
||||
# @return [String] string
|
||||
def cstr
|
||||
|
||||
Reference in New Issue
Block a user