8000 GitHub - dot1991/SkipHook
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

dot1991/SkipHook

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 

Repository files navigation

SkipHook

SkipHook is a header-only library that allows you to create function wrappers that skip the first instruction (x64 / x86).

Why?

Certain AntiCheats (eg. Battleye) try to find Cheaters by verifying the RETURNADDRESS of specific WinApi- / Gamefunctions. They either do this by placing a direct hook (0xE9) to their internal module OR they try to catch an exception (0xCC). To prevent this, you can use SkipHook.

How?

SkipHook tries to disassemble the first instruction of the function passed to skip_hook::make_skip_hook. If it was able to decode the instruction, SkipHook creates a trampoline in a local section that executes the first instruction and jumps back to the original code flow.

Code

Example to create a SkipHook function:

#include "skiphook.h"

int main() {

	auto skIsBadReadPtr = skip_hook::make_skip_hook<decltype(&IsBadReadPtr)>((uint64_t)IsBadReadPtr);

	std::cout << "skIsBadReadPtr(" << std::hex << GetModuleHandleA(0) << ", 8) -> " << skIsBadReadPtr(GetModuleHandleA(0), 8) << std::endl;
	
	auto skGetAsyncKeyState = skip_hook::make_skip_hook<decltype(&GetAsyncKeyState)>((uint64_t)GetAsyncKeyState);

	while (!skGetAsyncKeyState(VK_ESCAPE))
	{
		std::cout << "Waiting for ESCAPE key!" << std::endl;
		Sleep(1000);
	}
	
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 91.6%
  • C++ 8.4%
0