Captain woodlegs
Rookie
Hello, I want to make my first cheat for the Counter Flame game with root + MT manager .sh file. What do I need to prepare?
.sh. It is not a "download and install" guide - you will build the patch yourself. Read it once before touching anything.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.get_Health or the damage function and force a fixed value. Same mechanism every time: locate function, overwrite its first instructions, verify./proc/<pid>/mem writes.id from an MT terminal and seeing uid=0.pidof, printf or dd come back "not found".setenforce 0 as root. Enforcing SELinux is the number one cause of "Operation not permitted" on memory writes.com.ScarletWork.CounterFlame but the ID has changed between builds, so verify instead of trusting this post./data/app/ and find the folder matching that package. Copy base.apk out to your own storage.split_config.arm64_v8a.apk, in the same folder. Copy that too if it exists.lib/arm64-v8a/libil2cpp.so.assets/bin/Data/Managed/Metadata/global-metadata.dat.libil2cpp.so does not exist, the game is not IL2CPP and this guide stops applying.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.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.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.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.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..sh files as root. Create a new file, name it ammo.sh, and use this structure:#!/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"
pidof -s gets the PID and fails cleanly if the game is closed.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.echo lines are your log. MT prints them in its terminal.ammo.sh → Execute. Read the terminal output: it should show a base address and "patched". Go back to the game and confirm the effect.#!/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
.so patch persists but changes the APK signature and is far easier for an integrity check to catch. Start runtime./data/app/~~<hash>/ changes on every reinstall. Fine in a one-off command, wrong in a script you keep.