about summary refs log tree commit diff stats
path: root/src/wrapped
diff options
context:
space:
mode:
authorptitSeb <sebastien.chev@gmail.com>2022-09-04 15:20:29 +0200
committerptitSeb <sebastien.chev@gmail.com>2022-09-04 15:20:29 +0200
commitb2dfe64ceaeffcec02c98f5c332f8f8e31180dbd (patch)
treedcde7bb57e7398dbcf3553acbbac051432437603 /src/wrapped
parentff7dc072d1bcdd32a4ca9a8f1bdc0e5d760f77ab (diff)
downloadbox64-b2dfe64ceaeffcec02c98f5c332f8f8e31180dbd.tar.gz
box64-b2dfe64ceaeffcec02c98f5c332f8f8e31180dbd.zip
Limit all libc mmap to 47bits max
Diffstat (limited to 'src/wrapped')
-rwxr-xr-xsrc/wrapped/wrappedlibc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/wrapped/wrappedlibc.c b/src/wrapped/wrappedlibc.c
index 06e531e0..32aad1f8 100755
--- a/src/wrapped/wrappedlibc.c
+++ b/src/wrapped/wrappedlibc.c
@@ -1465,7 +1465,7 @@ EXPORT int32_t my___open(x64emu_t* emu, void* pathname, int32_t flags, uint32_t
 //        void* p = buf+ret;
 //        if(hasDBFromAddress((uintptr_t)p)) {
 //            // allow writing the whole block (this happens with HalfLife, libMiles load code directly from .mix and other file like that)
-//            unprotectDB((uintptr_t)p, count-ret);
+//            unprotectDB((uintptr_t)p, count-ret, 1);
 //            int l;
 //            do {
 //                l = read(fd, p, count-ret); 
@@ -2231,7 +2231,7 @@ EXPORT void* my_mmap64(x64emu_t* emu, void *addr, unsigned long length, int prot
         // 0x40 is MAP_32BIT, wich only exist on x86_64!
         //flags &= ~0x40;   // let the flags in?
         addr = findBlockNearHint(addr, length);
-    } else if (box64_wine) {
+    } else if (box64_wine || 1) {   // other mmap should be restricted to 47bits
         if(!addr)
             addr = find47bitBlock(length);
     }