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

  • Author
  • Localization

CamC999, posted Fri Dec 02, 2016 3:38 am (19214)


rus_lol_ wrote:
Ember wrote:
Can someone convert png to sc?

i came here with this question.. :cry:


I can't figure it out. If anyone knows, it would be barbossa42 (the creator of dumpsc.py script) or aluigi. It would be incredible if that was possible, because then you can create your own texture packs for clash royale!
  • Replies 239
  • Views 2
  • Created
  • Last Reply

Top Posters In This Topic

  • Author
  • Localization

barbossa42, posted Fri Dec 02, 2016 2:48 pm (19226)


It is VERY unlikely that the client (CR app) would accept modified resource files, since it validates their hash against the server.
Now, if there were some alternative server around, like the Ultrapowa Clash Server, it wouldn't be hard to reverse the process: change the textures, update the texture map if necessary, save a stream of pixels in the correct format, compress with LZMA and remove a part of the header, so the file would behave just like CR's .sc files.
Also, I'm not the creator of dumpsc, just fixed a bug ;-)
  • Author
  • Localization

Ember, posted Fri Dec 02, 2016 7:57 pm (19235)


barbossa42 wrote:
It is VERY unlikely that the client (CR app) would accept modified resource files, since it validates their hash against the server.
Now, if there were some alternative server around, like the Ultrapowa Clash Server, it wouldn't be hard to reverse the process: change the textures, update the texture map if necessary, save a stream of pixels in the correct format, compress with LZMA and remove a part of the header, so the file would behave just like CR's .sc files.
Also, I'm not the creator of dumpsc, just fixed a bug ;-)

But we can change font and sounds ;)
  • Author
  • Localization

CamC999, posted Sat Dec 03, 2016 12:19 am (19239)


barbossa42 wrote:
It is VERY unlikely that the client (CR app) would accept modified resource files, since it validates their hash against the server.
Now, if there were some alternative server around, like the Ultrapowa Clash Server, it wouldn't be hard to reverse the process: change the textures, update the texture map if necessary, save a stream of pixels in the correct format, compress with LZMA and remove a part of the header, so the file would behave just like CR's .sc files.
Also, I'm not the creator of dumpsc, just fixed a bug ;-)


So I found that the .sc files have a fingerprint and hash on them, not allowing you to edit them, however, the _tex.sc files don't. I was able to replace the chr_princess_tex.sc with chr_electro_wiz_tex.sc and it worked using filza on jailbreak. The problem is that the normal .sc files can't be changed, so it ends up trying to perform an animation meant for the princess texture, on the electro wizard, making the textures offset and out of place.

I am trying to find a way to use LZMA and the dumpsc.py script to reencrypt edited .png files that will save them as the correct encrypted .sc files. Do you know enough about the script to reverse the process? :?
  • Author
  • Localization

rus_lol_, posted Sat Dec 03, 2016 6:45 am (19241)


Ember wrote:
rus_lol_ wrote:
Ember wrote:
Can someone convert png to sc?

i came here with this question.. :cry:

?? ?? ?????

??! 8-)
  • Author
  • Localization

barbossa42, posted Mon Dec 05, 2016 12:21 pm (19287)


CamC999 wrote:
So I found that the .sc files have a fingerprint and hash on them, not allowing you to edit them, however, the _tex.sc files don't. I was able to replace the chr_princess_tex.sc with chr_electro_wiz_tex.sc and it worked using filza on jailbreak. The problem is that the normal .sc files can't be changed, so it ends up trying to perform an animation meant for the princess texture, on the electro wizard, making the textures offset and out of place.

I am trying to find a way to use LZMA and the dumpsc.py script to reencrypt edited .png files that will save them as the correct encrypted .sc files. Do you know enough about the script to reverse the process? :?


As I said before, the reverse process is relatively simple. Unfortunately I'm a bit busy at work to code it, but here is an outline:

0- Change your PNG file as wished; to keep it simple, keep the image dimensions the same.

1- Load the image using PIL/pillow, convert it to an 1D array of pixels, encoded as 4 bytes per pixel (RGBA)
2- Write the header:
2.1- byte 0 is 0x01
2.2- bytes 1-4 should be the number of pixels * the number of bytes per pixel (4), little endian notation
2.3- byte 5 should be 0x00
2.4- bytes 6-7 are the image width, little endian
2.5- bytes 8-9 are the image height, little endian

3- Write header image data to a file, compress using LZMA
4- Remove 4 0x00 bytes from position 9 of the compressed file
5- Save as .sc

Some sprite map files have the image pixel format in them, this could probably cause some errors; you would need to note the pixel format of the source image and re-encode the pixels in the original format, but this is outside my knowledge, the instructions above are for RGBA8888. Check the convert_pixel function and reverse the binary operations there.
  • Author
  • Localization

rus_lol_, posted Mon Dec 05, 2016 2:09 pm (19288)


barbossa42 wrote:
CamC999 wrote:
So I found that the .sc files have a fingerprint and hash on them, not allowing you to edit them, however, the _tex.sc files don't. I was able to replace the chr_princess_tex.sc with chr_electro_wiz_tex.sc and it worked using filza on jailbreak. The problem is that the normal .sc files can't be changed, so it ends up trying to perform an animation meant for the princess texture, on the electro wizard, making the textures offset and out of place.

I am trying to find a way to use LZMA and the dumpsc.py script to reencrypt edited .png files that will save them as the correct encrypted .sc files. Do you know enough about the script to reverse the process? :?


As I said before, the reverse process is relatively simple. Unfortunately I'm a bit busy at work to code it, but here is an outline:

0- Change your PNG file as wished; to keep it simple, keep the image dimensions the same.

1- Load the image using PIL/pillow, convert it to an 1D array of pixels, encoded as 4 bytes per pixel (RGBA)
2- Write the header:
2.1- byte 0 is 0x01
2.2- bytes 1-4 should be the number of pixels * the number of bytes per pixel (4), little endian notation
2.3- byte 5 should be 0x00
2.4- bytes 6-7 are the image width, little endian
2.5- bytes 8-9 are the image height, little endian

3- Write header image data to a file, compress using LZMA
4- Remove 4 0x00 bytes from position 9 of the compressed file
5- Save as .sc

Some sprite map files have the image pixel format in them, this could probably cause some errors; you would need to note the pixel format of the source image and re-encode the pixels in the original format, but this is outside my knowledge, the instructions above are for RGBA8888. Check the convert_pixel function and reverse the binary operations there.

Thanks man!but I'd rather wait for the script) :D
  • Author
  • Localization

Ember, posted Tue Dec 06, 2016 12:27 pm (19310)


rus_lol_ wrote:
barbossa42 wrote:
CamC999 wrote:
So I found that the .sc files have a fingerprint and hash on them, not allowing you to edit them, however, the _tex.sc files don't. I was able to replace the chr_princess_tex.sc with chr_electro_wiz_tex.sc and it worked using filza on jailbreak. The problem is that the normal .sc files can't be changed, so it ends up trying to perform an animation meant for the princess texture, on the electro wizard, making the textures offset and out of place.

I am trying to find a way to use LZMA and the dumpsc.py script to reencrypt edited .png files that will save them as the correct encrypted .sc files. Do you know enough about the script to reverse the process? :?


As I said before, the reverse process is relatively simple. Unfortunately I'm a bit busy at work to code it, but here is an outline:

0- Change your PNG file as wished; to keep it simple, keep the image dimensions the same.

1- Load the image using PIL/pillow, convert it to an 1D array of pixels, encoded as 4 bytes per pixel (RGBA)
2- Write the header:
2.1- byte 0 is 0x01
2.2- bytes 1-4 should be the number of pixels * the number of bytes per pixel (4), little endian notation
2.3- byte 5 should be 0x00
2.4- bytes 6-7 are the image width, little endian
2.5- bytes 8-9 are the image height, little endian

3- Write header image data to a file, compress using LZMA
4- Remove 4 0x00 bytes from position 9 of the compressed file
5- Save as .sc

Some sprite map files have the image pixel format in them, this could probably cause some errors; you would need to note the pixel format of the source image and re-encode the pixels in the original format, but this is outside my knowledge, the instructions above are for RGBA8888. Check the convert_pixel function and reverse the binary operations there.

Thanks man!but I'd rather wait for the script) :D

? ?? ???? ?? :?:
  • Author
  • Localization

rus_lol_, posted Thu Dec 08, 2016 6:59 pm (19364)


Well, the script is there?
  • Author
  • Localization

CamC999, posted Fri Dec 09, 2016 11:50 pm (19401)


I Really don't know how to do what barbossa42 said, but I would rather wait for a script. Thanks!
  • Author
  • Localization

CamC999, posted Wed Dec 28, 2016 1:02 am (19805)


The tutorial video for the .sc files decryption is up! https://youtu.be/oqnG9nuDV6I



P.S. : The .csv files decryption video will be posted soon! Subscribe to stay updated.
  • Author
  • Localization

Johnny, posted Sat Jan 07, 2017 3:02 pm (20001)


CamC999 wrote:
The tutorial video for the .sc files decryption is up! https://youtu.be/oqnG9nuDV6I
P.S. : The .csv files decryption video will be posted soon! Subscribe to stay updated.


Unfortunately the video got took down by "Supercell Oy", could you send the vid as an mp4 plz? Thx. (You could also re-upload the video and make it a private vid with only the ppl with the link that can have access to it)
  • Author
  • Localization

imblyzzard, posted Mon Jan 09, 2017 8:52 pm (20041)


CamC999 wrote:
barbossa42 wrote:
It is VERY unlikely that the client (CR app) would accept modified resource files, since it validates their hash against the server.
Now, if there were some alternative server around, like the Ultrapowa Clash Server, it wouldn't be hard to reverse the process: change the textures, update the texture map if necessary, save a stream of pixels in the correct format, compress with LZMA and remove a part of the header, so the file would behave just like CR's .sc files.
Also, I'm not the creator of dumpsc, just fixed a bug ;-)


So I found that the .sc files have a fingerprint and hash on them, not allowing you to edit them, however, the _tex.sc files don't. I was able to replace the chr_princess_tex.sc with chr_electro_wiz_tex.sc and it worked using filza on jailbreak. The problem is that the normal .sc files can't be changed, so it ends up trying to perform an animation meant for the princess texture, on the electro wizard, making the textures offset and out of place.

I am trying to find a way to use LZMA and the dumpsc.py script to reencrypt edited .png files that will save them as the correct encrypted .sc files. Do you know enough about the script to reverse the process? :?


So did you find a script that reverse the process ?
  • Author
  • Localization

imblyzzard, posted Mon Jan 09, 2017 8:54 pm (20042)


barbossa42 wrote:
CamC999 wrote:
So I found that the .sc files have a fingerprint and hash on them, not allowing you to edit them, however, the _tex.sc files don't. I was able to replace the chr_princess_tex.sc with chr_electro_wiz_tex.sc and it worked using filza on jailbreak. The problem is that the normal .sc files can't be changed, so it ends up trying to perform an animation meant for the princess texture, on the electro wizard, making the textures offset and out of place.

I am trying to find a way to use LZMA and the dumpsc.py script to reencrypt edited .png files that will save them as the correct encrypted .sc files. Do you know enough about the script to reverse the process? :?


As I said before, the reverse process is relatively simple. Unfortunately I'm a bit busy at work to code it, but here is an outline:

0- Change your PNG file as wished; to keep it simple, keep the image dimensions the same.

1- Load the image using PIL/pillow, convert it to an 1D array of pixels, encoded as 4 bytes per pixel (RGBA)
2- Write the header:
2.1- byte 0 is 0x01
2.2- bytes 1-4 should be the number of pixels * the number of bytes per pixel (4), little endian notation
2.3- byte 5 should be 0x00
2.4- bytes 6-7 are the image width, little endian
2.5- bytes 8-9 are the image height, little endian

3- Write header image data to a file, compress using LZMA
4- Remove 4 0x00 bytes from position 9 of the compressed file
5- Save as .sc

Some sprite map files have the image pixel format in them, this could probably cause some errors; you would need to note the pixel format of the source image and re-encode the pixels in the original format, but this is outside my knowledge, the instructions above are for RGBA8888. Check the convert_pixel function and reverse the binary operations there.


So did you find a script that convert png files to correct sc files ?
  • Author
  • Localization

YohanIsHere, posted Tue Jan 10, 2017 1:09 am (20047)


CamC999 wrote:
Okay so i did everything barbossa42 said and i get this error:

C:\Users\cam\Desktop\sc>for %v in (*_tex.sc) do python dumpsc.py %v

C:\Users\cam\Desktop\sc>python dumpsc.py arena_training_tex.sc
Traceback (most recent call last):
File "dumpsc.py", line 6, in
from PIL import Image
ImportError: No module named 'PIL'

It also does this for every SC file in the folder ending in _tex.sc

UPDATE: I was able to fix the issue by installing "pillow" for python (The link can be found here: https://pypi.python.org/pypi/Pillow/3.4.2#downloads)

ALSO: I was able to find all of the images by fixing the problem above! thank you everyone!

P.S. I can share the audio and images with any of you on google drive if you want :lol:

Here are some sample files!

ui_spells_tex_.png

chr_electro_wizard_tex.png

ui_spells_tex.png

YES Can you pleassee share the files with me. my email is [email protected]
  • Author
  • Localization

CamC999, posted Wed Jan 11, 2017 5:17 am (20070)


Johnny wrote:
CamC999 wrote:
The tutorial video for the .sc files decryption is up! https://youtu.be/oqnG9nuDV6I
P.S. : The .csv files decryption video will be posted soon! Subscribe to stay updated.


Unfortunately the video got took down by "Supercell Oy", could you send the vid as an mp4 plz? Thx. (You could also re-upload the video and make it a private vid with only the ppl with the link that can have access to it)


Yes, fortunately I do have it on my drive and this is the link: https://drive.google.com/open?id=0Bzh5n ... m1pdTJ2RlU

I guess it would be better to just also do this for the upcoming .csv decryption tutorial :D
  • Author
  • Localization

CamC999, posted Wed Jan 11, 2017 5:23 am (20071)


YohanIsHere wrote:
CamC999 wrote:
Okay so i did everything barbossa42 said and i get this error:

C:\Users\cam\Desktop\sc>for %v in (*_tex.sc) do python dumpsc.py %v

C:\Users\cam\Desktop\sc>python dumpsc.py arena_training_tex.sc
Traceback (most recent call last):
File "dumpsc.py", line 6, in
from PIL import Image
ImportError: No module named 'PIL'

It also does this for every SC file in the folder ending in _tex.sc

UPDATE: I was able to fix the issue by installing "pillow" for python (The link can be found here: https://pypi.python.org/pypi/Pillow/3.4.2#downloads)

ALSO: I was able to find all of the images by fixing the problem above! thank you everyone!

P.S. I can share the audio and images with any of you on google drive if you want :lol:

Here are some sample files!

ui_spells_tex_.png

chr_electro_wizard_tex.png

ui_spells_tex.png

YES Can you pleassee share the files with me. my email is [email protected]


Yes I have just shared the .png files with you as of now :D
  • Author
  • Localization

imblyzzard, posted Wed Jan 11, 2017 6:20 am (20072)


CamC999 wrote:
YohanIsHere wrote:
CamC999 wrote:
Okay so i did everything barbossa42 said and i get this error:

C:\Users\cam\Desktop\sc>for %v in (*_tex.sc) do python dumpsc.py %v

C:\Users\cam\Desktop\sc>python dumpsc.py arena_training_tex.sc
Traceback (most recent call last):
File "dumpsc.py", line 6, in
from PIL import Image
ImportError: No module named 'PIL'

It also does this for every SC file in the folder ending in _tex.sc

UPDATE: I was able to fix the issue by installing "pillow" for python (The link can be found here: https://pypi.python.org/pypi/Pillow/3.4.2#downloads)

ALSO: I was able to find all of the images by fixing the problem above! thank you everyone!

P.S. I can share the audio and images with any of you on google drive if you want :lol:

Here are some sample files!

ui_spells_tex_.png

chr_electro_wizard_tex.png

ui_spells_tex.png

YES Can you pleassee share the files with me. my email is [email protected]


Yes I have just shared the .png files with you as of now :D

Hi, did u find a script that reverse the process ?
  • Author
  • Localization

CamC999, posted Thu Jan 12, 2017 12:45 am (20085)


imblyzzard wrote:
CamC999 wrote:
YohanIsHere wrote:
YES Can you pleassee share the files with me. my email is [email protected]


Yes I have just shared the .png files with you as of now :D

Hi, did u find a script that reverse the process ?


Umm... unfortunatley I have not found a script to reverse the process. I have been working on it for a very long time, but if anyone can do it, i would say Barbossa42 could, but he doesn't appear to go on this forum anymore :(
  • Author
  • Localization

imblyzzard, posted Thu Jan 12, 2017 6:15 am (20086)


CamC999 wrote:
imblyzzard wrote:
CamC999 wrote:

Yes I have just shared the .png files with you as of now :D

Hi, did u find a script that reverse the process ?


Umm... unfortunatley I have not found a script to reverse the process. I have been working on it for a very long time, but if anyone can do it, i would say Barbossa42 could, but he doesn't appear to go on this forum anymore :(


Oh ok. I thank u for the work you realize (srry for my bad english). I'm still looking for reverse the process but its hard. There is a forum on ultrapowa.com/forum where a guy post a script to convert _tex.sc to png on december 2. He says that he works on that to. Same with knobse (on the same forum).
But if someone trying and do it, that could be awesome !
Thanks for you reply
Bye
  • Author
  • Localization

barbossa42, posted Thu Jan 12, 2017 2:36 pm (20092)


Hi guys.
I'm quite busy at work for some time now, so working on this script is being really hard. Also, my phone is not rooted right now (and I'll have to keep it like that for some time), so I can't really test if _tex.sc replacement will work.
I'll try to come up with something on the next week or so, but don't count on it.
And yes, I'll still follow this topic =)
  • Author
  • Localization

imblyzzard, posted Thu Jan 12, 2017 3:35 pm (20093)


barbossa42 wrote:
Hi guys.
I'm quite busy at work for some time now, so working on this script is being really hard. Also, my phone is not rooted right now (and I'll have to keep it like that for some time), so I can't really test if _tex.sc replacement will work.
I'll try to come up with something on the next week or so, but don't count on it.
And yes, I'll still follow this topic =)


Ok great man good luck ;)
  • Author
  • Localization

imblyzzard, posted Thu Jan 12, 2017 4:01 pm (20094)


imblyzzard wrote:
barbossa42 wrote:
Hi guys.
I'm quite busy at work for some time now, so working on this script is being really hard. Also, my phone is not rooted right now (and I'll have to keep it like that for some time), so I can't really test if _tex.sc replacement will work.
I'll try to come up with something on the next week or so, but don't count on it.
And yes, I'll still follow this topic =)


Ok great man good luck ;) on my side i will try to create a new fingerprint.json or something like that. If i succeed, we wont need to convert png to sc and that could be convenient. Sorry for my bad english one more time :lol: bye
  • Author
  • Localization

CamC999, posted Fri Jan 13, 2017 12:54 am (20107)


imblyzzard wrote:
imblyzzard wrote:
barbossa42 wrote:
Hi guys.
I'm quite busy at work for some time now, so working on this script is being really hard. Also, my phone is not rooted right now (and I'll have to keep it like that for some time), so I can't really test if _tex.sc replacement will work.
I'll try to come up with something on the next week or so, but don't count on it.
And yes, I'll still follow this topic =)


Ok great man good luck ;) on my side i will try to create a new fingerprint.json or something like that. If i succeed, we wont need to convert png to sc and that could be convenient. Sorry for my bad english one more time :lol: bye


I already know that fingerprint.json already has a fingerprint on it, preventing you from being able to change the .sc in any way. HOWEVER, the files that are _tex.sc can be altered. I have tested this by deleting the chr_princess_tex.sc file and duplicating the chr_goblin_blowdart and renaming back to "chr_princess_tex.sc"

This makes it so that the princess has the texture of the dart goblin, but since the normal .sc files control the hitboxes and animations, the troop's texture is offset, and this can't be changed because it is controlled by the fingerprint.json
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.