Jump to content

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


batchh

21 posts in this topic

Recommended Posts

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 4
  • Winner 6
  • Thanks 1
Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

    • Good Pizza, Great Pizza v5.15.6 +2 Jailed Cheats [ Unlimited Currencies ]
      Modded/Hacked App: Good Pizza, Great Pizza By TAPBLAZE, LLC
      Bundle ID: com.tapblaze.pizzabusiness
      iTunes Store Link: https://apps.apple.com/us/app/good-pizza-great-pizza/id911121200?uo=4


      Hack Features:
      - Unlimited Cash
      - Unlimited Diamonds


      Jailbreak required hack(s): [Mod Menu Hack] Good Pizza, Great Pizza v5.5.6 +2 Cheats [ Unlimited Currencies ] - Free Jailbroken Cydia Cheats - iOSGods
      Modded Android APK(s): https://iosgods.com/forum/68-android-section/
      For more fun, check out the Club(s): https://iosgods.com/clubs/
        • Informative
        • Agree
        • Haha
        • Thanks
        • Winner
        • Like
      • 129 replies
    • Good Pizza, Great Pizza v5.15.6 +2 Cheats [ Unlimited Currencies ]
      Modded/Hacked App: Good Pizza, Great Pizza By TAPBLAZE, LLC
      Bundle ID: com.tapblaze.pizzabusiness
      iTunes Store Link: https://apps.apple.com/us/app/good-pizza-great-pizza/id911121200?uo=4


      Hack Features:
      - Unlimited Cash
      - Unlimited Diamonds


      Non-Jailbroken & No Jailbreak required hack(s): [Non-Jailbroken Hack] Good Pizza, Great Pizza v5.5.6 +2 Jailed Cheats [ Unlimited Currencies ] - Free Non-Jailbroken IPA Cheats - iOSGods
      Modded Android APK(s): https://iosgods.com/forum/68-android-section/
      For more fun, check out the Club(s): https://iosgods.com/clubs/
        • Informative
        • Agree
        • Haha
        • Thanks
        • Winner
        • Like
      • 81 replies
    • MeChat v4.26.0 +1 Jailed Cheat [ Unlimited Gems ]
      Modded/Hacked App: MeChat By PlayMe Studio
      Bundle ID: world.playme.mechat
      iTunes Store Link: https://apps.apple.com/us/app/mechat/id1536157979
       

      Hack Features:
      - Unlimited Gems -> Will increase instead of decrease.
      - Unlimited Gems -> Earn some then uninstall this hack. DO NOT SPEND ANY GEMS WHILST THIS FEATURE IS ENABLED! [ VIP ]


      Free Jailbreak required hack(s): [Mod Menu Hack] [Free] MeChat - Love Secrets v3.3.2 +1 Cheat [ Unlimited Gems ] - Free Jailbroken Cydia Cheats - iOSGods
      ViP Jailbreak required hack(s): [Mod Menu Hack] MeChat - Love Secrets v3.3.2 +1 Cheat [ Unlimited Gems ] - ViP Cheats - iOSGods
      Modded Android APK(s): https://iosgods.com/forum/68-android-section/
      For more fun, check out the Club(s): https://iosgods.com/clubs
        • Informative
        • Agree
        • Haha
        • Thanks
        • Winner
        • Like
      • 678 replies
    • Monster Legends: Collect all Cheats v17.4.2 +8
      Modded/Hacked App: Monster Legends: Breeding RPG By Socialpoint
      Bundle ID: es.socialpoint.MonsterCity
      iTunes Store Link: https://apps.apple.com/us/app/monster-legends-breeding-rpg/id653508448?uo=4


      Hack Features:
      - 1 Hit Kill
      - Skip Enemy Turn
      - Insane Score (Always 3 Stars)
      - No Skill Cost
      - Auto Win


      iOS Hack Download Link: https://iosgods.com/topic/176914-monster-legends-collect-all-v1632-5-cheats/
        • Informative
        • Agree
        • Haha
        • Thanks
        • Winner
        • Like
      • 234 replies
    • [ VIP ] MeChat v4.26.0 +1 Cheat [ Unlimited Gems ]
      Modded/Hacked App: MeChat By PlayMe Studio
      Bundle ID: world.playme.mechat
      iTunes Store Link: https://apps.apple.com/us/app/mechat/id1536157979
       

      Hack Features:
      - Unlimited Gems -> Earn some then uninstall this hack. DO NOT SPEND ANY GEMS WHILST THIS FEATURE IS ENABLED!


      Non-Jailbroken & No Jailbreak required hack(s): [Non-Jailbroken Hack] MeChat - Love Secrets v3.3.2 +1 Jailed Cheat [ Unlimited Gems ] - Free Non-Jailbroken IPA Cheats - iOSGods
      Free Jailbreak required hack(s): [Mod Menu Hack] [Free] MeChat - Love Secrets v3.3.2 +1 Cheat [ Unlimited Gems ] - Free Jailbroken Cydia Cheats - iOSGods
      Modded Android APK(s): https://iosgods.com/forum/68-android-section/
      For more fun, check out the Club(s): https://iosgods.com/clubs/
        • Informative
        • Agree
        • Haha
        • Thanks
        • Winner
        • Like
      • 116 replies
    • [ FREE ] MeChat v4.26.0 +1 Cheat [ Unlimited Gems ]
      Modded/Hacked App: MeChat By PlayMe Studio
      Bundle ID: world.playme.mechat
      iTunes Store Link: https://apps.apple.com/us/app/mechat/id1536157979
       

      Hack Features:
      - Unlimited Gems -> Will increase instead of decrease.


      Non-Jailbroken & No Jailbreak required hack(s): [Non-Jailbroken Hack] MeChat - Love Secrets v3.3.2 +1 Jailed Cheat [ Unlimited Gems ] - Free Non-Jailbroken IPA Cheats - iOSGods
      ViP Jailbreak required hack(s): [Mod Menu Hack] MeChat - Love Secrets v3.3.2 +1 Cheat [ Unlimited Gems ] - ViP Cheats - iOSGods
      Modded Android APK(s): https://iosgods.com/forum/68-android-section/
      For more fun, check out the Club(s): https://iosgods.com/clubs/
        • Informative
        • Agree
        • Haha
        • Thanks
        • Winner
        • Like
      • 268 replies
    • The Simpsons™: Tapped Out v4.69.5 +3 Cheats
      Modded/Hacked App: The Simpsons™: Tapped Out By Electronic Arts Inc.
      Bundle ID: com.ea.simpsonssocial.inc2
      iTunes Store Link: https://apps.apple.com/us/app/the-simpsons-tapped-out/id497595276?uo=4


      Hack Features:
      - Free Store
      - Free Skipping
      - Extra Rewards (Receive when enter the game)


      Non-Jailbroken & No Jailbreak required hack(s): https://iosgods.com/topic/83384-the-simpsons%E2%84%A2-tapped-out-v4648-3-cheats-for-jailed-idevices/


      Hack Download Link: https://iosgods.com/topic/79480-the-simpsons%E2%84%A2-tapped-out-v4648-3-cheats/
        • Informative
        • Agree
        • Haha
        • Thanks
        • Winner
        • Like
      • 3,341 replies
    • WAR OF THE VISIONS FFBE Cheats v10.5.0 +3 [ Multiply Damage & Defense ]
      Modded/Hacked App: FINAL FANTASY BE:WOTV By SQUARE ENIX Co., Ltd.
      Bundle ID: com.square-enix.WOTVffbeww
      iTunes Store Link: https://apps.apple.com/us/app/final-fantasy-be-wotv/id1484937345?uo=4


      Hack Features:
      - Multiply Attack
      - Multiply Defense
      - Full Map Movement


      Non-Jailbroken & No Jailbreak required hack(s): https://iosgods.com/topic/173485-final-fantasy-bewotv-v730-jailed-cheats-3/


      iOS Hack Download Link: https://iosgods.com/topic/173483-war-of-the-visions-ffbe-cheats-v740-3-multiply-damage-defense/
        • Informative
        • Agree
        • Thanks
        • Winner
        • Like
      • 184 replies
    • LAST CLOUDIA Cheats v5.6.2 +5
      Modded/Hacked App: LAST CLOUDIA By AIDIS Inc.
      Bundle ID: com.aidis.lastcloudiaen
      iTunes Store Link: https://apps.apple.com/us/app/last-cloudia/id1473588527?uo=4


      Hack Features:
      - God Mode
      - Infinite MP
      - Infinite SP
      - Infinite Ether


      Non-Jailbroken & No Jailbreak required hack(s): https://iosgods.com/topic/147069-last-cloudia-v1160-jailed-cheats-1/


      iOS Hack Download Link: https://iosgods.com/topic/147068-last-cloudia-cheats-all-versions-1/
        • Informative
        • Agree
        • Haha
        • Thanks
        • Winner
        • Like
      • 440 replies
    • [ Last Cloudia TW ] 最後的克勞迪亞 Cheats v5.6.2 +5
      Modded/Hacked App: 最後的克勞迪亞 By Hong Kong Bao Chuan Software Technology Limited
      Bundle ID: com.boltrend.cloudia
      iTunes Store Link: https://apps.apple.com/tw/app/%E6%9C%80%E5%BE%8C%E7%9A%84%E5%85%8B%E5%8B%9E%E8%BF%AA%E4%BA%9E/id1530784975?uo=4



      Hack Features:
      - God Mode
      - Infinite MP
      - Infinite SP
      - Infinite Ether


      Non-Jailbroken & No Jailbreak required hack(s): https://iosgods.com/topic/139142-last-cloudia-tw-%E6%9C%80%E5%BE%8C%E7%9A%84%E5%85%8B%E5%8B%9E%E8%BF%AA%E4%BA%9E-v161-jailed-cheats-4/


      iOS Hack Download Link: https://iosgods.com/topic/139140-last-cloudia-tw-%E6%9C%80%E5%BE%8C%E7%9A%84%E5%85%8B%E5%8B%9E%E8%BF%AA%E4%BA%9E-cheats-all-versions-4/
        • Agree
        • Haha
        • Thanks
        • Winner
        • Like
      • 381 replies
    • [ Seven Deadly Sins JP ] - 七つの大罪 光と闇の交戦 : グラクロ Cheats v8.6.47 +5
      Modded/Hacked App: 七つの大罪 光と闇の交戦 : グラクロ By Netmarble Corporation
      Bundle ID: com.netmarble.nanatsunotaizai
      iTunes Store Link: https://apps.apple.com/jp/app/七つの大罪-光と闇の交戦-グラクロ/id1268959718?uo=4&at=1010lce4


      Hack Features:
      - God Mode
      - OHK


      iOS Hack Download Link: https://iosgods.com/topic/112888-seven-deadly-sins-%E4%B8%83%E3%81%A4%E3%81%AE%E5%A4%A7%E7%BD%AA-%E5%85%89%E3%81%A8%E9%97%87%E3%81%AE%E4%BA%A4%E6%88%A6-%E3%82%B0%E3%83%A9%E3%82%AF%E3%83%AD-v340-god-mode-unlimited-mp/
        • Informative
        • Agree
        • Haha
        • Thanks
        • Winner
        • Like
      • 1,031 replies
    • Mighty Party: Heroes Clash v45.1.0 +4 Jailed Cheats [Unlimited Currencies]
      Modded/Hacked App: Mighty Party: Heroes Clash By Satege s.r.o.
      Bundle ID: com.panoramik.forgeofgodsblitz
      iTunes Store Link: https://itunes.apple.com/us/app/mighty-party-heroes-clash/id1163805393


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


      Hack Features:
      - Unlimited Currencies - Will not decrease.
      - Free Summoning
      - Complete All Quests
        • Informative
        • Agree
        • Haha
        • Thanks
        • Winner
        • Like
      • 752 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