diff options
| author | ptitSeb <sebastien.chev@gmail.com> | 2024-02-24 14:12:36 +0100 |
|---|---|---|
| committer | ptitSeb <sebastien.chev@gmail.com> | 2024-02-24 14:12:36 +0100 |
| commit | 02caee0c02c75e035ce976d1ffdb29baa6e0a6c5 (patch) | |
| tree | be18434cbdef194f4de797f8286067ce9f085930 /src | |
| parent | 7260da63afd4c9617a420748a5d143de1e6268c5 (diff) | |
| download | box64-02caee0c02c75e035ce976d1ffdb29baa6e0a6c5.tar.gz box64-02caee0c02c75e035ce976d1ffdb29baa6e0a6c5.zip | |
Added some hack to rename wine binary process too (help mesa pick up the correct binary being run)
Diffstat (limited to 'src')
| -rw-r--r-- | src/include/box64context.h | 3 | ||||
| -rw-r--r-- | src/main.c | 2 | ||||
| -rw-r--r-- | src/wrapped/wrappedlibc.c | 5 |
3 files changed, 10 insertions, 0 deletions
diff --git a/src/include/box64context.h b/src/include/box64context.h index 52a512fa..c3493e7e 100644 --- a/src/include/box64context.h +++ b/src/include/box64context.h @@ -100,6 +100,9 @@ typedef struct box64context_s { int envc; char** envv; + int orig_argc; + char** orig_argv; + char* fullpath; char* box64path; // path of current box64 executable char* box86path; // path of box86 executable (if present) diff --git a/src/main.c b/src/main.c index 5f06fa24..cddfbc44 100644 --- a/src/main.c +++ b/src/main.c @@ -2031,6 +2031,8 @@ int main(int argc, const char **argv, char **env) { memset(endp - diff, 0, diff); // fill reminder with NULL for(int i=nextarg; i<argc; ++i) argv[i] -= diff; // adjust strings + my_context->orig_argc = argc; + my_context->orig_argv = (char**)argv; } box64_isglibc234 = GetNeededVersionForLib(elf_header, "libc.so.6", "GLIBC_2.34"); if(box64_isglibc234) diff --git a/src/wrapped/wrappedlibc.c b/src/wrapped/wrappedlibc.c index 107eeb94..6629585f 100644 --- a/src/wrapped/wrappedlibc.c +++ b/src/wrapped/wrappedlibc.c @@ -3437,6 +3437,11 @@ EXPORT int my_prctl(x64emu_t* emu, int option, unsigned long arg2, unsigned long if(option==PR_SET_NAME) { printf_log(LOG_DEBUG, "BOX64: set process name to \"%s\"\n", (char*)arg2); ApplyParams((char*)arg2); + size_t l = strlen((char*)arg2); + if(l>4 && !strcasecmp((char*)arg2+l-4, ".exe")) { + printf_log(LOG_DEBUG, "BOX64: hacking orig command line to \"%s\"\n", (char*)arg2); + strcpy(my_context->orig_argv[0], (char*)arg2); + } } if(option==PR_SET_SECCOMP) { printf_log(LOG_INFO, "BOX64: ignoring prctl(PR_SET_SECCOMP, ...)\n"); |