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

Allow to disable original bytes restoration in hook's destructor #53

Closed
ThirteenAG opened this issue Jan 28, 2024 · 2 comments · Fixed by #54
Closed

Allow to disable original bytes restoration in hook's destructor #53

ThirteenAG opened this issue Jan 28, 2024 · 2 comments · Fixed by #54

Comments

@ThirteenAG
Copy link

ThirteenAG commented Jan 28, 2024

InlineHook::~InlineHook() {
    destroy();
}

For example, if dll function was hooked, and this dll was unloaded, std::copy(m_original_bytes.begin(), m_original_bytes.end(), m_target); will crash on app exit(or whenever the destructor is called). Would be good to have an option to avoid that, or check for pointer validity inside ::destroy(); Also applies to mid hook.

@cursey
Copy link
Owner

cursey commented Jan 28, 2024

Can you try #54 and see if it fixes that behavior?

@ThirteenAG
Copy link
Author

Works fine now, thanks!

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

Successfully merging a pull request may close this issue.

2 participants