jmpews / Dobby

a lightweight, multi-platform, multi-architecture hook framework.
Apache License 2.0
3.98k stars 822 forks source link

Using HookZz and VirtualApp together. #33

Closed jbro129 closed 6 years ago

jbro129 commented 6 years ago

Hello, I want to use HookZz on an app that is located inside of the virtual space of a host app that use VirtualApp by asLody. The main library I want to hook is located in /data/data/{Package Name}/virtual/data/app/{Package Name in Virtual Space}/lib/lib.so and not in /data/data/{Package Name}/lib/lib.so How would I hook and possibly use ZzHookReplace when lib I want to hook is located in a different directory? Does HookZz have an option to declare the lib location to hook?

Example of custom declaration of lib -> ZzHookLib(const char filename, const char mode FILE * stream );

Example of usage -> ZzHookLib("/data/data/com.example.example/lib/libgame.so", "w", stdout); Example of usage with VirtualApp -> ZzHookLib("/data/data/com.example.example/virtual/data/app/com.installed.example/lib/libgame.so", "w", stdout);

Or maybe you can use ZzHookReplace and add a parameter for the lib?

ZzHookReplace("/data/data/com.example.example/virtual/data/app/com.installed.example/lib/libgame.so", (void ) stuff_addr, (void ) fake_stuff, (void **) &orig_suff);

This is mostly just ideas I am hoping you can maybe implement.

jmpews commented 6 years ago

maybe you need GOT hook, AKA replace GOT symbol address.

jbro129 commented 6 years ago

ZzHookGOT says it only support Darwin, but I am working with Arm.