This is the AMP version of this page.
If you want to load the real page instead, click this text.

Tutorial Solar2D (former Corona Lab) game modding tutorial

hemoridhero

Platinian
How to identify if a game is built using Coronalab: There's a "libcorona.so" in /lib folder.

They changed their name to Solar2D as corona is a really bad name since 2020 ^-^ It's a rare engine, few games uses it. Oh well, let's get started.

Tools you'll need:

APK packing/unpacking tool - e.g apktool. Guides available online, not covered here.

Corona Archiver

Any code editor, I use VSC, you can use notepad but... It won't be pleasant

Luadec51 (for lua v5.1) or Luadec (for 5.2/3, compile on your own) - Check the game's lua version by searching in lib/liblua.so

luacX.X.exe from Official Lua Sourceforge. The version must match the game's lua version!



Optional: jdk for signing the final apk (guides available online, not covered here).

WARNING: LUADEC IS BUGGY. SOMETIMES IT WILL BREAK THE CODE. THEREFORE THIS METHOD MAY NOT WORK WITH YOUR GAME.

------------------------------


Let's get started.

1. Unpack the apk using apktool or something else. This part is covered by other tutorials so I won't spend much time here.

2: Coronalab uses lua, and the script is compiled to a file called "resource.car", usually in /assets. Find the file, copy "corona-archiver.exe" to that directory.

3: In that directory: Create an empty folder, remember its name, and type "cmd" in the address bar. Then, paste:
corona-archiver -u resource.car *your folder name*

4: A bunch of .lu files should now be there. They are compiled lua scripts. Copy Luadec and luac to this directory, Start CMD here, decompile any script by this command:
luadec51 filename.lu > filename.lua

5: A .lua file should appear. This is the script itself. Edit and save it however you'd like.
If the script is empty, or contain any decompiler error, editing and recompiling will not work. This is due to the inadequacy of Luadec, there's no way to fix this.
Do think of creative ways of modding - strings of the same size is directly editable, compare compiled hex code pre-post edit, delete irrelevant & broken parts prior to recompile, etc.

6: Recompile the script using luac.exe. Depending on your luac version (X.X), use this command:

luacX.X -o *file-name.lua*
A file called "luac.out" should appear in the folder. BACK UP, then delete the original .lu file, rename "luac.out" to it.

7: Compile the new resource.car using this command (check the cmd directory!):

corona-archiver -p 'input_dir' 'output_file'

8: That's your edited file. Pack and sign the apk, and have fun!

 
Last edited:
For anyone who's wondering, the game is Overrapid. No mod exists for this app, anywhere. I mod for my personal enjoyment and will likely never upload them.
 
Nice tutorial!
I remember that resource.car on other game called Fun Run. Back then i was too noob that I can't compile ??
 
Tested both your game and my original mod, yours won't work entirely while mine's broken in some files.
Luadec is just too old and limited. This method may worked in 2015 but... Probably not that well today.
 
I do always get
Code:
unexpected symbol near ' '
when trying to recompile the script/.lua file