VoltMod
C++23 framework for CS2 server plugins
Loading...
Searching...
No Matches
MemoryAccess.hpp File Reference

Typed read/write of engine fields at a base pointer + byte offset. More...

#include <cstddef>
#include <cstdint>

Go to the source code of this file.

Namespaces

namespace  VoltMod
 

Functions

template<typename T >
T * VoltMod::MemberPtr (void *base, std::ptrdiff_t offset) noexcept
 
template<typename T >
T VoltMod::ReadAt (void *base, std::ptrdiff_t offset) noexcept
 
template<typename T >
void VoltMod::WriteAt (void *base, std::ptrdiff_t offset, const T &value) noexcept
 

Detailed Description

Typed read/write of engine fields at a base pointer + byte offset.

Engine objects have no nameable C++ type, so fields are reached by offset. These helpers keep that one reinterpret_cast in a single audited place; the caller owns base and offset. Note this aliases live storage - not a std::bit_cast, which copies bits into a new object.

Definition in file MemoryAccess.hpp.