Help! Question about debugging a game

pentarix1996

Platinian
Original poster
Dec 31, 2023
13
1
1
22
Good afternoon.

1º I'm trying to make a mod for the following game: https://play.google.com/store/apps/details?id=com.haoplay.game.and.hero&hl=en_US for the community (by popular demand Pixel Heroes: Tales of Emond - Platinmods.com - Android & iOS MODs, Mobile Games & Apps).

2º I put in context about my current progress:

3º I got the split APK ("com.haoplay.game.and.hero.apk", "config.armeabi_v7a.apk", "config.es.apk", "config.xhdpi.apk" and "game_asset.apk") .

1712066554097.png


4º I focused on "game_asset.apk". When I unzipped it I saw that it was all done in lua script (Luajit). With the Cocos2d engine.

1712066615445.png


5º Since there were all the ".lua and .lua64" files, I had to investigate to be able to decompile it and be able to see the content. I found the following tool that worked for me: GitHub - marsinator358/luajit-decompiler-v2: LuaJIT bytecode decompiler. I also wrote a small Python script to decompile all the files and keep the original file directories.

1712066705671.png


6º Once I had the code clean I started to investigate where I could make some modifications, I was doing several tests but without success, that is, the changes I make in the code are represented once I compile the ".lua" file again ", I sign the apk and install it. But almost everything is either visual or has verifications by the server.

Where I am at is this: I have discovered that the way this game does practically everything is with calls to an API with the "sendGame***" functions within the modules found in "src /game/net/" in "game_asset.apk".

1712066772450.png


Later they, in some way that I still don't know, launch a response and the code itself captures it in the "rec_game_***" functions. I see that all "rec_game_***" functions receive a "data" parameter. I would like to somehow be able to debug with prints or cc.logs to see what structure this "data" variable has in order to replicate the "rec_game_**" calls and thus surely force some result with the mod. But I am not able to get or capture the responses and see what structure the "data" variable has... The only thing I can see is that it is a structure that has the "reward" parameter. But I don't see anywhere any reference to how it is formed.

Any idea how I could continue debugging the game to set a breakpoint?

I understand that some way of capturing those calls that are made and seeing what "data" it contains also helps me.

Psdata:
  • I have tried Android studio, but since it is an APK split into several, I have not been able to get it to install correctly.
  • I have also tried putting prints and cc.logs in the code, but they are not shown since the game is installed without debug mode.
  • I currently do not have IDA PRO.
Edit:
- Anything you need or have doubts, ask me.


Thank you very much in advance :)