From 5afbeca23c80490f47c8f478b8cd9fa2e37c38b8 Mon Sep 17 00:00:00 2001 From: carman24r Date: Tue, 29 Sep 2026 16:06:41 -0400 Subject: [PATCH] Update Packet.cpp validated count-replacement helper. --- core/libs/prx/libSceAgc/Command/src/Packet.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/core/libs/prx/libSceAgc/Command/src/Packet.cpp b/core/libs/prx/libSceAgc/Command/src/Packet.cpp index b32303b1c..62a12734b 100644 --- a/core/libs/prx/libSceAgc/Command/src/Packet.cpp +++ b/core/libs/prx/libSceAgc/Command/src/Packet.cpp @@ -159,4 +159,11 @@ void PatchIndirectCount(std::uint32_t* packet, std::uint32_t opcode, std::uint32 packet[4] += count; } +void SetIndirectCount(std::uint32_t* packet, std::uint32_t opcode, std::uint32_t count, const char* function) { + ValidatePacket(packet, opcode, 5, function); + Require(packet[3] == 0x80000000u && packet[4] <= 0x3fffu, function, "invalid indirect register packet"); + CheckBits(count, 0x3fffu, function); + packet[4] = count; +} + }