mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2025-05-30 22:45:17 -04:00
loader: refactor ro manager/improve accuracy
This commit is contained in:
parent
d8a36e39f2
commit
d9dc04318d
24 changed files with 328 additions and 218 deletions
|
@ -33,7 +33,7 @@ namespace ams::dmnt::cheat {
|
|||
MemoryRegionExtents heap_extents;
|
||||
MemoryRegionExtents alias_extents;
|
||||
MemoryRegionExtents aslr_extents;
|
||||
u8 main_nso_build_id[0x20];
|
||||
u8 main_nso_module_id[0x20];
|
||||
};
|
||||
|
||||
static_assert(util::is_pod<CheatProcessMetadata>::value && sizeof(CheatProcessMetadata) == 0x70, "CheatProcessMetadata definition!");
|
||||
|
|
|
@ -73,8 +73,12 @@ namespace ams::ldr {
|
|||
}
|
||||
static_assert(sizeof(PinId) == sizeof(u64) && util::is_pod<PinId>::value, "PinId definition!");
|
||||
|
||||
/* Import ModuleInfo from libnx. */
|
||||
using ModuleInfo = ::LoaderModuleInfo;
|
||||
struct ModuleInfo {
|
||||
u8 module_id[0x20];
|
||||
u64 address;
|
||||
u64 size;
|
||||
};
|
||||
static_assert(sizeof(ModuleInfo) == 0x30);
|
||||
|
||||
/* NSO types. */
|
||||
struct NsoHeader {
|
||||
|
@ -123,7 +127,7 @@ namespace ams::ldr {
|
|||
};
|
||||
SegmentInfo segments[Segment_Count];
|
||||
};
|
||||
u8 build_id[sizeof(ModuleInfo::build_id)];
|
||||
u8 module_id[sizeof(ModuleInfo::module_id)];
|
||||
union {
|
||||
u32 compressed_sizes[Segment_Count];
|
||||
struct {
|
||||
|
|
|
@ -17,9 +17,10 @@
|
|||
#pragma once
|
||||
#include <vapours.hpp>
|
||||
#include <stratosphere/ro/ro_types.hpp>
|
||||
#include <stratosphere/ldr/ldr_types.hpp>
|
||||
#include <stratosphere/sf.hpp>
|
||||
|
||||
#define AMS_RO_I_DEBUG_MONITOR_INTERFACE_INTERFACE_INFO(C, H) \
|
||||
AMS_SF_METHOD_INFO(C, H, 0, Result, GetProcessModuleInfo, (sf::Out<u32> out_count, const sf::OutArray<LoaderModuleInfo> &out_infos, os::ProcessId process_id), (out_count, out_infos, process_id))
|
||||
AMS_SF_METHOD_INFO(C, H, 0, Result, GetProcessModuleInfo, (sf::Out<u32> out_count, const sf::OutArray<ldr::ModuleInfo> &out_infos, os::ProcessId process_id), (out_count, out_infos, process_id))
|
||||
|
||||
AMS_SF_DEFINE_INTERFACE(ams::ro::impl, IDebugMonitorInterface, AMS_RO_I_DEBUG_MONITOR_INTERFACE_INTERFACE_INFO)
|
||||
|
|
|
@ -27,10 +27,11 @@ namespace ams::ro {
|
|||
NrrKind_Count,
|
||||
};
|
||||
|
||||
static constexpr size_t ModuleIdSize = 0x20;
|
||||
struct ModuleId {
|
||||
u8 build_id[0x20];
|
||||
u8 data[ModuleIdSize];
|
||||
};
|
||||
static_assert(sizeof(ModuleId) == sizeof(LoaderModuleInfo::build_id), "ModuleId definition!");
|
||||
static_assert(sizeof(ModuleId) == ModuleIdSize);
|
||||
|
||||
struct NrrCertification {
|
||||
static constexpr size_t RsaKeySize = 0x100;
|
||||
|
|
|
@ -43,3 +43,16 @@
|
|||
\
|
||||
return ::ams::util::GetReference(s_singleton_storage); \
|
||||
}
|
||||
|
||||
#define AMS_CONSTINIT_SINGLETON_TRAITS(_CLASSNAME_) \
|
||||
private: \
|
||||
NON_COPYABLE(_CLASSNAME_); \
|
||||
NON_MOVEABLE(_CLASSNAME_); \
|
||||
private: \
|
||||
constexpr _CLASSNAME_ () = default; \
|
||||
public: \
|
||||
static _CLASSNAME_ &GetInstance() { \
|
||||
/* Declare singleton instance variables. */ \
|
||||
static constinit _CLASSNAME_ s_singleton_instance; \
|
||||
return s_singleton_instance; \
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue