ReXGlue SDK
Toggle main menu visibility
Loading...
Searching...
No Matches
symbol_map.h
Go to the documentation of this file.
1
10
11
#pragma once
12
13
#include <cstdint>
14
#include <span>
15
#include <string>
16
#include <filesystem>
17
#include <string_view>
18
#include <vector>
19
20
#include <
rex/types.h
>
21
#include <
rex/platform.h
>
22
#include <
rex/result.h
>
23
24
namespace
rex::kernel
{
25
26
enum class
BinarySymbolType : u8 {
kFunction
, kData, kImport, kUnknown };
27
28
struct
BinarySymbol
{
29
std::string name;
30
u32 address = 0;
31
u32 size = 0;
32
BinarySymbolType type = BinarySymbolType::kUnknown;
33
};
34
35
struct
BinarySection
{
36
std::string name;
37
u32
virtual_address
= 0;
38
u32 virtual_size = 0;
39
const
u8*
host_data
=
nullptr
;
40
bool
executable =
false
;
41
bool
writable =
false
;
42
};
43
44
}
// namespace rex::kernel
45
46
namespace
rex::kernel
{
47
48
struct
MapParseOptions
{
50
u32
base_address
= 0;
51
53
bool
functions_only
=
false
;
54
56
std::string_view
prefix_filter
;
57
};
58
66
[[nodiscard]]
REX_KERNEL_API
Result<std::vector<BinarySymbol>
>
ParseNmMap
(
67
const
std::filesystem::path& map_path,
const
MapParseOptions
& options = {});
68
75
[[nodiscard]]
REX_KERNEL_API
Result<std::vector<BinarySymbol>
>
ParseNmMapString
(
76
std::string_view map_data,
const
MapParseOptions
& options = {});
77
78
}
// namespace rex::kernel
rex::kernel
Definition
export.h:24
rex::kernel::ParseNmMap
Result< std::vector< BinarySymbol > > ParseNmMap(const std::filesystem::path &map_path, const MapParseOptions &options={})
rex::kernel::ExportType::kFunction
@ kFunction
Definition
export.h:33
rex::kernel::ParseNmMapString
Result< std::vector< BinarySymbol > > ParseNmMapString(std::string_view map_data, const MapParseOptions &options={})
rex::Result
std::expected< T, Error > Result
Definition
result.h:98
platform.h
Platform flags, packing macros and export markers.
REX_KERNEL_API
#define REX_KERNEL_API
Definition
platform.h:297
result.h
rex::kernel::BinarySection
Definition
symbol_map.h:35
rex::kernel::BinarySection::virtual_address
u32 virtual_address
Definition
symbol_map.h:37
rex::kernel::BinarySection::host_data
const u8 * host_data
Definition
symbol_map.h:39
rex::kernel::BinarySymbol
Definition
symbol_map.h:28
rex::kernel::MapParseOptions
Definition
symbol_map.h:48
rex::kernel::MapParseOptions::functions_only
bool functions_only
Definition
symbol_map.h:53
rex::kernel::MapParseOptions::base_address
u32 base_address
Definition
symbol_map.h:50
rex::kernel::MapParseOptions::prefix_filter
std::string_view prefix_filter
Definition
symbol_map.h:56
types.h
Integer types, byte order wrappers and size literals.
rex
kernel
symbol_map.h
Generated by
1.18.0