ZenHAX

Free Game Research Forum | Official QuickBMS support | twitter @zenhax | SSL HTTPS://zenhax.com
It is currently Thu Dec 14, 2017 6:08 am

All times are UTC




Post new topic  Reply to topic  [ 230 posts ]  Go to page Previous 17 8 9 10 11 12 Next
Author Message
PostPosted: Tue Apr 25, 2017 5:14 am 

Joined: Tue Apr 25, 2017 4:53 am
Posts: 1
I'm trying to use the dumpsc.py script on the latest APK for Clash of Clans (com.supercell.clashofclans_v8.709.24-844_Android-4.0.3.apk) to try and extract ui_tex.sc, and it is failing with the following message:
Quote:
$ python3.5 ~/dumpsc.py ui_tex.sc
ui_tex.sc
Traceback (most recent call last):
File "/home/eric/dumpsc.py", line 129, in <module>
process_sc(baseName, data[26:], path)
File "/home/eric/dumpsc.py", line 52, in process_sc
decompressed = lzma.LZMADecompressor().decompress(data)
_lzma.LZMAError: Input format not supported by decoder

But, it does work on some of the other files (info_babydragon_tex.sc for example).

I'll attach a ZIP containing the offending file. Can anybody help me extract the assets from it and convert them to PNG? It would be a bonus if the appropriate graphics could be extracted individually (with the polygons masked out, etc.), but I'll do that work manually if I have to.

EDIT: I tried the "Magic Editor" in the previous thread (in a VM of course), and it seems to work: it offers much more functionality than dumpsc.py including the ability to parse the information (the regular .sc file that ISN'T _tex.sc) about polygons and export resources and so on. However, it fails on the above files as well.

EDIT #2: I have come to the conclusion that it is simply a decompression problem--it seems that Supercell has switched to LZHAM compression, and I've downloaded the source code from richgel999's GitHub and compiled a test application, applied the header corrections from dumpsc.py to the target file (along with changing the first four bytes to 'LZH0') and I have successfully decompressed ui_tex.sc. I will post more information as I come across it.

EDIT #3: Success WITH BOTH FILES! I chopped the first 26 bytes from the beginning of each and added 4 bytes of 0x00 at position 9 (thanks for that info, dumpsc.py), altered the first four bytes to read "LZH0" in ASCII, ran them through the LZHAM test program which I compiled on Ubuntu 17.04 to decompress them without a problem, then loaded up the uncompressed files in Barbarianland's Magic Editor. The results are extremely satisfying. I can directly export any UI asset in the game, with full polygon, masking, and alpha channel support. It makes my custom Discord emojis look dope. Here's a screenshot for the curious:
Image

Thanks to @aluigi, @barbossa42, and @Mr Hacker for helping me make this happen. If/when I publish this amateur fankit (don't want to run into Supercell's legal teams... :D), I'll post a link here.


Attachments:
ui_tex.zip [3.92 MiB]
Downloaded 228 times
Top
   
PostPosted: Wed Apr 26, 2017 3:50 pm 

Joined: Tue Jan 17, 2017 6:30 pm
Posts: 33
eslindsey wrote:
I'm trying to use the dumpsc.py script on the latest APK for Clash of Clans (com.supercell.clashofclans_v8.709.24-844_Android-4.0.3.apk) to try and extract ui_tex.sc, and it is failing with the following message:
Quote:
$ python3.5 ~/dumpsc.py ui_tex.sc
ui_tex.sc
Traceback (most recent call last):
File "/home/eric/dumpsc.py", line 129, in <module>
process_sc(baseName, data[26:], path)
File "/home/eric/dumpsc.py", line 52, in process_sc
decompressed = lzma.LZMADecompressor().decompress(data)
_lzma.LZMAError: Input format not supported by decoder

But, it does work on some of the other files (info_babydragon_tex.sc for example).

I'll attach a ZIP containing the offending file. Can anybody help me extract the assets from it and convert them to PNG? It would be a bonus if the appropriate graphics could be extracted individually (with the polygons masked out, etc.), but I'll do that work manually if I have to.

EDIT: I tried the "Magic Editor" in the previous thread (in a VM of course), and it seems to work: it offers much more functionality than dumpsc.py including the ability to parse the information (the regular .sc file that ISN'T _tex.sc) about polygons and export resources and so on. However, it fails on the above files as well.

EDIT #2: I have come to the conclusion that it is simply a decompression problem--it seems that Supercell has switched to LZHAM compression, and I've downloaded the source code from richgel999's GitHub and compiled a test application, applied the header corrections from dumpsc.py to the target file (along with changing the first four bytes to 'LZH0') and I have successfully decompressed ui_tex.sc. I will post more information as I come across it.

EDIT #3: Success WITH BOTH FILES! I chopped the first 26 bytes from the beginning of each and added 4 bytes of 0x00 at position 9 (thanks for that info, dumpsc.py), altered the first four bytes to read "LZH0" in ASCII, ran them through the LZHAM test program which I compiled on Ubuntu 17.04 to decompress them without a problem, then loaded up the uncompressed files in Barbarianland's Magic Editor. The results are extremely satisfying. I can directly export any UI asset in the game, with full polygon, masking, and alpha channel support. It makes my custom Discord emojis look dope. Here's a screenshot for the curious:
Image

Thanks to @aluigi, @barbossa42, and @Mr Hacker for helping me make this happen. If/when I publish this amateur fankit (don't want to run into Supercell's legal teams... :D), I'll post a link here.


You're problem is lzma decompression for ui_tex ( i don't really understand all) ?


Top
   
PostPosted: Sun Apr 30, 2017 1:22 pm 

Joined: Sun Apr 30, 2017 1:20 pm
Posts: 5
Can QuickBms Encrypt the sc files?


Top
   
PostPosted: Sun Apr 30, 2017 2:47 pm 

Joined: Tue Jan 17, 2017 6:30 pm
Posts: 33
CookieKing24 wrote:
Can QuickBms Encrypt the sc files?

I think No


Top
   
PostPosted: Sun Apr 30, 2017 2:51 pm 

Joined: Sun Apr 30, 2017 1:20 pm
Posts: 5
oh ok


Top
   
PostPosted: Sun Apr 30, 2017 2:52 pm 

Joined: Sun Apr 30, 2017 1:20 pm
Posts: 5
but do you know how to encrypt a sc file?


Top
   
PostPosted: Sun Apr 30, 2017 8:08 pm 

Joined: Tue Jan 17, 2017 6:30 pm
Posts: 33
CookieKing24 wrote:
but do you know how to encrypt a sc file?

Yeah that's pretty easy for Clash Royale sc , for some COC Sc this is a little bit more difficult (LZHAM compression)


Top
   
PostPosted: Sun Apr 30, 2017 8:10 pm 

Joined: Tue Jan 17, 2017 6:30 pm
Posts: 33
CookieKing24 wrote:
but do you know how to encrypt a sc file?

But do you mean re-encrypt tex.sc(Png -> Tex.sc) or just recompress with LZMÀ


Top
   
PostPosted: Sun Apr 30, 2017 10:01 pm 

Joined: Sun Apr 30, 2017 1:20 pm
Posts: 5
Yes thats What i mean


Top
   
PostPosted: Fri May 12, 2017 1:09 pm 

Joined: Mon Feb 20, 2017 6:05 pm
Posts: 12
Greetings, members of the forum! I was able to convert sc to png and vice versa png to sc. Only now there was one problem: when I put the edited files in the application, it crashes when opened. How then do I replace the original with a fake?


Top
   
PostPosted: Fri May 12, 2017 5:32 pm 

Joined: Sun Jan 15, 2017 7:32 pm
Posts: 10
Ahah so you failed, is your application crash because of the new texture or because you forgot to sign it ?


Top
   
PostPosted: Sat May 13, 2017 10:39 am 

Joined: Mon Feb 20, 2017 6:05 pm
Posts: 12
Moon Arts wrote:
Ahah so you failed, is your application crash because of the new texture or because you forgot to sign it ?

App crash because i load a new tex to apk with WinRar & with program for mobile "Apk editor".


Top
   
PostPosted: Sat May 13, 2017 10:41 am 

Joined: Mon Feb 20, 2017 6:05 pm
Posts: 12
Moon Arts wrote:
Ahah so you failed, is your application crash because of the new texture or because you forgot to sign it ?

How I can load my own texture?


Top
   
PostPosted: Sat May 13, 2017 1:31 pm 

Joined: Tue Jan 17, 2017 6:30 pm
Posts: 33
peacemaker_of_war wrote:
Moon Arts wrote:
Ahah so you failed, is your application crash because of the new texture or because you forgot to sign it ?

How I can load my own texture?

After re-build your APK with modded texture have you re-sign it ?


Top
   
PostPosted: Sun May 14, 2017 6:35 pm 

Joined: Mon Feb 20, 2017 6:05 pm
Posts: 12
GaLaXy1036 wrote:
peacemaker_of_war wrote:
Moon Arts wrote:
Ahah so you failed, is your application crash because of the new texture or because you forgot to sign it ?

How I can load my own texture?

After re-build your APK with modded texture have you re-sign it ?

How to sign it?


Speak directly, how do I embed the texture in the application, sign it and run it without crashing?


Top
   
PostPosted: Mon May 15, 2017 5:06 am 

Joined: Tue Jan 17, 2017 6:30 pm
Posts: 33
Quote:
Speak directly, how do I embed the texture in the application, sign it and run it without crashing?

Just sign it with ApkTool Advanced by bdfreak, But i think you decompile the application dont do that just open it with 7zip or winrar and drop your modded texture in sc directory


Top
   
PostPosted: Mon May 15, 2017 6:58 pm 

Joined: Mon Feb 20, 2017 6:05 pm
Posts: 12
GaLaXy1036 wrote:
Quote:
Speak directly, how do I embed the texture in the application, sign it and run it without crashing?

Just sign it with ApkTool Advanced by bdfreak, But i think you decompile the application dont do that just open it with 7zip or winrar and drop your modded texture in sc directory

I don't know how to use this program


Top
   
PostPosted: Tue May 16, 2017 5:03 pm 

Joined: Sun Jan 15, 2017 7:32 pm
Posts: 10
Dude, you need to learn by yourself, stop asking for everything


Top
   
PostPosted: Thu May 18, 2017 11:52 am 

Joined: Thu May 18, 2017 11:50 am
Posts: 1
Watch this
https://youtu.be/Y6yl7nZRI-8


Before supercell makes it down


Top
   
PostPosted: Sat May 20, 2017 8:20 am 

Joined: Mon Jan 09, 2017 8:50 pm
Posts: 28
DARK DYNAMO wrote:
Watch this
https://youtu.be/Y6yl7nZRI-8


Before supercell makes it down


Remove it plz


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 230 posts ]  Go to page Previous 17 8 9 10 11 12 Next

All times are UTC


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Limited