Reconstruction layout: generated-src/ (generated) and src/ (curated), CMake, the first takeover: RNG
The decompiled C++ tree moves to generated-src/ (classes.h, C++20); src/ is for code written by hand. A curated function defines the generated declaration and starts its comment with its address, and source_tree.py stops emitting that body. src/rng.cpp takes over RNG (SetSeed, the constructor, Next, RandomInt, RandomFloat, Shuffle) with the shift table read from the exe as a constexpr array; src/log.h names KAGE_LogMessage's levels (1 INFO, 2 NET, 4 WARN, 8 ERROR, 16 ASSERT, from its prefix jump table). CMakeLists.txt builds src/*.cpp against generated-src/classes.h (clean with -Wall -Wextra). structs.hpp and headers.py are retired: scripts/merge_fields.py writes the merged field list, classes.h checks the layout. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
2ff2d5d87f
commit
3ce74c6e2d
331 files changed
+485
-7835
No files matched your search
@@ -0,0 +1,685 @@
|
||||
#include "classes.h"
|
||||
|
||||
// 009c4100
|
||||
void InviteFriendsMenu::load_graphics()
|
||||
{
|
||||
void *cursorSprite = this;
|
||||
undefined4 *puVar1;
|
||||
undefined4 *puVar2;
|
||||
void *pvVar3;
|
||||
byte bVar4;
|
||||
byte *pbVar5;
|
||||
undefined4 uVar6;
|
||||
byte *animNameChar;
|
||||
int iVar7;
|
||||
undefined4 *puVar8;
|
||||
char *otherName;
|
||||
LayerState *arrowLayer;
|
||||
char *pcVar9;
|
||||
int *profiles;
|
||||
uint uVar10;
|
||||
int *piVar11;
|
||||
bool isLess;
|
||||
undefined4 uVar12;
|
||||
double pageCount;
|
||||
int friendsBegin;
|
||||
int friendsEnd;
|
||||
int *local_70;
|
||||
int *local_6c;
|
||||
void *local_68;
|
||||
int *local_64;
|
||||
int *listHead;
|
||||
int *local_5c;
|
||||
int **local_58;
|
||||
int *local_54;
|
||||
int *local_50;
|
||||
int *onlineFriends;
|
||||
int *onlineFriendCount;
|
||||
int *sortNode;
|
||||
byte isArrowVisible;
|
||||
std_string anm2Path;
|
||||
uint local_24;
|
||||
undefined1 *puStack_20;
|
||||
void *local_1c;
|
||||
undefined1 *puStack_18;
|
||||
undefined4 local_14;
|
||||
ANM2 *cursorSprite;
|
||||
MenuManager *menuManager;
|
||||
|
||||
puStack_20 = GHIDRA_CAST<undefined1 *>((GHIDRA_INT(register0x00000010) + -4));
|
||||
local_14 = 0xffffffff;
|
||||
puStack_18 = &LAB_00b0ee1d;
|
||||
local_1c = ExceptionList;
|
||||
local_24 = __security_cookie ^ GHIDRA_INT(register0x00000010) - 0x10U;
|
||||
ExceptionList = &local_1c;
|
||||
local_68 = cursorSprite;
|
||||
(GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>((GHIDRA_INT(cursorSprite) + 4)))))->ANM2::Reset();
|
||||
cursorSprite = GHIDRA_CAST<ANM2 *>((GHIDRA_INT(cursorSprite) + 0x118));
|
||||
(GHIDRA_CAST<ANM2 *>((cursorSprite)))->ANM2::Reset();
|
||||
anm2Path._size = 0;
|
||||
anm2Path._capacity = 0xf;
|
||||
anm2Path._buf[0] = '\0';
|
||||
anm2Path._buf[1] = '\0';
|
||||
anm2Path._buf[2] = '\0';
|
||||
anm2Path._buf[3] = '\0';
|
||||
if (g_menuManager == GHIDRA_CAST<MenuManager *>(0x0)) {
|
||||
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(anm2Path._buf)) + 0x0))) = std::_Allocate(0x20);
|
||||
anm2Path._size = 0x18;
|
||||
anm2Path._capacity = 0x1f;
|
||||
builtin_strncpy((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(anm2Path._buf))) + 0x0))),"gfx/ui/InviteWidget.anm2",0x19);
|
||||
local_14 = 2;
|
||||
(GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>((GHIDRA_INT(cursorSprite) + 4)))))->ANM2::Load(&anm2Path,1);
|
||||
local_14 = 0xffffffff;
|
||||
if (0xf < anm2Path._capacity) {
|
||||
uVar10 = anm2Path._capacity + 1;
|
||||
pcVar9 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(anm2Path._buf))) + 0x0)));
|
||||
if (0xfff < uVar10) {
|
||||
pcVar9 = *GHIDRA_CAST<char **>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(anm2Path._buf)) + 0x0))) + -4));
|
||||
uVar10 = anm2Path._capacity + 0x24;
|
||||
if (GHIDRA_CAST<char *>(0x1f) < GHIDRA_CAST<char *>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(anm2Path._buf)) + 0x0))) + (-4 - GHIDRA_INT(pcVar9))))) {
|
||||
/* WARNING: Subroutine does not return */
|
||||
_invalid_parameter_noinfo_noreturn();
|
||||
}
|
||||
}
|
||||
operator_delete(pcVar9,uVar10);
|
||||
}
|
||||
anm2Path._size = 0;
|
||||
anm2Path._capacity = 0xf;
|
||||
anm2Path._buf[0] = '\0';
|
||||
anm2Path._buf[1] = '\0';
|
||||
anm2Path._buf[2] = '\0';
|
||||
anm2Path._buf[3] = '\0';
|
||||
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(anm2Path._buf)) + 0x0))) = std::_Allocate(0x20);
|
||||
anm2Path._size = 0x18;
|
||||
anm2Path._capacity = 0x1f;
|
||||
builtin_strncpy((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(anm2Path._buf))) + 0x0))),"gfx/ui/InviteWidget.anm2",0x19);
|
||||
local_14 = 3;
|
||||
(GHIDRA_CAST<ANM2 *>((cursorSprite)))->ANM2::Load(&anm2Path,1);
|
||||
local_14 = 0xffffffff;
|
||||
if (0xf < anm2Path._capacity) {
|
||||
uVar10 = anm2Path._capacity + 1;
|
||||
pcVar9 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(anm2Path._buf))) + 0x0)));
|
||||
if (0xfff < uVar10) {
|
||||
pcVar9 = *GHIDRA_CAST<char **>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(anm2Path._buf)) + 0x0))) + -4));
|
||||
uVar10 = anm2Path._capacity + 0x24;
|
||||
if (GHIDRA_CAST<char *>(0x1f) < GHIDRA_CAST<char *>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(anm2Path._buf)) + 0x0))) + (-4 - GHIDRA_INT(pcVar9))))) {
|
||||
/* WARNING: Subroutine does not return */
|
||||
_invalid_parameter_noinfo_noreturn();
|
||||
}
|
||||
}
|
||||
operator_delete(pcVar9,uVar10);
|
||||
}
|
||||
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(cursorSprite) + 0x24c)) = 0x3f400000;
|
||||
}
|
||||
else {
|
||||
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(anm2Path._buf)) + 0x0))) = std::_Allocate(0x30);
|
||||
anm2Path._size = 0x27;
|
||||
anm2Path._capacity = 0x2f;
|
||||
builtin_strncpy((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(anm2Path._buf))) + 0x0))),"gfx/ui/main menu/InviteFriendsMenu.anm2",0x28);
|
||||
local_14 = 0;
|
||||
(GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>((GHIDRA_INT(cursorSprite) + 4)))))->ANM2::Load(&anm2Path,1);
|
||||
local_14 = 0xffffffff;
|
||||
if (0xf < anm2Path._capacity) {
|
||||
uVar10 = anm2Path._capacity + 1;
|
||||
pcVar9 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(anm2Path._buf))) + 0x0)));
|
||||
if (0xfff < uVar10) {
|
||||
pcVar9 = *GHIDRA_CAST<char **>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(anm2Path._buf)) + 0x0))) + -4));
|
||||
uVar10 = anm2Path._capacity + 0x24;
|
||||
if (GHIDRA_CAST<char *>(0x1f) < GHIDRA_CAST<char *>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(anm2Path._buf)) + 0x0))) + (-4 - GHIDRA_INT(pcVar9))))) {
|
||||
/* WARNING: Subroutine does not return */
|
||||
_invalid_parameter_noinfo_noreturn();
|
||||
}
|
||||
}
|
||||
operator_delete(pcVar9,uVar10);
|
||||
}
|
||||
anm2Path._size = 0;
|
||||
anm2Path._capacity = 0xf;
|
||||
anm2Path._buf[0] = '\0';
|
||||
anm2Path._buf[1] = '\0';
|
||||
anm2Path._buf[2] = '\0';
|
||||
anm2Path._buf[3] = '\0';
|
||||
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(anm2Path._buf)) + 0x0))) = std::_Allocate(0x30);
|
||||
anm2Path._size = 0x27;
|
||||
anm2Path._capacity = 0x2f;
|
||||
builtin_strncpy((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(anm2Path._buf))) + 0x0))),"gfx/ui/main menu/InviteFriendsMenu.anm2",0x28);
|
||||
local_14 = 1;
|
||||
(GHIDRA_CAST<ANM2 *>((cursorSprite)))->ANM2::Load(&anm2Path,1);
|
||||
local_14 = 0xffffffff;
|
||||
if (0xf < anm2Path._capacity) {
|
||||
uVar10 = anm2Path._capacity + 1;
|
||||
pcVar9 = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(GHIDRA_CAST<char *>(anm2Path._buf))) + 0x0)));
|
||||
if (0xfff < uVar10) {
|
||||
pcVar9 = *GHIDRA_CAST<char **>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(anm2Path._buf)) + 0x0))) + -4));
|
||||
uVar10 = anm2Path._capacity + 0x24;
|
||||
if (GHIDRA_CAST<char *>(0x1f) < GHIDRA_CAST<char *>(((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(anm2Path._buf)) + 0x0))) + (-4 - GHIDRA_INT(pcVar9))))) {
|
||||
/* WARNING: Subroutine does not return */
|
||||
_invalid_parameter_noinfo_noreturn();
|
||||
}
|
||||
}
|
||||
operator_delete(pcVar9,uVar10);
|
||||
}
|
||||
}
|
||||
pbVar5 = *GHIDRA_CAST<byte **>((GHIDRA_CAST<char *>(cursorSprite) + 0x14c));
|
||||
if (pbVar5 == GHIDRA_CAST<byte *>(0x0)) {
|
||||
LAB_009c4468:
|
||||
bVar4 = (GHIDRA_CAST<ANM2 *>((cursorSprite)))->ANM2::SetAnimation(GHIDRA_CAST<byte *>("Cursor"),1);
|
||||
if (bVar4 != 0) {
|
||||
(GHIDRA_CAST<AnimationState *>((GHIDRA_CAST<AnimationState *>((GHIDRA_INT(cursorSprite) + 0x148)))))->AnimationState::Rewind();
|
||||
*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(cursorSprite) + 0x15c)) = 1;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (0xf < *GHIDRA_CAST<uint *>((pbVar5 + 0x14))) {
|
||||
pbVar5 = *GHIDRA_CAST<byte **>(pbVar5);
|
||||
}
|
||||
pcVar9 = "Cursor";
|
||||
do {
|
||||
bVar4 = *pbVar5;
|
||||
isLess = bVar4 < (byte)*pcVar9;
|
||||
if (bVar4 != *pcVar9) {
|
||||
LAB_009c4450:
|
||||
uVar10 = -GHIDRA_UINT(isLess) | 1;
|
||||
goto LAB_009c4455;
|
||||
}
|
||||
if (bVar4 == 0) break;
|
||||
bVar4 = pbVar5[1];
|
||||
isLess = bVar4 < (byte)pcVar9[1];
|
||||
if (bVar4 != pcVar9[1]) goto LAB_009c4450;
|
||||
pbVar5 = pbVar5 + 2;
|
||||
pcVar9 = pcVar9 + 2;
|
||||
} while (bVar4 != 0);
|
||||
uVar10 = 0;
|
||||
LAB_009c4455:
|
||||
if ((uVar10 != 0) ||
|
||||
((*GHIDRA_CAST<char *>((*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(cursorSprite) + 0x14c)) + 0x34)) != '\0' &&
|
||||
(*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(cursorSprite) + 0x15c)) == '\0')))) goto LAB_009c4468;
|
||||
}
|
||||
menuManager = g_menuManager;
|
||||
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(cursorSprite) + 0x250)) = 8;
|
||||
if (menuManager == GHIDRA_CAST<MenuManager *>(0x0)) {
|
||||
uVar6 = 0x41400000;
|
||||
}
|
||||
else {
|
||||
uVar6 = 0x41800000;
|
||||
}
|
||||
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(cursorSprite) + 0x254)) = uVar6;
|
||||
uVar6 = 0x40800000;
|
||||
if (menuManager == GHIDRA_CAST<MenuManager *>(0x0)) {
|
||||
uVar12 = 0x40400000;
|
||||
}
|
||||
else {
|
||||
uVar12 = uVar6;
|
||||
}
|
||||
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(cursorSprite) + 600)) = uVar12;
|
||||
if (menuManager == GHIDRA_CAST<MenuManager *>(0x0)) {
|
||||
uVar6 = 0x40000000;
|
||||
}
|
||||
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(cursorSprite) + 0x25c)) = uVar6;
|
||||
uVar6 = 0x60;
|
||||
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(cursorSprite) + 0x260)) = 0x41c00000;
|
||||
*GHIDRA_CAST<undefined4 *>(cursorSprite) = 1;
|
||||
if (menuManager != GHIDRA_CAST<MenuManager *>(0x0)) {
|
||||
uVar6 = 0xa4;
|
||||
}
|
||||
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(cursorSprite) + 0x264)) = uVar6;
|
||||
pbVar5 = *GHIDRA_CAST<byte **>((GHIDRA_CAST<char *>(cursorSprite) + 0x38));
|
||||
if (pbVar5 == GHIDRA_CAST<byte *>(0x0)) {
|
||||
LAB_009c455f:
|
||||
bVar4 = (GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>((GHIDRA_INT(cursorSprite) + 4)))))->ANM2::SetAnimation(GHIDRA_CAST<byte *>("Appear"),1);
|
||||
if (bVar4 != 0) {
|
||||
(GHIDRA_CAST<AnimationState *>((GHIDRA_CAST<AnimationState *>((GHIDRA_INT(cursorSprite) + 0x34)))))->AnimationState::Rewind();
|
||||
*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(cursorSprite) + 0x48)) = 1;
|
||||
}
|
||||
}
|
||||
else {
|
||||
animNameChar = pbVar5;
|
||||
if (0xf < *GHIDRA_CAST<uint *>((pbVar5 + 0x14))) {
|
||||
animNameChar = *GHIDRA_CAST<byte **>(pbVar5);
|
||||
}
|
||||
pcVar9 = "Appear";
|
||||
do {
|
||||
bVar4 = *animNameChar;
|
||||
isLess = bVar4 < (byte)*pcVar9;
|
||||
if (bVar4 != *pcVar9) {
|
||||
LAB_009c4544:
|
||||
uVar10 = -GHIDRA_UINT(isLess) | 1;
|
||||
goto LAB_009c4549;
|
||||
}
|
||||
if (bVar4 == 0) break;
|
||||
bVar4 = animNameChar[1];
|
||||
isLess = bVar4 < (byte)pcVar9[1];
|
||||
if (bVar4 != pcVar9[1]) goto LAB_009c4544;
|
||||
animNameChar = animNameChar + 2;
|
||||
pcVar9 = pcVar9 + 2;
|
||||
} while (bVar4 != 0);
|
||||
uVar10 = 0;
|
||||
LAB_009c4549:
|
||||
if ((uVar10 != 0) || ((pbVar5[0x34] != 0 && (*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(cursorSprite) + 0x48)) == '\0'))))
|
||||
goto LAB_009c455f;
|
||||
}
|
||||
iVar7 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(cursorSprite) + 0x244));
|
||||
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(cursorSprite) + 0x238)) = 0;
|
||||
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(cursorSprite) + 0x23c)) = 0;
|
||||
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(cursorSprite) + 0x240)) = 0;
|
||||
FID_conflict__Erase_tree<fuzzer::fuzzer_allocator<std::_Tree_node<fuzzer::TracePC::PCTableEntry_const*,void*>_>_>
|
||||
((void *)(GHIDRA_INT(cursorSprite) + 0x244),(void *)(GHIDRA_INT(cursorSprite) + 0x244),
|
||||
*(_Tree_node<unsigned_int,void*> **)(iVar7 + 4));
|
||||
*GHIDRA_CAST<int *>((iVar7 + 4)) = iVar7;
|
||||
*GHIDRA_CAST<int *>(iVar7) = iVar7;
|
||||
*GHIDRA_CAST<int *>((iVar7 + 8)) = iVar7;
|
||||
*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(cursorSprite) + 0x248)) = 0;
|
||||
steam_friends_get(&PTR_vftable_00c5ab50,&friendsBegin,1);
|
||||
local_14 = 4;
|
||||
onlineFriends = GHIDRA_CAST<int *>(0x0);
|
||||
onlineFriendCount = GHIDRA_CAST<int *>(0x0);
|
||||
listHead = operator_new(0x10);
|
||||
*listHead = GHIDRA_INT(listHead);
|
||||
listHead[1] = GHIDRA_INT(listHead);
|
||||
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 5;
|
||||
uVar10 = 0;
|
||||
onlineFriends = listHead;
|
||||
if (friendsEnd - friendsBegin >> 3 != 0) {
|
||||
do {
|
||||
iVar7 = (**(code **)(*GHIDRA_CAST<int *>((friendsBegin + uVar10 * 8)) + 8))();
|
||||
piVar11 = onlineFriends;
|
||||
if (iVar7 != 0) {
|
||||
local_5c = GHIDRA_CAST<int *>(friendsBegin);
|
||||
if (onlineFriendCount == GHIDRA_CAST<int *>(0xfffffff)) {
|
||||
/* WARNING: Subroutine does not return */
|
||||
std::_Xlength_error("list too long");
|
||||
}
|
||||
local_58 = &onlineFriends;
|
||||
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 6;
|
||||
local_54 = GHIDRA_CAST<int *>(0x0);
|
||||
puVar8 = operator_new(0x10);
|
||||
local_54 = GHIDRA_CAST<int *>(0x0);
|
||||
puVar8[2] = KAGE::System::UserProfileBase::vftable;
|
||||
puVar8[3] = *GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(local_5c) + 4 + uVar10 * 8));
|
||||
puVar8[2] = KAGE::System::UserProfile::vftable;
|
||||
onlineFriendCount = GHIDRA_CAST<int *>((GHIDRA_INT(onlineFriendCount) + 1));
|
||||
puVar1 = GHIDRA_CAST<undefined4 *>(piVar11[1]);
|
||||
*puVar8 = piVar11;
|
||||
puVar8[1] = puVar1;
|
||||
piVar11[1] = GHIDRA_INT(puVar8);
|
||||
*puVar1 = puVar8;
|
||||
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 5;
|
||||
}
|
||||
uVar10 = uVar10 + 1;
|
||||
} while (uVar10 < GHIDRA_UINT((friendsEnd - friendsBegin >> 3)));
|
||||
}
|
||||
local_5c = onlineFriendCount;
|
||||
listHead = onlineFriends;
|
||||
if ((onlineFriendCount != GHIDRA_CAST<int *>(0x0)) && (onlineFriendCount != GHIDRA_CAST<int *>(0x1))) {
|
||||
local_6c = GHIDRA_CAST<int *>(FUN_008e33c0());
|
||||
local_70 = GHIDRA_CAST<int *>(FUN_008e33c0());
|
||||
piVar11 = local_6c;
|
||||
sortNode = GHIDRA_CAST<int *>(*listHead);
|
||||
pcVar9 = GHIDRA_CAST<char *>((**(code **)(sortNode[2] + 4))());
|
||||
otherName = GHIDRA_CAST<char *>((**(code **)(piVar11[2] + 4))());
|
||||
iVar7 = _stricmp(otherName,pcVar9);
|
||||
local_50 = piVar11;
|
||||
if (iVar7 < 0) {
|
||||
local_5c = piVar11;
|
||||
}
|
||||
else {
|
||||
local_5c = sortNode;
|
||||
do {
|
||||
sortNode = GHIDRA_CAST<int *>(*sortNode);
|
||||
if (sortNode == piVar11) goto LAB_009c480b;
|
||||
pcVar9 = GHIDRA_CAST<char *>((**(code **)(sortNode[2] + 4))());
|
||||
otherName = GHIDRA_CAST<char *>((**(code **)(piVar11[2] + 4))());
|
||||
iVar7 = _stricmp(otherName,pcVar9);
|
||||
} while (-1 < iVar7);
|
||||
}
|
||||
do {
|
||||
local_54 = sortNode + 2;
|
||||
piVar11 = local_50;
|
||||
local_64 = local_50;
|
||||
do {
|
||||
piVar11 = GHIDRA_CAST<int *>(*piVar11);
|
||||
local_50 = piVar11;
|
||||
if (piVar11 == local_70) break;
|
||||
pcVar9 = GHIDRA_CAST<char *>((**(code **)(*local_54 + 4))());
|
||||
otherName = GHIDRA_CAST<char *>((**(code **)(piVar11[2] + 4))());
|
||||
iVar7 = _stricmp(otherName,pcVar9);
|
||||
} while (iVar7 < 0);
|
||||
puVar1 = GHIDRA_CAST<undefined4 *>(local_64[1]);
|
||||
*puVar1 = piVar11;
|
||||
puVar8 = GHIDRA_CAST<undefined4 *>(piVar11[1]);
|
||||
*puVar8 = sortNode;
|
||||
puVar2 = GHIDRA_CAST<undefined4 *>(sortNode[1]);
|
||||
*puVar2 = local_64;
|
||||
sortNode[1] = GHIDRA_INT(puVar8);
|
||||
piVar11[1] = GHIDRA_INT(puVar1);
|
||||
local_64[1] = GHIDRA_INT(puVar2);
|
||||
if (piVar11 == local_70) goto LAB_009c480b;
|
||||
do {
|
||||
sortNode = GHIDRA_CAST<int *>(*sortNode);
|
||||
if (sortNode == piVar11) goto LAB_009c480b;
|
||||
pcVar9 = GHIDRA_CAST<char *>((**(code **)(sortNode[2] + 4))());
|
||||
otherName = GHIDRA_CAST<char *>((**(code **)(piVar11[2] + 4))());
|
||||
iVar7 = _stricmp(otherName,pcVar9);
|
||||
piVar11 = local_50;
|
||||
} while (-1 < iVar7);
|
||||
} while( true );
|
||||
}
|
||||
LAB_009c4819:
|
||||
local_50 = GHIDRA_CAST<int *>((GHIDRA_INT(local_68) + 0x22c));
|
||||
puVar1 = *GHIDRA_CAST<undefined4 **>((GHIDRA_CAST<char *>(local_68) + 0x230));
|
||||
puVar8 = GHIDRA_CAST<undefined4 *>(*local_50);
|
||||
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 8;
|
||||
local_54 = puVar1;
|
||||
if (puVar8 != puVar1) {
|
||||
do {
|
||||
(**(code **)*puVar8)();
|
||||
puVar8 = puVar8 + 2;
|
||||
} while (puVar8 != puVar1);
|
||||
puVar8 = GHIDRA_CAST<undefined4 *>(*local_50);
|
||||
}
|
||||
local_14 = CONCAT31((*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x1))),5);
|
||||
local_50[1] = GHIDRA_INT(puVar8);
|
||||
if (GHIDRA_CAST<int *>((local_50[2] - *local_50 >> 3)) < onlineFriendCount) {
|
||||
if (GHIDRA_CAST<int *>(0x1fffffff) < onlineFriendCount) {
|
||||
/* WARNING: Subroutine does not return */
|
||||
std::_Xlen();
|
||||
}
|
||||
FUN_009c5810();
|
||||
puVar8 = GHIDRA_CAST<undefined4 *>(local_50[1]);
|
||||
}
|
||||
piVar11 = GHIDRA_CAST<int *>(*onlineFriends);
|
||||
profiles = local_50;
|
||||
if (piVar11 != onlineFriends) {
|
||||
do {
|
||||
pvVar3 = local_68;
|
||||
puVar1 = *GHIDRA_CAST<undefined4 **>((GHIDRA_CAST<char *>(local_68) + 0x230));
|
||||
if (puVar1 == *GHIDRA_CAST<undefined4 **>((GHIDRA_CAST<char *>(local_68) + 0x234))) {
|
||||
std::vector<UserProfile>::_Emplace_reallocate(puVar1,piVar11 + 2);
|
||||
puVar8 = *GHIDRA_CAST<undefined4 **>((GHIDRA_CAST<char *>(pvVar3) + 0x230));
|
||||
profiles = local_50;
|
||||
}
|
||||
else {
|
||||
*puVar1 = KAGE::System::UserProfileBase::vftable;
|
||||
puVar1[1] = piVar11[3];
|
||||
*puVar1 = KAGE::System::UserProfile::vftable;
|
||||
profiles[1] = profiles[1] + 8;
|
||||
puVar8 = GHIDRA_CAST<undefined4 *>(profiles[1]);
|
||||
}
|
||||
piVar11 = GHIDRA_CAST<int *>(*piVar11);
|
||||
} while (piVar11 != onlineFriends);
|
||||
}
|
||||
pvVar3 = local_68;
|
||||
local_54 = GHIDRA_CAST<int *>(((float)((double)(GHIDRA_INT(puVar8) - *profiles >> 3) +
|
||||
__uint_to_double_fixup[-(GHIDRA_INT(puVar8) - *profiles >> 0x1f)]) /
|
||||
(float)((double)*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(local_68) + 0x250)) +
|
||||
__uint_to_double_fixup[-(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(local_68) + 0x250)) >> 0x1f)])));
|
||||
pageCount = ceil((double)(float)local_54);
|
||||
local_54 = GHIDRA_CAST<int *>((float)pageCount);
|
||||
isArrowVisible = 1 < GHIDRA_INT(pageCount);
|
||||
arrowLayer = (GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>((GHIDRA_INT(pvVar3) + 4)))))->ANM2::GetLayer(GHIDRA_CAST<byte *>("ArrowUp"));
|
||||
arrowLayer->_visible = isArrowVisible;
|
||||
iVar7 = *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar3) + 0x230)) - *GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar3) + 0x22c));
|
||||
local_54 = GHIDRA_CAST<int *>(((float)((double)(iVar7 >> 3) + __uint_to_double_fixup[-(iVar7 >> 0x1f)]) /
|
||||
(float)((double)*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar3) + 0x250)) +
|
||||
__uint_to_double_fixup[-(*GHIDRA_CAST<int *>((GHIDRA_CAST<char *>(pvVar3) + 0x250)) >> 0x1f)])));
|
||||
pageCount = ceil((double)(float)local_54);
|
||||
local_54 = GHIDRA_CAST<int *>((float)pageCount);
|
||||
isArrowVisible = 1 < GHIDRA_INT(pageCount);
|
||||
arrowLayer = (GHIDRA_CAST<ANM2 *>((GHIDRA_CAST<ANM2 *>((GHIDRA_INT(pvVar3) + 4)))))->ANM2::GetLayer(GHIDRA_CAST<byte *>("ArrowDown"));
|
||||
arrowLayer->_visible = isArrowVisible;
|
||||
*GHIDRA_CAST<undefined4 *>(onlineFriends[1]) = 0;
|
||||
puVar1 = GHIDRA_CAST<undefined4 *>(*onlineFriends);
|
||||
while (puVar1 != GHIDRA_CAST<undefined4 *>(0x0)) {
|
||||
puVar8 = GHIDRA_CAST<undefined4 *>(*puVar1);
|
||||
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 9;
|
||||
(**(code **)puVar1[2])();
|
||||
operator_delete(puVar1,0x10);
|
||||
puVar1 = puVar8;
|
||||
}
|
||||
(*GHIDRA_CAST<undefined1 *>((GHIDRA_CAST<char *>(&(local_14)) + 0x0))) = 4;
|
||||
operator_delete(onlineFriends,0x10);
|
||||
vector_UserProfile_destroy(&friendsBegin);
|
||||
ExceptionList = local_1c;
|
||||
return;
|
||||
LAB_009c480b:
|
||||
*listHead = GHIDRA_INT(local_5c);
|
||||
goto LAB_009c4819;
|
||||
}
|
||||
|
||||
// 009c51e0
|
||||
void InviteFriendsMenu::Render()
|
||||
{
|
||||
char isLastRef;
|
||||
byte *text;
|
||||
undefined4 nameIdHigh;
|
||||
int *avatarImage;
|
||||
KColor *nameColor;
|
||||
int *in_ECX;
|
||||
float *friendListFrame;
|
||||
AnimationState *overlayAnim;
|
||||
undefined4 nameIdLow;
|
||||
KColor *nameColor;
|
||||
int iVar1;
|
||||
int extraout_EDX;
|
||||
int iVar2;
|
||||
float *statusFrame;
|
||||
int friendIndex;
|
||||
uint statusIdLow;
|
||||
uint statusIdHigh;
|
||||
undefined1 avatarQuad [112];
|
||||
undefined1 fadeQuad [112];
|
||||
undefined1 local_b4 [8];
|
||||
KColor defaultColor;
|
||||
KColor highlightColor;
|
||||
uint lookupIdLow;
|
||||
uint lookupIdHigh;
|
||||
undefined8 local_7c;
|
||||
undefined4 local_70;
|
||||
undefined4 local_6c;
|
||||
KColor local_68;
|
||||
Font *nameFont;
|
||||
KColor local_50;
|
||||
undefined8 local_3c;
|
||||
uint row;
|
||||
Vector local_2c;
|
||||
float cursorX;
|
||||
float local_20;
|
||||
float cursorY;
|
||||
Vector drawPos;
|
||||
void *local_10;
|
||||
undefined1 *puStack_c;
|
||||
undefined4 local_8;
|
||||
Font *statusFont;
|
||||
|
||||
local_8 = 0xffffffff;
|
||||
puStack_c = &LAB_00b0eeb0;
|
||||
local_10 = ExceptionList;
|
||||
ExceptionList = &local_10;
|
||||
if (*in_ECX != 0) {
|
||||
local_50._alpha = (float)in_ECX[0x93];
|
||||
local_50._unk = 0;
|
||||
local_50._red = 0.0;
|
||||
local_50._green = 0.0;
|
||||
local_50._blue = 0.0;
|
||||
render_quad_set_uniform_color(fadeQuad,0.0,0.0,g_screenWidth,g_screenHeight,&local_50);
|
||||
render_color_shader_pass(fadeQuad);
|
||||
if (g_menuManager == GHIDRA_CAST<MenuManager *>(0x0)) {
|
||||
drawPos.x = g_screenWidth - 79.0;
|
||||
drawPos.y = g_screenHeight - 96.0;
|
||||
}
|
||||
else {
|
||||
drawPos.x = g_screenWidth * 0.5;
|
||||
drawPos.y = g_screenHeight * 0.5;
|
||||
}
|
||||
if (*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(in_ECX) + 0x10d)) != '\0') {
|
||||
local_20 = drawPos.x;
|
||||
cursorY = drawPos.y;
|
||||
if ((char)in_ECX[0x1d] == '\0') {
|
||||
AnimationState::Render
|
||||
(GHIDRA_CAST<AnimationState *>((in_ECX + 0xd)),&drawPos,&g_vectorZero,&g_vectorZero);
|
||||
overlayAnim = GHIDRA_CAST<AnimationState *>((in_ECX + 0x15));
|
||||
}
|
||||
else {
|
||||
AnimationState::Render
|
||||
(GHIDRA_CAST<AnimationState *>((in_ECX + 0x15)),&drawPos,&g_vectorZero,&g_vectorZero);
|
||||
overlayAnim = GHIDRA_CAST<AnimationState *>((in_ECX + 0xd));
|
||||
}
|
||||
AnimationState::Render(overlayAnim,&drawPos,&g_vectorZero,&g_vectorZero);
|
||||
}
|
||||
local_20 = drawPos.x;
|
||||
cursorY = drawPos.y;
|
||||
if (in_ECX[0xe] == 0) {
|
||||
statusFrame = GHIDRA_CAST<float *>(0x0);
|
||||
friendListFrame = GHIDRA_CAST<float *>(0x0);
|
||||
}
|
||||
else {
|
||||
statusFrame = (GHIDRA_CAST<AnimationState *>((GHIDRA_CAST<AnimationState *>((in_ECX + 0xd)))))->AnimationState::GetNullFrame(GHIDRA_CAST<byte *>("Status"));
|
||||
if (in_ECX[0xe] == 0) {
|
||||
friendListFrame = GHIDRA_CAST<float *>(0x0);
|
||||
}
|
||||
else {
|
||||
friendListFrame =
|
||||
(GHIDRA_CAST<AnimationState *>((GHIDRA_CAST<AnimationState *>((in_ECX + 0xd)))))->AnimationState::GetNullFrame(GHIDRA_CAST<byte *>("FriendList"));
|
||||
}
|
||||
}
|
||||
if (((*in_ECX == 2) && (statusFrame != GHIDRA_CAST<float *>(0x0))) && (friendListFrame != GHIDRA_CAST<float *>(0x0))) {
|
||||
if (GHIDRA_UINT((in_ECX[0x8c] - in_ECX[0x8b])) < 8) {
|
||||
statusFont = &g_manager->_font2_TeamMeatEx12;
|
||||
FUN_00a1a580(1);
|
||||
local_8 = 0;
|
||||
local_50._red = 0.21176471;
|
||||
local_50._green = 0.18431373;
|
||||
local_50._blue = 0.1764706;
|
||||
local_50._alpha = 1.0;
|
||||
local_2c.x = local_20 + *statusFrame;
|
||||
local_50._unk = 0;
|
||||
local_2c.y = cursorY + statusFrame[1];
|
||||
text = string_table_translate
|
||||
(GHIDRA_CAST<StringTable *>((extraout_EDX + 0x4a920)),
|
||||
GHIDRA_CAST<byte *>("#Online/NO_ONLINE_FRIENDS"));
|
||||
(GHIDRA_CAST<Font *>((statusFont)))->Font::DrawString(text,&local_2c,GHIDRA_CAST<Vector *>((statusFrame + 4)),&local_50,local_b4);
|
||||
ExceptionList = local_10;
|
||||
return;
|
||||
}
|
||||
drawPos.x = local_20 + *friendListFrame;
|
||||
cursorY = cursorY + friendListFrame[1];
|
||||
iVar1 = in_ECX[0x94];
|
||||
friendIndex = in_ECX[0x8e] * iVar1;
|
||||
local_20 = (float)friendIndex;
|
||||
drawPos.y = cursorY;
|
||||
(GHIDRA_CAST<KColor *>((&defaultColor)))->KColor::SetFromARGB(0xff362f2d);
|
||||
highlightColor._unk = 0;
|
||||
row = 0;
|
||||
highlightColor._red = 0.4745098;
|
||||
highlightColor._green = 0.0;
|
||||
highlightColor._blue = 0.0;
|
||||
highlightColor._alpha = 1.0;
|
||||
if (iVar1 != 0) {
|
||||
do {
|
||||
if (GHIDRA_UINT((in_ECX[0x8c] - in_ECX[0x8b] >> 3)) <= GHIDRA_UINT(friendIndex)) {
|
||||
ExceptionList = local_10;
|
||||
return;
|
||||
}
|
||||
if ((row == in_ECX[0x8f]) && (*GHIDRA_CAST<char *>((GHIDRA_CAST<char *>(in_ECX) + 0x221)) != '\0')) {
|
||||
if ((char)in_ECX[0x62] == '\0') {
|
||||
AnimationState::Render
|
||||
(GHIDRA_CAST<AnimationState *>((in_ECX + 0x52)),&drawPos,&g_vectorZero,&g_vectorZero);
|
||||
overlayAnim = GHIDRA_CAST<AnimationState *>((in_ECX + 0x5a));
|
||||
}
|
||||
else {
|
||||
AnimationState::Render
|
||||
(GHIDRA_CAST<AnimationState *>((in_ECX + 0x5a)),&drawPos,&g_vectorZero,&g_vectorZero);
|
||||
overlayAnim = GHIDRA_CAST<AnimationState *>((in_ECX + 0x52));
|
||||
}
|
||||
AnimationState::Render(overlayAnim,&drawPos,&g_vectorZero,&g_vectorZero);
|
||||
cursorY = drawPos.y;
|
||||
friendIndex = GHIDRA_INT(local_20);
|
||||
}
|
||||
cursorX = drawPos.x + (float)in_ECX[0x98];
|
||||
nameFont = &g_manager->_font1_TeamMeatEx10;
|
||||
iVar1 = *GHIDRA_CAST<int *>((in_ECX[0x8b] + 4 + friendIndex * 8));
|
||||
if (iVar1 == 0) {
|
||||
local_3c = 0;
|
||||
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_3c)) + 0x4))) = GHIDRA_CAST<byte *>(0x0);
|
||||
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_3c)) + 0x0))) = 0;
|
||||
nameIdHigh = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_3c)) + 0x4)));
|
||||
nameIdLow = (undefined4)local_3c;
|
||||
}
|
||||
else {
|
||||
nameIdHigh = *GHIDRA_CAST<undefined4 *>((iVar1 + 0xc));
|
||||
nameIdLow = *GHIDRA_CAST<undefined4 *>((iVar1 + 8));
|
||||
}
|
||||
text = user_profile_format_display_name
|
||||
(CONCAT44(nameIdHigh,nameIdLow),nameFont,in_ECX[0x99]);
|
||||
local_3c = CONCAT44(text,(undefined4)local_3c);
|
||||
(GHIDRA_CAST<KColor *>((&local_68)))->KColor::SetFromARGB(0xffffffff);
|
||||
render_quad_set_uniform_color
|
||||
(avatarQuad,cursorX,cursorY,cursorX + (float)in_ECX[0x95],
|
||||
(float)in_ECX[0x95] + cursorY,nameColor);
|
||||
iVar1 = *GHIDRA_CAST<int *>((in_ECX[0x8b] + 4 + friendIndex * 8));
|
||||
if ((iVar1 == 0) || (avatarImage = GHIDRA_CAST<int *>((iVar1 + 0x14)), *avatarImage == 0)) {
|
||||
avatarImage = GHIDRA_CAST<int *>(&DAT_00c799d8);
|
||||
}
|
||||
(GHIDRA_CAST<KAGE::SmartPointer *>((&local_2c)))->KAGE::SmartPointer::operator_assign(avatarImage);
|
||||
local_8 = 1;
|
||||
(**(code **)(*GHIDRA_CAST<int *>(local_2c.x) + 0x1c))(avatarQuad,g_drawRectUnset);
|
||||
local_8 = 2;
|
||||
if (((GHIDRA_CAST<int *>(local_2c.y) != GHIDRA_CAST<int *>(0x0)) &&
|
||||
(isLastRef = (**(code **)(*GHIDRA_CAST<int *>(local_2c.y) + 0xc))(), isLastRef != '\0')) &&
|
||||
(g_imageReleaseFn != (void *)0x0)) {
|
||||
(*g_imageReleaseFn)(&local_2c);
|
||||
}
|
||||
local_70 = 0;
|
||||
local_6c = 0xffff;
|
||||
local_68._red = 0.0;
|
||||
local_68._green = 1.0;
|
||||
cursorX = (float)in_ECX[0x95] + (float)in_ECX[0x97] + cursorX;
|
||||
local_68._blue = -NAN;
|
||||
local_68._alpha = 0.0;
|
||||
local_68._unk = 0;
|
||||
local_8 = 3;
|
||||
iVar1 = *GHIDRA_CAST<int *>((in_ECX[0x8b] + 4 + friendIndex * 8));
|
||||
if (iVar1 == 0) {
|
||||
local_7c = 0;
|
||||
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_7c)) + 0x4))) = 0;
|
||||
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_7c)) + 0x0))) = 0;
|
||||
statusIdLow = GHIDRA_UINT(local_7c);
|
||||
statusIdHigh = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_7c)) + 0x4)));
|
||||
}
|
||||
else {
|
||||
statusIdLow = *GHIDRA_CAST<uint *>((iVar1 + 8));
|
||||
statusIdHigh = *GHIDRA_CAST<uint *>((iVar1 + 0xc));
|
||||
}
|
||||
lookupIdLow = statusIdLow;
|
||||
lookupIdHigh = statusIdHigh;
|
||||
drawPos.x = cursorX;
|
||||
FUN_00731ee0(&local_50._blue,&lookupIdLow);
|
||||
if (((*GHIDRA_CAST<char *>((local_50._unk + 0xd)) == '\0') &&
|
||||
(*GHIDRA_CAST<uint *>((local_50._unk + 0x14)) <= statusIdHigh)) &&
|
||||
((*GHIDRA_CAST<uint *>((local_50._unk + 0x14)) < statusIdHigh ||
|
||||
(*GHIDRA_CAST<uint *>((local_50._unk + 0x10)) <= statusIdLow)))) {
|
||||
iVar1 = local_50._unk;
|
||||
iVar2 = in_ECX[0x91];
|
||||
}
|
||||
else {
|
||||
iVar1 = in_ECX[0x91];
|
||||
iVar2 = iVar1;
|
||||
}
|
||||
nameColor = &defaultColor;
|
||||
if (iVar1 != iVar2) {
|
||||
nameColor = &highlightColor;
|
||||
}
|
||||
(GHIDRA_CAST<Font *>((nameFont)))->Font::DrawStringScaled((*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_3c)) + 0x4))),&drawPos,nameColor,&local_70);
|
||||
row = row + 1;
|
||||
local_8 = 0xffffffff;
|
||||
friendIndex = GHIDRA_INT(local_20) + 1;
|
||||
cursorY = cursorY + (float)in_ECX[0x95] + (float)in_ECX[0x96];
|
||||
drawPos.x = (cursorX - ((float)in_ECX[0x95] + (float)in_ECX[0x97])) - (float)in_ECX[0x98];
|
||||
local_20 = (float)friendIndex;
|
||||
drawPos.y = cursorY;
|
||||
} while (row < GHIDRA_UINT(in_ECX[0x94]));
|
||||
}
|
||||
}
|
||||
}
|
||||
ExceptionList = local_10;
|
||||
return;
|
||||
}
|
||||
Reference in new issue
Block a user