Android decompiles and modifies so files [concise tutorial]

Preparation

  • Create an ndk project
    and create a class "HelloWorld.java", the content is as follows
    insert image description here
    For the convenience of testing, we only need one abi
    insert image description here

  • Edit ndk.cpp
    insert image description here

  • Simply call
    insert image description here
    the device will display "ok888"

  • Package the project into apk, and decompile to obtain the so file in it

Start modifying the so file

  • Use the tool "IDA" to open the so file, and you will find the function we wrote, and the string "ok888" is clearly visible. I heard that
    insert image description here
    pressing f5 works better!
    insert image description here
  • Close IDA, use the "010 Editor" tool to open the so file,
    flip it up and down and find a very familiar place,
    insert image description here
    try changing "38" to "55"? Then save (ctrl+s)
    and open it with IDA, and found that the string ok888 has changed to "ok88U"

verify

Finally, verify our modification results, replace the original apk file with our modified so file, recompile and sign it, and finally run it. Surprisingly, the screen displays "ok88U"!

Guess you like

Origin blog.csdn.net/u010775335/article/details/126301279