Git Product home page Git Product logo

Comments (17)

123456abcdef avatar 123456abcdef commented on June 9, 2024

Decompressing works the same, but fileType 28 is new. I compaired an old tex.sc wih a new one. It seems, like you said already, that the pixels itself are stored the same way (colors are still correct), but they are ordered different.
Not sure when and if I will fix this script for the new version :P.

from cr-sc-dump.

milanmaldini avatar milanmaldini commented on June 9, 2024

what about clash of clans tex file? Is that can decompressing?

from cr-sc-dump.

123456abcdef avatar 123456abcdef commented on June 9, 2024

CoC uses LZHAM, I think, and I don't know how to adjust the header to be able to decompress the files. Last time I check (a few month ago) you could get the decompressed files from the cache folder inside your CoC installation path and could extract the images using this script. But I guess Supercell did the same changes to CoC's tex files like they did in CR.

from cr-sc-dump.

fpvolquind avatar fpvolquind commented on June 9, 2024

Hi!
This is the garbled image structure (tested with an image with width of 186 (chr_balloon_tex)):

pixels 0 to 31 (32 pixels) = pixels 0 to 31 of line 0 of final image
pixels 32 to 63 = pixels 0 to 31 of line 1 of final image
...
pixels 992 to 1023 = pixels 0 to 31 of line 31 of final image
pixels 1024 to 1055 = pixels 32 to 63 of line 0 of final image
...
pixels 2048 to 2079 = pixels 64 to 95 of line 0 of final image
...
...
pixels 5088 to 5119 = pixels 128 to 159 of line 31 of final image
pixels 5120 to 5145 (26 pixels = (width - (floor(width/32) * 32))) = pixels 160 to 185 of line 0 of final image
pixels 5146 to 5171 (26 pixels) = pixels 160 to 185 of line 1 of final image
...
pixels 5926 to 5951 = pixels 160 to 185 of line 31 of final image
pixels 5952 to 5983 (32 pixels) = pixels 0 to 31 of line 32 of final image
...
etc.

I'm currently testing with other images to check how it behaves at the end (chr_balloon_tex is all transparent pixels at the end).

from cr-sc-dump.

fpvolquind avatar fpvolquind commented on June 9, 2024

Tested with level_goblin_arena_tex.
If there are less than 32 lines remaining, use this number instead of 32 to iterate through the remaining 32-pixels blocks and rebuild the final lines.

from cr-sc-dump.

srabouin avatar srabouin commented on June 9, 2024

@fpvolquind did you end up writing the code for this? you should submit a pull request :)

from cr-sc-dump.

fpvolquind avatar fpvolquind commented on June 9, 2024

Well, I wrote the code, but in another language. I'm not so great with python, but I'll give a shot.

from cr-sc-dump.

srabouin avatar srabouin commented on June 9, 2024

Can you paste the logic from whatever other language, I can also give it a shot

from cr-sc-dump.

fpvolquind avatar fpvolquind commented on June 9, 2024

Ugly as hell, but works. Just ran through all _tex.sc files, no garbled images.

from cr-sc-dump.

srabouin avatar srabouin commented on June 9, 2024

Tested in a few files and worked great, thank you @fpvolquind great work!

from cr-sc-dump.

fpvolquind avatar fpvolquind commented on June 9, 2024

You're welcome. Glad to help the community =)

from cr-sc-dump.

srabouin avatar srabouin commented on June 9, 2024

Hate to put that here, but any advice on getting the contents of the .sc file? like ui.sc contains all the clan badges -- it would be interesting to decode it?

from cr-sc-dump.

fpvolquind avatar fpvolquind commented on June 9, 2024

Yes, decoding the .sc files would be great, I'd love to have the animated sprites. The files are LZMA-compressed, similar to the _tex.sc files. There is a script around for QuickBMS that can decompress most of them. I couldn't get much sense out of the decompressed files yet, but they are some sort of texture atlas. I'll try looking at ui_spells to try and get some sense of the data.

from cr-sc-dump.

srabouin avatar srabouin commented on June 9, 2024

Looking at the clan badges csv, it looks like all the badges are in the ui.sc file -- using the bms script i can see all the file names in there too now, so at least getting somewhere... thanks for that!

http://aluigi.altervista.org/bms/clash_royale.bms

from cr-sc-dump.

fpvolquind avatar fpvolquind commented on June 9, 2024

Posted what I found here: http://zenhax.com/viewtopic.php?f=9&t=2369&p=18181

from cr-sc-dump.

srabouin avatar srabouin commented on June 9, 2024

@umop-aplsdn did you have any progress? I just thought of something, maybe they're using the unity3d sprite packer since it's the engine used for the game. Something else to play with maybe :)

https://docs.unity3d.com/Manual/SpritePacker.html

from cr-sc-dump.

fpvolquind avatar fpvolquind commented on June 9, 2024

Check out my repository, just updated my script.
AFAIK, Supercell uses it's own game engine. I couldn't find any sample Unity texture atlas to compare with the sc files.

from cr-sc-dump.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.