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

Optiplex binaries parsing errors #1226

Open
DaniilKl opened this issue Jan 31, 2025 · 3 comments
Open

Optiplex binaries parsing errors #1226

DaniilKl opened this issue Jan 31, 2025 · 3 comments

Comments

@DaniilKl
Copy link
Contributor

DaniilKl commented Jan 31, 2025

Component

Dasharo Tools Suite

Device

Dell OptiPlex 9010

Dasharo version

v0.1.1

Dasharo Tools Suite version

v2.2.0

Test case ID

No response

Brief summary

Optiplex Dasharo Initial deployment shows binaries absence errors, but firmware installs with success.

How reproducible

100%

How to reproduce

Do initial deployment to Dasharo v0.1.1 on Optiplex 9010.

Expected behavior

Initial deployment passes without errors/warnings.

Actual behavior

Image

Screenshots

No response

Additional context

Though, I noticed it during initial deployment on Optiplex 9010 when deploying Dasharo (Coreboot + UEFI) v0.1.1. It might as well appear on other platforms/deployment workflows.

The line that causes the issue.

Logs

[12:08:33.922]: File "/usr/bin/uefi-firmware-parser", line 196, in <module>
[12:08:33.924]: _process_show_extract(firmware)
[12:08:33.927]: File "/usr/bin/uefi-firmware-parser", line 19, in _process_show_extract
[12:08:33.930]: parsed_object.showinfo('')
[12:08:33.932]: File "/usr/lib/python3.12/site-packages/uefi_firmware/__init__.py", line 130, in showinfo
[12:08:33.935]: self.objs[i].showinfo(ts, i)
[12:08:33.938]: File "/usr/lib/python3.12/site-packages/uefi_firmware/pfs.py", line 422, in showinfo
[12:08:33.940]: section.showinfo("%s  " % ts)
[12:08:33.943]: File "/usr/lib/python3.12/site-packages/uefi_firmware/pfs.py", line 324, in showinfo
[12:08:33.946]: sub_object.showinfo("%s  " % ts)
[12:08:33.948]: File "/usr/lib/python3.12/site-packages/uefi_firmware/base.py", line 198, in showinfo
[12:08:33.951]: self.object.showinfo(ts)
[12:08:33.954]: File "/usr/lib/python3.12/site-packages/uefi_firmware/me.py", line 675, in showinfo
[12:08:33.957]: partition.showinfo("  %s" % ts)
[12:08:33.959]: File "/usr/lib/python3.12/site-packages/uefi_firmware/me.py", line 625, in showinfo
[12:08:33.962]: purple(self.structure.Name.decode("utf-8")), purple(self.structure.Owner),
[12:08:33.965]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[12:08:33.967]: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe0 in position 0: invalid continuation byte
[12:08:33.970]: --2025-01-30 12:08:29--  https://cdrdv2.intel.com/v1/dl/getContent/630744

Solutions you've tried

No response

@m-iwanicki
Copy link

Can be replicated manually in DTS by using:

wget -O "/tmp/O7010A29.exe" --user-agent='Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)' "https://dl.dell.com/FOLDER05066036M/1/O7010A29.exe"
binwalk --run-as=root -e "/tmp/O7010A29.exe" -C /tmp
uefi-firmware-parser -e "/tmp/_O7010A29.exe.extracted/65C10" -O >> log

Binwalk will output warning:

DECIMAL       HEXADECIMAL     DESCRIPTION
--------------------------------------------------------------------------------
416784        0x65C10         Zlib compressed data, default compression

WARNING: One or more files failed to extract: either no utility was found or it's unimplemented

uefi-firmware-parser will output:

Error invalid FV header data ().
Error invalid FV header data ().
Error invalid FV header data ().
Error invalid FV header data ().
Error invalid FV header data ().
Error invalid FV header data ().
Error invalid FV header data ().
Traceback (most recent call last):
  File "/usr/bin/uefi-firmware-parser", line 196, in <module>
    _process_show_extract(firmware)
  File "/usr/bin/uefi-firmware-parser", line 19, in _process_show_extract
    parsed_object.showinfo('')
  File "/usr/lib/python3.12/site-packages/uefi_firmware/__init__.py", line 130, in showinfo
    self.objs[i].showinfo(ts, i)
  File "/usr/lib/python3.12/site-packages/uefi_firmware/pfs.py", line 422, in showinfo
    section.showinfo("%s  " % ts)
  File "/usr/lib/python3.12/site-packages/uefi_firmware/pfs.py", line 324, in showinfo
    sub_object.showinfo("%s  " % ts)
  File "/usr/lib/python3.12/site-packages/uefi_firmware/base.py", line 198, in showinfo
    self.object.showinfo(ts)
  File "/usr/lib/python3.12/site-packages/uefi_firmware/me.py", line 675, in showinfo
    partition.showinfo("  %s" % ts)
  File "/usr/lib/python3.12/site-packages/uefi_firmware/me.py", line 625, in showinfo
    purple(self.structure.Name.decode("utf-8")), purple(self.structure.Owner),
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe0 in position 0: invalid continuation byte

When trying this on Fedora 41 the only difference is that binwalk manages to extract everything (v2.3.3 and v2.3.4 work but newer v2.4.2+3dd13d7 in DTS has problems)

  • Binwalk outputs:

    $ binwalk -e "O7010A29.exe"
    
    DECIMAL       HEXADECIMAL     DESCRIPTION
    --------------------------------------------------------------------------------
    0             0x0             Microsoft executable, portable (PE)
    177443        0x2B523         Copyright string: "Copyright 2009-2013"
    185388        0x2D42C         CRC32 polynomial table, little endian
    189484        0x2E42C         CRC32 polynomial table, big endian
    196409        0x2FF39         Copyright string: "Copyright 1995-2010 Mark Adler "
    346831        0x54ACF         Copyright string: "Copyright 1995-2010 Mark Adler "
    347120        0x54BF0         CRC32 polynomial table, little endian
    351216        0x55BF0         CRC32 polynomial table, big endian
    365366        0x59336         Copyright string: "Copyright 2009-2013"
    416784        0x65C10         Zlib compressed data, default compression
    8496712       0x81A648        Object signature in DER format (PKCS header length: 4, sequence length: 7088
    8496853       0x81A6D5        Certificate in DER format (x509 v3), header length: 4, sequence length: 1272
    8498129       0x81ABD1        Certificate in DER format (x509 v3), header length: 4, sequence length: 1309
    8500097       0x81B381        Object signature in DER format (PKCS header length: 4, sequence length: 3703
    8500389       0x81B4A5        Certificate in DER format (x509 v3), header length: 4, sequence length: 1236
    8501629       0x81B97D        Certificate in DER format (x509 v3), header length: 4, sequence length: 1299
    8503263       0x81BFDF        Certificate in DER format (x509 v3), header length: 4, sequence length: 262

@m-iwanicki
Copy link

Fix: use current version from GitHub (not available on PyPi) https://github.com/theopolis/uefi-firmware-parser:

(venv) miwanicki@3M02 ➜ uefi-firmware-parser -e "_O7010A29.exe.extracted/65C10" -O >> log
/home/miwanicki/projects/tmp/venv/bin/uefi-firmware-parser:4: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
  __import__('pkg_resources').run_script('uefi-firmware==1.11', 'uefi-firmware-parser')
Error invalid FV header data ().
Error invalid FV header data ().
Error invalid FV header data ().
Error invalid FV header data ().
Error invalid FV header data ().
Error invalid FV header data ().
Error invalid FV header data ().
(venv) miwanicki@3M02 ➜ echo $?
0

@m-iwanicki
Copy link

Additionaly maybe we shouldn't output stdout to $ERR_LOG_FILE as it makes this log very hard to read as it contains 8 thousand lines of not errors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants