1
This commit is contained in:
parent
9c861b2e13
commit
71c377ccb9
8
hlna.py
8
hlna.py
@ -24,9 +24,11 @@ logging.basicConfig(stream=sys.stderr, level=logging.CRITICAL)
|
|||||||
class UnpackException(Exception):
|
class UnpackException(Exception):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
class SignatureUnpackException(UnpackException):
|
class SignatureUnpackException(UnpackException):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
class CorruptUnpackException(UnpackException):
|
class CorruptUnpackException(UnpackException):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@ -62,7 +64,7 @@ def path_server():
|
|||||||
def hlna():
|
def hlna():
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def arkit(src, dst):
|
def unpack(src, dst):
|
||||||
with open(src, 'rb') as f:
|
with open(src, 'rb') as f:
|
||||||
sigver = struct.unpack('q', f.read(8))[0]
|
sigver = struct.unpack('q', f.read(8))[0]
|
||||||
unpacked_chunk = f.read(8)
|
unpacked_chunk = f.read(8)
|
||||||
@ -489,12 +491,12 @@ def modextract(id_mod, id_game_workshop):
|
|||||||
src = os.path.join(curdir, file)
|
src = os.path.join(curdir, file)
|
||||||
dst = os.path.join(curdir, name)
|
dst = os.path.join(curdir, name)
|
||||||
uncompressed = os.path.join(curdir, file + ".uncompressed_size")
|
uncompressed = os.path.join(curdir, file + ".uncompressed_size")
|
||||||
arkit.unpack(src, dst)
|
unpack(src, dst)
|
||||||
#print("[+] Extracted " + file)
|
#print("[+] Extracted " + file)
|
||||||
os.remove(src)
|
os.remove(src)
|
||||||
if os.path.isfile(uncompressed):
|
if os.path.isfile(uncompressed):
|
||||||
os.remove(uncompressed)
|
os.remove(uncompressed)
|
||||||
except (arkit.UnpackException, arkit.SignatureUnpackException, arkit.CorruptUnpackException) as e:
|
except (UnpackException, SignatureUnpackException, CorruptUnpackException) as e:
|
||||||
print("[x] Unpacking .z files failed, aborting mod install")
|
print("[x] Unpacking .z files failed, aborting mod install")
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user