modifying .smali files

前端 未结 3 1538
伪装坚强ぢ
伪装坚强ぢ 2020-12-23 18:11

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



        
3条回答
  •  一整个雨季
    2020-12-23 18:41

    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

提交回复
热议问题