Jump to content

Some C# To Il2cpp Conversions


Jbro129

36 posts in this topic

Recommended Posts

Background

I created a unity project on my computer and wrote simple C# to then convert to Arm through Unity's Il2cpp compiler.  I have more complicated conversions but they would be pretty hard to explain.  If you do want those conversions then make sure to comment below :)

Example Conversions

Force True: C#

    private bool True()
    {
        return true;
    }

Force True: IDA Arm

 MOV             R0, #1
 BX              LR
hex -> 01 00 A0 E3 1E FF 2F E1

 

 

Force False: C#

    private bool False()
    {
        return false;
    }

Force False: IDA Arm

 MOV             R0, #0
 BX              LR
hex -> 00 00 A0 E3 1E FF 2F E1

 

 

Force positive int: C#

    private int pInt()
    {
        return 999;
    }

Force positive int: IDA Arm

 MOV             R0, #999
 BX              LR
hex -> E7 03 00 E3 1E FF 2F E1

 

 

Force Float: C#

    private float pFloat()
    {
        return 999f;
    }

Force Float: IDA Arm

 MOV             R0, #0x447A
 BX              LR
hex -> 7A 04 04 E3 1E FF 2F E1
// 447A <= 447A0000 Float Hexadecimal
// Convert Int to Float here - https://babbage.cs.qc.cuny.edu/IEEE-754.old/Decimal.html
// Convert Float to Int here - https://babbage.cs.qc.cuny.edu/IEEE-754.old/32bit.html

You CANNOT use hexadecimals longer than 4 character long

Working example => Movt r0, #447A (1000 int)

Not-Working Example => Movt r0, #4479C (999 int)

There is a way to use longer hexadecimal floating points with MOV and I plan on adding it in the future.

 

 

Force Int or Float into a field: C#

//float
    private void setFieldF()
    {
        fieldF = 1000F;
    }

    public float fieldF;

//int
    private void setFieldI()
    {
        fieldI = 1000;
    }

    public int fieldI;

Force Int or Float into a field: IDA Arm

Get your field offset from your generated dump.cs from Il2CppDumper by Prefare.

//float field
 MOV             R1, #0x447A
 STR             R1, [R0,#0x10] // replace "0x10" with your field offset inside of dump.cs
 BX              LR
hex -> 7A 14 04 E3 10 10 80 E5 1E FF 2F E1
   
//int field
 MOV             R1, #1000
 STR             R1, [R0,#0x14] // replace "0x14" with your field offset inside of dump.cs
 BX              LR
hex -> FA 1F A0 E3 14 10 80 E5 1E FF 2F E1

 

 

Force Return with Parameters:  C#

// 1 Parameter
	private string Param1(string one)
    {
        return one;
    }

//2 Parameters
	private int Param2(int one, int two)
    {
        return two;
    }

//3 Parameters
	private int Param2(float one, float two, float three)
    {
        return three;
    }

Force Return with Parameters:  IDA Arm

It does not matter if the function is string, int, or float, if the function is the same type as the parameter then it will be the same arm code regardless.

//1 Parameter
 MOV             R0, R1
 BX              LR
hex -> 01 00 A0 E1 1E FF 2F E1
//2 Parameters
 MOV             R0, R2
 BX              LR
hex -> 02 00 A0 E1 1E FF 2F E1
//3 Parameters
 MOV             R0, R3
 BX              LR
hex -> 03 00 A0 E1 1E FF 2F E1
//if the function has more than 3 parameters then reolace the second "R" with said parameter number
Example: 7 Parameters
 MOV             R0, R7
 BX              LR
hex -> 07 00 A0 E1 1E FF 2F E1
Example: 5 Parameters
 MOV             R0, R5
 BX              LR
hex -> 05 00 A0 E1 1E FF 2F E1

 

 

Force end an IEnumertor/IEnumerable: C#

    private IEnumerator setYielEnumerator()
    {
        yield break;
    }

    private IEnumerable setYieldEnumerable()
    {
        yield break;
    }

Force end an IEnumertor/IEnumerable: IDA Arm

Using BX LR to end an IEnumertor or IEnumerable is wrong.  Go to dump.cs and find the IEnumertor or IEnumerable function

Say for example dump.cs says this

private IEnumerator setYielEnumerator(); // 0xOFFSET

or

private IEnumerable setYieldEnumerable(); // 0xOFFSET

Find the "sealed class" that has the function name in the class name

Example

// Namespace: 
private sealed class <setYielEnumerator>c__Iterator0 : IEnumerator, IDisposable, IEnumerator`1<object> // TypeDefIndex: 1446
{
	// Fields
	internal object $current; // 0x8
	internal bool $disposing; // 0xC
	internal int $PC; // 0x10

	// Methods
	public void .ctor(); // 0xOFFSET
	public bool MoveNext(); // 0xOFFSET
	private object System.Collections.Generic.IEnumerator<object>.get_Current(); // 0xOFFSET
	private object System.Collections.IEnumerator.get_Current(); // 0xOFFSET
	public void Dispose(); // 0xOFFSET
	public void Reset(); // 0xOFFSET
}

// Namespace: 
private sealed class <setYieldEnumerable>c__Iterator1 : IEnumerable, IEnumerable`1<object>, IEnumerator, IDisposable, IEnumerator`1<object> // TypeDefIndex: 1447
{
	// Fields
	internal object $current; // 0x8
	internal bool $disposing; // 0xC
	internal int $PC; // 0x10

	// Methods
	public void .ctor(); // 0xOFFSET
	public bool MoveNext(); // 0xOFFSET
	private object System.Collections.Generic.IEnumerator<object>.get_Current(); // 0xOFFSET
	private object System.Collections.IEnumerator.get_Current(); // 0xOFFSET
	public void Dispose(); // 0xOFFSET
	public void Reset(); // 0xOFFSET
	private IEnumerator System.Collections.IEnumerable.GetEnumerator(); // 0xOFFSET
	private IEnumerator`1<object> System.Collections.Generic.IEnumerable<object>.GetEnumerator(); // 0xOFFSET
}

Go to the offset of MoveNext()

public bool MoveNext(); // 0xOFFSET

And write this in hex editor

 MOV             R1, #0xFFFFFFFF
 STR             R1, [R0,#0x10]
 MOV             R0, #0
 BX              LR
hex -> 00 10 E0 E3 10 10 80 E5 00 00 A0 E3 1E FF 2F E1
//same hex for both IEnumertor and IEnumerable

Credits

@Jbro129 for the tutorial

Prefare for Il2CppDumper

- Kienn, @Valeschi ,  @Earthiest and @DiDA for Armconverter.com

Updated by Jbro129
  • Like 3
  • Winner 1
  • Thanks 1
  • Agree 1
  • Informative 2
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

    • Dragons: Rise of Berk v1.83.11 +6 Cheats
      Modded/Hacked App: Dragons: Rise of Berk By Jam City, Inc.
      Bundle ID: com.ludia.dragons
      iTunes Store Link: https://apps.apple.com/us/app/dragons-rise-of-berk/id667461862?uo=4


      Hack Features:
      - Free Shopping (shows original cost but able to purchase regardless)
      - Free Skipping
      - Free Odin's Market Shopping
      - Odin's Market Packs Never Reduce
      - Currency Hack [Spend to Gain - reverts to zero on next launch]
      - Enable Rider's Club


      Non-Jailbroken & No Jailbreak required hack(s):  https://iosgods.com/topic/79228-dragons-rise-of-berk-v1794-4-cheats-for-jailed-idevices/


      iOS Hack Download Link: https://iosgods.com/topic/139612-dragons-rise-of-berk-v1794-6-cheats/
      • 583 replies
    • Toram Online v4.0.29 - [ Custom Move Speed & More ]
      Modded/Hacked App: Toram Online By ASOBIMO,Inc.
      Bundle ID: com.asobimo.toramonline
      iTunes Store Link: https://itunes.apple.com/us/app/toram-online/id988683886?mt=8&uo=4&at=1010lce4
       

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


      Hack Features:
      - Custom Move Speed
      - God Mode 
      - Fast Attack Speed
      - Fast Cast Speed
      - Always Critical Chance
      - Never Miss Hit 
      - Mobs/Bosses Can't Avoid & Guard 
      - Quick Draw
      - Armor Break
      - Magic Wall - Stun + Full Map Hack 
      • 2,394 replies
    • Shadow Fight 2 v2.34 Cheats +3
      Modded/Hacked App: Shadow Fight 2 By MOBILNYE IGRY OOO
      Bundle ID: com.nekki.shadowfight
      iTunes Store Link: https://apps.apple.com/us/app/shadow-fight-2/id696565994?uo=4


      Mod Requirements:
      - Jailbroken iPhone/iPad/iPod Touch.
      - iGameGod / Filza / iMazing or any other file managers for iOS.
      - Cydia Substrate, Substitute or libhooker depending on your jailbreak.
      - PreferenceLoader (from Cydia, Sileo or Zebra).


      Hack Features:
      - Unlimited gold
      - Unlimited gem
      - Max level
      • 75 replies
    • Shadow Fight 2 v2.34 Cheats +3
      Modded/Hacked App: Shadow Fight 2 By MOBILNYE IGRY OOO
      Bundle ID: com.nekki.shadowfight
      iTunes Store Link: https://apps.apple.com/us/app/shadow-fight-2/id696565994?uo=4


      Mod Requirements:
      - Non-Jailbroken/Jailed or Jailbroken iPhone/iPad/iPod Touch.
      - Sideloadly / Cydia Impactor or alternatives.
      - A Computer Running Windows/macOS/Linux with iTunes installed.


      Hack Features:
      - Unlimited gold
      - Unlimited gem
      - Max level


      Jailbreak required hack(s): https://iosgods.com/forum/5-game-cheats-hack-requests/
      Modded Android APK(s): https://iosgods.com/forum/68-android-section/
      For more fun, check out the Club(s): https://iosgods.com/clubs/
      • 497 replies
    • Abyss - Roguelike ARPG v1.92 Cheats +4
      Modded/Hacked App: Abyss - Roguelike ARPG By Pyro Entertainment Limited
      Bundle ID: com.titans.abyss
      iTunes Store Link: https://apps.apple.com/us/app/abyss-roguelike-arpg/id6443793989?uo=4

       

      Mod Requirements:
      - Non-Jailbroken/Jailed or Jailbroken iPhone/iPad/iPod Touch.
      - Sideloadly / Cydia Impactor or alternatives.
      - A Computer Running Windows/macOS/Linux with iTunes installed.


      Hack Features:
      - Stupid enemies
      - AOE atk
      - Always combo
      - Fast atk
      • 22 replies
    • Abyss - Roguelike ARPG v1.92 Cheats +6 [semi-autoupdate]
      Modded/Hacked App: Abyss - Roguelike ARPG By Pyro Entertainment Limited
      Bundle ID: com.titans.abyss
      iTunes Store Link: https://apps.apple.com/us/app/abyss-roguelike-arpg/id6443793989?uo=4


      Mod Requirements:
      - Jailbroken iPhone/iPad/iPod Touch.
      - iGameGod / Filza / iMazing or any other file managers for iOS.
      - Cydia Substrate, Substitute or libhooker depending on your jailbreak.
      - PreferenceLoader (from Cydia, Sileo or Zebra).


      Hack Features:
      - Enermies no atk
      - Stupid enemies
      - Speed move
      - AOE atk
      - Always combo
      - Fast atk
      • 66 replies
    • Idle Ninja Online v2060 Cheats +15
      Modded/Hacked App: Idle Ninja Online By Puzzle Monsters Inc.
      Bundle ID: com.puzzlemonsters.growninja
      iTunes Store Link: https://apps.apple.com/us/app/idle-ninja-online/id1559182313?uo=4


      Hack Features:
      - no cool skill
      - no need mana
      - speed
      - max level
      - fast shot
      - penetration
      - multi shot
      - far FOV (in setting)
      - can move 
      - reduce animation
      - skin dame (need show damege skin in setting, from 1 to 23)
      - antiban (not sure 100%) 


      Non-Jailbroken & No Jailbreak required hack(s): https://iosgods.com/forum/79-no-jailbreak-section/
      Modded Android APK(s): https://iosgods.com/forum/68-android-section/
      For more fun, check out the Club(s): https://iosgods.com/clubs/
      • 507 replies
    • Basketball Arena - Sports Game v1.109 Cheats +3
      Modded/Hacked App: Basketball Arena - Sports Game By MASOMO LIMITED
      Bundle ID: com.masomo.basketballarena
      iTunes Store Link: https://apps.apple.com/us/app/basketball-arena-sports-game/id1491198695?uo=4


      Mod Requirements:
      - Non-Jailbroken/Jailed or Jailbroken iPhone/iPad/iPod Touch.
      - Sideloadly / Cydia Impactor or alternatives.
      - A Computer Running Windows/macOS/Linux with iTunes installed.


      Hack Features:
      - Speed move
      - Skip transition
      - Unlimited mana
      - Dump AI
      • 5 replies
    • Basketball Arena - Sports Game v1.109 Cheats +4
      Modded/Hacked App: Basketball Arena - Sports Game By MASOMO LIMITED
      Bundle ID: com.masomo.basketballarena
      iTunes Store Link: https://apps.apple.com/us/app/basketball-arena-sports-game/id1491198695?uo=4

       

      Mod Requirements:
      - Jailbroken iPhone/iPad/iPod Touch.
      - iGameGod / Filza / iMazing or any other file managers for iOS.
      - Cydia Substrate, ElleKit, Substitute or libhooker depending on your jailbreak.
      - PreferenceLoader (from Cydia, Sileo or Zebra).


      Hack Features:
      - Speed move
      - Skip transition
      - Unlimited mana
      - Dump AI
      • 7 replies
    • Critical Strike CS: Online FPS v12.805 +3 Jailed Cheats [ Unlimited Ammo ]
      Modded/Hacked App: Critical Strike CS: Online FPS By VERTIGOGAMES OU
      Bundle ID: com.vertigo.criticalforce
      iTunes Store Link: https://apps.apple.com/us/app/critical-strike-cs-online-fps/id1467648713?uo=4


      Hack Features:
      - Unlimited Ammo -> Will not decrease.
      - All Weapon Skins Unlocked
      - All Gloves Unlocked


      Jailbreak required hack(s): [Mod Menu Hack] Critical Strike CS: Online FPS v12.709 +6 Cheats [ Damage + More ] - 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/
      • 24 replies
    • Critical Strike CS: Online FPS v12.805 +6 Cheats [ Damage + More ]
      Modded/Hacked App: Critical Strike CS: Online FPS By VERTIGOGAMES OU
      Bundle ID: com.vertigo.criticalforce
      iTunes Store Link: https://apps.apple.com/us/app/critical-strike-cs-online-fps/id1467648713?uo=4


      Hack Features:
      - Damage Multiplier
      - Fire Rate Multiplier
      - Move Speed Multiplier
      - Unlimited Ammo -> Will not decrease.
      - All Weapon Skins Unlocked
      - All Gloves Unlocked


      Non-Jailbroken & No Jailbreak required hack(s): [Non-Jailbroken Hack] Critical Strike CS: Online FPS v12.709 +3 Jailed Cheats [ Unlimited Ammo ] - 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/
      • 27 replies
    • College: Perfect Match v1.0.53 +100++ Jailed Cheats [ Debug Menu ]
      Modded/Hacked App: College: Perfect Match By RANGOSIOUS HOLDINGS LIMITED
      Bundle ID: com.amrita.college
      iTunes Store Link: https://apps.apple.com/us/app/college-perfect-match/id6469139716?uo=4


      Hack Features:
      - Debug Menu -> Head over to Settings and toggle the Sound button.


      Jailbreak required hack(s): [Mod Menu Hack] College: Perfect Match v1.0.41 +100++ Cheats [ Debug Menu ] - 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/
      • 15 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