Updated all scripts to v1.1

Added "Working..." indicators while running at all scripts
Added dependency filename expectations when required
Apple EFI File Renamer now saves the checksum in hex
This commit is contained in:
Plato Mavropoulos 2018-09-04 21:15:46 +03:00
parent 25cf901460
commit bdcb70c2c8
5 changed files with 24 additions and 13 deletions

View file

@ -6,7 +6,7 @@ Apple EFI File Renamer
Copyright (C) 2018 Plato Mavropoulos Copyright (C) 2018 Plato Mavropoulos
""" """
print('Apple EFI File Renamer v1.0\n') print('Apple EFI File Renamer v1.1\n')
import os import os
import re import re
@ -24,6 +24,7 @@ else :
# Folder path # Folder path
apple_efi = [] apple_efi = []
in_path = input('\nEnter the full folder path: ') in_path = input('\nEnter the full folder path: ')
print('\nWorking...')
for root, dirs, files in os.walk(in_path): for root, dirs, files in os.walk(in_path):
for name in files : for name in files :
apple_efi.append(os.path.join(root, name)) apple_efi.append(os.path.join(root, name))
@ -73,11 +74,12 @@ for input_file in apple_efi :
file_chk = zlib.adler32(buffer) & 0xFFFFFFFF # Checksum for EFI with same $IBIOSI$ but different PRD/PRE status file_chk = zlib.adler32(buffer) & 0xFFFFFFFF # Checksum for EFI with same $IBIOSI$ but different PRD/PRE status
file_path_new = os.path.join(file_dir, '%s_%s_%s_20%s-%s-%s_%s-%s_%s%s' % (model, version, build, year, month, day, hour, minute, file_chk, file_ext)) file_path_new = os.path.join(file_dir, '%s_%s_%s_20%s-%s-%s_%s-%s_%0.8X%s' % (model, version, build, year, month, day, hour, minute, file_chk, file_ext))
if not os.path.isfile(file_path_new) : os.replace(file_path, file_path_new) # Rename input EFI with proper name if not os.path.isfile(file_path_new) : os.replace(file_path, file_path_new) # Rename input EFI with proper name
else : else :
print('Error: Could not find $IBIOSI$ pattern at %s!\n' % file_name) print('Error: Could not find $IBIOSI$ pattern at %s!' % file_name)
print(' Make sure that "UEFIFind" and "UEFIExtract" executables exist!\n')
input('Done!') input('Done!')

View file

@ -6,7 +6,7 @@ Apple EFI IM4P Splitter
Copyright (C) 2018 Plato Mavropoulos Copyright (C) 2018 Plato Mavropoulos
""" """
print('Apple EFI IM4P Splitter v1.0\n') print('Apple EFI IM4P Splitter v1.1\n')
import os import os
import re import re
@ -22,6 +22,7 @@ else :
# Folder path # Folder path
apple_im4p = [] apple_im4p = []
in_path = input('\nEnter the full folder path: ') in_path = input('\nEnter the full folder path: ')
print('\nWorking...')
for root, dirs, files in os.walk(in_path): for root, dirs, files in os.walk(in_path):
for name in files : for name in files :
apple_im4p.append(os.path.join(root, name)) apple_im4p.append(os.path.join(root, name))

View file

@ -6,7 +6,7 @@ Apple EFI Sucatalog Link Grabber
Copyright (C) 2018 Plato Mavropoulos Copyright (C) 2018 Plato Mavropoulos
""" """
print('Apple EFI Sucatalog Link Grabber v1.0\n') print('Apple EFI Sucatalog Link Grabber v1.1\n')
import os import os
import sys import sys
@ -27,6 +27,8 @@ else :
if name.endswith('.sucatalog') : if name.endswith('.sucatalog') :
catalogs.append(os.path.join(root, name)) catalogs.append(os.path.join(root, name))
print('Working...')
# Parse each input xml file # Parse each input xml file
for input_file in catalogs : for input_file in catalogs :
with open(input_file, 'r') as in_file : with open(input_file, 'r') as in_file :
@ -56,4 +58,4 @@ if os.path.isfile('OUT.txt') :
os.remove('OUT.txt') # Remove temporary output file os.remove('OUT.txt') # Remove temporary output file
input('Done!') input('\nDone!')

View file

@ -9,7 +9,7 @@ https://ist.uwaterloo.ca/~schepers/formats/LHA.TXT
https://sites.google.com/site/pinczakko/pinczakko-s-guide-to-award-bios-reverse-engineering https://sites.google.com/site/pinczakko/pinczakko-s-guide-to-award-bios-reverse-engineering
""" """
print('Award BIOS Module Extractor v1.0\n') print('Award BIOS Module Extractor v1.1\n')
import os import os
import re import re
@ -23,6 +23,7 @@ else :
# Folder path # Folder path
awd_images = [] awd_images = []
in_path = input('\nEnter the full folder path: ') in_path = input('\nEnter the full folder path: ')
print('\nWorking...')
for root, dirs, files in os.walk(in_path): for root, dirs, files in os.walk(in_path):
for name in files : for name in files :
awd_images.append(os.path.join(root, name)) awd_images.append(os.path.join(root, name))
@ -51,8 +52,11 @@ for in_file in awd_images :
with open('mod_temp.bin', 'wb') as lzh_img : lzh_img.write(mod_data) with open('mod_temp.bin', 'wb') as lzh_img : lzh_img.write(mod_data)
try : decomp = subprocess.run(['7z', 'x', '-bso0', '-bse0', '-bsp0', '-o%s' % os.path.join(extr_path, file_name), 'mod_temp.bin']) # 7-Zip try :
except : print('Error: Could not decompress LZH image at %s!\n' % file_name) decomp = subprocess.run(['7z', 'x', '-bso0', '-bse0', '-bsp0', '-o%s' % os.path.join(extr_path, file_name), 'mod_temp.bin']) # 7-Zip
except :
print('Error: Could not decompress LZH image at %s!' % file_name)
print(' Make sure that "7z" executable exists!\n')
os.remove('mod_temp.bin') # Remove temporary LZH image os.remove('mod_temp.bin') # Remove temporary LZH image

View file

@ -7,7 +7,7 @@ Copyright (C) 2018 Plato Mavropoulos
Inspired from https://forums.mydigitallife.net/threads/i-present-you-a-tool-to-decompress-dell-uefi-bios.44785/ by JimboBobB Inspired from https://forums.mydigitallife.net/threads/i-present-you-a-tool-to-decompress-dell-uefi-bios.44785/ by JimboBobB
""" """
print('Dell HDR Module Extractor v1.0\n') print('Dell HDR Module Extractor v1.1\n')
import os import os
import re import re
@ -22,6 +22,7 @@ else :
# Folder path # Folder path
hdr_exec = [] hdr_exec = []
in_path = input('\nEnter the full folder path: ') in_path = input('\nEnter the full folder path: ')
print('\nWorking...')
for root, dirs, files in os.walk(in_path): for root, dirs, files in os.walk(in_path):
for name in files : for name in files :
hdr_exec.append(os.path.join(root, name)) hdr_exec.append(os.path.join(root, name))
@ -63,15 +64,16 @@ for input_file in hdr_exec :
print('\n Decompressed %s%s via Python' % (input_name, input_extension)) print('\n Decompressed %s%s via Python' % (input_name, input_extension))
# Call LongSoft's PFSExtractor RS to extract the Dell HDR container # Call LongSoft's PFSExtractor-RS to extract the Dell HDR container
try : try :
subprocess.run(['PFSExtractor', output_name], check = True, stdout = subprocess.DEVNULL) subprocess.run(['PFSExtractor', output_name], check = True, stdout = subprocess.DEVNULL)
if os.path.isfile(output_name) : os.remove(output_name) if os.path.isfile(output_name) : os.remove(output_name)
print(' Extracted %s via PFSExtractor' % output_name) print(' Extracted %s via PFSExtractor-RS' % output_name)
except : except :
print(' Error: Could not extract %s via PFSExtractor!' % output_name) print(' Error: Could not extract %s via PFSExtractor-RS!' % output_name)
print(' Make sure that "PFSExtractor" executable exists!')
else : else :
input('\nDone!') input('\nDone!')