Add quick format check functions for PFAT, UCP, PFS

This commit is contained in:
platomav 2022-04-14 14:06:23 +03:00
parent d6e8d31391
commit d02de2ac57
3 changed files with 11 additions and 4 deletions

View file

@ -7,7 +7,7 @@ AMI BIOS Guard Extractor
Copyright (C) 2018-2022 Plato Mavropoulos
"""
title = 'AMI BIOS Guard Extractor v4.0_a3'
title = 'AMI BIOS Guard Extractor v4.0_a4'
import os
import re
@ -128,6 +128,9 @@ class IntelBiosGuardSignature2k(ctypes.LittleEndianStructure):
printer(['Exponent :', '0x%X' % self.Exponent], p, False)
printer(['Signature:', '%s [...]' % Signature[:32]], p, False)
def is_ami_pfat(input_buffer):
return bool(get_ami_pfat(input_buffer)[0])
def get_ami_pfat(input_buffer):
match = PAT_AMI_PFAT.search(input_buffer)

View file

@ -7,7 +7,7 @@ AMI UCP BIOS Extractor
Copyright (C) 2021-2022 Plato Mavropoulos
"""
title = 'AMI UCP BIOS Extractor v2.0_a4'
title = 'AMI UCP BIOS Extractor v2.0_a5'
import os
import re
@ -159,6 +159,10 @@ def chk16_validate(data, tag, padd=0):
else:
printer('Checksum of UCP Module %s is valid!' % tag, padd)
# Check if input file is AMI UCP image
def is_ami_ucp(buffer):
return bool(get_ami_ucp(buffer)[0])
# Get all input file AMI UCP patterns
def get_ami_ucp(buffer):
uaf_len_max = 0x0 # Length of largest detected @UAF|@HPU

View file

@ -7,7 +7,7 @@ Dell PFS Update Extractor
Copyright (C) 2018-2022 Plato Mavropoulos
"""
title = 'Dell PFS Update Extractor v6.0_a2'
title = 'Dell PFS Update Extractor v6.0_a3'
import os
import io
@ -208,7 +208,7 @@ def is_pfs_ftr(in_buffer):
# Check if input buffer is Dell PFS/PKG image
def is_dell_pfs(in_buffer):
return is_pfs_hdr(in_buffer) or is_pfs_pkg(in_buffer)
return bool(is_pfs_hdr(in_buffer) or is_pfs_pkg(in_buffer))
# Get PFS ZLIB Section Offsets
def get_section_offsets(buffer):