How do you know it uses lua library? I don't see any .lua files in the decompiled folder.You won't be able to find it as this game uses lua library and the logic are all there... Unless you have knowledge to handle that i suggest you try different game
It's usually stored inside the assets folder and stored as Unity Asset and not plain lua text, and it's likely encryptedHow do you know it uses lua library? I don't see any .lua files in the decompiled folder.
Yeah, I see. Is there any way to just hook lua functions from the executing game?It's usually stored inside the assets folder and stored as Unity Asset and not plain lua text, and it's likely encrypted
Are you sure those findExport returns something?I've looked up some tutorial on the internet for hooking lua, but seems like this game isn't based on lua. I checked in dnspy, yes it gets LuaDLL in it. However, when I tried to hook the methods, nothing was found. View attachment 570187View attachment 570188
they returned nothing, but I'm sure they were executed.Are you sure those findExport returns something?
In addition, I tried hooking all java method and print out function name when they are called, it seems that java code only handles network socket. I don't even see any lua or JNI related java method being executed. I'm guessing that beside network oriented process, all the other execution is in lua, but when and how is the lua loaded?
// int luaL_loadbuffer(lua_State *L, const char *buff, size_t sz, const char *name);
Interceptor.attach(Module.findExportByName("libtolua.so", 'luaL_loadbufferx'), {
onEnter: function (args) {
var fileBytesAddress = args[1];
var fileSize = args[2].toInt32();
var fileName = args[3].readUtf8String();
console.log(`File ${fileName} is at ${fileBytesAddress} with file size ${fileSize}.`)
},
onLeave: function (retval) {
},
});
[...]
File @Mod/Battle/Data/Unit/BattleUnit is at 0x74a25e6020 with file size 32910.
File @Mod/Battle/Data/Unit/BattlePlayerUnit is at 0x74a25ef020 with file size 10601.
File @Mod/Battle/Data/Unit/BattleEnemyUnit is at 0x74a25f3020 with file size 3014.
File @Mod/Battle/Data/Unit/BattleBossUnit is at 0x74a25e5980 with file size 752.
File @Mod/Battle/Data/Unit/BattleNPCUnit is at 0x74a25e5660 with file size 694.
File @Mod/Battle/Data/Unit/BattleSubUnit is at 0x74a25f5020 with file size 2061.
File @Mod/Battle/Data/Unit/BattleMinionUnit is at 0x74a25dc560 with file size 1120.
[...]
@CodeJutsu is correct Azur Lane is lua, dnSpy is only showing you data from il2cpp.so, while it does mention Lua its still the binary file for UnityEngine so the Lua stuff you are seeing in dnSpy could be just some stuff for Lua and Unity to communicate to eachother, Azur Lane stores the lua scripts packed together and encrypted in the obb.
Open the obb and go into assets/AssetBundles/ then scroll down and you will see the script files there are 2 files, one for 32 bit and another for 64 bit.
There is also a "libtolua.so" binary in the libs folder which is the lib that loads the lua files, you can see this by hooking the function luaL_loadbufferx in libtolua.so and logging the functions parameters.
Once the game is loading you should very quickly see messages logging.JavaScript:// int luaL_loadbuffer(lua_State *L, const char *buff, size_t sz, const char *name); Interceptor.attach(Module.findExportByName("libtolua.so", 'luaL_loadbufferx'), { onEnter: function (args) { var fileBytesAddress = args[1]; var fileSize = args[2].toInt32(); var fileName = args[3].readUtf8String(); console.log(`File ${fileName} is at ${fileBytesAddress} with file size ${fileSize}.`) }, onLeave: function (retval) { }, });
still need some time to learn though.
Search for GetHP, SetHP get_hp or set_hp as well, or any functions that have the parameter _hp in it and nop it
To be honest Azure Lane isn't a good choice to learn how to handle lua games if you're new to this fieldI've managed to find some tutorial and examples online, still need some time to learn though. Thank you guys for guiding me to the right way, really appreciate.
Ah yes, the golden rule of android modding, if in doubt... mod getters and setters... clearly you didnt read any of the info in this thread.
We use cookies to personalize content and ads, to provide social media features and to analyse our traffic. We also share necessary information with our advertising and analytics partners to optimize your experience on our site.
Learn more about cookies
We use cookies to personalize content and ads, to provide social media features and to analyse our traffic. We also share necessary information with our advertising and analytics partners to optimize your experience on our site.
Learn more about cookies