我需要解决这个问题或创建一个 d3d 设备,任何人都可以帮助我吗?提前致谢。
void** GetOriginalD3DVTable()
{
// may be more reliable to create a new d3d device and get the vt ptr from that instead of relying on a pattern
static void** VT = nullptr;
if (VT == nullptr)
{
HMODULE d3d9Module = NULL;
while (!d3d9Module)
{
d3d9Module = GetModuleHandleA("d3d9.dll");
Sleep(100);
}
const void* tempadd = FindPattern(d3d9Module, 0x128000, reinterpret_cast<const unsigned char*>("\xC7\x06\x00\x00\x00\x00\x89\x86\x00\x00\x00\x00\x89\x86"), "xx????xx????xx");
if (tempadd != nullptr)
{
VT = *reinterpret_cast<void***>(reinterpret_cast<uintptr_t>(tempadd) + 2);
}
else
{
//maybe we should try to find another pattern?
}
}
return VT;
}