Skip to content

Check checksums on corkami files in pefile-tests - #649

Merged
j-t-1 merged 3 commits into
erocarrera:masterfrom
HuzaifaChaudary:tests/checksum-corpus-files
Nov 8, 2026
Merged

j-t-1 merged 3 commits into
erocarrera:masterfrom
HuzaifaChaudary:tests/checksum-corpus-files

Conversation

@HuzaifaChaudary

Copy link
Copy Markdown
Contributor

part of #584 .

the four commented out checks use files from a checksum folder that is not in pefile-tests . these use corkami files that are there .

multiss_drv.sys , multiss_gui.exe and multiss_con.exe only differ at offset 0x9c , the Subsystem field , set to 1 , 2 and 3 . all three carry the checksum of the driver , 0x255c , so the driver one is good and the other two give 0x255d and 0x255e .

tinydrivXP.sys is 97 bytes and its optional header runs past the end . it is the case #635 fixed , and this check fails on the pefile from before #635 .

radare2 prints the computed checksum next to the one in the header ( rabin2 -I , cmp.csum and hdr.csum ) and gives the same values . pefile , radare2 and a separate implementation of the checksum agree on all 354 files in pefile-tests that radare2 loads .

the four commented out checks use files from the old checksum folder , which is not in pefile-tests . these use corkami files that are .

multiss_drv.sys , multiss_gui.exe and multiss_con.exe only differ at offset 0x9c , the Subsystem field , set to 1 , 2 and 3 . all three carry the checksum of the driver , 0x255c , so the driver one is good and the other two are off by 1 and 2 . tinydrivXP.sys is the 97 byte file whose optional header runs past the end , it was the case erocarrera#635 fixed , and that check fails on the pefile from before erocarrera#635 .

the values match radare2 , which prints the computed checksum next to the one in the header ( rabin2 -I , cmp.csum and hdr.csum ) , and a separate implementation of the checksum . pefile , radare2 and that implementation agree on every file in pefile-tests that radare2 loads , 354 of 356 .
Copilot AI review requested due to automatic review settings November 3, 2026 13:30

@j-t-1 j-t-1 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Is the suggested comment okay?

Comment thread tests/pefile_test.py Resolved
@j-t-1
j-t-1 merged commit f82ffd6 into erocarrera:master Nov 8, 2026
25 checks passed
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