Ark Server API (ASA) - Wiki
Loading...
Searching...
No Matches
Offsets.h
Go to the documentation of this file.
1#pragma once
2
3#include <API/Base.h>
4
5#include <unordered_map>
6
7namespace API
8{
9 class Offsets
10 {
11 public:
12 static Offsets& Get();
13
14 Offsets(const Offsets&) = delete;
15 Offsets(Offsets&&) = delete;
16 Offsets& operator=(const Offsets&) = delete;
17 Offsets& operator=(Offsets&&) = delete;
18
19 void Init(std::unordered_map<std::string, intptr_t>&& offsets_dump,
20 std::unordered_map<std::string, BitField>&& bitfields_dump);
21
22 DWORD64 GetAddress(const void* base, const std::string& name);
23 LPVOID GetAddress(const std::string& name);
24
25 LPVOID GetDataAddress(const std::string& name);
26
27 BitField GetBitField(const void* base, const std::string& name);
28 BitField GetBitField(LPVOID base, const std::string& name);
29
30 private:
31 Offsets();
32 ~Offsets() = default;
33
34 BitField GetBitFieldInternal(const void* base, const std::string& name);
35
36 DWORD64 module_base_;
37 DWORD64 data_base_;
38
41 };
42} // namespace API
ARK_API LPVOID GetDataAddress(const std::string &name)
Definition Base.cpp:15
ARK_API BitField GetBitField(LPVOID base, const std::string &name)
Definition Base.cpp:25
ARK_API BitField GetBitField(const void *base, const std::string &name)
Definition Base.cpp:20
ARK_API DWORD64 GetAddress(const void *base, const std::string &name)
Definition Base.cpp:5
ARK_API LPVOID GetAddress(const std::string &name)
Definition Base.cpp:10
BitField GetBitField(const void *base, const std::string &name)
Definition Offsets.cpp:89
DWORD64 module_base_
Definition Offsets.h:36
DWORD64 GetAddress(const void *base, const std::string &name)
Definition Offsets.cpp:50
Offsets & operator=(const Offsets &)=delete
DWORD64 data_base_
Definition Offsets.h:37
LPVOID GetDataAddress(const std::string &name)
Definition Offsets.cpp:76
std::unordered_map< std::string, BitField > bitfields_dump_
Definition Offsets.h:40
Offsets(const Offsets &)=delete
void Init(std::unordered_map< std::string, intptr_t > &&offsets_dump, std::unordered_map< std::string, BitField > &&bitfields_dump)
Definition Offsets.cpp:43
static Offsets & Get()
Definition Offsets.cpp:37
~Offsets()=default
Offsets(Offsets &&)=delete
BitField GetBitFieldInternal(const void *base, const std::string &name)
Definition Offsets.cpp:99
LPVOID GetAddress(const std::string &name)
Definition Offsets.cpp:63
BitField GetBitField(LPVOID base, const std::string &name)
Definition Offsets.cpp:94
std::unordered_map< std::string, intptr_t > offsets_dump_
Definition Offsets.h:39
Offsets & operator=(Offsets &&)=delete
Definition IBaseApi.h:9