mirror of
https://github.com/optiscaler/OptiScaler.git
synced 2026-05-29 13:01:18 +00:00
Separate namespace for spoofed information
This commit is contained in:
@@ -74,12 +74,12 @@ namespace nvd {
|
||||
}
|
||||
|
||||
NvAPI_Status __cdecl NvAPI_GPU_GetArchInfo(NvPhysicalGpuHandle handle, NV_GPU_ARCH_INFO* archInfo) {
|
||||
archInfo->architecture = NV_GPU_ARCHITECTURE_AD100;
|
||||
archInfo->architecture_id = NV_GPU_ARCHITECTURE_AD100;
|
||||
archInfo->implementation = NV_GPU_ARCH_IMPLEMENTATION_AD102;
|
||||
archInfo->implementation_id = NV_GPU_ARCH_IMPLEMENTATION_AD102;
|
||||
archInfo->revision = NV_GPU_CHIP_REV_UNKNOWN;
|
||||
archInfo->revision_id = NV_GPU_CHIP_REV_UNKNOWN;
|
||||
archInfo->architecture = spoof::arch;
|
||||
archInfo->architecture_id = spoof::arch;
|
||||
archInfo->implementation = spoof::implementation;
|
||||
archInfo->implementation_id = spoof::implementation;
|
||||
archInfo->revision = spoof::revision;
|
||||
archInfo->revision_id = spoof::revision;
|
||||
|
||||
return Ok();
|
||||
}
|
||||
@@ -99,7 +99,7 @@ namespace nvd {
|
||||
return Ok();
|
||||
}
|
||||
NvAPI_Status __cdecl NvAPI_GPU_GetFullName(NvPhysicalGpuHandle hPhysicalGpu, NvAPI_ShortString szName) {
|
||||
tonvss(szName, fullGPUName);
|
||||
tonvss(szName, spoof::fullGPUName);
|
||||
return Ok();
|
||||
}
|
||||
NvAPI_Status __cdecl NvAPI_GPU_GetGpuCoreCount(NvPhysicalGpuHandle hPhysicalGpu, NvU32* pCount) {
|
||||
@@ -117,13 +117,13 @@ namespace nvd {
|
||||
}
|
||||
|
||||
NvAPI_Status __cdecl NvAPI_SYS_GetDisplayDriverInfo(NV_DISPLAY_DRIVER_INFO* driverInfo) {
|
||||
spoofDriverInfo(driverInfo);
|
||||
spoof::driverInfo(driverInfo);
|
||||
return Ok();
|
||||
}
|
||||
|
||||
NvAPI_Status __cdecl NvAPI_SYS_GetDriverAndBranchVersion(NvU32* pDriverVersion, NvAPI_ShortString szBuildBranchString) {
|
||||
*pDriverVersion = driverVersion;
|
||||
tonvss(szBuildBranchString, buildBranch);
|
||||
*pDriverVersion = spoof::driverVersion;
|
||||
tonvss(szBuildBranchString, spoof::buildBranch);
|
||||
return Ok();
|
||||
}
|
||||
|
||||
|
||||
@@ -1,12 +1,14 @@
|
||||
#include "spoofInfo.h"
|
||||
|
||||
void spoofDriverInfo(NV_DISPLAY_DRIVER_INFO* driverInfo) {
|
||||
driverInfo->driverVersion = driverVersion;
|
||||
tonvss(driverInfo->szBuildBranch, buildBranch);
|
||||
driverInfo->bIsDCHDriver = isDCHDriver;
|
||||
driverInfo->bIsNVIDIAStudioPackage = isNVIDIAStudioPackage;
|
||||
driverInfo->bIsNVIDIARTXProductionBranchPackage = isNVIDIARTXProductionBranchPackage;
|
||||
driverInfo->bIsNVIDIARTXNewFeatureBranchPackage = isNVIDIARTXNewFeatureBranchPackage;
|
||||
if (driverInfo->version == 2)
|
||||
tonvss(driverInfo->szBuildBaseBranch, buildBaseBranch);
|
||||
namespace spoof {
|
||||
void driverInfo(NV_DISPLAY_DRIVER_INFO* driverInfo) {
|
||||
driverInfo->driverVersion = driverVersion;
|
||||
tonvss(driverInfo->szBuildBranch, buildBranch);
|
||||
driverInfo->bIsDCHDriver = isDCHDriver;
|
||||
driverInfo->bIsNVIDIAStudioPackage = isNVIDIAStudioPackage;
|
||||
driverInfo->bIsNVIDIARTXProductionBranchPackage = isNVIDIARTXProductionBranchPackage;
|
||||
driverInfo->bIsNVIDIARTXNewFeatureBranchPackage = isNVIDIARTXNewFeatureBranchPackage;
|
||||
if (driverInfo->version == 2)
|
||||
tonvss(driverInfo->szBuildBaseBranch, buildBaseBranch);
|
||||
}
|
||||
}
|
||||
@@ -1,16 +1,18 @@
|
||||
#include "util.h"
|
||||
|
||||
constexpr NvU32 driverVersion = 54629;
|
||||
constexpr std::string buildBranch = "buildBranch";
|
||||
constexpr NvU32 isDCHDriver = 1;
|
||||
constexpr NvU32 isNVIDIAStudioPackage = 1;
|
||||
constexpr NvU32 isNVIDIARTXProductionBranchPackage = 1;
|
||||
constexpr NvU32 isNVIDIARTXNewFeatureBranchPackage = 1;
|
||||
constexpr std::string buildBaseBranch = "buildBaseBranch";
|
||||
namespace spoof {
|
||||
constexpr NvU32 driverVersion = 54629;
|
||||
constexpr std::string buildBranch = "buildBranch";
|
||||
constexpr NvU32 isDCHDriver = 1;
|
||||
constexpr NvU32 isNVIDIAStudioPackage = 1;
|
||||
constexpr NvU32 isNVIDIARTXProductionBranchPackage = 1;
|
||||
constexpr NvU32 isNVIDIARTXNewFeatureBranchPackage = 1;
|
||||
constexpr std::string buildBaseBranch = "buildBaseBranch";
|
||||
|
||||
const std::string fullGPUName = "NVIDIA GeForce RTX 4090";
|
||||
// constexpr unsigned deviceId = 0x2684;
|
||||
// constexpr unsigned vendorId = 0x10de;
|
||||
// constexpr unsigned subSystemId = 0x88ac1043;
|
||||
const std::string fullGPUName = "NVIDIA GeForce RTX 4090";
|
||||
constexpr NV_GPU_ARCHITECTURE_ID arch = NV_GPU_ARCHITECTURE_AD100;
|
||||
constexpr NV_GPU_ARCH_IMPLEMENTATION_ID implementation = NV_GPU_ARCH_IMPLEMENTATION_AD102;
|
||||
constexpr NV_GPU_CHIP_REVISION revision = NV_GPU_CHIP_REV_UNKNOWN;
|
||||
|
||||
void spoofDriverInfo(NV_DISPLAY_DRIVER_INFO* driverInfo);
|
||||
void driverInfo(NV_DISPLAY_DRIVER_INFO* driverInfo);
|
||||
}
|
||||
Reference in New Issue
Block a user