From b00add8f595bf68fa271bfabd25e7e25d16e4a1e Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Fri, 30 Oct 2026 14:29:36 +0000 Subject: [PATCH] Decompile 7 functions in Source/UI/ProbabilityTable/UIProbabilityTable.cpp, Source/UI/ProbabilityTable/UIProbabilityTable.h Batch #5675 by Yommy: 4 byte-identical, 3 confirmed by peer review. - fn_16104 UnusedTrueA47EF0: byte-identical - fn_16105 UnusedTrueA47F00: byte-identical - fn_16106 UnusedTrueA47F10: byte-identical - fn_16108 CUIListBoxEx::CUIListBoxEx: logic confirmed by peer review - fn_16109 CUIListBoxEx::~CUIListBoxEx: logic confirmed by peer review - fn_16115 CUIListBoxEx::ClearItems: byte-identical - fn_16116 CUIProbabilityTable::Slot53: logic confirmed by peer review Peer-reviewed-by: ragnarok-clanker, Romain, Snow Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes). --- .../ProbabilityTable/UIProbabilityTable.cpp | 104 ++++++++++++++++++ .../UI/ProbabilityTable/UIProbabilityTable.h | 2 + 2 files changed, 106 insertions(+) diff --git a/Source/UI/ProbabilityTable/UIProbabilityTable.cpp b/Source/UI/ProbabilityTable/UIProbabilityTable.cpp index 6bb773a0..262170c2 100644 --- a/Source/UI/ProbabilityTable/UIProbabilityTable.cpp +++ b/Source/UI/ProbabilityTable/UIProbabilityTable.cpp @@ -1,8 +1,112 @@ #include "UI/ProbabilityTable/UIProbabilityTable.h" +#include "UI/Lists/UIVScrollBar.h" #include "UI/Window/WindowBorder.h" +#include "Utility/Cipher/XorBytes.h" #include "Utility/Text/FormatString.h" +#include +#include +#include + +namespace { + +template +class EncryptedName { +public: + explicit EncryptedName(const std::uint8_t (&source)[Length]) : m_encrypted(true) { + for (std::uint64_t index = 0; index < Length; ++index) { + this->m_text[index] = source[index]; + } + } + + ~EncryptedName() { + for (std::uint64_t index = 0; index < Length; ++index) { + this->m_text[index] = 0; + } + } + + const char* Text() { + if (this->m_encrypted) { + utility::XorBytes(this->m_text, Length, Key); + this->m_encrypted = false; + } + + return reinterpret_cast(this->m_text); + } + +private: + std::uint8_t m_text[Length]; + bool m_encrypted; +}; + +} + +template <> +void CUIListBoxEx::OnScroll(int position); + +// OFFSET: 0x00A47EF0 +// FUNCTION: fn_16104 +bool UnusedTrueA47EF0() { + return true; +} + +// OFFSET: 0x00A47F00 +// FUNCTION: fn_16105 +bool UnusedTrueA47F00() { + return true; +} + +// OFFSET: 0x00A47F10 +// FUNCTION: fn_16106 +bool UnusedTrueA47F10() { + return true; +} + +// OFFSET: 0x00A47FA0 +// FUNCTION: fn_16108 +template <> +CUIListBoxEx::CUIListBoxEx(UIWindowContext& context) + : CUIControl(context), scrollBar(nullptr), itemWidth(0), rowHeight(0), itemX(0), itemY(0), unknown_00C4(0), selected(static_cast(-1)), + unknown_00E0(1), rebind(0) { +} + +// OFFSET: 0x00A48160 +// FUNCTION: fn_16109 +template <> +CUIListBoxEx::~CUIListBoxEx() { +} + +// OFFSET: 0x00A48740 +// FUNCTION: fn_16115 +template <> +void CUIListBoxEx::ClearItems() { + for (ProbabilityTable::CUIItem* item : this->items) { + this->RemoveChild(item, 1); + } + + this->items.clear(); + this->selected = static_cast(-1); +} + +// OFFSET: 0x00A487D0 +// FUNCTION: fn_16116 +void CUIProbabilityTable::Slot53() { + this->unknown_00B4 = 0; + this->Resize(345, 455); + this->Move(0, 0); + this->Slot15(this->geometry.width, this->geometry.height); + this->Slot16(); +} + +// OFFSET: 0x00A48860 + +namespace ProbabilityTable { + +// OFFSET: 0x00A48A70 + +} + // OFFSET: 0x00A4BFF0 // FUNCTION: fn_16120 template <> diff --git a/Source/UI/ProbabilityTable/UIProbabilityTable.h b/Source/UI/ProbabilityTable/UIProbabilityTable.h index 03de1598..ef31c1a8 100644 --- a/Source/UI/ProbabilityTable/UIProbabilityTable.h +++ b/Source/UI/ProbabilityTable/UIProbabilityTable.h @@ -20,6 +20,7 @@ public: class CUIItem : public CUIListItem { public: + void Slot15(int width, int height) override; void Slot16() override; void Paint() override; void Slot25(int x, int y) override; @@ -35,6 +36,7 @@ public: class CUIProbabilityTable : public CUIFrameWnd { public: void Paint() override; + virtual void Slot53(); void OnButtonClick(); void OnPrepareItem(ProbabilityTable::CUIItem* item, const ProbabilityTable::CItemData& data);