
OBS의 graphics-hook32.dll에서 D3D9 Present 포인터를 후킹하여 안티치트 게임 캡처 탐지를 회피하는 스트림 방지 렌더링을 구현하는 방법을 보여줍니다.
내 것이 아님. 저장용일 뿐. https://www.unknowncheats.me/forum/anti-cheat-bypass/501609-obs-graphics-hook32-hook.html
예전에 여러 종류의 후킹을 공부해 본 적이 있는데, 이런 종류의 기법이 스트림 방지 렌더링을 만드는 데 사용될 수 있어서 내 관심을 끌었다.
그래서 이걸 초보자들에게 공유하고 싶다.

"graphics-hook32.dll + 32DC8"이 우리의 대상 주소이며, IDA나 https://github.com/obsproject/obs-st...pture.cpp#L651에서 다음과 같이 보일 것이다.

그 후에는 포인터를 교체하기만 하면 된다 (예전 방식). mov eax, Hook_Present_Addr 이므로 Hook_Present_Addr = &Present_hook ??? PROFIT P2C 준비 완료 KEKEKEKEKEKW
void MainThread()
{
while (!obsBase) // check if graphics-hook32.dll is not loaded
{
obsBase = (DWORD)GetModuleHandleA(XorStr("graphics-hook32.dll"));
if (!obsBase)
Sleep(200);
else
isOBSFound = true;
}
if (isOBSFound)
{
renderOBSPresent = obsBase + 0x32DC8;
while (!*reinterpret_cast<uintptr_t*>(renderOBSPresent))
{
Sleep(200);
}
OrigPresent = SwapPointer<Present_t>((uintptr_t)renderOBSPresent, (uintptr_t)&Hooked_Present);
}
}
우리가 교체하는 함수 포인터는 IDA에 표시된 "RealPresent"이며 present_begin이 아니다(RealPresent 함수는 .data 포인터이다). present_begin을 후킹해도 동일한 결과를 얻을 수 있다. 이는 obs의 x64 버전에도 적용된다.
참고: 이는 게임 캡처와 d3d9 게임에서만 작동한다