0

I'm currently creating a private server for a game that closed almost a year ago, and I'm stuck at a point where my server has to respond to the game to populate the server list.

The problem is that I don't know what structure the JSON response needs to have. The client makes a GET request to my /server/get endpoint, and while it receives the response without any error on the logcat unlike the others, the server list in the UI just stays empty. I've looked in the decompiled C# files (with Ghidra), but I haven't found anything that processes the JSON directly. The only clues were a couple of methods related to a RecyclableGridLayoutGroup class, which seems to just handle the UI grid, and a ChooseServer method that doesn't tell me much.

The biggest discovery I've made is that the game's C# code doesn't seem to parse the /server/get response at all. It looks like the raw JSON string from the server response is passed directly to a Lua script through a LuaInterface.LuaFunction.Call. This means all the important logic for reading the server data and setting up the list is hidden inside the game's Lua scripts. My main problem is that I can't find these scripts. They aren't loose .lua files, and they don't appear as simple TextAssets or anything else when I check the asset bundles in AssetStudio and other software.

So my only hope is to extract and decompile the Lua code somehow. Is there a common way to find and extract Lua scripts when they're hidden or packed like this, maybe as compiled bytecode inside another asset type? And if I can extract them, is there a reliable way to decompile them? As an alternative, if I can't get the scripts, is there another way to figure out what the Lua script expects, like maybe a specific Frida script?

Additional informations: One of the two ChooseServer methods in the il2cpp library actually calls a ChooseServer method in a Java (smali) file but for some reason the method, in the file, is not present.

Edit: While searching I found that using Frida you can hook to a luaL_loadbuffer (or similar) function. How do I do that?

I never posted something on the Internet, so if I messed up or forgot to tell something, please tell me.

Thanks in advance for any help or advices.

1
  • Welcome! "I never posted something on the Internet ..." Please take the tour to learn how these Stack Exchange sites work, and read some pages of the help center, as any sensible human does when entering a community. Commented Oct 22 at 6:00

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.