I'm currently developing the SO plugin loader for the existing SO library (GTA SA for Android). The SO libraries on Android are Unix ELF files. Having no source code of the library I cannot simply add the imported function in source code and compile the SO library again.
There is libGTASA.so, which I want to edit and alter the import table, adding a new symbol RunSOpluginLoader, which would be implemented in libFastman92pluginLoader.so, which is already loaded before libGTASA.so gets loaded, by Java code (classes.dex) that I also have modified.
For EXE files on Windows there are plenty of programs to edit the imports and I'd use LordPE. For ELF file I need a different solution however and I'm having a trouble with finding one.
I tried using HT Editor, which is supposed to open and edit the ELF files, but few seconds after libGTASA.so gets opened in HT Editor the application simply crashes.
I need a solution to add an import to SO library, preferably the solution that would run on Windows, but if there's none then I am willing to do it on Linux system.
After properly adding an import I am going to edit a bit of ARM code inside the libGTASA.so to actually call the newly imported function.
Essentially:
libGTASA.so - I want to add an imported symbol RunSOpluginLoader to this file.
Few days after I wrote the question I figured out how to do this task. I had written a simple ELF file manager class in C++ and program, which does the following:
If you want to learn more about or get the code, feel free to contact me.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.