mirror of
https://github.com/platomav/BIOSUtilities.git
synced 2025-05-13 06:34:42 -04:00
Improved AMI UCP > NAL unpacking
Fix potential illegal path traversals
This commit is contained in:
parent
672b4b2321
commit
40686d5edf
13 changed files with 102 additions and 43 deletions
|
@ -7,7 +7,7 @@ AMI BIOS Guard Extractor
|
|||
Copyright (C) 2018-2022 Plato Mavropoulos
|
||||
"""
|
||||
|
||||
title = 'AMI BIOS Guard Extractor v4.0_a5'
|
||||
title = 'AMI BIOS Guard Extractor v4.0_a6'
|
||||
|
||||
import os
|
||||
import re
|
||||
|
@ -20,7 +20,7 @@ sys.dont_write_bytecode = True
|
|||
|
||||
from common.externals import get_bgs_tool
|
||||
from common.num_ops import get_ordinal
|
||||
from common.path_ops import safe_name
|
||||
from common.path_ops import get_safe_name
|
||||
from common.patterns import PAT_AMI_PFAT
|
||||
from common.struct_ops import get_struct, char, uint8_t, uint16_t, uint32_t
|
||||
from common.system import script_init, argparse_init, printer
|
||||
|
@ -139,7 +139,7 @@ def get_ami_pfat(input_buffer):
|
|||
return match, buffer
|
||||
|
||||
def get_file_name(index, title):
|
||||
return safe_name('%0.2d -- %s' % (index, title))
|
||||
return get_safe_name('%0.2d -- %s' % (index, title))
|
||||
|
||||
def parse_bg_script(script_data, padding):
|
||||
is_opcode_div = len(script_data) % 8 == 0
|
||||
|
@ -224,7 +224,7 @@ def parse_pfat_file(buffer, output_path, padding):
|
|||
|
||||
extract_name = os.path.basename(output_path)
|
||||
|
||||
extract_path = os.path.join(output_path + '_extracted', '')
|
||||
extract_path = os.path.join(output_path + '_extracted')
|
||||
|
||||
if os.path.isdir(extract_path): shutil.rmtree(extract_path)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue