Help! I want to make my first counter flame cheat with root+Mt manager

This is a from-zero walkthrough for your first CounterFlame cheat with root and an MT Manager .sh. It is not a "download and install" guide - you will build the patch yourself. Read it once before touching anything.

Note: several links below are Platinmods threads with gated downloads. You need to be registered and hit Like or leave a comment on those threads to reveal the tools.

How the cheat actually works
CounterFlame is a Unity IL2CPP game. Its C# logic is compiled into native ARM64 code inside libil2cpp.so, so there is nothing readable to edit in the APK. Instead you patch the library in memory while the game runs: your script finds the game's process ID, looks up where the game mapped libil2cpp.so, and overwrites a few bytes of one function through /proc/<pid>/mem.

MT Manager is not doing anything magic here. It is your root shell and script runner. The cheat is your script plus your offset.

Concretely, to make a weapon fire infinitely you find the function that decrements ammo and make it return without touching the count. To be unkillable you find get_Health or the damage function and force a fixed value. Same mechanism every time: locate function, overwrite its first instructions, verify.

This is also the method that survives anti-cheat best, because you never touch the APK or the library on disk. There is a dedicated write-up on why that matters here: Memory Patching Using Dumped Il2cpp Offset.

Step 1 - Prepare the phone
  1. Unlocked bootloader with Magisk or KernelSU installed. No root, no /proc/<pid>/mem writes.
  2. Open MT Manager and grant it root permanently when it asks. Confirm root works by running id from an MT terminal and seeing uid=0.
  3. Install busybox if pidof, printf or dd come back "not found".
  4. Set SELinux to permissive for testing: setenforce 0 as root. Enforcing SELinux is the number one cause of "Operation not permitted" on memory writes.
  5. Keep a second device or adb on a PC available. Debugging a script on the phone the game is running on is miserable.
If MT Manager is new to you, its feature set is documented here: [Android] MT Manager - A powerful file manager with APK editor.

Step 2 - Get the game's files
  1. Get the exact package name from MT's app list. It is currently com.ScarletWork.CounterFlame but the ID has changed between builds, so verify instead of trusting this post.
  2. In MT, open /data/app/ and find the folder matching that package. Copy base.apk out to your own storage.
  3. On Android 11+ the native libs usually live in a separate split, split_config.arm64_v8a.apk, in the same folder. Copy that too if it exists.
  4. Open the APKs in MT and extract lib/arm64-v8a/libil2cpp.so.
  5. Also extract assets/bin/Data/Managed/Metadata/global-metadata.dat.
Those two files are everything. If libil2cpp.so does not exist, the game is not IL2CPP and this guide stops applying.

Dealing with split APKs is covered here if you get confused: How to merge split APK's into standalone APK.

Step 3 - Dump the class structure
Move both files to a PC and run Il2CppDumper against them. It produces dump.cs, a plain-text listing of every class, method and its RVA. There is a GUI build that removes the command line: Il2CppDumper GUI+CLI Tool (Windows). Background reading on what the dump is actually showing you: Understanding Il2Cpp structure - #1.

If Il2CppDumper errors out on the metadata, it is encrypted or obfuscated and the static route is closed. In that case use a runtime dumper:


Step 4 - Pick a target
Search dump.cs for candidate methods. Good first targets, easiest first:

  • get_Ammo / set_Ammo / Reload - infinite ammo.
  • get_Health / TakeDamage / get_IsDead - god mode.
  • get_Recoil / spread setters - laser accuracy.
  • get_IsVisible - wallhack logic, later on.
Write down the method name and its RVA. Do not pick five at once for your first run.

Step 5 - Find the offset and choose the bytes
Open libil2cpp.so in Ghidra, load it as AARCH64, and go to the RVA. That RVA is your offset - it is relative to the library base, never an absolute address, because ASLR moves the base every launch.

Read the first instructions of the function and decide the patch. The standard ARM64 byte patterns and what each is for are collected here: Hex Codes for ARM64 modding | True | False | NOP | High Value. The ones you will actually use:

  • C0 03 5F D6 = RET. The function does nothing. Good for a decrement routine you want skipped.
  • 20 00 80 D2 C0 03 5F D6 = mov x0, #1 then RET. The function always returns true. Good for get_IsDead, get_CanShoot, any bool.
  • 00 00 80 D2 C0 03 5F D6 = returns false / 0. Good for cooldowns and "is reloading" checks.
  • 1F 20 03 D5 = NOP. Neutralises a single instruction without killing the whole function. Follow it with a RET if you are closing the method.
Offsets must land on a 4-byte boundary. Patching mid-instruction corrupts the function. If you want to return a specific number instead of just true, see LIST OF HEX CODES | YEARS OF RESEARCH and How to convert C++ code to ARM32/ARM64 assembly.

Step 6 - Test in GameGuardian before scripting
Do not write the script first. Install GameGuardian, select CounterFlame as target, go to address libil2cpp.so + your offset, write the bytes, and check the effect in a match. If it crashes, you picked the wrong function or misaligned the offset, and it is much faster to find that out here than through a script.

Only once the patch works live do you have something worth scripting. If offset hunting itself is new to you: How to find offsets with GG (Tutorial) and GameGuardian Lesson - Searching encrypted "known" value.

Step 7 - Write the script
MT Manager runs .sh files as root. Create a new file, name it ammo.sh, and use this structure:

Code:
#!/system/bin/sh
PKG="com.ScarletWork.CounterFlame"
PID=$(pidof -s "$PKG") || { echo "game not running"; exit 1; }
BASE=$(grep -m1 libil2cpp.so /proc/$PID/maps | cut -d'-' -f1)
[ -z "$BASE" ] && { echo "lib not loaded, enter a match first"; exit 1; }
ADDR=$((0x$BASE + 0x1A2B3C))     # <- your offset
echo "base: $(printf 0x%X $BASE)  target: $(printf 0x%X $ADDR)"
kill -STOP $PID
printf '\xC0\x03\x5F\xD6' | dd of=/proc/$PID/mem bs=1 seek=$ADDR conv=notrunc 2>/dev/null
kill -CONT $PID
echo "patched"
Why each part matters:

  • pidof -s gets the PID and fails cleanly if the game is closed.
  • The grep pulls the first mapping of the library out of /proc/$PID/maps and cuts the start address. That is the runtime base.
  • kill -STOP freezes the process so the CPU is not executing the bytes you are overwriting, kill -CONT resumes it. Skip this and you get random crashes.
  • bs=1 with conv=notrunc stops dd from truncating the memory file.
  • The echo lines are your log. MT prints them in its terminal.

Step 8 - Run it
Launch CounterFlame, get into a match so the library is loaded, then switch to MT and long-press ammo.sh → Execute. Read the terminal output: it should show a base address and "patched". Go back to the game and confirm the effect.

If you get "Operation not permitted", SELinux is still enforcing. If the game crashes on return, the offset or alignment is wrong. If nothing happens at all, the function you patched is not the one the game actually reads from.

Step 9 - Make it toggleable
A one-way patch means rebooting the game to undo it. Store the original bytes and let the script flip between them:

Code:
#!/system/bin/sh
PKG="com.ScarletWork.CounterFlame"
PID=$(pidof -s "$PKG") || exit 1
BASE=$(grep -m1 libil2cpp.so /proc/$PID/maps | cut -d'-' -f1)
ADDR=$((0x$BASE + 0x1A2B3C))
FLAG=/data/local/tmp/ammo.on
kill -STOP $PID
if [ -f "$FLAG" ]; then
  printf '\x1F\x20\x03\xD5' | dd of=/proc/$PID/mem bs=1 seek=$ADDR conv=notrunc 2>/dev/null
  rm "$FLAG"; echo "off"
else
  printf '\xC0\x03\x5F\xD6' | dd of=/proc/$PID/mem bs=1 seek=$ADDR conv=notrunc 2>/dev/null
  touch "$FLAG"; echo "on"
fi
kill -CONT $PID
Replace the "off" bytes with the real originals you read in Ghidra, not the NOP placeholder, so toggling is a true restore.

Step 10 - What will bite you
  • Hardcoded absolute addresses. They break every launch. Only ever store offsets.
  • Game updates. Every patch moves every RVA. Re-dump and re-find the offset after each update; the old number will silently patch the wrong thing.
  • Anti-cheat. CounterFlame advertises instant cheater bans and almost certainly validates some values server-side. Keep patches small and behavioural - infinite ammo and health usually pass, teleporting and speed hacks get noticed. Change one thing at a time so you know what triggered a ban.
  • Runtime vs static. Runtime patching survives signature and integrity checks and needs no resigning, but dies when the process closes. A static .so patch persists but changes the APK signature and is far easier for an integrity check to catch. Start runtime.
  • Hardcoded APK paths. The hash in /data/app/~~<hash>/ changes on every reinstall. Fine in a one-off command, wrong in a script you keep.
Before scripting, be able to fill this in: package, offset, original bytes, new bytes, function name, expected effect. If you cannot, you are still at Step 4.

Further reading
All of these were checked and load fine.

 
Last edited:
Back
Top Bottom