I reverse engineered some android apks to add some instrumentation for functional testing. I want to know given an smali as following how can I add something like
A comment on registers that was too large for a comment to JesusFreke's answer. It is worth mentioning that if you have .local
directives instead of .register
directives, the number scheme will be different. Roughly speaking, the directives relate in the following manner:
.registers = .locals + NUMBER_OF_PARAMETERS
So if you have a function that has 4 parameters and uses 3 more registers the directives that could show up are .registers 7
or .locals 3
.
And you will get the registers setup as follows:
v0
v1
v2
v3 <==> p0
v4 <==> p1
v5 <==> p2
v6 <==> p3
Source: https://github.com/JesusFreke/smali/wiki/Registers