CS2-Kit
C++23 library for CS2 Metamod:Source plugin development
Loading...
Searching...
No Matches
SigScanner.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <cstdint>
4#include <string>
5
6#ifdef _WIN32
7#include <windows.h>
8#endif
9
10namespace CS2Kit::Sdk
11{
12
13/**
14 * Scan a loaded module's memory for a byte pattern (hex string with '?' wildcards).
15 * Returns the first match address, or nullptr if not found.
16 */
17void* FindPattern(const char* moduleName, const std::string& pattern);
18
19/**
20 * Resolve a RIP-relative address: reads the 32-bit displacement at addr+ripOffset
21 * and computes the absolute target as addr + ripOffset + ripSize + displacement.
22 */
23uintptr_t ResolveRelativeAddress(uintptr_t addr, int ripOffset, int ripSize);
24
25} // namespace CS2Kit::Sdk
void * FindPattern(const char *moduleName, const std::string &pattern)
uintptr_t ResolveRelativeAddress(uintptr_t addr, int ripOffset, int ripSize)