Tutorial Solar2D (former Corona Lab) game modding tutorial

hemoridhero

Platinian
Original poster
Jul 29, 2020
37
52
18
30
Tokyo
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!

version.JPG


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, for example.


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!

Screenshot_20210110-124025_OverRapid.jpg
 
Last edited:

hemoridhero

Platinian
Original poster
Jul 29, 2020
37
52
18
30
Tokyo
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.
 

AndnixSH

Security Detective
Staff member
Modding-Team
Jun 27, 2017
1,495
89,812
1,213
Modding World
Nice tutorial!
I remember that resource.car on other game called Fun Run. Back then i was too noob that I can't compile 😭😂
 
  • Like
Reactions: hemoridhero

DDEVELOPER2

Platinian
Aug 12, 2020
8
5
3
Sbennytopia
Um Thankyou for the response.
here's the link of the game:-
the main.lua was always blank
 

hemoridhero

Platinian
Original poster
Jul 29, 2020
37
52
18
30
Tokyo
Um Thankyou for the response.
here's the link of the game:-
the main.lua was always blank
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.
 
  • Like
Reactions: DDEVELOPER2

About us

  • Welcome to platinmods.com! We are proud to present you the place which let's dreams come true! Focusing on quality and trust we have spend much time to build a gaming community fitting to your wishes and needs. Actually we offer you the finest MODs and Games of the Android section and we slowly expand to the iOS section as well. But games, Android MODs & iOS MODs are not the only things we can offer you. We have tutorials, tools, a very friendly, active and solid community which will help you with any problem you have =) Your happiness is our goal. We hope you enjoy!

Forum statistics

Threads
42,309
Messages
810,092
Members
1,902,207
Latest member
elrokie