the only thing that erks me just a bit about this thread is the fact dude just said he did it because he wanted to know, but then he POSTED it (saying and doing are different things). wick wicka wack.
Yeah.....
the only thing that erks me just a bit about this thread is the fact dude just said he did it because he wanted to know, but then he POSTED it (saying and doing are different things). wick wicka wack.
what drama? did i miss something here? i was just replying to the thread... this is why i dont come to forums cuz the people with a voice tend to use it to much..
the only thing that erks me just a bit about this thread is the fact dude just said he did it because he wanted to know, but then he POSTED it (saying and doing are different things). wick wicka wack.
That was after I had reversed it. So I posted that code with the intention of allowing interoperability and letting others improve on your plugin. I apologize if it violated youI felt that people should be able to make their own patches and now they have the needed information.
#include <stdio.h>
#include <assert.h>
#define SIZE 0xC40A
unsigned char key1[7] = { 0xD4, 0xCA, 0x6D, 0x85, 0x90, 0x85, 0xA6 };
unsigned char key2[4] = { 0xF1, 0x0E, 0xC4, 0x6A };
unsigned char key3[3] = { 0xEB, 0xAC, 0x8D };
unsigned char key4[7] = { 0xDC, 0x1E, 0xA9, 0x1F, 0x3C, 0x65, 0x6B };
void Decrypt(unsigned char* buf, unsigned int len)
{
if(len == 0) return;
unsigned int idx = 0;
unsigned char key1_idx = 0;
unsigned char key2_idx = 0;
unsigned char key3_idx = 0;
unsigned char key4_idx = 0;
unsigned int result;
while(idx < len)
{
result = buf[idx];
result ^= ~key1[key1_idx];
result ^= ~key2[key2_idx];
result ^= ~key3[key3_idx];
result ^= ~key4[key4_idx];
key1_idx++;
if(key1_idx >= 7) key1_idx = 0;
key2_idx++;
if(key2_idx >= 4) key2_idx = 0;
key3_idx++;
if(key3_idx >= 3) key3_idx = 0;
key4_idx++;
if(key4_idx >= 7) key4_idx = 0;
buf[idx] = (unsigned char)result;
idx++;
}
}
int main(int argc, char** argv)
{
FILE* fd = fopen("redscrypted.prx", "rb");
assert(fd != NULL);
fseek(fd, 0x620, SEEK_SET);
unsigned char* buf = (unsigned char*)malloc(SIZE);
assert(buf != NULL);
fread(buf, SIZE, 1, fd);
fclose(fd);
Decrypt(buf, SIZE);
fd = fopen("out.bin", "wb");
fwrite(buf, SIZE, 1, fd);
fclose(fd);
}
Decrypts the same way as the PSP does. Checked with psplink ie. loaded prx, called the decryption function with the same arguments as the PRX would pass and dumped the buffer.
Up for a bigger challenge?