AuroraRuntime/Include/Aurora/Process/ProcessMap.hpp
Reece Wilson 4671664396 [+] IProcessSectionView::AllocateEx
[+] IProcessSectionView::AllocateEx2
[+] IProcessSectionView::MapFileByPathEx
[+] IProcessSectionView::MapFileByObjectEx
[+] IProcessSectionView::MapIPCMemoryEx
[+] IProcessSectionView::GetAllocations
[+] ReserveAddressSpace(AuUInt uLength)
[*] Modified default value of: PageTable::NX
2022-09-30 23:47:18 +01:00

77 lines
1.7 KiB
C++

/***
Copyright (C) 2021 J Reece Wilson (a/k/a "Reece"). All rights reserved.
File: ProcessMap.hpp
Date: 2021-6-10
Author: Reece
***/
#pragma once
namespace Aurora::Process
{
struct PublicModule;
struct ModuleMeta
{
AuString moduleName;
AuString modulePath;
AuUInt moduleBase {};
AuUInt origVa {};
};
struct PageTable
{
bool NX { true };
bool writable {};
bool readable {};
bool acSanity {};
};
static const auto kSectionNameStack = "STACK";
static const auto kSectionNameFile = "FILE";
static const auto kSectionNameHeap = "HEAP";
struct Section
{
AuUInt baseVa {};
AuUInt origVa {};
AuUInt fsOff {};
AuUInt size {};
PageTable pt;
AuString name;
AuWPtr<PublicModule> moduleMeta;
};
using Sections = AuList<Section>;
struct PublicModule
{
Sections sections;
AuSPtr<ModuleMeta> moduleMeta;
};
/**
* @brief Given a pointer to anything whatsoever looks up a section struct worth of page map data
* @param pointer
* @return
*/
AUKN_SYM AuOptional<Section> GetSection(AuUInt pointer);
/**
* @brief Returns the executable module (like GetModuleHandle(NULL) on Windows)
* @return
*/
AUKN_SYM PublicModule DumpExecutableRoot();
/**
* @brief Dumps all known sections belonging to points of interest and modules
* @return
*/
AUKN_SYM Sections DumpExecutableAll();
/**
* @brief Rescans for loaded dynamic libraries, recalculates lookup tables
* @return
*/
AUKN_SYM void TryRescanSlow();
}