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

Simplify Detour API #47

Closed
rdbo opened this issue Dec 21, 2022 · 2 comments
Closed

Simplify Detour API #47

rdbo opened this issue Dec 21, 2022 · 2 comments

Comments

@rdbo
Copy link
Owner

rdbo commented Dec 21, 2022

Instead of having LM_MakeTrampoline, LM_DestroyTrampoline, etc, what could be done is have a single LM_Detour function that has a parameter which would be the pointer to a trampoline. If that pointer is not null, generate the trampoline. If it is null, don't do anything.
Prototype:

LM_API lm_size_t
LM_Detour(lm_address_t src, lm_address_t dst, lm_address_t *ptrampoline);

LM_API lm_bool_t
LM_RestoreDetour(lm_address_t ptrampoline, lm_size_t size);
@rdbo rdbo mentioned this issue Dec 22, 2022
@rdbo
Copy link
Owner Author

rdbo commented Dec 23, 2022

New internal API: 9339934 4823a5d 40b2b17

Declarations:

LM_API lm_size_t
LM_HookCode(lm_address_t  from,
	    lm_address_t  to,
	    lm_address_t *ptrampoline);

LM_API lm_bool_t
LM_UnhookCode(lm_address_t  from,
	      lm_address_t  trampoline,
	      lm_size_t     size);

@rdbo
Copy link
Owner Author

rdbo commented Dec 23, 2022

New external API: bb91547

Declarations:

LM_API lm_size_t
LM_HookCodeEx(lm_process_t  proc,
	      lm_address_t  from,
	      lm_address_t  to,
	      lm_address_t *ptrampoline);

LM_API lm_bool_t
LM_UnhookCodeEx(lm_process_t  proc,
		lm_address_t  from,
		lm_address_t  trampoline,
		lm_size_t     size);

@rdbo rdbo closed this as completed Dec 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant