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
|
ui_block_size = br.i32u
|
||||||
flags = 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)
|
guid = head.read(16)
|
||||||
|
|
||||||
blocks = []
|
blocks = []
|
||||||
|
|||||||
@@ -51,6 +51,14 @@ module Mikunyan
|
|||||||
data
|
data
|
||||||
end
|
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
|
# Read string until null character
|
||||||
# @return [String] string
|
# @return [String] string
|
||||||
def cstr
|
def cstr
|
||||||
|
|||||||
Reference in New Issue
Block a user