Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how can i hook unexported functions? #16

Closed
codingsf opened this issue Feb 14, 2020 · 4 comments
Closed

how can i hook unexported functions? #16

codingsf opened this issue Feb 14, 2020 · 4 comments
Labels

Comments

@codingsf
Copy link

cydiasbustrate can hook function by address, mshookfunction(modulebase + offset, proxy_func, stub_func). plz tell me how can i hook a function by address?

@steven-michaud
Copy link
Owner

There's an example in my hook library template. Please read it and let me know if you have any further questions.

@codingsf
Copy link
Author

codingsf commented Feb 14, 2020

I still don't known how i can hook a sub function. in Hooked_sub_123abc, there are two question.

  1. is 123abc a relative address in the main module,so i should minus the module base address?
  2. if i want to hook a number-address function in none main module, how can i appoint the module name?

tks, your hookcase is a usefull project. I read your cases many times,still confused.


after tries of many times, i've got what i want. thanks again!

  1. yes
  2. patch_function can help specify the module name!

@steven-michaud
Copy link
Owner

I don't think there's anything I can say here that will make things clearer than than what I've already said in my documentation.

To use HookCase, you need to be familiar with disassemblers and assembly code. In my favorite disassembler, Hopper Disassembler, internal functions that aren't in a module's symbol table are given names composed of the prefix "sub_" and the function's address (in hexadecimal format) in the module's file on disk -- for example sub_123abc(). As the example shows, you can use this "name" to hook the function by its address. HookCase figures out where the function is in actual random access memory, into which the module has been loaded.

@steven-michaud
Copy link
Owner

Oops, I see that you've already figured things out. I'll close this bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants