Added Apple EFI Image Identifier v2.0_a3

Fixed argparse lock of input files
This commit is contained in:
platomav 2022-08-15 18:29:58 +03:00
parent 48562b0f68
commit c144ad804c
5 changed files with 283 additions and 5 deletions

View file

@ -5,6 +5,9 @@
Copyright (C) 2022 Plato Mavropoulos
"""
from common.path_ops import project_root, safe_path
from common.system import get_os_ver
# https://github.com/allowitsme/big-tool by Dmitry Frolov
# https://github.com/platomav/BGScriptTool by Plato Mavropoulos
def get_bgs_tool():
@ -14,3 +17,15 @@ def get_bgs_tool():
BigScript = None
return BigScript
# Get UEFIFind path
def get_uefifind_path():
exec_name = f'UEFIFind{".exe" if get_os_ver()[1] else ""}'
return safe_path(project_root(), ['external',exec_name])
# Get UEFIExtract path
def get_uefiextract_path():
exec_name = f'UEFIExtract{".exe" if get_os_ver()[1] else ""}'
return safe_path(project_root(), ['external',exec_name])

View file

@ -136,6 +136,8 @@ def get_argparse_path(argparse_path):
# Process input files (argparse object)
def process_input_files(argparse_args, sys_argv=None):
input_files = []
if sys_argv is None:
sys_argv = []
@ -146,7 +148,12 @@ def process_input_files(argparse_args, sys_argv=None):
input_path_full = get_argparse_path(input_path_user) if input_path_user else ''
input_files = get_path_files(input_path_full)
else:
input_files = [file.name for file in argparse_args.files]
# Parse list of input files (i.e. argparse FileType objects)
for file_object in argparse_args.files:
# Store each argparse FileType object's name (i.e. path)
input_files.append(file_object.name)
# Close each argparse FileType object (i.e. allow input file changes)
file_object.close()
# Set output fallback value for missing argparse Output and Input Path
output_fallback = path_parent(input_files[0]) if input_files else None

View file

@ -9,6 +9,7 @@ import re
PAT_AMI_PFAT = re.compile(br'_AMIPFAT.AMI_BIOS_GUARD_FLASH_CONFIGURATIONS', re.DOTALL)
PAT_AMI_UCP = re.compile(br'@(UAF|HPU).{12}@', re.DOTALL)
PAT_APPLE_EFI = re.compile(br'\$IBIOSI\$.{16}\x2E\x00.{6}\x2E\x00.{8}\x2E\x00.{6}\x2E\x00.{20}\x00{2}', re.DOTALL)
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)