Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

skip unprocessed guid defined sections #124

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions bin/uefi-firmware-parser
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ from uefi_firmware import AutoParser
import uefi_firmware.utils # import nocolor

def _process_show_extract(parsed_object):
if parsed_object is None:
return

global FILENAME
if not args.quiet:
parsed_object.showinfo('')
Expand Down
3 changes: 0 additions & 3 deletions uefi_firmware/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
import os

from . import uefi
from . import pfs
from . import me
from . import flash

from .misc import checker
from .base import FirmwareObject, RawObject, AutoRawObject
Expand Down
8 changes: 5 additions & 3 deletions uefi_firmware/uefi.py
Original file line number Diff line number Diff line change
Expand Up @@ -850,6 +850,9 @@ def process(self):
if raw_object:
self.parsed_object = RawObject(self.data)
status = True
elif isinstance(self.parsed_object, GuidDefinedSection):
self.parsed_object = None
return True
return status

def build(self, generate_checksum=False, debug=False):
Expand All @@ -872,7 +875,6 @@ def build(self, generate_checksum=False, debug=False):
string_size = struct.pack("<I", size)
header = struct.pack("<3sB", string_size[:3], self.type)
return size, header + data
pass

def showinfo(self, ts='', index=-1):
print ("%s type 0x%02x, size 0x%x (%d bytes) (%s section)" % (
Expand Down Expand Up @@ -1186,11 +1188,11 @@ def _is_ucode(self, data):
return data[:4] == "\x01\x00\x00\x00" and data[20:24] == "\x01\x00\x00\x00"

def _guessinfo_dict(self, data):
if _is_ucode(data):
if self._is_ucode(data):
return "Might contain CPU microcodes"

def _guessinfo_text(self, ts, data, index="N/A"):
if _is_ucode(data):
if self._is_ucode(data):
print ("%s Might contain CPU microcodes" % (
blue("%sBlob %d:" % (ts, index))))

Expand Down
Loading