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

x64 windows sourcehook hookmangen #175

Open
wants to merge 6 commits into
base: 1.12-dev
Choose a base branch
from

Conversation

Kenzzer
Copy link
Member

@Kenzzer Kenzzer commented Apr 20, 2024

Add x64 dynamic hook support to SourceHook, Windows only

  • Added x64GenContext to generate SourceHook virtual stubs on x86_64
  • GenBuffer has been moved to sh_asm.h, since it's only ever used to allocate blocks of memories where assembly is written at
  • x64JitWriter (inheriting from GenBuffer). It's a collection of helper functions to write x86_64 assembly bytes
  • Added IGenContext in order to keep a single implementation of CHookManagerAutoGen that can be compiled on all architectures. Consequently, x64GenContext & GenContext inherit from IGenContext

This is already a massive PR as it is. And I really don't want to be adding Linux support right now, but it will come shortly after rest assured.

@Kenzzer Kenzzer force-pushed the x64_sourcehook_hookmangen branch from 9cf0a7e to 3b50c37 Compare May 12, 2024 14:45
@Kenzzer Kenzzer changed the title x64 sourcehook hookmangen x64 windows sourcehook hookmangen May 16, 2024
@Kenzzer Kenzzer marked this pull request as ready for review May 16, 2024 21:52
@Kenzzer
Copy link
Member Author

Kenzzer commented May 16, 2024

@dvander @TheDS @peace-maker

I believe you'll be the ones that want to look most at this, given it's pertaining to sourcehook. My goal is to have this PR merged, before I make any further changes for linux support.

Comment on lines +420 to +424
static bool g_logging = false;
if (g_logging) {
return;
}
g_logging = true;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change exist, because I happened to be log looping to hell while debugging sourcehook.

@Kenzzer Kenzzer force-pushed the x64_sourcehook_hookmangen branch from 9bd32a3 to 3a5283e Compare May 16, 2024 22:01
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 this pull request may close these issues.

None yet

1 participant