Comments (10)
You can use AKLoadImage
with absloute or relative path to load the specified lib, and then get stuff_addr
via AKFindSymbol
.
For more information, see https://github.com/Rprop/AndHook/blob/master/lib/include/AndHook.h
from andhook.
What if the library I want to load does not have any symbols? Can I use AKHookFunction and specify an offset to hook? The library I want to hook all the functions are removed and the symbols are removed. I found the function I want to hook at an offset (let's say 0x12345 function name is sub_12345 with no symbol). How do I hook the library at a specific offset in the file?
from andhook.
stuff_addr = AKGetBaseAddress + load_bias + offset
from andhook.
Like this?
void *lib =
AKLoadImage("/data/data/com.package.name/virtual/data/app/com.package.name/lib/libgame.so", 1, What Goes Here?);
if (lib != NULL) {
void *addr = (int)AKGetBaseAddress(lib) + load_bias??? + 0x12345;
if (addr != NULL)
{
AKHookFunction(addr, hook_shotgun_Update, &orig_shotgun_Update);
}
AKCloseImage(lib);
What would go in the two spaces that I dont know what to fill with? The third parameter of AKLoadImage which is to do with Nougat and 'load_bias' which I do not know what that is.
is load_bias 'void *lib'?
( void *addr = AKGetBaseAddress(lib) + lib + 0x12345; )
from andhook.
Can you please help me fill in the blanks for the code in the comment above? Thank you so much @Rprop ! 👍
from andhook.
AKFindAnonymity(lib, 0x12345)
from andhook.
My app crashed when I do System.loadLibrary("jbro");
in my MainActivity.
Here is libjbro.so
int (*orig_freedom_Update)(const int *) = NULL; // 0x12345 int hook_freedom_Update(const int *) { return 0; } void freedom() { LOG("starting native hook..."); { static bool hooked = false; if (!hooked) { void *lib = AKLoadImage("/data/data/com.package.name/virtual/data/app/com.package.name/lib/libgame.so",0, NULL); if (lib != NULL) { void *p = AKFindAnonymity(lib, 0x12345); if (p != NULL) { AKHookFunction(p, reinterpret_cast<void *>(hook_freedom_Update), reinterpret_cast<void **>(&orig_freedom_Update)); } AKCloseImage(lib); } //if hooked = true; } //if } }
Here is my logcat
06-27 02:10:27.568 11359-11359/? A/DEBUG: Build fingerprint: 'samsung/gts28vewifixx/gts28vewifi:7.0/NRD90M/T713XXU2BQI1:user/release-keys' Revision: '5' ABI: 'arm' pid: 11141, tid: 11141, name: ge_me_to_smthn4 >>> com.package.name <<< signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0 r0 00cd3b44 r1 00000000 r2 c60fd6e9 r3 00000001 r4 e8ff9178 r5 c60fd6e9 r6 dbd73a90 r7 ffad0f20 r8 e8ff9178 r9 e90085bc sl e8ff9167 fp dbd73a90 ip 00000000 sp ffad0f20 lr c60fd6fd pc 00000000 cpsr 800f0010 06-27 02:10:27.573 11359-11359/? A/DEBUG: backtrace: #00 pc 00000000 <unknown> #01 pc 000006fb /data/app/com.package.name-1/lib/arm/libjbro.so #02 pc 00006039 /system/bin/linker (__dl__ZN6soinfo13call_functionEPKcPFvvE+84) #03 pc 00005f59 /system/bin/linker (__dl__ZN6soinfo10call_arrayEPKcPPFvvEjb+184)
//Edit 1 - I dont know why the Logcat is malformed like that.
from andhook.
more detailed log?
from andhook.
Yes I managed to find one more log
E/art: No implementation found for java.lang.String andhook.lib.AndHook.getVersionInfo() (tried Java_andhook_lib_AndHook_getVersionInfo and Java_andhook_lib_AndHook_getVersionInfo__)
from andhook.
I removed using the java method andhook.lib.AndHook.ensureNativeLibraryLoaded(null);
to load the libraries. I removed using that method and used System.loadLibrary("AK");
and System.loadLibrary("AKCompat");
instead before I do System.loadLibrary("jbro");
Now I get this.
java.lang.UnsatisfiedLinkError: dlopen failed: "/data/app/com.package.name-1/lib/arm/libAKCompat.so" has unexpected e_machine: 3
from andhook.
Related Issues (20)
- zygote AKInitializeOnce失败 HOT 2
- How to install andhook? HOT 1
- NoSuchMethodError getPackageInfo
- hook libc.so clock_gettime 闪退
- 如何hook微信方法?
- 寻求andhook 二次开发
- 混淆proguard咋写
- When does this tool support android Q?
- 如何在andhook的app程序里hook另一个app里的方法? HOT 1
- andhook crash when arm64 app
- 在Android9.0上直接崩溃,请问有支持Android9.0的计划么
- hook fun getPackageName inoperative
- hook fun getPackageName inoperative
- How to hook events?
- proc/$pid/mem HOT 1
- I got error
- crashing on 64 bit
- How to use in cmake
- 請問一下程式的用途
- AndHook loading aborted
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from andhook.