Files
AnyPS5/core/libs/tests/GuestOperationMode.cpp
T
hugodearaujoandClaude Opus 5.5 d1631862f5 fix(libkernel): report the operation mode the console reports
sceKernelGetOperationMode returned 0 for both values, which were
unknown. A payload on a PS5 (firmware 13.60) reads mode 2 and submode 0;
nothing past the two ints is written and the result register holds no
status, so the function now returns nothing. PPSA12544 logs both values
and ignores the result.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 14:20:54 -03:00

21 lines
703 B
C++

#include "prx/libc/include/general/VabiMacros.hpp"
#include <cstdlib>
#include <stdexcept>
extern "C" {
void APS5_VABI sceKernelGetOperationMode(int* mode, int* submode);
}
static void Require(bool value) { if (!value) std::abort(); }
static bool Throws(int* mode, int* submode) {
try { sceKernelGetOperationMode(mode, submode); } catch (const std::invalid_argument&) { return true; }
return false;
}
int main() {
int out[4] = {-1, -1, -1, -1};
sceKernelGetOperationMode(&out[0], &out[2]);
Require(out[0] == 2 && out[1] == -1);
Require(out[2] == 0 && out[3] == -1);
int value = -1;
Require(Throws(nullptr, &value) && Throws(&value, nullptr));
Require(value == -1);
}