When I search text in a folder using bash I can see that text is in binary file. I would like to change the text in *.so file.

  • Before this job, you should make a back-up your original .so file.
  • Following command may destroy your files.

    1. open your library with vi editor.
      • Here, the target is not .so file.
      • As .so is a symbolic link in general, you have to find an original destination file.
    2. enter :%!xxd
      • This command changes file display format from binary to hex and ASCII.
    3. modify what you want, that is, text.
      • You must modify on the left, Hex code, not right side, ASCII chars.
      • You must not insert or delete characters, only replace them. You can't make a string longer. You can make a string shorter by putting nul characters (press Ctrl+V Ctrl+@) at the end.
    4. After modification, enter :%!xxd -r
      • It will recover display format into binary.
    5. save your file and exit, by entering :wq.
  • I don't know how to use vim, I changed the text file directly with gvim. But .so file is broken.I couldn't be successful.. – Edip Ahmet Jun 20 '17 at 20:53
  • 1
    @EdipAhmet You probably changed the length of a string. That won't work: the code looks for each string at a certain position. There's no realistic way to change the length of a string without recompiling the source code. – Gilles Jun 20 '17 at 23:11
  • @Gilles I see. So there is no way to change closed source shared libraries. I wanted to change text of a closed source binary which the SDK is used to build Android apps. There is a tag named "Developer Use Only" on Android app when I use this SDK. So I won't use the SDK. – Edip Ahmet Jun 20 '17 at 23:32
  • @EdipAhmet Not really. There's a reason why people edit source code and not binaries. Changing binaries in nontrivial ways can be done but you need to be good at reverse engineering. There's probably another way to solve your problem though. – Gilles Jun 20 '17 at 23:36
  • @Gilles Yes I think there might be a way for this. I searched on the Internet but I couldn't find anything for cracking Linux shared libraries. It might be easy to find a way to get source code on Windows platforms. Protected Visual Basic binaries can be cracked using hex editor. Executable binary files of .NET can be cracked using third part softwares and can be reached the source code :) – Edip Ahmet Jun 21 '17 at 0:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.