mirror of
https://github.com/boykopovar/AnyPS5.git
synced 2026-10-22 08:33:12 -05:00
Measured on a PS5 (firmware 13.60) through dlopen of libSceVoiceQoS.sprx: a null block, any size other than exactly 0x40000, and an app type other than 0x20000000 or 0x10000000 all return 0x804E0902 without touching the block, instead of throwing. A second initialization returns 0x804E0905, as prosper reads from the module. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
29 lines
1.3 KiB
C++
29 lines
1.3 KiB
C++
#include "prx/libc/include/general/VabiMacros.hpp"
|
|
#include <cstdint>
|
|
#include <cstdlib>
|
|
#include <vector>
|
|
|
|
extern "C" {
|
|
int APS5_VABI sceVoiceQoSInit(void*, std::uint32_t, std::int32_t);
|
|
}
|
|
|
|
static void Require(bool value) { if (!value) std::abort(); }
|
|
|
|
int main(int argc, char** argv) {
|
|
Require(argc == 2);
|
|
constexpr int argumentInvalid = static_cast<int>(0x804E0902);
|
|
constexpr int initialized = static_cast<int>(0x804E0905);
|
|
const auto appType = static_cast<std::int32_t>(std::strtoul(argv[1], nullptr, 16));
|
|
std::vector<std::uint8_t> memory(0x40000, 0xAA);
|
|
Require(sceVoiceQoSInit(nullptr, 0x40000, appType) == argumentInvalid);
|
|
Require(sceVoiceQoSInit(nullptr, 0, appType) == argumentInvalid);
|
|
for (std::uint32_t size : {0u, 1u, 0x100u, 0x3FFFFu, 0x40001u, 0x80000u, 0xFFFFFFFFu}) Require(sceVoiceQoSInit(memory.data(), size, appType) == argumentInvalid);
|
|
for (std::int32_t type : {0, 1, 0x08000000, 0x20000001, 0x30000000, 0x40000000, static_cast<std::int32_t>(0x80000000), -1}) {
|
|
Require(sceVoiceQoSInit(memory.data(), 0x40000, type) == argumentInvalid);
|
|
}
|
|
for (std::uint8_t byte : memory) Require(byte == 0xAA);
|
|
Require(sceVoiceQoSInit(memory.data(), 0x40000, appType) == 0);
|
|
Require(sceVoiceQoSInit(memory.data(), 0x40000, appType) == initialized);
|
|
Require(sceVoiceQoSInit(nullptr, 0, 0) == initialized);
|
|
}
|