Implemented stone-unpack mode
This commit is contained in:
@@ -79,7 +79,7 @@ class RangeDecoder:
|
|||||||
self.lecteur_de_bits.reprendre_des_bits_si_besoin()
|
self.lecteur_de_bits.reprendre_des_bits_si_besoin()
|
||||||
return bit_lu
|
return bit_lu
|
||||||
|
|
||||||
class DecodeurLZMA:
|
class DecodeurLZMASPD:
|
||||||
|
|
||||||
def decode(self, entree : bytes) -> bytes:
|
def decode(self, entree : bytes) -> bytes:
|
||||||
self.flux_decompresse = b''
|
self.flux_decompresse = b''
|
||||||
|
|||||||
@@ -5,8 +5,7 @@ import os
|
|||||||
import sys
|
import sys
|
||||||
import struct
|
import struct
|
||||||
import lzma
|
import lzma
|
||||||
#from custlzma.lzma_decoder import LZMADecoder # (for LZMA_SPD decompression)
|
from custlzma.frenchlzma import DecodeurLZMASPD # (for LZMA_SPD decompression)
|
||||||
from custlzma.frenchlzma import DecodeurLZMA
|
|
||||||
|
|
||||||
# common utils
|
# common utils
|
||||||
|
|
||||||
@@ -56,7 +55,7 @@ def unpack_block(blkData, blkPacSize, targetFile):
|
|||||||
print('Found LZMA blocks: %d, decompressing...' % lzmaBlocksAmount)
|
print('Found LZMA blocks: %d, decompressing...' % lzmaBlocksAmount)
|
||||||
dest = b''
|
dest = b''
|
||||||
inSizePure = blkPacSize * 2
|
inSizePure = blkPacSize * 2
|
||||||
lzmaDec = DecodeurLZMA()
|
lzmaDec = DecodeurLZMASPD()
|
||||||
for i in range(lzmaBlocksAmount):
|
for i in range(lzmaBlocksAmount):
|
||||||
if blocksOffTbl is not None:
|
if blocksOffTbl is not None:
|
||||||
dataOffset = getTblOffset(blocksOffTbl,i)
|
dataOffset = getTblOffset(blocksOffTbl,i)
|
||||||
|
|||||||
Reference in New Issue
Block a user