How to find decryption key for cocos2djs

Rarely seen games based on cocos2djs, the game is compiled and encrypted to .jsc files. I think Cocos2d would come out encrypted by default with it’s hardcoded key. Finding decryption key is pretty easy

This is not for all cocos2djs games. Some games may hide the decryption key, making it hard to find, so you would need to reverse deeper and debug it

Let’s get started!

In this tutorial, I use this game Download LifeSimulator - Chinese Life APK for Android (Free)

Extract jsc files from assets folder of APK file

Now we gonna look after the key

Method 1: Hex editor
Use any hex eidtor that support string search. I use 010 editor

Search for jsb-adapter, jsb-builtin.js or main.js

The key should be located between Game. and .jsb-adapter . In my case the key is e07a4d47-b82e-4f

1626710532908.png

If it’s blank like this, or you can’t find the key, it must have been encoded or encrypted. Use IDA Pro instead

1626710651495.png

Method 2: IDA Pro
It is highly recommended to use IDA Pro 7.5 and later which can display string correctly. Older version may not be able to display string correctly

I WILL NOT SHARE LINK TO IDA PRO. HOWEVER IT IS EASIER TO FIND IF YOU USE BRAVE OR DUCKDUCKGO SEARCH

Load the libcoco2djs.so to IDA Pro

Search for AppDelegate::applicationDidFinishLaunching

Press F5 to view pseduocode, and tada!, here is the decryption key

Image 1625848935.png

Tools to decrypt and encrypt
You can use any xxtea tools to decrypt and encrypt, like Mika’s Tool Encryption & Decryption JSC Files to Modded Games Based Cocos2djs - Platinmods.com - Android & iOS MODs, Mobile Games & Apps

I successfully decrypted .jsc to .js

Image 1625848815.png

Comments

Popular Posts

VMOS Pro - FREE Custom ROMs without VIP | GMS, ROOT, Xposed | Android 4.4.4, 5.1.1, 7.1.2, 9.0 ROMs

How to activate VMOS Assistant to run VMOS on Android 12 and above