From 3fc58dbe64253a3ff34514cd8f61d328a919e757 Mon Sep 17 00:00:00 2001 From: dualshock-tools Date: Sat, 2 Aug 2025 11:50:27 +0200 Subject: [PATCH] Fix: Reverse PCBA ID --- core.js | 7 ++++++- index.html | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/core.js b/core.js index 14a28a1..5539ea7 100644 --- a/core.js +++ b/core.js @@ -588,6 +588,11 @@ function ds5_color(x) { return colorName; } +// This function should be used only for ASCII strings (not UTF) +function reverse_str(s) { + return s.split('').reverse().join(''); +} + async function ds5_info(is_edge) { try { @@ -623,7 +628,7 @@ async function ds5_info(is_edge) { serial_number = await ds5_system_info(1, 19, 17); append_info(l("Serial Number"), serial_number, "hw"); append_info_extra(l("MCU Unique ID"), await ds5_system_info(1, 9, 9, false), "hw"); - append_info_extra(l("PCBA ID"), await ds5_system_info(1, 17, 14), "hw"); + append_info_extra(l("PCBA ID"), reverse_str(await ds5_system_info(1, 17, 14)), "hw"); append_info_extra(l("Battery Barcode"), await ds5_system_info(1, 24, 23), "hw"); append_info_extra(l("VCM Left Barcode"), await ds5_system_info(1, 26, 16), "hw"); append_info_extra(l("VCM Right Barcode"), await ds5_system_info(1, 28, 16), "hw"); diff --git a/index.html b/index.html index 0016146..450e8cf 100644 --- a/index.html +++ b/index.html @@ -943,7 +943,7 @@ dl.row dd { font-family: monospace; }