Ark Server API (ASE) - Wiki
Loading...
Searching...
No Matches
PDBReader.h
Go to the documentation of this file.
1#pragma once
2
3#include <dia2.h>
4#include <unordered_set>
5
6#include "json.hpp"
7
8#include <API/Fields.h>
9
10namespace API
11{
13 {
14 public:
15 PdbReader() = default;
16 ~PdbReader() = default;
17
18 void Read(const std::wstring& path, std::unordered_map<std::string, intptr_t>* offsets_dump,
19 std::unordered_map<std::string, BitField>* bitfields_dump);
20
21 private:
22 static void LoadDataFromPdb(const std::wstring& /*path*/, IDiaDataSource** /*dia_source*/, IDiaSession**
23 /*session*/, IDiaSymbol** /*symbol*/);
24
25 void DumpStructs(IDiaSymbol* /*g_symbol*/);
26 void DumpFunctions(IDiaSymbol* /*g_symbol*/);
27 void DumpGlobalVariables(IDiaSymbol* /*g_symbol*/);
28 void DumpType(IDiaSymbol* /*symbol*/, const std::string& /*structure*/, int /*indent*/) const;
29 void DumpData(IDiaSymbol* /*symbol*/, const std::string& /*structure*/) const;
30
31 static std::string GetSymbolNameString(IDiaSymbol* /*symbol*/);
32 static uint32_t GetSymbolId(IDiaSymbol* /*symbol*/);
33 static void Cleanup(IDiaSymbol* /*symbol*/, IDiaSession* /*session*/, IDiaDataSource* /*source*/);
34
37
39 };
40} // 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
PdbReader()=default
void DumpType(IDiaSymbol *, const std::string &, int) const
std::unordered_set< uint32_t > visited_
Definition PDBReader.h:38
std::unordered_map< std::string, BitField > * bitfields_dump_
Definition PDBReader.h:36
void DumpFunctions(IDiaSymbol *)
static void LoadDataFromPdb(const std::wstring &, IDiaDataSource **, IDiaSession **, IDiaSymbol **)
Definition PDBReader.cpp:82
std::unordered_map< std::string, intptr_t > * offsets_dump_
Definition PDBReader.h:35
static uint32_t GetSymbolId(IDiaSymbol *)
void DumpData(IDiaSymbol *, const std::string &) const
void DumpGlobalVariables(IDiaSymbol *)
void Read(const std::wstring &path, std::unordered_map< std::string, intptr_t > *offsets_dump, std::unordered_map< std::string, BitField > *bitfields_dump)
Definition PDBReader.cpp:44
void DumpStructs(IDiaSymbol *)
~PdbReader()=default
static void Cleanup(IDiaSymbol *, IDiaSession *, IDiaDataSource *)
static std::string GetSymbolNameString(IDiaSymbol *)
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