Skip to content

Conversation

@bird-dancer
Copy link

@bird-dancer bird-dancer commented Jan 22, 2026

When extracting a file, replacing it without change, and extracting it again the file changes significantly.
This is due to length and address field being changed incorrectly.
The size doesn't (always??) have to be 0x10 aligned as evidenced by the TPMLITE file for this example.

now the repacked rom image still has 8 padding bytes that are different from the original but these are inconsequential for the content and when unpacking.

@github-actions
Copy link

Metrics

psptool command line interface metrics

Metric Value
Files Processed 68
Stdout Lines 14,913
Stderr Lines 144
Total Lines 15,057
Error Ratio 0.96%

PSPTool python library metrics

Status Count Percentage
✓ Successful 68 100.0%
✗ Failed 0 0.0%
Total 68 100%

All files parsed successfully!

entry.type = type_
entry.size = size
entry.offset = offset
entry.offset = offset - self.get_address()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why the subtraction?

Copy link
Author

@bird-dancer bird-dancer Jan 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

because file.buffer_offset passed as an argument refers to the absolute offset. The DirectoryEntry.offset refers to the relative offset from the directory.

@bird-dancer bird-dancer marked this pull request as draft January 26, 2026 23:45
@github-actions
Copy link

Metrics

psptool command line interface metrics

Metric Value
Files Processed 68
Stdout Lines 4,596
Stderr Lines 834
Total Lines 5,430
Error Ratio 15.36%

PSPTool python library metrics

Status Count Percentage
✓ Successful 33 48.53%
✗ Failed 35 51.47%
Total 68 100%

Failed Files

  • ASUS_ROG-STRIX-X470-F-GAMING-ASUS-4804.CAP
  • ASUS_ROG-STRIX-B450-F-GAMING-ASUS-2301.CAP
  • ASRock_B450_B45P4_3.31
  • TUF-GAMING-A520M-PLUS-WIFI-ASUS-2604.CAP
  • Lenovo_Thinkpad_T14_WinGLC3A106.ROM
  • ASRock_X470_X47GK4_3.31
  • ASUS_ROG-STRIX-B350-F-GAMING-ASUS-4801.CAP
  • ASUS_TUF-B450M-PRO-GAMING-ASUS-1201.CAP
  • ASUS_PRIME-X470-PRO-4011.CAP
  • Gigabyte_X470AG7W.F40
  • ASUS_PRIME-X370-PRO-3803.CAP
  • ASRock_X370_X370GK45.30
  • ASRock-A520M-HSV-1.31.ROM
  • MSI_X470_E7B77AMS.194
  • ASUS_PRIME-X470-PRO-ASUS-4804.CAP
  • ASUS_PRIME-B350-PLUS-4011.CAP
  • ASUS_ROG-STRIX-X370-F-GAMING-ASUS-4801.CAP
  • ASRock_A320_A32M5.00
  • ASRock_B350_AB35G4_5.70
  • Gigabyte_AX370G3.F31
  • AORUS_X370G5.23d
  • ASUS_B450M_KII_Zen1_ROM_Exploit.rom
  • AORUS_B450AE.F40
  • ASRock_A520M_HVS_1.31.ftpm_with_data.rom
  • Gigabyte_WRX80F2
  • AORUS_X570_X57AOXT2.FCd
  • MSI_X370_E7A33AMS.4I1
  • ASUS_PRIME-B450M-A-ASUS-1201.CAP
  • MSI_B450_E7B86AMS.181
  • Acer_R01-A4.ROM
  • AORUS_X470AG7W.F40
  • ASUS_PRIME-A320M-A-ASUS-4801.CAP
  • MSI_A320_E7A38AMS.2I2
  • Lenovo_Ideapad_5_Pro-16ACH6.rom
  • MSI_B350_E7A34AMS.1O1

@github-actions
Copy link

Metrics

psptool command line interface metrics

Metric Value
Files Processed 68
Stdout Lines 4,596
Stderr Lines 834
Total Lines 5,430
Error Ratio 15.36%

PSPTool python library metrics

Status Count Percentage
✓ Successful 33 48.53%
✗ Failed 35 51.47%
Total 68 100%

Failed Files

  • ASUS_ROG-STRIX-X470-F-GAMING-ASUS-4804.CAP
  • ASUS_ROG-STRIX-B450-F-GAMING-ASUS-2301.CAP
  • ASRock_B450_B45P4_3.31
  • TUF-GAMING-A520M-PLUS-WIFI-ASUS-2604.CAP
  • Lenovo_Thinkpad_T14_WinGLC3A106.ROM
  • ASRock_X470_X47GK4_3.31
  • ASUS_ROG-STRIX-B350-F-GAMING-ASUS-4801.CAP
  • ASUS_TUF-B450M-PRO-GAMING-ASUS-1201.CAP
  • ASUS_PRIME-X470-PRO-4011.CAP
  • Gigabyte_X470AG7W.F40
  • ASUS_PRIME-X370-PRO-3803.CAP
  • ASRock_X370_X370GK45.30
  • ASRock-A520M-HSV-1.31.ROM
  • MSI_X470_E7B77AMS.194
  • ASUS_PRIME-X470-PRO-ASUS-4804.CAP
  • ASUS_PRIME-B350-PLUS-4011.CAP
  • ASUS_ROG-STRIX-X370-F-GAMING-ASUS-4801.CAP
  • ASRock_A320_A32M5.00
  • ASRock_B350_AB35G4_5.70
  • Gigabyte_AX370G3.F31
  • AORUS_X370G5.23d
  • ASUS_B450M_KII_Zen1_ROM_Exploit.rom
  • AORUS_B450AE.F40
  • ASRock_A520M_HVS_1.31.ftpm_with_data.rom
  • Gigabyte_WRX80F2
  • AORUS_X570_X57AOXT2.FCd
  • MSI_X370_E7A33AMS.4I1
  • ASUS_PRIME-B450M-A-ASUS-1201.CAP
  • MSI_B450_E7B86AMS.181
  • Acer_R01-A4.ROM
  • AORUS_X470AG7W.F40
  • ASUS_PRIME-A320M-A-ASUS-4801.CAP
  • MSI_A320_E7A38AMS.2I2
  • Lenovo_Ideapad_5_Pro-16ACH6.rom
  • MSI_B350_E7A34AMS.1O1

@github-actions
Copy link

Metrics

psptool command line interface metrics

Metric Value
Files Processed 68
Stdout Lines 4,596
Stderr Lines 834
Total Lines 5,430
Error Ratio 15.36%

PSPTool python library metrics

Status Count Percentage
✓ Successful 33 48.53%
✗ Failed 35 51.47%
Total 68 100%

Failed Files

  • ASUS_ROG-STRIX-X470-F-GAMING-ASUS-4804.CAP
  • ASUS_ROG-STRIX-B450-F-GAMING-ASUS-2301.CAP
  • ASRock_B450_B45P4_3.31
  • TUF-GAMING-A520M-PLUS-WIFI-ASUS-2604.CAP
  • Lenovo_Thinkpad_T14_WinGLC3A106.ROM
  • ASRock_X470_X47GK4_3.31
  • ASUS_ROG-STRIX-B350-F-GAMING-ASUS-4801.CAP
  • ASUS_TUF-B450M-PRO-GAMING-ASUS-1201.CAP
  • ASUS_PRIME-X470-PRO-4011.CAP
  • Gigabyte_X470AG7W.F40
  • ASUS_PRIME-X370-PRO-3803.CAP
  • ASRock_X370_X370GK45.30
  • ASRock-A520M-HSV-1.31.ROM
  • MSI_X470_E7B77AMS.194
  • ASUS_PRIME-X470-PRO-ASUS-4804.CAP
  • ASUS_PRIME-B350-PLUS-4011.CAP
  • ASUS_ROG-STRIX-X370-F-GAMING-ASUS-4801.CAP
  • ASRock_A320_A32M5.00
  • ASRock_B350_AB35G4_5.70
  • Gigabyte_AX370G3.F31
  • AORUS_X370G5.23d
  • ASUS_B450M_KII_Zen1_ROM_Exploit.rom
  • AORUS_B450AE.F40
  • ASRock_A520M_HVS_1.31.ftpm_with_data.rom
  • Gigabyte_WRX80F2
  • AORUS_X570_X57AOXT2.FCd
  • MSI_X370_E7A33AMS.4I1
  • ASUS_PRIME-B450M-A-ASUS-1201.CAP
  • MSI_B450_E7B86AMS.181
  • Acer_R01-A4.ROM
  • AORUS_X470AG7W.F40
  • ASUS_PRIME-A320M-A-ASUS-4801.CAP
  • MSI_A320_E7A38AMS.2I2
  • Lenovo_Ideapad_5_Pro-16ACH6.rom
  • MSI_B350_E7A34AMS.1O1

1 similar comment
@github-actions
Copy link

Metrics

psptool command line interface metrics

Metric Value
Files Processed 68
Stdout Lines 4,596
Stderr Lines 834
Total Lines 5,430
Error Ratio 15.36%

PSPTool python library metrics

Status Count Percentage
✓ Successful 33 48.53%
✗ Failed 35 51.47%
Total 68 100%

Failed Files

  • ASUS_ROG-STRIX-X470-F-GAMING-ASUS-4804.CAP
  • ASUS_ROG-STRIX-B450-F-GAMING-ASUS-2301.CAP
  • ASRock_B450_B45P4_3.31
  • TUF-GAMING-A520M-PLUS-WIFI-ASUS-2604.CAP
  • Lenovo_Thinkpad_T14_WinGLC3A106.ROM
  • ASRock_X470_X47GK4_3.31
  • ASUS_ROG-STRIX-B350-F-GAMING-ASUS-4801.CAP
  • ASUS_TUF-B450M-PRO-GAMING-ASUS-1201.CAP
  • ASUS_PRIME-X470-PRO-4011.CAP
  • Gigabyte_X470AG7W.F40
  • ASUS_PRIME-X370-PRO-3803.CAP
  • ASRock_X370_X370GK45.30
  • ASRock-A520M-HSV-1.31.ROM
  • MSI_X470_E7B77AMS.194
  • ASUS_PRIME-X470-PRO-ASUS-4804.CAP
  • ASUS_PRIME-B350-PLUS-4011.CAP
  • ASUS_ROG-STRIX-X370-F-GAMING-ASUS-4801.CAP
  • ASRock_A320_A32M5.00
  • ASRock_B350_AB35G4_5.70
  • Gigabyte_AX370G3.F31
  • AORUS_X370G5.23d
  • ASUS_B450M_KII_Zen1_ROM_Exploit.rom
  • AORUS_B450AE.F40
  • ASRock_A520M_HVS_1.31.ftpm_with_data.rom
  • Gigabyte_WRX80F2
  • AORUS_X570_X57AOXT2.FCd
  • MSI_X370_E7A33AMS.4I1
  • ASUS_PRIME-B450M-A-ASUS-1201.CAP
  • MSI_B450_E7B86AMS.181
  • Acer_R01-A4.ROM
  • AORUS_X470AG7W.F40
  • ASUS_PRIME-A320M-A-ASUS-4801.CAP
  • MSI_A320_E7A38AMS.2I2
  • Lenovo_Ideapad_5_Pro-16ACH6.rom
  • MSI_B350_E7A34AMS.1O1

@github-actions
Copy link

Metrics

psptool command line interface metrics

Metric Value
Files Processed 68
Stdout Lines 4,596
Stderr Lines 834
Total Lines 5,430
Error Ratio 15.36%

PSPTool python library metrics

Status Count Percentage
✓ Successful 33 48.53%
✗ Failed 35 51.47%
Total 68 100%

Failed Files

  • ASUS_ROG-STRIX-X470-F-GAMING-ASUS-4804.CAP
  • ASUS_ROG-STRIX-B450-F-GAMING-ASUS-2301.CAP
  • ASRock_B450_B45P4_3.31
  • TUF-GAMING-A520M-PLUS-WIFI-ASUS-2604.CAP
  • Lenovo_Thinkpad_T14_WinGLC3A106.ROM
  • ASRock_X470_X47GK4_3.31
  • ASUS_ROG-STRIX-B350-F-GAMING-ASUS-4801.CAP
  • ASUS_TUF-B450M-PRO-GAMING-ASUS-1201.CAP
  • ASUS_PRIME-X470-PRO-4011.CAP
  • Gigabyte_X470AG7W.F40
  • ASUS_PRIME-X370-PRO-3803.CAP
  • ASRock_X370_X370GK45.30
  • ASRock-A520M-HSV-1.31.ROM
  • MSI_X470_E7B77AMS.194
  • ASUS_PRIME-X470-PRO-ASUS-4804.CAP
  • ASUS_PRIME-B350-PLUS-4011.CAP
  • ASUS_ROG-STRIX-X370-F-GAMING-ASUS-4801.CAP
  • ASRock_A320_A32M5.00
  • ASRock_B350_AB35G4_5.70
  • Gigabyte_AX370G3.F31
  • AORUS_X370G5.23d
  • ASUS_B450M_KII_Zen1_ROM_Exploit.rom
  • AORUS_B450AE.F40
  • ASRock_A520M_HVS_1.31.ftpm_with_data.rom
  • Gigabyte_WRX80F2
  • AORUS_X570_X57AOXT2.FCd
  • MSI_X370_E7A33AMS.4I1
  • ASUS_PRIME-B450M-A-ASUS-1201.CAP
  • MSI_B450_E7B86AMS.181
  • Acer_R01-A4.ROM
  • AORUS_X470AG7W.F40
  • ASUS_PRIME-A320M-A-ASUS-4801.CAP
  • MSI_A320_E7A38AMS.2I2
  • Lenovo_Ideapad_5_Pro-16ACH6.rom
  • MSI_B350_E7A34AMS.1O1

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

Successfully merging this pull request may close these issues.

2 participants