add support for a header of AssetBundle on the last in the file

This commit is contained in:
Ishotihadus
2018-08-05 18:15:33 +09:00
parent 823ef428c1
commit fd470c97f7
2 changed files with 9 additions and 1 deletions
+1 -1
View File
@@ -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 = []
+8
View File
@@ -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