From ac92840bf4e3cdb5beab4470a8db2c69ac548f02 Mon Sep 17 00:00:00 2001 From: DanTheMan827 <790119+DanTheMan827@users.noreply.github.com> Date: Mon, 8 Nov 2021 14:28:10 -0600 Subject: [PATCH 1/3] More accurately generate the decrypted bin data --- script.js | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/script.js b/script.js index 6ea6cc6..c20def1 100644 --- a/script.js +++ b/script.js @@ -24,10 +24,39 @@ }); }; + function getRandomBytes(count) { + var output = new Uint8Array(count); + + for (var i = 0; i < output.length; i++) { + output[i] = Math.round(Math.random() * 255); + } + + return output; + } + function generateData(id) { var arr = new Uint8Array(540); - arr[2] = 0x0F; - arr[3] = 0xE0; + // Set UID + arr.set([0x04, 0x01, 0x02, 0x8F, 0x03, 0x04, 0x05, 0x06], 0x1D4); + + // Set BCC, Internal, Static Lock, and CC + arr.set([0x04, 0x48, 0x0F, 0xE0, 0xF1, 0x10, 0xFF, 0xEE], 0x0); + + // Set 0xA5, Write Counter, and Unknown + arr.set([0xA5, 0x00, 0x00, 0x00], 0x28); + + // Set Dynamic Lock, and RFUI + arr.set([0x01, 0x00, 0x0F, 0xBD], 0x208); + + // Set CFG0 + arr.set([0x00, 0x00, 0x00, 0x04], 0x208); + + // Set CFG1 + arr.set([0x5F, 0x00, 0x00, 0x00], 0x208); + + // Set Keygen Salt + arr.set(getRandomBytes(32), 0x1E8); + // write key/amiibo num in big endian as a 64 bit value starting from offset off var off = 0x1DC; id = id.substring(2); From 19f2ee6bc985342be46cb9bb3cf67c63f4446e49 Mon Sep 17 00:00:00 2001 From: DanTheMan827 <790119+DanTheMan827@users.noreply.github.com> Date: Mon, 8 Nov 2021 14:36:47 -0600 Subject: [PATCH 2/3] Typo --- script.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/script.js b/script.js index c20def1..f7ac529 100644 --- a/script.js +++ b/script.js @@ -49,10 +49,10 @@ arr.set([0x01, 0x00, 0x0F, 0xBD], 0x208); // Set CFG0 - arr.set([0x00, 0x00, 0x00, 0x04], 0x208); + arr.set([0x00, 0x00, 0x00, 0x04], 0x20C); // Set CFG1 - arr.set([0x5F, 0x00, 0x00, 0x00], 0x208); + arr.set([0x5F, 0x00, 0x00, 0x00], 0x210); // Set Keygen Salt arr.set(getRandomBytes(32), 0x1E8); From 267d822351220afa41654791248a932f879d576c Mon Sep 17 00:00:00 2001 From: DanTheMan827 <790119+DanTheMan827@users.noreply.github.com> Date: Mon, 8 Nov 2021 15:59:43 -0600 Subject: [PATCH 3/3] Update script.js --- script.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/script.js b/script.js index f7ac529..6f221f9 100644 --- a/script.js +++ b/script.js @@ -37,10 +37,10 @@ function generateData(id) { var arr = new Uint8Array(540); // Set UID - arr.set([0x04, 0x01, 0x02, 0x8F, 0x03, 0x04, 0x05, 0x06], 0x1D4); + arr.set([0x04, 0xC0, 0x0A, 0x46, 0x61, 0x6B, 0x65, 0x0A], 0x1D4); // Set BCC, Internal, Static Lock, and CC - arr.set([0x04, 0x48, 0x0F, 0xE0, 0xF1, 0x10, 0xFF, 0xEE], 0x0); + arr.set([0x65, 0x48, 0x0F, 0xE0, 0xF1, 0x10, 0xFF, 0xEE], 0x0); // Set 0xA5, Write Counter, and Unknown arr.set([0xA5, 0x00, 0x00, 0x00], 0x28);