VoltMod
C++23 framework for CS2 server plugins
Loading...
Searching...
No Matches
GameDataRecord.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <cstdint>
4#include <map>
5#include <string>
6
7namespace VoltMod
8{
9
10/** Addresses and offsets from a successful load, normalized for comparison across builds. */
12{
13 struct Location
14 {
15 std::string Module;
17 };
18
19 struct Slot
20 {
21 std::string Module;
22 uint64_t Table = 0; ///< The class table's RVA.
23 int Index = -1;
24 uint64_t Code = 0; ///< RVA of the function in that slot; 0 when a hook trampoline outside the module holds it.
25 };
26
27 std::string Build;
28 std::map<std::string, Location> Functions;
29 std::map<std::string, Location> Globals;
30 std::map<std::string, Slot> VTables;
31 std::map<std::string, int> Offsets;
32};
33
34/** Write @p resolved to `addons/voltmod/gamedata/dumps/resolved.json` once per build; failures only log. */
36
37} // namespace VoltMod
void WriteGameDataRecord(const GameDataRecord &resolved)
static std::string ReadFile(const std::filesystem::path &path)
Definition Loader.cpp:56
uint64_t Code
RVA of the function in that slot; 0 when a hook trampoline outside the module holds it.
uint64_t Table
The class table's RVA.
std::map< std::string, Location > Functions
std::map< std::string, Location > Globals
std::map< std::string, int > Offsets
std::map< std::string, Slot > VTables