Loader: Fix bugs ldr:ro, Loader now works fully on hardware.

This commit is contained in:
Michael Scire 2018-05-02 01:39:24 -06:00
parent 361e9607a9
commit 9e03852703
6 changed files with 13 additions and 6 deletions

View file

@ -1,4 +1,5 @@
#include <switch.h>
#include <cstdio>
#include "ldr_map.hpp"
#include "ldr_random.hpp"
@ -159,7 +160,7 @@ Result MapUtils::MapCodeMemoryForProcessDeprecated(Handle process_h, bool is_64_
if (size > addspace_size) {
return 0x6609;
}
u64 try_address;
for (unsigned int i = 0; i < 0x200; i++) {
try_address = addspace_base + (RandomUtils::GetRandomU64((u64)(addspace_size - size) >> 12) << 12);