If have login problems remove cookies and clear browser cache.



Post Reply 
 
Thread Rating:
  • 2 Vote(s) - 3 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Tutorial 1: Hacking Java Games.
04-11-2020, 12:34 PM (This post was last modified: 04-13-2020 09:55 AM by Haque.)
Post: #1
Tutorial 1: Hacking Java Games.
Section-0.A: {Requirements}
This is going to be a brief tutorial over hacking In-game values of Java Games. I personally follow this method to hack my favourite java games and my success rate is 90%.
Noob abbreviations: RSK- Right Soft Key, LSK- Left Soft Key.
Requirements:
1. Java enabled mobile device (s40/s60/Generic).
2. JBE or Java Byte-Code Editor v1.40 App (Bugless; Link Below).
3. Blue FTP/ MiniCommander/ File Explorer App (Search On Internet).
4. Common-sense*.
5. Patience*.
6. Basic knowledge of mobile apps & files (Renaming, Extracting, Repacking, Copying, Pasting .jar .jad .zip files & granting permissions to apps).
Note: You can do this over computer or smartphone but I am limiting this tutorial within java phones. If you find any error like "Out Of Memory"/ "Not Enough Memory"/ "Can't Run On This Device" then it means your device lacks enough RAM and necessary JSR Libs to run the required apps.
***Don't Quote any of the posts. If u don't understand anything post quick reply or PM me***

Section-0.B: {File Types}
To be a successful hacker you will need some knowledge about java games, game file contents and game vendors. Java games are supplied in a ".jar" archive which is actually a ".zip" archive format. This archive contains the compiled binary files and game resources. In a ".jar" Java game, you will see a "META-INF" folder containing a "MANIFEST.MF" descriptor file. It's simply a text file renamed as ".MF" rather than ".txt" and uses UTF-8 encoding. You can edit this file using any Text Editors or File Manager App to change the game name, description, vendor name etc.
In ".jar" you will see some files with ".class" extension. These are the compiled CLASS files which contain the binary codes to run a java game. To hack In-game values & strings we usually modify these CLASS files.
There are some other files in the ".jar" archive named as: a.png, b.mid, c.lang, d.gif, e.bmp, f.dat, g.db, h.bin etc. PNG files are image files, MID files are audio files, LANG/LNG files are compiled language files which contain the language strings, GIF files are graphics files ect. (to learn more search on internet).
Vendors like Baltoro Games, Fishlabs etc. keep these files with extensions. But Gameloft removes extension from all other files except CLASS files to shrink the size of the entire game archive. This sometimes becomes tricky to identify the audio/ image/ language files of GameLoft games. To identify these files we use HEX Editors or similar apps along with the knowledge of file signatures or mime types.

Section-1: {Strategy Games/ Single Level Games}
1. Using File Explorer, navigate to your "game.jar" file. Select it. Extract it in a Folder. Go into the folder and recheck if all files are properly extracted. Close the app.
2. Open JBE v1.4 app. Navigate to the same above Folder. You will see CLASS files like: a.class, b.class, c.class etc. Now you have to learn some commands. (A)Search-Commands: "iconst" for value "0-5", "bipush" for value "6-127", "sipush" for value greater than 127. (B)Replace-Command: "ldc-w" for the hack value.
3. Open a CLASS file and you will get 4 options: 'Constant pool', 'Field', 'Methods', 'Search'. We need to work with only 4th option 'Search'. Select 'Search' and type the above search-commands according to your desired values (Example: "sipush<space>2500" for searching value 2500). If app finds similar values according to your command then it will show the 'methods'. Otherwise the value that you are looking for is not in the current CLASS file. In this case search in another CLASS file. If app finds and shows one or more methods like: a, b, c, A, B, C, ae, ax, az, <init>, <clinit> etc open each of them one by one.
4. For practical knowledge, I'll be hacking "Kingdoms & Lords" by GameLoft (download from dedomil). Play the game for a bit and you will see the game starts with 1500 coins, 3 diamonds, 25 woods, 25 metals, 25 cloths, 200 population limitation, 10 energy points and 0 friendly stars. Exit the game. Follow step 1 & 2. Then come back to step 5.
5. Any of these CLASS files may contain the above In-game values. Open each of them> Select 'Search' option> Type "sipush 1500" (targeting the coin's value)> Ok. You will find only searching in the "j.class" file shows a valid result which is "<clinit>" method. Open it. There are many lines containing codes, some similar to our search-commands and some unknown. DON'T PRESS ANY WRONG KEY NOW OR THE GAME WILL CRASH. Press RSK titled 'Fast'> Select 'Edit'> Select 'Search'> Type "sipush 1500"> Ok.
6. The app will take you to the line containing value 1500 (line 2571). Now, how can you be sure that it is the exact value that you are looking for? Look at the codes carefully. The codes present a list of In-game values. The codes:
iconst_0
sipush 1500
iastore
dup
iconst_1
iconst_3
iastore
dup
iconst_2
bipush 10
iastore
dup
iconst_3
iconst_0
iastore
dup
iconst_4
sipush 200
iastore
dup
iconst_5
bipush 25
iastore
dup
bipush 6
bipush 25
iastore
dup
bipush 7
bipush 25
iastore
dup
bipush 8
iconst_1
iastore
dup
bipush 9
iconst_0
iastore
dup
bipush 10
iconst_0
iastore
putstatic j/x[I
....and a new syntax pattern will start. It indicates our last range for searching our desired values. So, we won't look any further below. I'm typing them in an arranged format for better understanding:
iconst_0, sipush 1500, iastore, dup
iconst_1, iconst_3, iastore, dup
iconst_2, bipush 10, iastore, dup
iconst_3, iconst_0, iastore, dup
iconst_4, sipush 200, iastore, dup
iconst_5, bipush 25, iastore, dup
bipush 6, bipush 25, iastore, dup
bipush 7, bipush 25, iastore, dup
bipush 8, iconst_1, iastore, dup
bipush 9, iconst_0, iastore, dup
bipush 10,iconst_0, iastore,
...Look at the above codes again. Can you imagine a sequence like below?
0. 1500
1. 3
2. 10
3. 0
4. 200
5. 25
6. 25
7. 25
8. 1
9. 0
10. 0
....Excited Huh?! Yeah, now we are Damn sure this is the CLASS file which stores the In-game values and these are the values that we are looking for; where 1500 is coins, 3 is diamonds, 10 is energy points, 200 is population limitation, 25 is woods metals cloths and any of the 0 can be friendly stars.
7. Now select each line and click RSK titled 'Fast'> Select 'Edit'> Select 'Edit the line'> Type "ldc_w 999999" [Note: there are two spaces at the beginning of each line. Don't mess them while editing. Just erase each letter from end one by one and type replace-command with hack value]> LSK titled 'Menu'> Ok. Change all values similarly. After finished your codes will look like this:
iconst_0
ldc_w 999999
iastore
dup
iconst_1
ldc_w 999999
iastore
dup
iconst_2
ldc_w 999999
iastore
dup
iconst_3
iconst_0
iastore
dup
iconst_4
ldc_w 999999
iastore
dup
iconst_5
ldc_w 999999
iastore
dup
bipush 6
ldc_w 999999
iastore
dup
bipush 7
ldc_w 999999
iastore
dup
bipush 8
iconst_1
iastore
dup
bipush 9
ldc_w 999999
iastore
dup
bipush 10
iconst_0
...Now click RSK titled 'Fast'> Select 'Save'> Select 'Menu'> Select 'Save'> 'Dismiss'.
You are done! You successfully hacked the game! Now repack all the files of the Folder in a JAR archive using a File Explorer app. Install the game and Whalla! You got a hack game of your own.
#I have hacked "Kingdoms & Lords", "Total Conquest", "Ice Age Village", "Little Big City 1 & 2", "Green Farm 1 & 2". All were successful.
Note: After hacking and running game if you get error "MIDlet is Corrupted" it means you have messed up the CLASS file while hacking. Or, if you see no change in the hacked game then it means you have not changed the exact value of the game. Try Again From Beginning with more Focus.
Tips: For some games it will be tricky to identify the exact value. If you are not sure which value may be the one that you are looking for, you should edit every possible value one by one and save the CLASS file for each changes you make. Then repack and run the game for every single change and notice the In-game changes. At last..hacking is not that easy readers. Cheers!!!
Next post is going to be on Hacking Multi level Games. Till then, Good Luck.


Attached File(s)
.jar  JBE v1.4.jar (Size: 140.65 KB / Downloads: 694)
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Tutorial 1: Hacking Java Games. - Haque - 04-11-2020 12:34 PM

Forum Jump:


User(s) browsing this thread: 5 Guest(s)