Jump to content

How to hack Unity Games | il2cpp resolver [ Level: Beginner ]


31 posts in this topic

Recommended Posts

Updated (edited)

Hello everyone, today i'll show you how to hack Unity Game using il2cpp resolver

Level: Beginner

Game: Subway Surf

Requirements:
- Theos (https://theos.dev/docs/installation)
- DNSpy (https://github.com/dnSpy/dnSpy) / IlSpy (https://github.com/icsharpcode/ILSpy)
- Batchh Mod Menu Template (Template)
- Follow the tutorial carefully! 

What we will make:
Will make this: Subway Surf All Version Hack
SOO Let's START!!!

Step 1 (Dump our game):
- What "Dump our game" means: Dumping is extracting data or code from a binary file for analysis or modification. IL2CPPDumper is a tool used to extract metadata and code from Unity games that use the IL2CPP scripting backend.
- To perform the dump we'll use: https://armconverter.com/il2cppdumper but first we need to get our decrypter game, from here https://armconverter.com/decryptedappstore/us/Subway surf
- Now to perform the dump just extract the zip of the decrypted game, and you need to get two files: UnityFramework and global-metadata.dat
- UnityFramework is located in "Frameworks/UnityFramework.framework/"
- global-metadata.dat is located in "Data/Managed/Metadata"
- Drop the UnityFramework (Executable) on the left box and drop the global-metadata.dat in the right box
- Wait and then download the results! 
(If you're lazy here the dumped zip: https://iosddl.net/07d83ef42134a41e/com.kiloo.subwaysurfers-3.31.0-Decrypted.ipa-il2cppdumper.zip)

Step 2 (Open the dumped data):
- Open DNSpy / ILSpy then choose files and open the folder where you extracted the dump zip you need to select all the file insinde DummyDll

Step 2.5 (Open the Batchh mod menu template):
- Theos need to be installed!
- To open the mod menu template you simply run this command in your terminal inside the folder you want your mods:

$THEOS/bin/nic.pl

- Fill all the information required, for the information about the app they can be found in: https://armconverter.com/appinfo

Step 3 (Let's search values in the DNSpy/ILSpy):

- Open a txt file to write down what we find! (it will be useful after)
- What we want to achieve is: Unlimited Jumps, Unlimited currency, No Collision 
- But first let's change our search options to "Method", for our purpose:
Screenshot-2024-07-06-at-19-19-02.png
- Let's search for "Jump", maybe we can the checker that handles the jump:
Screenshot-2024-07-06-at-19-20-58.png
- As you can see there are alot, so how can we find it? After some time it will became more easy to find! My though process for unlimited jump is to find the handler of "can jump", so let's search it!
Screenshot-2024-07-06-at-19-24-06.png
- We found two result, the first one is the right one! "System....", that is not correlate with what we want. So double click the "CanJump" Method:
Screenshot-2024-07-06-at-19-26-32.png
As you can see we get direct to the Class that contains out method, also in the left you can open the toggle arrow to reveal all the methods and fields inside the class. 
- So let's write down in our txt file, the Assembly we're in, this can be found by scrolling all the way up:
Screenshot-2024-07-06-at-19-29-45.png
- Right now we are in "Assembly-CSharp.dll", now let's write down our Class, namespace, method name, to find this scroll all the way up inside the CanJump class:
Screenshot-2024-07-06-at-19-32-15.png
- We see that our Namespace is "SYBO.RunnerCore.Character", our Class is "CharacterMotor", our Method name is "get_CanJump".
- Before searching for Unlimited currency or No Collision let's explore class CharacterMotor and see if we can find anything.
- In this class we can find two methods related to collision "CheckFrontalImpact" and "CheckSideImpact", we will use this for our no collision, also as you can see in these two there are 1 arguments "impactState", write it down that too.
- Let's search for the currency, the first thing it comes to my mind is to search GetCurrency:
Screenshot-2024-07-06-at-19-38-25.png

- Note that also this one has 1 argument "CurrencyType" it indicates the type of currency
- We also need Class, namespace, do as before! Namespace = SYBO.Subway.Meta, Class = WalletModel

Step 4 (Coding):
I've made my template as simple as possible, all the changes and coding will be done in Cheat/ folder, for this particular hack we'll use Patches.h and Offset.h
First let's change our Offset.h this is where all the offsets are stored, with my new method "il2cpp resolver" we now don't need to hard code the offset anymore!
 

//Offset.h
namespace offset
{
    namespace CharacterMotor
    {
        uint64_t CheckSideImpact = 0x0;
        uint64_t CheckFrontalImpact = 0x0;
        uint64_t get_CanJump = 0x0;
    }

    namespace WalletModel
    {
        uint64_t GetCurrency = 0x0;
    } 
}

- So as you can see from the code i defined with Class and Method inside them, this will be for having more clarity! You can do how you like it, this is my method of storing them. 
- Now let's go to Patches.h where the real code begin (Don't worry it's not hard, even if you don't know how to code!)
 

//Patches.h
#ifndef PATCHES_H
#define PATCHES_H

#include "../KittyMemory/MemoryPatch.hpp"
#include "Offset.h"
#include "Settings.h"
#include "Util.h"
#include "il2cpp.h"

struct PatchInfo {
    MemoryPatch patch;
    bool* setting;
};

std::vector<PatchInfo> patch_infos;

void addNewPatch(uintptr_t offset, const char* hexPattern, bool* setting) {
    MemoryPatch newPatch = createUnityFrameworkPatch(offset, hexPattern);
    if (!newPatch.isValid()) return;
    patch_infos.push_back({newPatch, setting});
}

void initPatch() {
    //here init your patches
}
#endif // PATCHES_H

- This is how it should look like, now let's edit it! All the edit will be inside the initPatch function.
- For this hack we'll use as i said my Il2cpp resolver what does that do? Retrieve information of the game based on Assembly, Class, Method, and other stuff we'll cover in next tutorial!
- So let's finish our code!
 

void initPatch() {

    Il2CppAttach();

    Il2CppMethod AsmMethod("Assembly-CSharp.dll");

    offset::CharacterMotor::CheckSideImpact = AsmMethod.getClass("SYBO.RunnerCore.Character", "CharacterMotor").getMethod("CheckSideImpact", 1);
    offset::CharacterMotor::CheckFrontalImpact = AsmMethod.getClass("SYBO.RunnerCore.Character", "CharacterMotor").getMethod("CheckFrontalImpact", 1);
    offset::CharacterMotor::get_CanJump = AsmMethod.getClass("SYBO.RunnerCore.Character", "CharacterMotor").getMethod("get_CanJump", 0);

    offset::WalletModel::GetCurrency = AsmMethod.getClass("SYBO.Subway.Meta", "WalletModel").getMethod("GetCurrency", 1);

}

- As you can see this uses all the information we gathered before! What does this do? Retrieve information!
- Now we need to execute the hack! How? by calling function patch(offset, modify)
 

void initPatch() {

    Il2CppAttach();

    Il2CppMethod AsmMethod("Assembly-CSharp.dll");

    offset::CharacterMotor::CheckSideImpact = AsmMethod.getClass("SYBO.RunnerCore.Character", "CharacterMotor").getMethod("CheckSideImpact", 1);
    offset::CharacterMotor::CheckFrontalImpact = AsmMethod.getClass("SYBO.RunnerCore.Character", "CharacterMotor").getMethod("CheckFrontalImpact", 1);
    offset::CharacterMotor::get_CanJump = AsmMethod.getClass("SYBO.RunnerCore.Character", "CharacterMotor").getMethod("get_CanJump", 0);

    offset::WalletModel::GetCurrency = AsmMethod.getClass("SYBO.Subway.Meta", "WalletModel").getMethod("GetCurrency", 1);

    //ADD PATCHES
    patch(offset::CharacterMotor::CheckSideImpact, "C0035FD6"); //return so it doesn't execute the check
    patch(offset::CharacterMotor::CheckFrontalImpact, "C0035FD6"); //return
    patch(offset::CharacterMotor::get_CanJump, "20008052C0035FD6"); //Set the can jump to 'true'
    patch(offset::WalletModel::GetCurrency, "007C009B007C009BC0035FD6"); //Multiply the value by it self 2 times
}

- And this is it! the hack are already enabled it! On the next tutorial we'll see how to add options, and use checkboxes 
- Now it's you're turn to add more hacks to it!
- I know you are wondering what is "C0035FD6", "2008052C0035FD6" those are assembly code, how can you get them? from using this converter: https://armconverter.com/

Step 5 (Bonus arm code):
- C0035FD6 = ret = return
- 20008052 = movz w0, #1 = set boolean to true
- 00008052 = movz w0, #0 = set boolean to false
- 00F0271E = fmov s0, #31 = High float value
- 007C009B = mul x0, x0, x0 = Multiply int
- 00E284D2 = mov x0, #10000 = Set int to 10k
- You can figure out the rest or google it! :) 

This is the end! Thanks for reading and hope this will help you create a Unity hack on your own, if you need any help feel free to comment, i'll try to respond to everyone! :) 

Credits:
- @batchh

Updated by batchh
  • Like 9
  • Winner 6
  • Thanks 1
Posted
4 hours ago, sukiop said:

If I use this method does it mean that I don't need to use hook update to modify the set_ function

In the next tutorial, I’ll show invoke function for it

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below. For more information, please read our Posting Guidelines.
Reply to this topic... Posting Guidelines

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Our picks

    • Hello Kitty My Dream Store v1.0.5 +5 Jailed Cheats [ Unlimited Currencies ]
      Modded/Hacked App: Hello Kitty My Dream Store By ACTGames Co., Ltd.
      Bundle ID: com.actgames.HelloKittyMDS
      iTunes Store Link: https://apps.apple.com/us/app/hello-kitty-my-dream-store/id6736896540?uo=4

       

       
       

      🤩 Hack Features

      - Unlimited Gold
      - Unlimited Energy
      - Unlimited Diamonds
      - Unlimited Gacha Coins
      - Unlimited Stars
      • 9 replies
    • Hello Kitty My Dream Store v1.0.5 +5 Cheats [ Unlimited Currencies ]
      Modded/Hacked App: Hello Kitty My Dream Store By ACTGames Co., Ltd.
      Bundle ID: com.actgames.HelloKittyMDS
      iTunes Store Link: https://apps.apple.com/us/app/hello-kitty-my-dream-store/id6736896540?uo=4

       


      🤩 Hack Features

      - Unlimited Gold
      - Unlimited Energy
      - Unlimited Diamonds
      - Unlimited Gacha Coins
      - Unlimited Stars
        • Like
      • 13 replies
    • Kitty’s Kitchen Diary v1.0.9 +3 Jailed Cheats [ Unlimited Currencies ]
      Modded/Hacked App: Kitty’s Kitchen Diary By SuperPlanet corp.
      Bundle ID: com.superplanet.catrecipe
      iTunes Store Link: https://apps.apple.com/us/app/kittys-kitchen-diary/id6496345774?uo=4

       


      🤩 Hack Features

      - Unlimited Currencies -> Head into Settings and toggle the Notifications button.
      - Unlock All -> Head into Settings and toggle the Nightly Notifications button.
      - Freeze Diamonds
      • 6 replies
    • Kitty’s Kitchen Diary v1.0.9 +3 Cheats [ Unlimited Currencies ]
      Modded/Hacked App: Kitty’s Kitchen Diary By SuperPlanet corp.
      Bundle ID: com.superplanet.catrecipe
      iTunes Store Link: https://apps.apple.com/us/app/kittys-kitchen-diary/id6496345774?uo=4

       


      🤩 Hack Features

      - Unlimited Currencies -> Head into Settings and toggle the Notifications button.
      - Unlock All -> Head into Settings and toggle the Nightly Notifications button.
      - Freeze Diamonds
      • 11 replies
    • Brotato v1.3.171 +4 Jailed Cheats [ Damage + More ]
      Modded/Hacked App: Brotato By QI YU SG. PTE. LTD.
      Bundle ID: com.brotato.shooting.survivors.action.games.bullethell.ios
      iTunes Store Link: https://apps.apple.com/us/app/brotato/id6445884925?uo=4

       
       

      🤩 Hack Features

      - Damage Multiplier
      - God Mode
      - Move Speed Multiplier
      - Free In-App Purchases
      • 0 replies
    • Brotato v1.3.171 +4 Cheats [ Damage + More ]
      Modded/Hacked App: Brotato By QI YU SG. PTE. LTD.
      Bundle ID: com.brotato.shooting.survivors.action.games.bullethell.ios
      iTunes Store Link: https://apps.apple.com/us/app/brotato/id6445884925?uo=4

       


      🤩 Hack Features

      - Damage Multiplier
      - God Mode
      - Move Speed Multiplier
      - Free In-App Purchases
      • 0 replies
    • Travel Town - Merge Adventure Cheats v2.12.991 +1
      Modded/Hacked App: Travel Town By Magmatic Games Ltd
      Bundle ID: io.randomco.travel
      iTunes Store Link: https://apps.apple.com/us/app/travel-town/id1521236603?uo=4


      Hack Features:
      - Infinite Currencies


      Non-Jailbroken & No Jailbreak required hack(s): https://iosgods.com/topic/148953-travel-town-v231-jailed-cheats-1/

      iOS Hack Download Link: https://iosgods.com/topic/148951-travel-town-cheats-all-versions-1/
        • Haha
        • Like
      • 160 replies
    • Match Valley v1316 [ +5 Jailed ] Coins Max
      Modded/Hacked App: Match Valley By TALEMONSTER OYUN YAZILIM VE PAZARLAMA ANONIM SIRKETI
      Bundle ID: com.talemonster.matchvalley
      iTunes Store Link: https://apps.apple.com/us/app/match-valley/id6511226434?uo=4


      🤩 Hack Features

      - Coins
      - Lives
      - Potion
      - Booster

      - Up Cost 0
      • 3 replies
    • Match Valley v1316 [ +5 Cheats ] Coins Max
      Modded/Hacked App: Match Valley By TALEMONSTER OYUN YAZILIM VE PAZARLAMA ANONIM SIRKETI
      Bundle ID: com.talemonster.matchvalley
      iTunes Store Link: https://apps.apple.com/us/app/match-valley/id6511226434?uo=4


      🤩 Hack Features

      - Coins
      - Lives
      - Potion
      - Booster

      - Up Cost 0
        • Agree
      • 5 replies
    • Grim Soul: Survival v7.1.1 +19 Jailed Cheats [Free Crafting + More]
      Modded/Hacked App: Grim Soul: Survival By Andrey Pryakhin
      Bundle ID: fantasy.survival.game.rpg
      iTunes Store Link: https://itunes.apple.com/us/app/grim-soul-survival/id1366215798


      Mod Requirements:
      - Jailbroken or Non-Jailbroken iPhone/iPad/iPod Touch.
      - Cydia Impactor.
      - A Computer Running Windows/Mac/Linux.


      Hack Features:
      - Unlimited Storage Items - Taking storage items will increase them.
      - Free Crafting - Will allow you to craft items without the required materials.
      - No Crafting Level Requirement
      - Free Construction
      - Items Duplicate When Split
      - Unlimited Item Durability
        • Haha
        • Winner
        • Like
      • 4,160 replies
    • Grim Soul: Survival v7.1.1 +19 Cheats [Unlimited Currencies + More]
      Modded/Hacked App: Grim Soul: Survival By Andrey Pryakhin
      Bundle ID: fantasy.survival.game.rpg
      iTunes Store Link: https://itunes.apple.com/us/app/grim-soul-survival/id1366215798


      Mod Requirements:
      - Jailbroken iPhone/iPad/iPod Touch.
      - iFile / Filza / iFunBox / iTools or any other file managers for iOS.
      - Cydia Substrate (from Cydia).
      - PreferenceLoader (from Cydia).


      Hack Features:
      - Unlimited Thalers/Coins & Crafting Points - Once enabled, purchase something using coins & use a craft point so the currencies stick, then disable this feature.
      - Unlimited Storage Items - Taking storage items will increase them.
      - Unlimited Energy / Instant Energy Refills - Will refill your energy once you run to another location.
      - Godmode - Unlinked. Health will still decrease but you won't die.
      - One-Hit Kill - Linked to the enemy. Would recommend enabling 'Godmode'.
      - Increased Attack Range - Allows you to kill enemies from some distance away.
      - Free Crafting - Will allow you to craft items without the required materials.
      - No Crafting Level Requirement
      - Free Construction
      - Items Duplicate When Split
      - Unlimited Item Durability
      - x2 Player Speed
      - x3 Player Speed
      • 5,023 replies
    • Summoners War Cheats v8.6.8 +7
      Hacked App: Summoners War By Com2uS Corp.
      iTunes Link: https://itunes.apple.com/us/app/summoners-war/id852912420?mt=8&uo=4&at=1010lce4
      Bundle ID: com.com2us.smon.normal.freefull.apple.kr.ios.universal

      Hack Features:
      - Damage Multiplier 
      - Godmode
      - Monster Count Unlink
      - Max Accuracy
      - No Skill Cooldown
      - First Turn
      - Build buildings without having required level
      - Antiban
        • Informative
        • Agree
        • Haha
        • Thanks
        • Winner
        • Like
      • 6,843 replies
×
  • Create New...

Important Information

We would like to place cookies on your device to help make this website better. The website cannot give you the best user experience without cookies. You can accept or decline our cookies. You may also adjust your cookie settings. Privacy Policy - Guidelines