📖 Tutorial [IDA tutorial] How to mod x86 lib .so file

Sbenny.com is trusted by 1,327,057 happy users since 2014.
Register

AndnixSH

Savage Lv6️⃣
SB Mod Squad ⭐
Member for 8 years
Hello dear community,

Today, i will teach you how to mod x86 libs. x86 is not that hard to understand because the instruction are almost the same as ARM. In this tutorial, i mod the game called The Sandbox 2.

You don't really need to mod x86 at all since I never heard any problem with ARM translating to x86, and it's too hard to change instruction without code caving. Just wanna make tutorial lol

Now let's start modding.

In this tutorial, I'll show you how to mod The Sandbox Evolution very easy in x86.

First of all, you need IDA PRO and Hex Workshop installed on your computer. If you already have them installed, go to next step

Open the APK file with WinRar and extract the lib folder (In case you want to mod both x86 and ARM)
Open the x86 .so file in IDA. You will see the dialog box similar to the following:



In x86, you don't need to change anything. MetaPC is fine. Click OK to disassemble the lib file, and let it fully load. After that, press CTRL + F, search "isElementUnlocked" and double click on the function to open it

1525981136868.png


Remember the offset (9869E0) of first instruction. we need to use it later.

Note: The offset will change each update.



Open Hex Workshop or other hex editing program, and search the offset. I'm using Hex Workshop





Here is the offset of isElementUnlocked



The function isElementUnlocked is a boolean function, which means it can return true or false. If you want unlock everything, replace it with b8 01 00 00 00 c3, which will return true.

True is:
Code:
b8 01 00 00 00 (mov eax, 1)
False is:
Code:
b8 00 00 00 00 (mov eax, 0)
And return is:
Code:
c3 (retn)


When you open the modded .so file in IDA, your modded instruction will look like:



Isn't that easy?

You can also do the same on hasBoughtPromoPack to unlock premium

If you want to hack mana like 9999999, search getManaBalance and giveMana, and replace it with any values you want
Code:
b8 7f 96 98 00 (mov eax, 9999999)
c3 (ret)
You can use online x86 Assembly to get raw hex
Online x86 and x64 Intel Instruction Assembler

Open the APK with WinRAR and replace the modded .so file. Re-sign the APK, install it and run the game.

1525981266473.png


Credits:
AndnixSH#

Tutorial updated (May 2018)
 
Last edited:

BRILLIANT

Veteran Lv7️⃣
✔ Approved Releaser
Member for 6 years

Adolfo42

Apprentice Lv2️⃣
Member for 6 years
So any .so file can be modded?
 

Sibway

Apprentice Lv2️⃣
Member for 5 years
I actually tried to mod this game but I didn't know what to do since it wasn't ARM. This will certainly help me with practicing modding in IDA. Thanks!
 

Null69

Lurker Lv0️⃣
Member for 5 years
@AndnixSH can I have the code for return 100😁 and what site is the converter for x86? Thanks
 

AndnixSH

Savage Lv6️⃣
SB Mod Squad ⭐
Member for 8 years
@AndnixSH can I have the code for return 100😁 and what site is the converter for x86? Thanks
Lol have you missed something? it's near the end of the thread. Ensure you fully the thread before asking a question :D
 

Null69

Lurker Lv0️⃣
Member for 5 years
Where should I put the hex code of 100? At the last?
 

caspaas

Novice Lv1️⃣
Member for 5 years
I am trying to do this for Knights of fury.
Any experience with that one ?
 
Top