-
Notifications
You must be signed in to change notification settings - Fork 27
wow64 support, more unit tests, jit stub #2
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
base: main
Are you sure you want to change the base?
Conversation
|
Hi @susMdT, thanks for the awesome PR. What's the reason for the Unit Tests needing to be .NET Framework? |
|
Glad you like the changes, I've been wanting to contribute this technique to a project for a while and this one seemed perfect. I changed the unit tests to .NET Framework since I saw that the If you would like, I could modify the PR to account for different versions of .NET by checking if the technique is possible and falling back to a dynamic call to ntprotect if it is not possible |
|
Ah fair enough, I don't anticipate many .NET (core) projects using this, (sorry @checkymander). I was more asking because the project didn't want to load for me in Rider 😅 |
|
Oh, I've been using visual studio and had to do some manual work to make the project files work, so that might explain the jank, sorry about that. Yeah I didn't expect many .net (core) projects using this since I thought most tooling is done in framework(?), but idk much 🤷 |
Despite this statement I'm still using it 😂 Couldn't you target it for .net standard? That way both could use it easily |
|
The code generator itself is .NET Standard 2.0, so it will codegen for both Framework and Core. The question would be if the actual JIT magic code that it generates is actually useable on both. Based on what @susMdT has experienced, we can expect it to work for any(?) .NET Framework version, as well as .NET 5/6, but nothing above. |
|
I'll do more testing, but at least for .net 5/6 and framework 4+ it works fine. As a fallback, I can add a check to see if the jit tech is possible and fall back on the original ntprotect call if its not possible. |
Replaced how the syscall stubs are used
Added wow64 support
Wow64IndirectSyscallStubin Syscalls.cs and added questionable (but working) logic toGetSyscallStubto account for wow64Added more unit tests
GenericTests.GetUnloadedLibraryAddresswould fail after 20 or so iterations.