uint8_t* relativeAddress = MEM::ResolveRelativeAddress(MEM::FindPattern(RENDERSYSTEM_DLL, CS_XOR("48 8D 15 ? ? ? ? 0F 28 44 24")), 0x3, 0x7);
ISwapChainDx11* SwapChain = relativeAddress ? *reinterpret_cast<ISwapChainDx11**>(relativeAddress) : nullptr;
//bSuccess &= (SwapChain != nullptr);
L_PRINT(LOG_INFO) << CS_XOR("SwapChain Success Loaded!\"");
if (SwapChain != nullptr)
{
if (FAILED(SwapChain->pDXGISwapChain->GetDevice(__uuidof(ID3D11Device), (void**)&Device)))
{
L_PRINT(LOG_ERROR) << CS_XOR("failed to get device from swapchain");
CS_ASSERT(false);
return false;
}
else
// we successfully got device, so we can get immediate context
Device->GetImmediateContext(&DeviceContext);
}
bSuccess &= (Device != nullptr && DeviceContext != nullptr);