ReXGlue SDK
Toggle main menu visibility
Loading...
Searching...
No Matches
export.h
Go to the documentation of this file.
1
12
13
#pragma once
14
15
#include <optional>
16
#include <span>
17
#include <string_view>
18
#include <unordered_map>
19
20
#include <
rex/platform.h
>
21
#include <
rex/ppc/recompiled_code.h
>
22
#include <
rex/types.h
>
23
24
namespace
rex::kernel
{
25
26
enum class
ExportModule : u8 {
27
kXboxkrnl,
28
kXAM,
29
kXBDM,
30
};
31
32
enum class
ExportType
: u8 {
33
kFunction
,
34
kVariable
,
35
};
36
37
struct
ExportEntry
{
38
u16
ordinal
;
39
ExportType
type;
40
std::string_view name;
41
::PPCFunc*
fn
;
42
};
43
44
class
ExportVariableTable
{
45
public
:
47
void
SetAddress
(u16 ordinal, u32 address) { addresses_[ordinal] = address; }
48
50
u32
GetAddress
(u16 ordinal)
const
{
51
const
auto
it = addresses_.find(ordinal);
52
return
it == addresses_.end() ? 0 : it->second;
53
}
54
55
private
:
56
std::unordered_map<u16, u32> addresses_;
57
};
58
60
REX_KERNEL_API
std::span<const ExportEntry>
GetExports
(ExportModule module);
61
67
REX_KERNEL_API
const
ExportEntry
*
FindByOrdinal
(ExportModule module, u16 ordinal);
68
74
REX_KERNEL_API
bool
IsNoReturnExport
(ExportModule module, u16 ordinal);
75
83
REX_KERNEL_API
std::optional<ExportModule>
ModuleFromName
(std::string_view name);
84
85
}
// namespace rex::kernel
rex::kernel::ExportVariableTable
Definition
export.h:44
rex::kernel::ExportVariableTable::SetAddress
void SetAddress(u16 ordinal, u32 address)
Definition
export.h:47
rex::kernel::ExportVariableTable::GetAddress
u32 GetAddress(u16 ordinal) const
Definition
export.h:50
rex::kernel
Definition
export.h:24
rex::kernel::ModuleFromName
std::optional< ExportModule > ModuleFromName(std::string_view name)
rex::kernel::ExportType
ExportType
Definition
export.h:32
rex::kernel::ExportType::kFunction
@ kFunction
Definition
export.h:33
rex::kernel::ExportType::kVariable
@ kVariable
Definition
export.h:34
rex::kernel::IsNoReturnExport
bool IsNoReturnExport(ExportModule module, u16 ordinal)
rex::kernel::GetExports
std::span< const ExportEntry > GetExports(ExportModule module)
rex::kernel::FindByOrdinal
const ExportEntry * FindByOrdinal(ExportModule module, u16 ordinal)
platform.h
Platform flags, packing macros and export markers.
REX_KERNEL_API
#define REX_KERNEL_API
Definition
platform.h:297
recompiled_code.h
rex::kernel::ExportEntry
Definition
export.h:37
rex::kernel::ExportEntry::fn
::PPCFunc * fn
Definition
export.h:41
rex::kernel::ExportEntry::ordinal
u16 ordinal
Definition
export.h:38
types.h
Integer types, byte order wrappers and size literals.
rex
kernel
export.h
Generated by
1.18.0