mirror of
https://github.com/platomav/BIOSUtilities.git
synced 2025-05-09 13:52:00 -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)
|
||||
|
|
|
@ -13,7 +13,7 @@ PAT_AWARD_LZH = re.compile(br'-lh[04567]-')
|
|||
PAT_DELL_FTR = re.compile(br'\xEE\xAA\xEE\x8F\x49\x1B\xE8\xAE\x14\x37\x90')
|
||||
PAT_DELL_HDR = re.compile(br'\xEE\xAA\x76\x1B\xEC\xBB\x20\xF1\xE6\x51.\x78\x9C', re.DOTALL)
|
||||
PAT_DELL_PKG = re.compile(br'\x72\x13\x55\x00.{45}7zXZ', re.DOTALL)
|
||||
PAT_INSYDE_IFL = re.compile(br'\$_IFLASH_')
|
||||
PAT_INSYDE_IFL = re.compile(br'\$_IFLASH')
|
||||
PAT_INSYDE_SFX = re.compile(br'\x0D\x0A;!@InstallEnd@!\x0D\x0A(7z\xBC\xAF\x27|\x6E\xF4\x79\x5F\x4E)')
|
||||
PAT_INTEL_ENG = re.compile(br'\x04\x00{3}[\xA1\xE1]\x00{3}.{8}\x86\x80.{9}\x00\$((MN2)|(MAN))', re.DOTALL)
|
||||
PAT_MICROSOFT_CAB = re.compile(br'MSCF\x00{4}')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue