Posts: 161
Threads: 4
Joined: Jul 2017
(01-22-2023, 06:11 PM)Hollow Wrote: Hello? Are you there? Could you direct me to or recommend a hex editor that allows me to both XOR and re-save the file as an .astc file? I can't go any further at the moment.
What do you mean by you couldn't re-save the file by .ASTC extension? If you can File -> Open the file, then you can File -> Save As to re-save it.
Also XOR means this : https://en.wikipedia.org/wiki/Bitwise_operation#XOR
It is the example of decoded files. .PNG is the original file. .PNG.ASTC is the re-saved file. .PNG.ASTC.PNG is the output file by `astcenc` tool from github.
https://cdn.discordapp.com/attachments/1...xample.zip
Here is an example hex editor that also have XOR function. You can see it in action in 10:04 mark. He used Hiew.
- Rufas
P.S. If you are using Windows, make sure you disable that "Hide extensions for known file types" first. Other than that, I have no clue.
https://knowledge.autodesk.com/support/a...ndows.html
Posts: 13
Threads: 0
Joined: Nov 2021
02-22-2023, 06:00 PM
(This post was last modified: 02-22-2023, 06:07 PM by Hollow.)
(12-10-2022, 09:42 PM)rufaswan Wrote: 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
Ok so, I followed these steps and I ran into an issue.
I opened a png file named '1e3b42733ae3dbc38cc643206a9376fd' in the '1e' folder from the assets > release directory in wxHexEditor and deleted the first 16 bytes.
I use XOR on the next 16 bytes, then save the file as .astc.
When I run the command to convert it to PNG, I get a message saying 'ERROR: Unknown compressed input file type'.
What could I be doing wrong? Please bare with me, I am fairly new to this. Perhaps a short video tutorial could be of some use.
By the way, would that same key be used to XOR all the other encrypted images?
Posts: 161
Threads: 4
Joined: Jul 2017
In case you missed it, I already given you an example. You can use it to compare what you got, to see if you done it correctly. So here it is again:
Quote:It is the example of decoded files. .PNG is the original file. .PNG.ASTC is the re-saved file. .PNG.ASTC.PNG is the output file by `astcenc` tool from github.
https://cdn.discordapp.com/attachments/1...xample.zip
Also, from your screenshot, you XOR the whole file instead just the 16 bytes header.
Good luck!
- Rufas
Posts: 13
Threads: 0
Joined: Nov 2021
02-24-2023, 10:36 PM
(This post was last modified: 02-24-2023, 10:37 PM by Hollow.)
(02-24-2023, 09:21 AM)rufaswan Wrote: In case you missed it, I already given you an example. You can use it to compare what you got, to see if you done it correctly. So here it is again:
Quote:It is the example of decoded files. .PNG is the original file. .PNG.ASTC is the re-saved file. .PNG.ASTC.PNG is the output file by `astcenc` tool from github.
https://cdn.discordapp.com/attachments/1...xample.zip
Also, from your screenshot, you XOR the whole file instead just the 16 bytes header.
Good luck!
- Rufas
Sorry, but that wasn't very helpful. I saw the example. I still don't know what went wrong. That hex editor I used seems like it doesn't account for editing a single line of 16 bytes. The other hex editors I have are HxD (doesn't have an XOR function), Hex Editor Neo (doesn't support saving files under different formats properly) and Hiew32 Demo Version (I don't know my way around it.)
What hex editor did you personally use? Honestly a video tutorial for this sort of thing helps for those of us who aren't programmers.
Posts: 34
Threads: 7
Joined: Jun 2021
The English version of the game is released, and I've looked into it's apk, but I can't find the game's graphic data files from that version (though I've already extracted it's app icons). Maybe the files on that version are all encrypted or something...
Posts: 13
Threads: 0
Joined: Nov 2021
(03-02-2023, 03:12 PM)JacintaB2022 Wrote: The English version of the game is released, and I've looked into it's apk, but I can't find the game's graphic data files from that version (though I've already extracted it's app icons). Maybe the files on that version are all encrypted or something...
The files are in the same directory as the Chinese version. The method to decrypt the image files was shared earlier in the thread.
Posts: 17
Threads: 4
Joined: Feb 2019
(02-24-2023, 10:36 PM)Hollow Wrote: (02-24-2023, 09:21 AM)rufaswan Wrote: In case you missed it, I already given you an example. You can use it to compare what you got, to see if you done it correctly. So here it is again:
Quote:It is the example of decoded files. .PNG is the original file. .PNG.ASTC is the re-saved file. .PNG.ASTC.PNG is the output file by `astcenc` tool from github.
https://cdn.discordapp.com/attachments/1...xample.zip
Also, from your screenshot, you XOR the whole file instead just the 16 bytes header.
Good luck!
- Rufas
Sorry, but that wasn't very helpful. I saw the example. I still don't know what went wrong. That hex editor I used seems like it doesn't account for editing a single line of 16 bytes. The other hex editors I have are HxD (doesn't have an XOR function), Hex Editor Neo (doesn't support saving files under different formats properly) and Hiew32 Demo Version (I don't know my way around it.)
What hex editor did you personally use? Honestly a video tutorial for this sort of thing helps for those of us who aren't programmers.
https://www.vg-resource.com/thread-34303...hlight=kof
Replace the first sixteen bytes of the picture file, and use the bms of this post to decrypt it. Before using the bms, modify the export name first, and finally convert the decrypted astc file to png.
Posts: 13
Threads: 0
Joined: Nov 2021
03-06-2023, 10:54 PM
(This post was last modified: 03-07-2023, 01:18 AM by Hollow.)
(03-05-2023, 04:44 PM)bymutou Wrote: (02-24-2023, 10:36 PM)Hollow Wrote: (02-24-2023, 09:21 AM)rufaswan Wrote: In case you missed it, I already given you an example. You can use it to compare what you got, to see if you done it correctly. So here it is again:
Also, from your screenshot, you XOR the whole file instead just the 16 bytes header.
Good luck!
- Rufas
Sorry, but that wasn't very helpful. I saw the example. I still don't know what went wrong. That hex editor I used seems like it doesn't account for editing a single line of 16 bytes. The other hex editors I have are HxD (doesn't have an XOR function), Hex Editor Neo (doesn't support saving files under different formats properly) and Hiew32 Demo Version (I don't know my way around it.)
What hex editor did you personally use? Honestly a video tutorial for this sort of thing helps for those of us who aren't programmers.
https://www.vg-resource.com/thread-34303...hlight=kof
Replace the first sixteen bytes of the picture file, and use the bms of this post to decrypt it. Before using the bms, modify the export name first, and finally convert the decrypted astc file to png.
Thanks for sharing, this helped
Posts: 13
Threads: 0
Joined: Nov 2021
So I've finally managed to decrypt some images:
I've done about 16 images in total, but the process for this is actually quite tedious. Now that we understand how to decrypt them, I have to imagine there is a script or tool that can be made at some point to automate the entire process, from decrypting the image header to converting the astc files to png format. I understand bihaiorg has a tool but there's been no response from him in regards to any updates, even after DM'ing and email. There are 7,646 image files in total, mostly PNG files and some JPG.
Posts: 34
Threads: 7
Joined: Jun 2021
03-07-2023, 04:39 AM
(This post was last modified: 03-07-2023, 04:49 AM by JacintaB2022.)
(03-07-2023, 03:29 AM)Hollow Wrote: So I've finally managed to decrypt some images:
I've done about 16 images in total, but the process for this is actually quite tedious. Now that we understand how to decrypt them, I have to imagine there is a script or tool that can be made at some point to automate the entire process, from decrypting the image header to converting the astc files to png format. I understand bihaiorg has a tool but there's been no response from him in regards to any updates, even after DM'ing and email. There are 7,646 image files in total, mostly PNG files and some JPG.
Judging by the look of these three sample images you've decrypted, two of them are items while the middle one seems to be a Summer variant of Yang. Though i'm unsure if he's an unlockable playable fighter in the game or not, this could mean that there's some planned future (or unused) fighters hiding around inside the game's image files.
Posts: 17
Threads: 4
Joined: Feb 2019
(03-07-2023, 03:29 AM)Hollow Wrote: So I've finally managed to decrypt some images:
I've done about 16 images in total, but the process for this is actually quite tedious. Now that we understand how to decrypt them, I have to imagine there is a script or tool that can be made at some point to automate the entire process, from decrypting the image header to converting the astc files to png format. I understand bihaiorg has a tool but there's been no response from him in regards to any updates, even after DM'ing and email. There are 7,646 image files in total, mostly PNG files and some JPG. Friend, I modified the BMS, and now I do n’t need to replace the first 16 bytes, and then use the ASTCTOPNG.BAT in the bag to convert the decoded ASTC file. Remember to put the three exe of ASTC in the BAT in the same directory in the same directory.
test.zip (Size: 857 bytes / Downloads: 105)
Posts: 13
Threads: 0
Joined: Nov 2021
03-10-2023, 05:15 PM
(This post was last modified: 03-10-2023, 05:20 PM by Hollow.)
(03-09-2023, 03:46 AM)bymutou Wrote: (03-07-2023, 03:29 AM)Hollow Wrote: So I've finally managed to decrypt some images:
I've done about 16 images in total, but the process for this is actually quite tedious. Now that we understand how to decrypt them, I have to imagine there is a script or tool that can be made at some point to automate the entire process, from decrypting the image header to converting the astc files to png format. I understand bihaiorg has a tool but there's been no response from him in regards to any updates, even after DM'ing and email. There are 7,646 image files in total, mostly PNG files and some JPG. Friend, I modified the BMS, and now I do n’t need to replace the first 16 bytes, and then use the ASTCTOPNG.BAT in the bag to convert the decoded ASTC file. Remember to put the three exe of ASTC in the BAT in the same directory in the same directory. This was very helpful, thank you. Do you or anyone else know of a program that can rip individual sprites from these kinds of sheets?
The image I uploaded is rather simple, since I can't go over the 500kb limit, but it's just an example.
Btw, is it possible to make those scripts compatible with .jpg files as well? There are a little over 300 jpg images within the 'release' directory.
Posts: 17
Threads: 4
Joined: Feb 2019
(03-10-2023, 05:15 PM)Hollow Wrote: (03-09-2023, 03:46 AM)bymutou Wrote: (03-07-2023, 03:29 AM)Hollow Wrote: So I've finally managed to decrypt some images:
I've done about 16 images in total, but the process for this is actually quite tedious. Now that we understand how to decrypt them, I have to imagine there is a script or tool that can be made at some point to automate the entire process, from decrypting the image header to converting the astc files to png format. I understand bihaiorg has a tool but there's been no response from him in regards to any updates, even after DM'ing and email. There are 7,646 image files in total, mostly PNG files and some JPG. Friend, I modified the BMS, and now I do n’t need to replace the first 16 bytes, and then use the ASTCTOPNG.BAT in the bag to convert the decoded ASTC file. Remember to put the three exe of ASTC in the BAT in the same directory in the same directory. This was very helpful, thank you. Do you or anyone else know of a program that can rip individual sprites from these kinds of sheets?
The image I uploaded is rather simple, since I can't go over the 500kb limit, but it's just an example.
Btw, is it possible to make those scripts compatible with .jpg files as well? There are a little over 300 jpg images within the 'release' directory.
https://en.esotericsoftware.com/spine-download You can use this software to split sprites,Although the trial version cannot export things, it can be split,Bms scripts also support jpg
Posts: 13
Threads: 0
Joined: Nov 2021
(03-10-2023, 08:40 PM)bymutou Wrote: (03-10-2023, 05:15 PM)Hollow Wrote: (03-09-2023, 03:46 AM)bymutou Wrote: Friend, I modified the BMS, and now I do n’t need to replace the first 16 bytes, and then use the ASTCTOPNG.BAT in the bag to convert the decoded ASTC file. Remember to put the three exe of ASTC in the BAT in the same directory in the same directory. This was very helpful, thank you. Do you or anyone else know of a program that can rip individual sprites from these kinds of sheets?
The image I uploaded is rather simple, since I can't go over the 500kb limit, but it's just an example.
Btw, is it possible to make those scripts compatible with .jpg files as well? There are a little over 300 jpg images within the 'release' directory.
https://en.esotericsoftware.com/spine-download You can use this software to split sprites,Although the trial version cannot export things, it can be split,Bms scripts also support jpg Sorry, I should have specified. The astc encoder tool doesn't support .jpg, the bat file you shared also doesn't support it.
Posts: 17
Threads: 4
Joined: Feb 2019
03-10-2023, 11:09 PM
(This post was last modified: 03-10-2023, 11:12 PM by bymutou.)
(03-10-2023, 09:04 PM)Hollow Wrote: (03-10-2023, 08:40 PM)bymutou Wrote: (03-10-2023, 05:15 PM)Hollow Wrote: This was very helpful, thank you. Do you or anyone else know of a program that can rip individual sprites from these kinds of sheets?
The image I uploaded is rather simple, since I can't go over the 500kb limit, but it's just an example.
Btw, is it possible to make those scripts compatible with .jpg files as well? There are a little over 300 jpg images within the 'release' directory.
https://en.esotericsoftware.com/spine-download You can use this software to split sprites,Although the trial version cannot export things, it can be split,Bms scripts also support jpg Sorry, I should have specified. The astc encoder tool doesn't support .jpg, the bat file you shared also doesn't support it. For jpg files, just modify them according to the picture below
|