mirror of
https://github.com/platomav/BIOSUtilities.git
synced 2025-05-13 06:34:42 -04:00
Insyde iFlash/iFdPacker Extractor v2.0_a9
Support for hardcoded Insyde 7-Zip SFX password Fixed 7-Zip hang on password protected files
This commit is contained in:
parent
69784889cb
commit
df47293d01
4 changed files with 49 additions and 21 deletions
|
@ -23,9 +23,11 @@ def check_bad_exit_code(exit_code):
|
|||
raise Exception(f'BAD_EXIT_CODE_{exit_code}')
|
||||
|
||||
# Check if file is 7-Zip supported
|
||||
def is_szip_supported(in_path, padding=0, check=False, silent=False):
|
||||
def is_szip_supported(in_path, padding=0, password='', check=False, silent=False):
|
||||
try:
|
||||
szip_t = subprocess.run([get_szip_path(), 't', in_path, '-bso0', '-bse0', '-bsp0'], check=False)
|
||||
szip_c = [get_szip_path(), 't', in_path, f'-p{password}', '-bso0', '-bse0', '-bsp0']
|
||||
|
||||
szip_t = subprocess.run(szip_c, check=False)
|
||||
|
||||
if check:
|
||||
check_bad_exit_code(szip_t.returncode)
|
||||
|
@ -38,12 +40,14 @@ def is_szip_supported(in_path, padding=0, check=False, silent=False):
|
|||
return True
|
||||
|
||||
# Archive decompression via 7-Zip
|
||||
def szip_decompress(in_path, out_path, in_name, padding=0, check=False, silent=False):
|
||||
def szip_decompress(in_path, out_path, in_name, padding=0, password='', check=False, silent=False):
|
||||
if not in_name:
|
||||
in_name = 'archive'
|
||||
|
||||
try:
|
||||
szip_x = subprocess.run([get_szip_path(), 'x', '-aou', '-bso0', '-bse0', '-bsp0', '-o' + out_path, in_path], check=False)
|
||||
szip_c = [get_szip_path(), 'x', f'-p{password}', '-aou', '-bso0', '-bse0', '-bsp0', f'-o{out_path}', in_path]
|
||||
|
||||
szip_x = subprocess.run(szip_c, check=False)
|
||||
|
||||
if check:
|
||||
check_bad_exit_code(szip_x.returncode)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue