#include "classes.h" // 00a5f770 uint8_t KAGE::EosManager::FUN_00a649b0() { char cVar1; int iVar2; uint32_t extraout_EAX; uint32_t uVar3; uint32_t lobbyInterface; int in_ECX; char *lengthCursor; uint64_t notifyId; uint8_t auStack_492 [2]; uint8_t auStack_48c [8]; uint32_t initOptions; uint32_t local_480; uint32_t local_47c; uint32_t local_478; uint32_t productName; uint32_t productVersion; uint32_t local_46c; uint32_t local_468; uint32_t local_464; uint32_t uStack_460; char *productId; char *sandboxId; char *clientId; char *clientSecret; uint32_t uStack_44c; char *encryptionKey; uint32_t uStack_444; uint32_t uStack_440; char *deploymentId; uint32_t uStack_438; uint32_t platformFlags; uint32_t uStack_430; CHAR *cacheDirectory; uint64_t uStack_428; uint64_t uStack_420; uint32_t uStack_418; CHAR tempPath [1032]; uint32_t local_c; local_c = __security_cookie ^ GHIDRA_UINT(auStack_48c); if ((*GHIDRA_CAST((in_ECX + 4)) & 1) == 0) { FUN_00a24530(); FUN_00a24530(); lengthCursor = DAT_00c79a14; do { cVar1 = *lengthCursor; lengthCursor = lengthCursor + 1; } while (cVar1 != '\0'); if (0x40 < GHIDRA_UINT((GHIDRA_INT(lengthCursor) - GHIDRA_INT((DAT_00c79a14 + 1))))) { KAGE_LogMessage(0x10,(uint8_t *) "Specified product ID is not valid: It is longer than the allowed size of %d\n" ); } lengthCursor = DAT_00c79a18; do { cVar1 = *lengthCursor; lengthCursor = lengthCursor + 1; } while (cVar1 != '\0'); if (0x40 < GHIDRA_UINT((GHIDRA_INT(lengthCursor) - GHIDRA_INT((DAT_00c79a18 + 1))))) { KAGE_LogMessage(0x10,(uint8_t *) "Specified sandbox ID is not valid: It is longer than the allowed size of %d\n" ); } lengthCursor = DAT_00c79a1c; do { cVar1 = *lengthCursor; lengthCursor = lengthCursor + 1; } while (cVar1 != '\0'); if (0x40 < GHIDRA_UINT((GHIDRA_INT(lengthCursor) - GHIDRA_INT((DAT_00c79a1c + 1))))) { KAGE_LogMessage(0x10,(uint8_t *) "Specified deployment ID is not valid: It is longer than the allowed size of %d\n" ); } lengthCursor = DAT_00c79a20; do { cVar1 = *lengthCursor; lengthCursor = lengthCursor + 1; } while (cVar1 != '\0'); if (0x40 < GHIDRA_UINT((GHIDRA_INT(lengthCursor) - GHIDRA_INT((DAT_00c79a20 + 1))))) { KAGE_LogMessage(0x10,(uint8_t *) "Specified client ID is not valid: It is longer than the allowed size of %d\n" ); } lengthCursor = DAT_00c79a24; do { cVar1 = *lengthCursor; lengthCursor = lengthCursor + 1; } while (cVar1 != '\0'); if (0x40 < GHIDRA_UINT((GHIDRA_INT(lengthCursor) - GHIDRA_INT((DAT_00c79a24 + 1))))) { KAGE_LogMessage(0x10,(uint8_t *) "Specified client secret is not valid: It is longer than the allowed size of %d\n" ); } lengthCursor = DAT_00c79a28; do { cVar1 = *lengthCursor; lengthCursor = lengthCursor + 1; } while (cVar1 != '\0'); if (0x40 < GHIDRA_UINT((GHIDRA_INT(lengthCursor) - GHIDRA_INT((DAT_00c79a28 + 1))))) { KAGE_LogMessage(0x10,(uint8_t *) "Specified encryption key is not valid: It is longer than the allowed size of %d\n" ); } productName = DAT_00c79a0c; productVersion = DAT_00c79a10; initOptions = 4; local_480 = 0; local_47c = 0; local_478 = 0; local_46c = 0; local_468 = 0; local_464 = 0; iVar2 = _EOS_Initialize_4(); if (iVar2 != 0) { _EOS_EResult_ToString_4(); KAGE_LogMessage(8,GHIDRA_CAST("Failed to initialize EOS: %s\n")); return extraout_EAX & 0xffffff00; } productId = DAT_00c79a14; sandboxId = DAT_00c79a18; deploymentId = DAT_00c79a1c; clientId = DAT_00c79a20; clientSecret = DAT_00c79a24; encryptionKey = DAT_00c79a28; platformFlags = 2; if (DAT_00c79a2c != '\0') { platformFlags = 0x40; } uStack_460 = 0; uStack_438 = 0; uStack_428 = 0; uStack_420 = 0; uStack_418 = 0; local_464 = 0xe; uStack_44c = 0; uStack_444 = 0; uStack_440 = 0; uStack_430 = 0; memset(tempPath,0,0x400); GetTempPathA(0x400,tempPath); cacheDirectory = tempPath; iVar2 = _EOS_Platform_Create_4(); *GHIDRA_CAST((in_ECX + 0x14)) = iVar2; if (iVar2 == 0) { KAGE_LogMessage(8,GHIDRA_CAST("Failed to acquire EOS platform handle object\n")); uVar3 = _EOS_Shutdown_0(); return uVar3 & 0xffffff00; } (**(code **)(*GHIDRA_CAST((in_ECX + 0x30)) + 4))(); lobbyInterface = _EOS_Platform_GetLobbyInterface_4(g_eosPlatform); notifyId = _EOS_Lobby_AddNotifyLobbyInviteAccepted_16(lobbyInterface); *GHIDRA_CAST((in_ECX + 0x40)) = notifyId; lobbyInterface = _EOS_Platform_GetLobbyInterface_4(g_eosPlatform,auStack_492 + -0x12,0,FUN_00a60c50); notifyId = _EOS_Lobby_AddNotifyJoinLobbyAccepted_16(lobbyInterface); local_c = GHIDRA_UINT(notifyId); *GHIDRA_CAST((in_ECX + 4)) = *GHIDRA_CAST((in_ECX + 4)) | 1; *GHIDRA_CAST((in_ECX + 0x48)) = notifyId; } return CONCAT31((int3)(local_c >> 8),1); }