Ark Server API (ASE) - 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
39 std::unordered_map<std::string, intptr_t> offsets_dump_;
40 std::unordered_map<std::string, BitField> bitfields_dump_;
41 };
42} // namespace API
std::string GetApiName() override
std::unique_ptr< ArkApi::IApiUtils > & GetApiUtils() override
static void LoadPluginCmd(APlayerController *, FString *, bool)
std::unique_ptr< ArkApi::IHooks > & GetHooks() override
std::unique_ptr< ArkApi::IApiUtils > api_utils_
Definition ArkBaseApi.h:39
void RegisterCommands() override
float GetVersion() override
std::unique_ptr< ArkApi::ICommands > & GetCommands() override
~ArkBaseApi() override=default
static FString LoadPlugin(FString *cmd)
static void UnloadPluginRcon(RCONClientConnection *, RCONPacket *, UWorld *)
std::unique_ptr< ArkApi::ICommands > commands_
Definition ArkBaseApi.h:37
bool Init() override
static void UnloadPluginCmd(APlayerController *, FString *, bool)
static void LoadPluginRcon(RCONClientConnection *, RCONPacket *, UWorld *)
std::unique_ptr< ArkApi::IHooks > hooks_
Definition ArkBaseApi.h:38
static FString UnloadPlugin(FString *cmd)
BitField GetBitField(const void *base, const std::string &name)
Definition Offsets.cpp:65
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:60
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:75
LPVOID GetAddress(const std::string &name)
Definition Offsets.cpp:55
BitField GetBitField(LPVOID base, const std::string &name)
Definition Offsets.cpp:70
std::unordered_map< std::string, intptr_t > offsets_dump_
Definition Offsets.h:39
Offsets & operator=(Offsets &&)=delete
static PluginManager & Get()
std::shared_ptr< Plugin > & LoadPlugin(const std::string &plugin_name) noexcept(false)
Load plugin by it's name.
void UnloadPlugin(const std::string &plugin_name) noexcept(false)
Unload plugin by it's name. Plugin must free all used resources.
virtual void AddRconCommand(const FString &command, const std::function< void(RCONClientConnection *, RCONPacket *, UWorld *)> &callback)=0
Adds a rcon command.
virtual void AddConsoleCommand(const FString &command, const std::function< void(APlayerController *, FString *, bool)> &callback)=0
Adds a console command.
static const FColor Green
Definition ColorList.h:13
FORCEINLINE const TCHAR * operator*() const
Definition FString.h:282
Definition IBaseApi.h:9
constexpr float api_version
ARK_API std::string GetCurrentDir()
Definition Tools.cpp:7
ARK_API std::wstring Utf8Decode(const std::string &str)
Converts an UTF8 string to a wide Unicode String.
Definition Tools.cpp:56
IApiUtils & GetApiUtils()
Definition ApiUtils.cpp:99
void InitHooks()
Definition HooksImpl.cpp:31
Definition json.hpp:4518
void SendMessageW(int Id, int Type, FString *OutGoingMessage)
Definition Other.h:122
int Id
Definition Other.h:129
FString Body
Definition Other.h:131