mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-11-13 01:29:41 +01:00
Fix "copy type" pointer cwc
This commit is contained in:
1 parent
4a97ab25b3
commit
3f90c2ded0
1 file changed
+3
-3
+3
-3
@@ -439,7 +439,7 @@ void CWCheatEngine::Run() {
|
||||
int count = arg2 & 0xFFFF;
|
||||
int type = (arg2 >> 16) & 0xF;
|
||||
for (int i = 1; i < count; i ++ ) {
|
||||
if (i+1 < count) {
|
||||
if (i < count) {
|
||||
code = GetNextCode();
|
||||
if (code.size() < 2) {
|
||||
// User provided incomplete cheat. Should warn but would be very spammy...
|
||||
@@ -452,8 +452,8 @@ void CWCheatEngine::Run() {
|
||||
case 0x1: // type copy byte
|
||||
{
|
||||
int srcAddr = Memory::Read_U32(addr) + offset;
|
||||
int dstAddr = Memory::Read_U16(addr + baseOffset) + (arg3 & 0x0FFFFFFF);
|
||||
if (Memory::IsValidAddress(dstAddr) && Memory::IsValidAddress(srcAddr)) {
|
||||
int dstAddr = Memory::Read_U32(addr + baseOffset) + (arg3 & 0x0FFFFFFF);
|
||||
if (Memory::IsValidAddress(dstAddr) && Memory::IsValidAddress(srcAddr) && Memory::IsValidAddress(srcAddr + arg) && Memory::IsValidAddress(dstAddr + arg)) {
|
||||
Memory::MemcpyUnchecked(dstAddr, srcAddr, arg);
|
||||
}
|
||||
type = -1; //Done
|
||||
|
||||
Reference in new issue
Block a user