diff --git a/Source/Core/Core/Src/ARDecrypt.cpp b/Source/Core/Core/Src/ARDecrypt.cpp index 514f6ed723..6c44febd47 100644 --- a/Source/Core/Core/Src/ARDecrypt.cpp +++ b/Source/Core/Core/Src/ARDecrypt.cpp @@ -470,7 +470,7 @@ void DecryptARCode(std::vector vCodes, std::vector &ops) u32 uCodes[1200]; int i,ret; - for(int i = 0; i < vCodes.size(); ++i) + for(i = 0; i < vCodes.size(); ++i) { transform(vCodes[i].begin(), vCodes[i].end(), vCodes[i].begin(), toupper); //PanicAlert("Encrypted AR Code\n%s", vCodes[i].c_str()); @@ -483,15 +483,28 @@ void DecryptARCode(std::vector vCodes, std::vector &ops) } else if (!batchdecrypt(uCodes, vCodes.size()<<1)) { - PanicAlert("Action Replay Code Decryption Error:\nCRC Check Failed\n\nFirst Code in Block(verification code):\n%s", vCodes[0].c_str()); - } + PanicAlert("Action Replay Code Decryption Error:\nCRC Check Failed\n\n" + "First Code in Block(should be verification code):\n%s", vCodes[0].c_str()); - for (i = 0; i < (vCodes.size()<<1); i+=2) + for (i = 0; i < (vCodes.size()<<1); i+=2) + { + AREntry op; + op.cmd_addr = uCodes[i]; + op.value = uCodes[i+1]; + ops.push_back(op); + //PanicAlert("Decrypted AR Code without verification code:\n%08X %08X", uCodes[i], uCodes[i+1]); + } + } + else { - AREntry op; - op.cmd_addr = uCodes[i]; - op.value = uCodes[i+1]; - ops.push_back(op); - //PanicAlert("Decrypted AR Code:\n%08X %08X", uCodes[i], uCodes[i+1]); + // Skip passing the verification code back + for (i = 2; i < (vCodes.size()<<1); i+=2) + { + AREntry op; + op.cmd_addr = uCodes[i]; + op.value = uCodes[i+1]; + ops.push_back(op); + //PanicAlert("Decrypted AR Code:\n%08X %08X", uCodes[i], uCodes[i+1]); + } } } diff --git a/Source/Core/Core/Src/ActionReplay.cpp b/Source/Core/Core/Src/ActionReplay.cpp index 00b94ff865..64527b2ed8 100644 --- a/Source/Core/Core/Src/ActionReplay.cpp +++ b/Source/Core/Core/Src/ActionReplay.cpp @@ -71,7 +71,6 @@ void LoadActionReplayCodes(IniFile &ini) std::vector lines; std::vector encryptedLines; - std::string oldName; ARCode currentCode; arCodes.clear();