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

Failing Parse on MSI MPG X670E Carbon #57

Open
joshgarde opened this issue Mar 9, 2024 · 5 comments
Open

Failing Parse on MSI MPG X670E Carbon #57

joshgarde opened this issue Mar 9, 2024 · 5 comments

Comments

@joshgarde
Copy link

Attempting to parse the latest BIOS for the MSI MPG X670E Carbon appears to be failing.

PSP Tool version: 2.7

Output:

$ psptool E7D70AMS.1E0
Warning: Skipping FET at 0x1000 due to unknown ROM alignment
Warning: Couldn't parse entry at: 0x83020. Type: 0x48. Size 0x100
Warning: Couldn't parse entry at: 0x83040. Type: 0x48. Size 0x100
Warning: Couldn't parse entry at: 0x83060. Type: 0x48. Size 0x100
Warning: Couldn't parse entry at: 0x84000. Type: 0x4a. Size 0x100
Traceback (most recent call last):
  File "/home/jgarde/.local/bin/psptool", line 8, in <module>
    sys.exit(main())
  File "/home/jgarde/.local/lib/python3.10/site-packages/psptool/__main__.py", line 105, in main
    psp = PSPTool.from_file(args.file, verbose=args.verbose)
  File "/home/jgarde/.local/lib/python3.10/site-packages/psptool/psptool.py", line 33, in from_file
    pt = PSPTool(file_bytes, verbose=verbose)
  File "/home/jgarde/.local/lib/python3.10/site-packages/psptool/psptool.py", line 41, in __init__
    self.blob = Blob(rom_bytes, len(rom_bytes), self)
  File "/home/jgarde/.local/lib/python3.10/site-packages/psptool/blob.py", line 68, in __init__
    potential_rom = Rom(self, rom_size, rom_offset, fet_offset, psptool)
  File "/home/jgarde/.local/lib/python3.10/site-packages/psptool/rom.py", line 20, in __init__
    self.fet = Fet(self, fet_offset, psptool)
  File "/home/jgarde/.local/lib/python3.10/site-packages/psptool/fet.py", line 45, in __init__
    self._parse_entry_table()
  File "/home/jgarde/.local/lib/python3.10/site-packages/psptool/fet.py", line 118, in _parse_entry_table
    self._create_directory(rom_addr, dir_magic, zen_generation='unknown')
  File "/home/jgarde/.local/lib/python3.10/site-packages/psptool/fet.py", line 89, in _create_directory
    secondary_dir = Directory(self.rom, secondary_directory_address, 'secondary', self.psptool, zen_generation)
  File "/home/jgarde/.local/lib/python3.10/site-packages/psptool/directory.py", line 67, in __init__
    self._parse_header()
  File "/home/jgarde/.local/lib/python3.10/site-packages/psptool/directory.py", line 116, in _parse_header
    self.header = NestedBuffer(
  File "/home/jgarde/.local/lib/python3.10/site-packages/psptool/utils.py", line 48, in __init__
    assert (self.buffer_size <= self.buffer_offset + self.buffer_size), \
TypeError: unsupported operand type(s) for +: 'int' and 'tuple'
@vanishingfork
Copy link

Experiencing the same issue with my MSI PRO B650M-A WIFI
Tested versions:
7D77v1F (latest)
7D77v12 (initial release)
PSPTool version: 2.8.dev3+g9841727
Output:

Warning: Skipping FET at 0x1000 due to unknown ROM alignment
Warning: Couldn't parse entry at: 0x83020. Type: 0x48. Size 0x100
Warning: Couldn't parse entry at: 0x83040. Type: 0x48. Size 0x100
Warning: Couldn't parse entry at: 0x83060. Type: 0x48. Size 0x100
Warning: Couldn't parse entry at: 0x84000. Type: 0x4a. Size 0x100
Traceback (most recent call last):
  File "c:\python39\lib\runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "c:\python39\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "C:\Python39\Scripts\psptool.exe\__main__.py", line 7, in <module>
  File "c:\python39\lib\site-packages\psptool\__main__.py", line 105, in main
    psp = PSPTool.from_file(args.file, verbose=args.verbose)
  File "c:\python39\lib\site-packages\psptool\psptool.py", line 33, in from_file
    pt = PSPTool(file_bytes, verbose=verbose)
  File "c:\python39\lib\site-packages\psptool\psptool.py", line 41, in __init__
    self.blob = Blob(rom_bytes, len(rom_bytes), self)
  File "c:\python39\lib\site-packages\psptool\blob.py", line 68, in __init__
    potential_rom = Rom(self, rom_size, rom_offset, fet_offset, psptool)
  File "c:\python39\lib\site-packages\psptool\rom.py", line 20, in __init__
    self.fet = Fet(self, fet_offset, psptool)
  File "c:\python39\lib\site-packages\psptool\fet.py", line 45, in __init__
    self._parse_entry_table()
  File "c:\python39\lib\site-packages\psptool\fet.py", line 118, in _parse_entry_table
    self._create_directory(rom_addr, dir_magic, zen_generation='unknown')
  File "c:\python39\lib\site-packages\psptool\fet.py", line 89, in _create_directory
    secondary_dir = Directory(self.rom, secondary_directory_address, 'secondary', self.psptool, zen_generation)
  File "c:\python39\lib\site-packages\psptool\directory.py", line 76, in __init__
    self._parse_entries()
  File "c:\python39\lib\site-packages\psptool\directory.py", line 140, in _parse_entries
    entry_fields['offset'] &= self.rom.addr_mask
KeyError: 'offset'

@cwerling
Copy link
Member

cwerling commented Apr 9, 2024

Check out latest master as of now 765a3f6, it should parse now at least. I had to add two more weird directory magics for some equally weird new directory format I don't understand yet. Let me know if you do.

@vanishingfork
Copy link

vanishingfork commented Apr 10, 2024

It parses now for the following versions, the 3rd board was chosen to test if the same problem occurs with other vendors:

PSPTool -V:
2.8.dev5+g59576e6

The following firmware versions fail to parse:

  • <=7D77v1C, MSI PRO B650M-A WIFI, 2023-11-28, AGESA ComboPI 1.0.9.0
  • <=7D70v1C, MPG-X670E-CARBON-WIFI, 2023-11-29, AGESA ComboPI 1.0.9.0
  • <=1709, ROG CROSSHAIR X670E EXTREME, 2023-10-05, AGESA ComboPI 1.0.8.0

I don't know anything about AGESA but maybe the 1.1.0.0 release changed something.

The following error was seen:

> PSPTool .\E7D77AMS.1C0
Warning: Skipping FET at 0x1000 due to unknown ROM alignment
Warning: Couldn't parse entry at: 0x83020. Type: 0x48. Size 0x100
Warning: Couldn't parse entry at: 0x83040. Type: 0x48. Size 0x100
Warning: Couldn't parse entry at: 0x83060. Type: 0x48. Size 0x100
Warning: Couldn't parse entry at: 0x84000. Type: 0x4a. Size 0x100
Warning: Couldn't parse entry at: 0x7c0000. Type: 0x49. Size 0x400
Warning: Couldn't parse entry at: 0x751c00. Type: 0x8d. Size 0x30
Warning: Couldn't parse entry at: 0xab0000. Type: 0x93. Size 0x28000
Warning: Couldn't parse entry at: 0xad8000. Type: 0x93. Size 0x28000
Warning: Couldn't parse plain entry: 0x62
Warning: Entry of Directory(address=0x7c0000, type=secondary, magic=b'$BL2', count=19) at 0x15c2000 cannot be parsed
Warning: Couldn't parse plain entry: 0x62
Warning: Entry of Directory(address=0x7c0000, type=secondary, magic=b'$BL2', count=19) at 0x13c2000 cannot be parsed
Warning: Couldn't parse plain entry: 0x63
Warning: Entry of Directory(address=0x7c0000, type=secondary, magic=b'$BL2', count=19) at 0x1760000 cannot be parsed
Warning: Entry of Directory(address=0x7c0000, type=secondary, magic=b'$BL2', count=19) at 0x1360000 cannot be parsed
Warning: Entry of Directory(address=0x7c0000, type=secondary, magic=b'$BL2', count=19) at 0x1380000 cannot be parsed
Warning: Entry of Directory(address=0x7c0000, type=secondary, magic=b'$BL2', count=19) at 0x1350000 cannot be parsed
Warning: Entry of Directory(address=0x7c0000, type=secondary, magic=b'$BL2', count=19) at 0x13a0000 cannot be parsed
Traceback (most recent call last):
  File "c:\python39\lib\runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "c:\python39\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "C:\Python39\Scripts\psptool.exe\__main__.py", line 7, in <module>
  File "c:\python39\lib\site-packages\psptool\__main__.py", line 105, in main
    psp = PSPTool.from_file(args.file, verbose=args.verbose)
  File "c:\python39\lib\site-packages\psptool\psptool.py", line 33, in from_file
    pt = PSPTool(file_bytes, verbose=verbose)
  File "c:\python39\lib\site-packages\psptool\psptool.py", line 41, in __init__
    self.blob = Blob(rom_bytes, len(rom_bytes), self)
  File "c:\python39\lib\site-packages\psptool\blob.py", line 68, in __init__
    potential_rom = Rom(self, rom_size, rom_offset, fet_offset, psptool)
  File "c:\python39\lib\site-packages\psptool\rom.py", line 20, in __init__
    self.fet = Fet(self, fet_offset, psptool)
  File "c:\python39\lib\site-packages\psptool\fet.py", line 45, in __init__
    self._parse_entry_table()
  File "c:\python39\lib\site-packages\psptool\fet.py", line 121, in _parse_entry_table
    self._create_directory(rom_addr, dir_magic, zen_generation='unknown')
  File "c:\python39\lib\site-packages\psptool\fet.py", line 92, in _create_directory
    secondary_dir = Directory(self.rom, secondary_directory_address, 'secondary', self.psptool, zen_generation)
  File "c:\python39\lib\site-packages\psptool\directory.py", line 76, in __init__
    self._parse_entries()
  File "c:\python39\lib\site-packages\psptool\directory.py", line 140, in _parse_entries
    entry_fields['offset'] &= self.rom.addr_mask
KeyError: 'offset'

@cwerling
Copy link
Member

Fixed your firmware files with 0299688

Let me know if you have any clue how to properly identify these directories.

@joshgarde
Copy link
Author

I do have a logic trace on the SPI during boot for the board so I can try working on the directory structure

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

No branches or pull requests

3 participants