Fix #1499 hf 15 restore and fix trace list -t 15 writeblock

This commit is contained in:
Philippe Teuwen 2021-09-07 10:04:01 +02:00
parent c326c25905
commit 3e39689b6e
3 changed files with 7 additions and 4 deletions

View file

@ -3,6 +3,7 @@ All notable changes to this project will be documented in this file.
This project uses the changelog in accordance with [keepchangelog](http://keepachangelog.com/). Please use this to write notable changes, which is not the same as git commit log...
## [unreleased][unreleased]
- Fix `hf 15 restore` write command and `trace list -t 15` write command (@doegox)
- Changed default standalone mode to LF_SAMYRUN (@iceman1001)
- Add MIFARE Plus SL3 mode traces (@iceman1001)
- Fix PAC/Stanley checksum calculation (@rknoll)

View file

@ -2028,7 +2028,7 @@ static int CmdHF15Restore(const char *Cmd) {
uint16_t i = 0;
while (bytes < datalen) {
req[reqlen + 1] = i;
req[reqlen] = i;
// copy over the data to the request
memcpy(req + reqlen + 1, data + bytes, blocksize);
AddCrc15(req, reqlen + 1 + blocksize);

View file

@ -470,10 +470,10 @@ void annotateIso15693(char *exp, size_t size, uint8_t *cmd, uint8_t cmdsize) {
case ISO15693_READBLOCK: {
uint8_t block = 0;
if (cmdsize == 13)
block = cmd[10];
else if (cmdsize == 5)
if (cmdsize == 5)
block = cmd[2];
else if (cmdsize == 13) // with UID
block = cmd[10];
snprintf(exp, size, "READBLOCK(%d)", block);
return;
@ -482,6 +482,8 @@ void annotateIso15693(char *exp, size_t size, uint8_t *cmd, uint8_t cmdsize) {
uint8_t block = 0;
if (cmdsize == 9)
block = cmd[2];
else if (cmdsize == 9 + 8) // with UID
block = cmd[2 + 8];
snprintf(exp, size, "WRITEBLOCK(%d)", block);
return;
}