7

Is it possible to edit values in memory used by an app? I would assume this requires root.

Matthew Read
  • 50,567
  • 30
  • 145
  • 273
gontadu
  • 261
  • 1
  • 3
  • 5
  • what do you need to do this for? I would assume that trying to do this would be very difficult due to android's sandboxing structure. –  May 22 '12 at 20:21
  • Which type of values you are talking about? – iOS May 23 '12 at 04:48
  • @SachinShekhar like counters? for example a button press counter or something. – gontadu Jun 24 '12 at 21:07

3 Answers3

4

That may be possible without root if the app you want to manipulate allows debugging via Android Debug Bridge (ADB). If an app can be connected to an debugger is specified in it's AndroidManifest.xml in the android:debuggable entry.

If the app is enabled for debugging you can enable the USB debugging mode on your device and connect to it via adb. Then you can connect an standard Java debugger to the app and inspect/modify variables.

If it does not allow debugging you can try to decompile it using apktool, change the debuggable value in AndroidManifest.xml and the re-build and sign the app (using a custom generated key pair).

A second alternative would be to include Frida Gadget into the app and load it at run-time. Then you can use Frida to connect to the app on an unrooted device and hook Java or native methods as well as modify app memory.

Robert
  • 20,025
  • 6
  • 47
  • 66
2

In Android the system memory is just another file, so with the appropriate rights it's just as simple as vi -b /dev/mem (device node may vary for your system). The result of changing a running system's memory could be one of a nop, a touch of an electric fence, a system crash or a simple nuke resulting in an unusable device.

ott--
  • 198
  • 1
  • 3
  • 12
  • 1
    how can you get an unusable device? I'd imagine the running apps would be in a different device from the actual ROM stuff? – gontadu Jun 24 '12 at 21:06
2

You can use a program called ACE Engine to scan and edit memory value of any running app or program in android which can be download here

you need to install the program with adb and run the program in adb shell

  1. run ACE engine and select a process which you want to edit its value.

  2. scan for value in process's memory, like a coin, health or anything

  3. you may got a couple of matches result you can reduces the matches, by changing the value in the game and scan for the new value to reduce scan results

  4. repeat the processes until you got 1 match

  5. write any value to the address to change the game/apk's value

you can find more details in the tutorial here

DISCLAIMER!!!: I am the author of this program

KuhakuPixel
  • 129
  • 4