mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2024-12-28 19:31:19 +08:00
merge-srec.pl create proper S19 file with checksums.
This commit is contained in:
parent
9bea179a71
commit
49209d37da
1 changed files with 7 additions and 2 deletions
|
@ -6,13 +6,18 @@ open(FLASH, $flashFile) or die "$flashFile: $!\n";
|
|||
|
||||
while(<FLASH>) {
|
||||
print if /^S3/;
|
||||
$EOF_record = $_ if /^S[789]/;
|
||||
}
|
||||
|
||||
open(RAM, $ramFile) or die "$ramFile: $!\n";
|
||||
|
||||
while(<RAM>) {
|
||||
if(/^S3(..)(........)(.*)/) {
|
||||
if(/^S3(..)(........)(.*)([0-9a-fA-F]{2})/) {
|
||||
$addr = sprintf('%08X', hex($2) - 0x00200000 + 0x200);
|
||||
print "S3$1$addr$3\n";
|
||||
$line = "$1$addr$3";
|
||||
$checksum = 0;
|
||||
$checksum += $_ foreach map(hex, unpack("a2"x40, $line));
|
||||
print "S3$line", sprintf("%02X", ($checksum%256)^0xff ), "\n";
|
||||
}
|
||||
}
|
||||
print $EOF_record;
|
||||
|
|
Loading…
Reference in a new issue