Decrypt lua files of Cocos2dx ?

Extraction and unpacking of game archives and compression, encryption, obfuscation, decoding of unknown files
hackspeedok
Posts: 404
Joined: Mon Oct 06, 2014 6:41 pm

Decrypt lua files of Cocos2dx ?

Post by hackspeedok »

Hi everybody,
I want to translate a Chinese IOS game to my language. But I dont know how to decrypt Lua files of Cocos2dx (I'm noob). I read this article but still do not understand: https://boards.libre.io/threads/decrypt ... es.297552/
So, I hope someone is able to help me decrypt these files, I am extremely thankful
Link of files: https://drive.google.com/file/d/1Q2s-g0 ... ixMXF/view
Link alll game files: https://drive.google.com/file/d/1JXj03c ... Vuzj3/view
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Decrypt lua files of Cocos2dx ?

Post by aluigi »

Eh no, this is a different encryption:
http://aluigi.org/bms/kdqht_lua.bms
hackspeedok
Posts: 404
Joined: Mon Oct 06, 2014 6:41 pm

Re: Decrypt lua files of Cocos2dx ?

Post by hackspeedok »

aluigi wrote:Eh no, this is a different encryption:
http://aluigi.org/bms/kdqht_lua.bms

Thanks Aluigi, can you help me to encrypt the edited files ? I tried reimport but the new files must be same size as original :(
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Decrypt lua files of Cocos2dx ?

Post by aluigi »

Script 0.2, you must re-decrypt the files because it now adds a "_decrypt" suffix in the filename.
Reuse the script on the decryted files to automatically encrypt them
hackspeedok
Posts: 404
Joined: Mon Oct 06, 2014 6:41 pm

Re: Decrypt lua files of Cocos2dx ?

Post by hackspeedok »

aluigi wrote:Script 0.2, you must re-decrypt the files because it now adds a "_decrypt" suffix in the filename.
Reuse the script on the decryted files to automatically encrypt them

Thanks so much, its work perfectly :D
hackspeedok
Posts: 404
Joined: Mon Oct 06, 2014 6:41 pm

Re: Decrypt lua files of Cocos2dx ?

Post by hackspeedok »

Hi Aluigi, can you help me with this file ? Thanks.
hackspeedok
Posts: 404
Joined: Mon Oct 06, 2014 6:41 pm

Re: Decrypt lua files of Cocos2dx ?

Post by hackspeedok »

Please help me. Thanks
hackspeedok
Posts: 404
Joined: Mon Oct 06, 2014 6:41 pm

Re: Decrypt lua files of Cocos2dx ?

Post by hackspeedok »

Need some help, thanks :(
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Decrypt lua files of Cocos2dx ?

Post by aluigi »

It's encrypted, simple.
What's the game?
hackspeedok
Posts: 404
Joined: Mon Oct 06, 2014 6:41 pm

Re: Decrypt lua files of Cocos2dx ?

Post by hackspeedok »

aluigi wrote:It's encrypted, simple.
What's the game?

The name is "三国演义:吞噬无界" - KingWar - IOS game :)
Attachment is all database of game. Thanks
hackspeedok
Posts: 404
Joined: Mon Oct 06, 2014 6:41 pm

Re: Decrypt lua files of Cocos2dx ?

Post by hackspeedok »

Help me, Aluigi. Thanks
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Decrypt lua files of Cocos2dx ?

Post by aluigi »

Unfortunately I can't, I can only write a script once someone will post the algorithm and key.
memes
Posts: 8
Joined: Thu Oct 04, 2018 2:59 pm

Re: Decrypt lua files of Cocos2dx ?

Post by memes »

I found out xxtea by simple, unfortunately my ability is not enough to find the key, the game uses anti-debugging.

Code: Select all

int __fastcall cocos2d::xxtea_decrypt(int a1, int a2, int a3, unsigned int a4, int a5, int a6, int a7, int a8, int (__fastcall *a9)(int), int a10, int a11, int a12, _DWORD *a13)
{
  unsigned int v13; // r7
  int v14; // r6
  int v15; // r4
  int v17; // [sp+24h] [bp+4h]
  int v18; // [sp+28h] [bp+8h]

  v13 = a4;
  *a13 = 0;
  if ( a4 > 0xF )
  {
    v15 = sub_73D7FC(a1, a2, a3, a13);
  }
  else
  {
    v18 = a2;
    v17 = a1;
    v14 = sub_6C65B4(16);
    sub_6C63F4();
    sub_6C64B4(v14 + v13, 16 - v13, 0);
    v15 = sub_73D7FC(v17, v18, v14, a13);
    sub_6C64C4(v14);
  }
  return a9(v15);
}
hackspeedok
Posts: 404
Joined: Mon Oct 06, 2014 6:41 pm

Re: Decrypt lua files of Cocos2dx ?

Post by hackspeedok »

Hi Aluigi, the game is updated with Android version. But I cant extract OBB file. Please help me, thanks :D
https://play.google.com/store/apps/deta ... zbf.jyfree
hackspeedok
Posts: 404
Joined: Mon Oct 06, 2014 6:41 pm

Re: Decrypt lua files of Cocos2dx ?

Post by hackspeedok »

need some help, please :D
RonDo
Posts: 2
Joined: Thu Jul 25, 2019 1:19 am

Re: Decrypt lua files of Cocos2dx ?

Post by RonDo »

hackspeedok wrote:need some help, please :D

send me APK file or a place i can download APK i will take a look
hackspeedok
Posts: 404
Joined: Mon Oct 06, 2014 6:41 pm

Re: Decrypt lua files of Cocos2dx ?

Post by hackspeedok »

RonDo wrote:
hackspeedok wrote:need some help, please :D

send me APK file or a place i can download APK i will take a look

Hi RonDo, here is the download link: https://apkpure.com/vn/store/apps/detai ... zbf.jyfree
hackspeedok
Posts: 404
Joined: Mon Oct 06, 2014 6:41 pm

Re: Decrypt lua files of Cocos2dx ?

Post by hackspeedok »

Hi all, please help me. Thanks
hackspeedok
Posts: 404
Joined: Mon Oct 06, 2014 6:41 pm

Re: Decrypt lua files of Cocos2dx ?

Post by hackspeedok »

Need some help
hackspeedok
Posts: 404
Joined: Mon Oct 06, 2014 6:41 pm

Re: Decrypt lua files of Cocos2dx ?

Post by hackspeedok »

Hi Aluigi, can you help me ?