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>
76 lines
2.2 KiB
C++
76 lines
2.2 KiB
C++
#include "classes.h"
|
|
|
|
// 00a57060
|
|
undefined4 KAGE::System::FriendManager::request_friend_lobbies(int param_1, int param_2)
|
|
{
|
|
char isInGame;
|
|
undefined4 *steamFriends;
|
|
undefined4 steamIdHigh;
|
|
int *in_ECX;
|
|
undefined4 steamIdLow;
|
|
int friendCursor;
|
|
int friendsBegin;
|
|
int friendsEnd;
|
|
undefined8 local_20;
|
|
void *local_10;
|
|
undefined1 *puStack_c;
|
|
undefined4 local_8;
|
|
code *getFriendGamePlayed;
|
|
int profile;
|
|
|
|
local_8 = 0xffffffff;
|
|
puStack_c = &LAB_00b12935;
|
|
local_10 = ExceptionList;
|
|
ExceptionList = &local_10;
|
|
in_ECX[2] = param_1;
|
|
in_ECX[3] = param_2;
|
|
in_ECX[6] = 0;
|
|
FUN_00a57a10();
|
|
in_ECX[8] = in_ECX[7];
|
|
in_ECX[10] = 0;
|
|
FUN_00a57a10();
|
|
in_ECX[0xc] = in_ECX[0xb];
|
|
(**(code **)(*in_ECX + 0x10))();
|
|
local_8 = 0;
|
|
friendCursor = friendsBegin;
|
|
if (friendsBegin != friendsEnd) {
|
|
do {
|
|
steamFriends = GHIDRA_CAST<undefined4 *>(SteamInternal_ContextInit());
|
|
getFriendGamePlayed = *(code **)(*GHIDRA_CAST<int *>(*steamFriends) + 0x20);
|
|
profile = *GHIDRA_CAST<int *>((friendCursor + 4));
|
|
if (profile == 0) {
|
|
local_20 = 0;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_20)) + 0x4))) = 0;
|
|
(*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_20)) + 0x0))) = 0;
|
|
steamIdHigh = (*GHIDRA_CAST<undefined4 *>((GHIDRA_CAST<char *>(&(local_20)) + 0x4)));
|
|
steamIdLow = (undefined4)local_20;
|
|
}
|
|
else {
|
|
steamIdHigh = *GHIDRA_CAST<undefined4 *>((profile + 0xc));
|
|
steamIdLow = *GHIDRA_CAST<undefined4 *>((profile + 8));
|
|
}
|
|
FUN_00a238e0(steamIdLow,steamIdHigh);
|
|
isInGame = (*getFriendGamePlayed)();
|
|
if (isInGame != '\0') {
|
|
steamFriends = GHIDRA_CAST<undefined4 *>(SteamInternal_ContextInit());
|
|
(**(code **)(*GHIDRA_CAST<int *>(*steamFriends) + 0x24))();
|
|
}
|
|
friendCursor = friendCursor + 8;
|
|
} while (friendCursor != friendsEnd);
|
|
}
|
|
if (in_ECX[10] != 0) {
|
|
in_ECX[6] = in_ECX[6] + 1;
|
|
}
|
|
local_8 = 0xffffffff;
|
|
vector_UserProfile_destroy(&friendsBegin);
|
|
in_ECX[6] = in_ECX[6] + 1;
|
|
eos_friend_lobby_search_start();
|
|
if ((in_ECX[6] == 0) && (DAT_00c5ab58 != (code *)0x0)) {
|
|
(*DAT_00c5ab58)();
|
|
DAT_00c5ab58 = (code *)0x0;
|
|
DAT_00c5ab5c = 0;
|
|
}
|
|
ExceptionList = local_10;
|
|
return 1;
|
|
}
|