upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/runtime/src/pe_loader.cpp
diff options
context:
space:
mode:
authorTomgamer <73783069+tomgamer22@users.noreply.github.com>2026-11-22 15:57:50 +0100
committerGitHub <noreply@github.com>2026-11-22 15:57:50 +0100
commitd63fac7606f55fa5c1ec9a5e3e3c0541adb22873 (patch)
tree3a738704c48d6f6fc80cb61f6aea1968d9cd10c5 /runtime/src/pe_loader.cpp
parent0a488f67333490a15226ef0c0930d23467751aa6 (diff)
parent6a6704df1592e1dc4a3215ddf1423a78adb52045 (diff)
Merge branch 'main' into d3d-238-createheap-validation
Diffstat (limited to 'runtime/src/pe_loader.cpp')
-rw-r--r--runtime/src/pe_loader.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/runtime/src/pe_loader.cpp b/runtime/src/pe_loader.cpp
index 1ab9c7801..387051756 100644
--- a/runtime/src/pe_loader.cpp
+++ b/runtime/src/pe_loader.cpp
@@ -14,6 +14,7 @@
14#include <vector> 14#include <vector>
15 15
16#include "../shims/shims.h" 16#include "../shims/shims.h"
17#include "base_reservation.h"
17 18
18namespace rt { 19namespace rt {
19 20
@@ -506,8 +507,11 @@ Module& Loader::map_image(const std::filesystem::path& path) {
506 by_name_[lower(m->name)] = m; 507 by_name_[lower(m->name)] = m;
507 order_.push_back(m); 508 order_.push_back(m);
508 509
509 m->base = static_cast<uint8_t*>( 510 // Inside the range gta6rt reserved for this image before the process started (base_reservation.h), else as usual.
510 VirtualAlloc(reinterpret_cast<void*>(oh.ImageBase), oh.SizeOfImage, MEM_RESERVE | MEM_COMMIT, PAGE_READWRITE)); 511 m->base = static_cast<uint8_t*>(base_reservation::commit_reserved(oh.ImageBase, oh.SizeOfImage));
512 if (!m->base)
513 m->base = static_cast<uint8_t*>(VirtualAlloc(reinterpret_cast<void*>(oh.ImageBase), oh.SizeOfImage,
514 MEM_RESERVE | MEM_COMMIT, PAGE_READWRITE));
511 if (!m->base) { 515 if (!m->base) {
512 const auto relocs = directory(nt, IMAGE_DIRECTORY_ENTRY_BASERELOC); 516 const auto relocs = directory(nt, IMAGE_DIRECTORY_ENTRY_BASERELOC);
513 if (!relocs.Size) 517 if (!relocs.Size)