Closed aybe closed 1 year ago
Invoke IHook.OriginalFunction
as per example in wiki.
Misc Note: Since Graphics APIs are high frequency, consider using Function Pointers for your hooks to reduce overhead. This should reduce transition overhead from native to managed to around ~36 x86 instructions (native to managed) transition into your hook.
Misc Note 2: If absolute performance is a must, the best option is writing a shim in native code for the native graphics API DLLs (like d3d8to9, dxvk do etc,).
Thank you for the tips, they'll come in handy at some point!
I have a small problem, I cannot get the Just-In-Time Debugger window to show up.
Things appear to be working in the console:
[Reloaded] Create Loader | Time: 114ms
[Reloaded] Loaded: reloaded.sharedlib.hooks in 21ms
[Reloaded] Current Process Location: C:\DERBYS3\DD.EXE
[Reloaded] Loaded: DestructionDerbyS3ViRGE in 106ms
[Reloaded] Loading Mods (Total) | Time: 133ms
[Reloaded] Setting Up Hooks (Async) | Time: 253ms
[Reloaded] Total Loader Initialization Time: 422ms
I've reset Visual Studio settings to default, nothing.
Then went to Options, Tools, Debugging, Just-In-Time, found that:.
Restarted as administrator so that I can enable it for everything:
But still nothing, the JIT Debugger Wizard doesn't want to show up.
Any ideas?
Thank you 😀
Pretty strange and definitively a first I've seen, usually this works out of the box with no configuration required.
I'd usually refer to this MSDN page for guidance regarding this stuff.
You can try setting the defaults I suppose: in
Computer\HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows NT\CurrentVersion\AeDebug
Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AeDebug
Default value of Debugger
is "C:\Windows\system32\vsjitdebugger.exe" -p %ld -e %ld -j 0x%p
.
Might work if you manually restore it, not sure as I've never ran into this personally before.
I repaired VS, it appeared once for whatever unit tests on some project, I then tried on the project but nothing. 🤬 Been getting all sort of funny stuff lately, e.g. __debugbreak on F12 on a game I'm working on while there's no such code. I think I'm off for a good old reinstallation, hopefully I'll be able to get started hooking by this weekend. Anyway, thanks for your help! 😀
Here's some context:
I'd like to see if I can write an OpenGL renderer for Destruction Derby S3 ViRGE version.
The game is as follows:
What I'd like to achieve:
Hook onto each exports of both AYAPI.DLL and S3DTKW.DLL so that:
In short, some sort of instrumentation.
In this example, I can see how calls are hooked, the thing I haven't figured out is, how is the call forwarded back to the originally hooked method?
Any clues are welcome, thank you!