From c847896a152ad951850c8be886d942b7a33e5d9b Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Thu, 1 May 2025 08:34:39 +0200 Subject: [PATCH] fix #2835 due to wrong variable used to calculate the size of the emulator memory to download , all get memory from emulator memory failed with a block no larger that 30-ish --- CHANGELOG.md | 1 + armsrc/appmain.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d7a1bfe99..ca5e26a02 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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] +- Fixed `hf mf ekeyprn` - failed to download emulator memory due to wrong size calculation (@iceman1001) - Fixed `hf mf fchk --mem` to actually use flash dict (@doegox) - Fixed `make install` on OSX thanks DaveItsLong (@doegox) - Added new standalone mode `HF_ST25_TEAROFF` to store/restore ST25TB tags with tearoff for counters (@seclabz) diff --git a/armsrc/appmain.c b/armsrc/appmain.c index 0f112907f..0929f80c5 100644 --- a/armsrc/appmain.c +++ b/armsrc/appmain.c @@ -1969,7 +1969,7 @@ static void PacketReceived(PacketCommandNG *packet) { struct p *payload = (struct p *) packet->data.asBytes; // - size_t size = payload->blockno * payload->blockwidth; + size_t size = payload->blockcnt * payload->blockwidth; if (size > PM3_CMD_DATA_SIZE) { reply_ng(CMD_HF_MIFARE_EML_MEMGET, PM3_EMALLOC, NULL, 0); return;