in data manrawdemode the em410xdecode resets the size if it fails to decode, render the setdemodbuf useless afterwards.

This commit is contained in:
iceman1001 2024-01-16 08:59:08 +01:00
commit 9c7890e50c
2 changed files with 5 additions and 1 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... 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] ## [unreleased][unreleased]
- Fixed `data manrawdecode` - now copy to demodbuf even if em4100 decode fails (@iceman1001)
- Changed `nfc decode` - now supports Android Managed Provision NDEF message decoding (@iceman1001) - Changed `nfc decode` - now supports Android Managed Provision NDEF message decoding (@iceman1001)
- Changed `hf_cardhopper` - Allow button presses to break, handle non-zero CID from reader by relaying RATS and improving PPS and WTX handling, more reliably cook ATS, ignore client packets on serial line (@nvx) - Changed `hf_cardhopper` - Allow button presses to break, handle non-zero CID from reader by relaying RATS and improving PPS and WTX handling, more reliably cook ATS, ignore client packets on serial line (@nvx)
- Fixed `data diff` - client no longer crashes when using short widths on long filenames (@iceman1001) - Fixed `data diff` - client no longer crashes when using short widths on long filenames (@iceman1001)

View file

@ -608,11 +608,14 @@ static int Cmdmandecoderaw(const char *Cmd) {
uint64_t id = 0; uint64_t id = 0;
uint32_t hi = 0; uint32_t hi = 0;
size_t idx = 0; size_t idx = 0;
int res = Em410xDecode(bits, &size, &idx, &hi, &id); size_t tmpsize = 0;
int res = Em410xDecode(bits, &tmpsize, &idx, &hi, &id);
if (res > 0) { if (res > 0) {
//need to adjust to set bitstream back to manchester encoded data //need to adjust to set bitstream back to manchester encoded data
//setDemodBuff(bits, size, idx); //setDemodBuff(bits, size, idx);
printEM410x(hi, id, false, res); printEM410x(hi, id, false, res);
size = tmpsize;
} }
} }
setDemodBuff(bits, size, 0); setDemodBuff(bits, size, 0);