You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// NOTE: nvngx_dlssd namespace is pretty much a copy of nvngx_dlss atm...
494
+
// Ideally we would reuse the same code between them, but since both DLLs are usually loaded at the same time it wouldn't be possible to use the same SafetyHookInline instance between them
495
+
// our hook code also has no way to know which DLL we were called from, so wouldn't be able to add seperate instances for each DLL...
496
+
// only solution I can see requires us to include seperate functions for both dlss & dlssd
497
+
// unfortunately I don't know a good way of making them both share the same code yet, so would need to share changes between them manually :/
498
+
namespacenvngx_dlssd
499
+
{
500
+
// Allow force enabling/disabling the DLSS debug display via RegQueryValueExW hook
501
+
// (fallback method if we couldn't find the indicator value check pattern in the DLL)
502
+
// NOTE: copy any changes to the nvngx_dlss::RegQueryValueExW_Hook above!
// Unfortunately it's not enough to just hook the function, HUD render code seems to have an optimization where it checks funcptr and inlines code if it matches
554
+
// So we also need to search for the address of the function, find vftable that holds it, and overwrite entry to point at our hook
555
+
556
+
// Ugly way of converting our address to a pattern string...
557
+
uint8_t* p = (uint8_t*)&indicatorValueCheck_addr;
558
+
559
+
std::stringstream ss;
560
+
ss << std::hex << std::setw(2) << std::setfill('0') << (int)p[0];
561
+
for (int i = 1; i < 8; ++i)
562
+
ss << "" << std::setw(2) << std::setfill('0') << (int)p[i];
563
+
564
+
auto pattern = ss.str();
565
+
566
+
auto indicatorValueCheckMemberVf = hook::pattern((void*)ngx_module, pattern);
567
+
for (int i = 0; i < indicatorValueCheckMemberVf.size(); i++)
568
+
{
569
+
auto vfAddr = indicatorValueCheckMemberVf.get(i).get<uintptr_t>(0);
0 commit comments