silicontrip / SkyReader

A Skylander portal reader/editor/writer for OSX.
87 stars 55 forks source link

Decrypt not working #10

Open bobox59 opened 8 years ago

bobox59 commented 8 years ago

Hi, i have a understandable problem, with the windows version, all is ok, no problem. with this version compiled with xcode, impossible to get a normal decrypted dump. By logic, all checksums except type 0 are bad i have modified code to show the buffer content before and after decrypt, but the data still non readable. this occurs with files (crypted dumps) and with 3 different portals, together with many figurines did you have any idea ? Thanks.

ps: i can "create" others toys based on one toy on fresh new badges, this works great with windows version and some tricks, i probably include possibility to this code as a fork or directly to the author.

jtp10181 commented 8 years ago

Are you only having issues with this "silicontrip" version on xcode / mac ? Have you tried to compile my fork on xcode? Is my fork the windows version you are talking about that works fine? I dont know if it will work on mac but I tried to keep it compatible with xcode. I do not have a mac to try it on.

bobox59 commented 8 years ago

I have the problem with many forks and silicontrip original. after few researches, i've found the origin: Crypt::ComputeMD5 function

if i put this code for testing on main() ` unsigned char test[16]; MD5 md5b; MD5Open(&md5b); MD5Digest(&md5b, "12345678901234567890123456789012345678901234567890123456789012345678901234567890123456", 86); MD5Close(&md5b, test);

printf("MD5 digest : ");
for(int compteur = 0; compteur <= 15; compteur++) {
    printf("%02X ",test[compteur]);
}

`

It responds MD5 digest : AF 64 FF 7B C2 7E 8C 39 78 7E 8E E4 18 F4 A9 A8 but the correct MD5 digest of 12345678901234567890123456789012345678901234567890123456789012345678901234567890123456 is 5cdfce0bd8d611bc54d2865c5c5b4a7f.

when i put the same code on windows version source and compile it under visualc++ the response is ok (5cdfce0bd8d611bc54d2865c5c5b4a7f)

i really don't understand why the same code md5.h md5.cpp did not the same response on xcode/mac !

bobox59 commented 8 years ago

Same problem with another MD5 library and simple example ! if i copy the files to windows, compile, all is ok on windows... totally desperate to understand WHY !

bobox59 commented 8 years ago

Problem RESOLVED ! with usage of another MD5 Lib and many modification of code.

silicontrip commented 8 years ago

Sounds like the md5 code is not endian safe. This is strange since both the mac and windows use the same CPU now. Maybe whoever wrote that library assumed that Mac was big endian. Sorry I can't validate this code anymore, my son upgraded to an xbox and although we have skylanders, I can no longer test it with an xbox portal.

bobox59 commented 8 years ago

Yes probably default endian support different on mac/pc, i don't know anymore about this. I only have wii / wii-u portals. I added some code to have an new option '-T toyid' to permit to change the ToyID as i want. i also added some code to validate the Checksums Type 3 for Traps As absolutely all working great for now my next work is superchargers support... Thank you for your great job !

2016-07-25 2:18 GMT+02:00 Mark Heath notifications@github.com:

Sounds like the md5 code is not endian safe. This is strange since both the mac and windows use the same CPU now. Maybe whoever wrote that library assumed that Mac was big endian. Sorry I can't validate this code anymore, my son upgraded to an xbox and although we have skylanders, I can no longer test it with an xbox portal.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/silicontrip/SkyReader/issues/10#issuecomment-234812586, or mute the thread https://github.com/notifications/unsubscribe-auth/AIZzwbwg7HI-psucO3rd4zxzjszECvVwks5qZADRgaJpZM4JRvus .