#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(SteamInternal_ContextInit()); getFriendGamePlayed = *(code **)(*GHIDRA_CAST(*steamFriends) + 0x20); profile = *GHIDRA_CAST((friendCursor + 4)); if (profile == 0) { local_20 = 0; (*GHIDRA_CAST((GHIDRA_CAST(&(local_20)) + 0x4))) = 0; (*GHIDRA_CAST((GHIDRA_CAST(&(local_20)) + 0x0))) = 0; steamIdHigh = (*GHIDRA_CAST((GHIDRA_CAST(&(local_20)) + 0x4))); steamIdLow = (undefined4)local_20; } else { steamIdHigh = *GHIDRA_CAST((profile + 0xc)); steamIdLow = *GHIDRA_CAST((profile + 8)); } FUN_00a238e0(steamIdLow,steamIdHigh); isInGame = (*getFriendGamePlayed)(); if (isInGame != '\0') { steamFriends = GHIDRA_CAST(SteamInternal_ContextInit()); (**(code **)(*GHIDRA_CAST(*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; }