From b15152662c2b7432450b276facfa6bb05e1389af Mon Sep 17 00:00:00 2001 From: tpglitch <123958345+tpglitch@users.noreply.github.com> Date: Sat, 7 Nov 2026 16:58:21 -0600 Subject: [PATCH] fix: payload for in Lua script --- CHANGELOG.md | 1 + client/luascripts/hf_mfu_amiibo_sim.lua | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index df0841f18..9e33d31aa 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 payload for `CMD_HF_MIFARE_EML_MEMSET` in `hf_mfu_amiibo_sim.lua` (@tpglitch) - Fixed `hf thinfilm sim` - a second simulation in the same client no longer ends at once with `Done!` (@matrix) - Added `hf mf supercard -u` - UID change on super card generation 2 (@mishamyte) - Changed `hf mf supercard` - a refused `-r`/`-u` now exits non-zero instead of reporting success (@mishamyte) diff --git a/client/luascripts/hf_mfu_amiibo_sim.lua b/client/luascripts/hf_mfu_amiibo_sim.lua index bedd0b8a6..0ea66422c 100644 --- a/client/luascripts/hf_mfu_amiibo_sim.lua +++ b/client/luascripts/hf_mfu_amiibo_sim.lua @@ -6,8 +6,8 @@ local ansicolors = require('ansicolors') local amiibo_tools = require('amiibo_tools') copyright = '' -author = 'George Talusan, modified by Lee Hambley' -version = 'v0.0.3' +author = 'George Talusan, modified by Lee Hambley and tpglitch' +version = 'v0.0.4' desc = [[ This script will try to load a binary datadump of an Amiibo. It will recalculate PWD and PACK if necessary. @@ -82,10 +82,10 @@ local function LoadEmulator(uid, blocks) io.write('.') io.flush() core.clearCommandBuffer() - -- Pack blockno (uint16_t LE) + blockcnt (uint8_t) + blockwidth (uint8_t) + data + -- Pack blockno (uint16_t LE) + blockcnt (uint8_t) + blockwidth (uint8_t) + flags (uint8_t) + data local block_lo = bit32.band(i, 0xff) local block_hi = bit32.rshift(i, 8) - local payload = ('%02x%02x%02x%02x'):format(block_lo, block_hi, 1, 4)..blockdata + local payload = ('%02x%02x%02x%02x%02x'):format(block_lo, block_hi, 1, 4, 0)..blockdata cmd = Command:newNG{cmd = cmds.CMD_HF_MIFARE_EML_MEMSET, data = payload} local err, msg = cmd:sendNG(true) if err == nil then return err, msg end