This commit is contained in:
Alhaziel01
2020-05-27 10:54:59 +02:00
parent c8ffb4a55e
commit 79d1e94f3d

View File

@@ -66,8 +66,14 @@ class Cursor(object):
def prepare_decoder(self,offset):
initial_value = self.initial_value + int(offset/16)
from lib import pyaes
self.decryptor = pyaes.AESModeOfOperationCTR(self._file._client.a32_to_str(self.k), counter=pyaes.Counter(initial_value=initial_value))
try:
from Cryptodome.Cipher import AES
from Cryptodome.Util import Counter
self.decryptor = AES.new(self._file._client.a32_to_str(self.k), AES.MODE_CTR, counter = Counter.new(128, initial_value = initial_value))
except:
from Crypto.Cipher import AES
from Crypto.Util import Counter
self.decryptor = AES.new(self._file._client.a32_to_str(self.k), AES.MODE_CTR, counter = Counter.new(128, initial_value = initial_value))
rest = offset - int(offset/16)*16
if rest:
self.decode(str(0)*rest)