From 22db5ecae3a892bb1b42474838e32c9cce3e1cfb Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Sun, 1 Nov 2026 21:15:33 +0000 Subject: [PATCH] Decompile fn_12449 (UISecondPasswordInputWnd::ShuffleKeypad) Batch #9742 by dori: 0 byte-identical, 1 confirmed by peer review. - fn_12449 UISecondPasswordInputWnd::ShuffleKeypad: logic confirmed by peer review Peer-reviewed-by: ragnarok-clanker, KWDev, Romain, Toshiro Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes). --- Source/UI/Acceptance/UIChooseSellBuyWnd.cpp | 19 +++++++++++++++++++ Source/UI/Dialogs/UIPasswordWnd.h | 1 + 2 files changed, 20 insertions(+) diff --git a/Source/UI/Acceptance/UIChooseSellBuyWnd.cpp b/Source/UI/Acceptance/UIChooseSellBuyWnd.cpp index d6900aeb..2c4b4e22 100644 --- a/Source/UI/Acceptance/UIChooseSellBuyWnd.cpp +++ b/Source/UI/Acceptance/UIChooseSellBuyWnd.cpp @@ -122,6 +122,7 @@ #include "Utility/Text/GroupedInteger.h" #include "Client/Mode/ModeTooltip.h" #include +#include #include #include #include @@ -7033,3 +7034,21 @@ void UIStorePasswordInputWnd::Paint() { } } } + +// OFFSET: 0x0090C5A0 +// FUNCTION: fn_12449 +void UISecondPasswordInputWnd::ShuffleKeypad() +{ + unsigned char digits[10]; + for (int index = 0; index < 10; ++index) + digits[index] = static_cast(index); + std::mt19937 engine(std::random_device{}()); + std::shuffle(digits, digits + 10, engine); + const int positions[11][2] = { + {219, 78}, {279, 78}, {339, 78}, {219, 138}, {279, 138}, {339, 138}, + {219, 198}, {279, 198}, {339, 198}, {219, 258}, {279, 258} + }; + for (int index = 0; index < 10; ++index) + unknown_0124[index]->Move(positions[digits[index]][0], positions[digits[index]][1]); + Invalidate(); +} diff --git a/Source/UI/Dialogs/UIPasswordWnd.h b/Source/UI/Dialogs/UIPasswordWnd.h index 946a1dfb..98e21d92 100644 --- a/Source/UI/Dialogs/UIPasswordWnd.h +++ b/Source/UI/Dialogs/UIPasswordWnd.h @@ -81,6 +81,7 @@ class UISecondPasswordInputWnd : public UIStorePasswordInputWnd { public: UISecondPasswordInputWnd(UIWindowContext& windows, UIFrameContext& frames); void Paint() override; + void ShuffleKeypad(); /* 010C */ int unknown_010C; /* 0110 */ unsigned char unknown_0110[0xC];