我需要修复此问题或创建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;
}