Don't rely on a fixed offset length.
This commit is contained in:
parent
5a3b12c464
commit
54daa0bf9b
2 changed files with 4 additions and 3 deletions
|
@ -6,7 +6,7 @@ Currently, only writing to RPAv2/RPAv3 archives is supported.
|
|||
|
||||
Usage
|
||||
-----
|
||||
rpatool [-l|-x|-c|-d] [-a] [-o OUTFILE] [-2] [-3] [-k KEY]
|
||||
rpatool [-l|-x|-c|-d|-a] [-o OUTFILE] [-2] [-3] [-k KEY]
|
||||
[-p COUNT] [-h] [-v] [-V]
|
||||
ARCHIVE [FILE [FILE ...]]
|
||||
|
||||
|
|
5
rpatool
5
rpatool
|
@ -57,10 +57,11 @@ class RenPyArchive:
|
|||
if self.version == 2 or self.version == 3:
|
||||
# Fetch metadata.
|
||||
metadata = self.handle.readline()
|
||||
offset = int(metadata[8:24], 16)
|
||||
vals = metadata.split()
|
||||
offset = int(vals[1], 16)
|
||||
if self.version == 3:
|
||||
self.key = 0
|
||||
for subkey in metadata[25:].split():
|
||||
for subkey in vals[2:]:
|
||||
self.key ^= int(subkey, 16)
|
||||
|
||||
# Load in indexes.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue