Users browsing this thread: 2 Guest(s)
Street Fighter: Duel images
#11
Actually @bihaiorg already posted the solution, the code from 52pojie.cn looks very complex, but it can be simplified to

Code:
if ( v10 == *(_QWORD *)"VEGATOPJOY000000VEGATOPJOY000000N7cocos2d5ImageE" )
   {
     v33 = v10;
     v34 = v9;
     v35 = v11;
     v3 -= 16;
     v12 = v4[23];
     v4 += 16;
     *v4 ^= 0x51u;
     v4[1] = v4[1] ^ 0x49;
     v4[2] = v4[2] ^ 0x51;
     v4[3] = v4[3] ^ 0x49;
     v4[4] = v4[4] ^ 0x41;
     v4[5] = v4[5] ^ 0x4E;
     v4[6] = v4[6] ^ 0x52;
     v4[7] = v12 ^ 0x41;
     v4[8] = v4[8] ^ 0x4E;
     v4[9] = v4[9] ^ 0x58;
     v4[10] = v4[10] ^ 0x49;
     v4[11] = v4[11] ^ 0x41;
     v4[12] = v4[12] ^ 0x4F;
     v4[13] = v4[13] ^ 0x42;
     v4[14] = v4[14] ^ 0x45;
     v4[15] ^= 0x49u;
   }

What the code basically means - check the first 16 bytes for "VEGATOPJOY000000", then XOR the next 16 bytes with "51 49 51 49 41 4e 52 41 4e 58 49 41 4f 42 45 49". That is the ASTC image header. The rest are ASTC image data, and they are unencrypted..

Re-save the ASTC image part as *.ASTC file, and you can use this tool to convert them
https://github.com/ARM-software/astc-encoder/releases

Run in command line like this
Code:
astcenc-sse2.exe  -dl  IN.ASTC   OUT.PNG

The tool can also encode the edited PNG back. Just XOR the ASTC header, and then prepend "VEGATOPJOY000000" back to the file. It's very easy.

Thanks for @bihaiorg for figured the whole thing out and sharing the code!
- Rufas
Reply
Thanked by:


Messages In This Thread
Street Fighter: Duel images - by tombmonkey - 10-08-2021, 07:35 AM
RE: Street Fighter: Duel images - by Hollow - 11-12-2021, 08:17 PM
RE: Street Fighter: Duel images - by bihaiorg - 01-20-2022, 03:43 PM
RE: Street Fighter: Duel images - by JacintaB2022 - 01-24-2022, 12:15 PM
RE: Street Fighter: Duel images - by bihaiorg - 01-26-2022, 06:03 AM
RE: Street Fighter: Duel images - by JacintaB2022 - 02-25-2022, 05:47 AM
RE: Street Fighter: Duel images - by tombmonkey - 10-17-2022, 02:32 PM
RE: Street Fighter: Duel images - by tombmonkey - 10-30-2022, 02:04 PM
RE: Street Fighter: Duel images - by AkashiYasuto - 12-04-2022, 12:49 AM
RE: Street Fighter: Duel images - by Barack Obama - 12-04-2022, 02:23 AM
RE: Street Fighter: Duel images - by rufaswan - 12-10-2022, 09:42 PM
RE: Street Fighter: Duel images - by Hollow - 12-20-2022, 08:52 PM
RE: Street Fighter: Duel images - by rufaswan - 12-24-2022, 08:21 PM
RE: Street Fighter: Duel images - by Hollow - 12-27-2022, 08:33 PM
RE: Street Fighter: Duel images - by Hollow - 01-22-2023, 06:11 PM
RE: Street Fighter: Duel images - by rufaswan - 02-05-2023, 06:41 AM
RE: Street Fighter: Duel images - by Hollow - 02-22-2023, 06:00 PM
RE: Street Fighter: Duel images - by rufaswan - 02-24-2023, 09:21 AM
RE: Street Fighter: Duel images - by Hollow - 02-24-2023, 10:36 PM
RE: Street Fighter: Duel images - by bymutou - 03-05-2023, 04:44 PM
RE: Street Fighter: Duel images - by Hollow - 03-06-2023, 10:54 PM
RE: Street Fighter: Duel images - by JacintaB2022 - 03-02-2023, 03:12 PM
RE: Street Fighter: Duel images - by Hollow - 03-02-2023, 06:07 PM
RE: Street Fighter: Duel images - by Hollow - 03-07-2023, 03:29 AM
RE: Street Fighter: Duel images - by JacintaB2022 - 03-07-2023, 04:39 AM
RE: Street Fighter: Duel images - by bymutou - 03-09-2023, 03:46 AM
RE: Street Fighter: Duel images - by Hollow - 03-10-2023, 05:15 PM
RE: Street Fighter: Duel images - by bymutou - 03-10-2023, 08:40 PM
RE: Street Fighter: Duel images - by Hollow - 03-10-2023, 09:04 PM
RE: Street Fighter: Duel images - by bymutou - 03-10-2023, 11:09 PM
RE: Street Fighter: Duel images - by Hollow - 03-12-2023, 04:35 PM
RE: Street Fighter: Duel images - by bymutou - 03-12-2023, 09:14 PM
RE: Street Fighter: Duel images - by Devola - 03-11-2023, 12:45 AM
RE: Street Fighter: Duel images - by bymutou - 03-11-2023, 02:49 AM
RE: Street Fighter: Duel images - by Devola - 03-12-2023, 09:15 PM
RE: Street Fighter: Duel images - by Hollow - 03-13-2023, 12:49 AM
RE: Street Fighter: Duel images - by bymutou - 03-13-2023, 08:02 AM

Forum Jump: