Skip to content
View in the app

A better way to browse. Learn more.

ResHax

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.
Help us keep the site running.

Clash Royale .sc files decrypt

Featured Replies

  • Replies 239
  • Views 1
  • Created
  • Last Reply

Top Posters In This Topic

  • Author
  • Localization

iCraftHD, posted Wed Apr 27, 2016 9:26 am (12912)


Hi, i'm new in this site and my english is very bad eheh...
I've a question: can you decrypt .sc files from clash royale game?
Example: chr_giant.sc
Download: https://mega.nz/#!b4VFgASb
Thanks a lot!
  • Author
  • Localization

aluigi, posted Wed Apr 27, 2016 10:27 am (12913)


Have you already checked this thread?
viewtopic.php?t=2186

There is a script but the compressed files are extracted "as-is" without decompression (unknown algorithm).
  • Author
  • Localization

iCraftHD, posted Sun May 01, 2016 12:42 pm (13016)


aluigi wrote:
Have you already checked this thread?
viewtopic.php?t=2186

There is a script but the compressed files are extracted "as-is" without decompression (unknown algorithm).

Hi Aluigi, i read this thread, but i don't understand how to use the script. I'm really ignorant in this
  • Author
  • Localization

aluigi, posted Sun May 01, 2016 1:51 pm (13017)


It's a script for quickbms, you can find the tool here:
http://quickbms.aluigi.org

launch quickbms.exe, select the script, select the sc archive and then the output folder where extracting the files.
  • Author
  • Localization

iCraftHD, posted Sun May 01, 2016 2:31 pm (13020)


I did it! Thanks. Now i have to find a way to open the file
  • Author
  • Localization

minhkhoant, posted Thu May 05, 2016 12:50 am (13107)


How to decrypt clash of clans _tex.sc?it not as clash royale _tex
.sc!
  • Author
  • Localization

aluigi, posted Thu May 05, 2016 7:32 am (13112)


Have you tried the script in that other thread?
If it doesn't work then upload that file.
  • Author
  • Localization

aluigi, posted Mon May 09, 2016 6:15 am (13227)


There is no solution for the SCLZ files.
I think they are compressed but I guess I already tried to scan them (which is not easy since they don't contain textual strings to guess what compression is correct).
  • Author
  • Localization

midler, posted Mon May 09, 2016 9:52 am (13230)


Hello, folks!
I want to "import" village to ultrapowa from original Clash Of Clans game. I have discovered that when I enter someone's base, android creates 4 files in data - chache:
name size
background_player.info 1kb
background_player.sc 1kb
background_player_tex.info 1kb
background_player_tex.sc 10 582 kb

background_player_tex.sc is 10 mb. I think it's texture files and I don't need it. background_player.sc seems to be objects location of village (I think) that I need. Maybe I am wrong and village information is in .info file.

Here are my files -
https://mega.nz/#!5YYnEARJ!BropWWdmQi4A ... ovWE6XnJVU

Any information will be helpful
Thanks.
  • Author
  • Localization

aluigi, posted Tue Oct 18, 2016 5:51 am (18143)


Script 0.2 :D
  • Author
  • Localization

barbossa42, posted Thu Oct 20, 2016 1:59 pm (18181)


Hi there!
I'm a sucker for pattern searching (and for Clash Royale too), so I got instantly hooked on decoding these files.

First: as for the images, this script can extract them all: https://github.com/123456abcdef/cr-sc-dump/

Second: even with the new script version, some sc files can't be extracted, namely the attached list. They exit with the error below:
Code:
- open script clash_royale.bms
- set output folder 1.5.0\error\sc

  offset   filesize   filename
--------------------------------------
  00000023 36034      building_mega_bomb

Error: the compressed LZMA input is wrong or incomplete (0)
Info:  algorithm   445
       offset      00000023
       input size  0x000017c5 6085
       output size 0x00008cc2 36034
       result      0xffffff9c -100

Error: the uncompressed data (-100) is bigger than the allocated buffer (36034)

Last script line before the error or that produced the error:
  28  clog NAME OFFSET SIZE XSIZE


Third: now this is what you guys were waiting for. With the .sc files that quickBMS could extract, I googled for their headers and found nothing useful. So I dug Notepad and an hex editor plugin and started researching the binaries for patterns and such. I focused on ui_spells.sc (the card's pictures on your card collection), because it's a neat grid and patterns would emerge quickly. Among the text strings inside I found "atlasgenerator_texture_rgba5656", which could be a clue, but Google doesn't know much about it. This is what I found so far (addresses are in hex):
  1. numbers are INT16 Little Endian: first byte is the least significative part, second byte is the most significative. So a pair e6 03 is 998, not 58883.
  2. 00-01 - total number of effective sprites mapped in the file
  3. 02-10 - ??
  4. 11-12 - number of IDs/strings (these are mentioned in the CSV files)
  5. 13-xx - a list of IDs for each string, 2 bytes each
  6. a list of strings. Each is preceded by a byte with the string's legth.
  7. 17 00 00 00 00 1A 00 00 00 00 (constant?)
  8. block(s) of 10 bytes, starting with 01 05, one for each image mapped in this file. The image extracting script appends an "_" on the filename for each image on the same _tex.sc file. The last 4 bytes are the image's width and height
  9. blocks starting with byte 12, one for each sprite: these map the sprites on the image, and vary in size. These have 5 '00' bytes between blocks.
    1. 12
    2. 2 bytes: length of the block
    3. 00 00
    4. 2 bytes: sprite ID (not the same as string ID, but they're associated later)
    5. (lots of bytes to decode)
    6. for static, rectangular images: final 16 bytes are the coordinates (xy) of the 4 corners, normalized between 0000 and FFFF. Just multiply by (image_dimension/65535)
  10. blocks starting with byte 08, not sure how many, not sure what they are, same size rule as 12-blocks. These have 5 '00' bytes between blocks.
  11. blocks starting with byte 09, not sure how many, not sure what they are, same size rule as 12-blocks. These have 5 '00' bytes between blocks.
  12. blocks starting with byte 0C, one for each string, same size rule as 12-blocks. Bytes 5-6 are the same IDs from address 13 onwards, bytes 22-23 are the IDs on the sprite blocks. These have 5 '00' bytes between blocks.

Again, this is based on a study of ui_spells.sc, which are static and mostly rectangular images (legendary cards are hexagonal and their 12-blocks are structured differently). In time I'll try to get some sense off of the animated ones. Any constructive feedback is appreciated.
  • Author
  • Localization

aluigi, posted Thu Oct 20, 2016 2:31 pm (18182)


Can you upload building_mega_bomb.sc?
  • Author
  • Localization

aluigi, posted Thu Oct 20, 2016 3:07 pm (18183)


The following are the LZHAM parameters adopted by the SCLZ archives, in case someone is interested:
Code:
m_dict_size_log2 18
m_decompress_flags 0
m_table_update_rate 8
m_table_max_update_interval 0
m_table_update_interval_slow_rate 0
  • Author
  • Localization

barbossa42, posted Thu Oct 20, 2016 3:24 pm (18184)


There, all .sc files that couldn't be extracted.
  • Author
  • Localization

aluigi, posted Thu Oct 20, 2016 3:29 pm (18185)


Script 0.2.1 :D
  • Author
  • Localization

barbossa42, posted Thu Oct 20, 2016 4:43 pm (18187)


Thanks a lot!
Going back to research now... I wonder if I can make some cool animated GIFs out of those sprites :lol:
  • Author
  • Localization

milanmaldini, posted Tue Oct 25, 2016 2:20 pm (18331)


aluigi wrote:
Script 0.2.1 :D


hi aluigi
I have tried your script and get one file.

How I can use this tool to get *.png files?

Thank you.
  • Author
  • Localization

Johnny, posted Fri Oct 28, 2016 10:03 am (18419)


barbossa42 wrote:
Hi there!
I'm a sucker for pattern searching (and for Clash Royale too), so I got instantly hooked on decoding these files.

First: as for the images, this script can extract them all: https://github.com/123456abcdef/cr-sc-dump/


Hey barbossa42, I was wondering if you could explain to me this step of the github link:

2. Install pyliblzma with:
python -m pip install pyliblzma

3. Install Pillow with:
python -m pip install Pillow

I don't understand how you can install pylibzma just by using this code. Bc when i type it on python it says: SyntaxError invalid syntax

Thx so much !(I'm sorry if this is obvious, im just a noob. I just want some good clash royale high rez pics)
  • Author
  • Localization

aluigi, posted Fri Oct 28, 2016 2:48 pm (18425)


@milanmaldini
Unfortunately I worked only on the script, I can't help with the content of the extracted data

@Johnny
The syntax of the commands reported on that link is correct but pyliblzma is an obsolete package of 6 years ago that can't be installed on Windows by default ("close_fds is not supported on Windows ").
Just my 2 cents in case you get no answer from the other user.
  • Author
  • Localization

Johnny, posted Sat Oct 29, 2016 11:33 am (18446)


aluigi wrote:
@Johnny
The syntax of the commands reported on that link is correct but pyliblzma is an obsolete package of 6 years ago that can't be installed on Windows by default ("close_fds is not supported on Windows ").
Just my 2 cents in case you get no answer from the other user.


Damn i thought i was just not reading the instructions right
Thx aluigi
  • Author
  • Localization

barbossa42, posted Mon Oct 31, 2016 11:47 am (18499)


I remember having some trouble with pyliblzma too, but can't remember how I solved it =(
If you have any info, please share here or open an issue on Github.
  • Author
  • Localization

Johnny, posted Sat Nov 05, 2016 3:06 pm (18585)


I found something interesting in the clash royale reddit. Can someone tell me what the guy did or about the software(s) he used bc it seems like he found a way to do it. Thx

Link:
https://www.reddit.com/r/ClashRoyale/co ... zard_card/
The image:
http://i.imgur.com/YGlx1kt.png

(I can see he has bluestacks and microsoft visual studios express open as well as this thing called "GL - Kosmos")
  • Author
  • Localization

barbossa42, posted Tue Nov 08, 2016 11:29 am (18650)


GL Kosmos looks like something the author built with Visual Studio... The spritesheets and strings are extractable already, so nothing new there.
I'm currently working on the .sc files and started a wiki on GitHub, any help is appreciated: https://github.com/umop-aplsdn/sc_decode/wiki
Also:
Image
Guest
This topic is now closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.