From 9705d5e38bdf4ec72daf480de0830dfde6e33a70 Mon Sep 17 00:00:00 2001 From: ptitSeb Date: Sat, 18 Feb 2023 15:06:40 +0100 Subject: Preliminary work to get steamwebhelper working --- src/main.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/main.c') diff --git a/src/main.c b/src/main.c index 6df6c8b1..4c0af6cd 100755 --- a/src/main.c +++ b/src/main.c @@ -45,6 +45,7 @@ int box64_dynarec_log = LOG_NONE; uintptr_t box64_pagesize; uintptr_t box64_load_addr = 0; int box64_nosandbox = 0; +int box64_malloc_hack = 0; #ifdef DYNAREC int box64_dynarec = 1; int box64_dynarec_dump = 0; @@ -678,6 +679,19 @@ void LoadLogEnv() if(!box64_dummy_crashhandler) printf_log(LOG_INFO, "Don't use dummy crashhandler lib\n"); } + p = getenv("BOX64_MALLOC_HACK"); + if(p) { + if(strlen(p)==1) { + if(p[0]>='0' && p[0]<='0'+2) + box64_malloc_hack = p[0]-'0'; + } + if(!box64_malloc_hack) { + if(box64_malloc_hack==1) { + printf_log(LOG_INFO, "Malloc hook will not be redirected\n"); + } else + printf_log(LOG_INFO, "Malloc hook will check for mmap/free occurences\n"); + } + } p = getenv("BOX64_NOPULSE"); if(p) { if(strlen(p)==1) { -- cgit 1.4.1