mirror of
https://github.com/FEX-Emu/FEX.git
synced 2026-10-06 17:00:19 +02:00
Redirect applications using execve with self
Fixes a step in the Java JRE and shapez.io
This commit is contained in:
1 parent
235e05e8b9
commit
6618bb809b
1 file changed
+11
@@ -119,6 +119,17 @@ uint64_t ExecveHandler(const char *pathname, std::vector<const char*> &argv, std
|
||||
return -ENOENT;
|
||||
}
|
||||
|
||||
int pid = getpid();
|
||||
|
||||
char PidSelfPath[50];
|
||||
snprintf(PidSelfPath, 50, "/proc/%i/exe", pid);
|
||||
|
||||
if (strcmp(pathname, "/proc/self/exe") == 0 || strcmp(pathname, PidSelfPath) == 0) {
|
||||
// If pointing to self then redirect to the application
|
||||
// JRE and shapez.io does this
|
||||
Filename = FEX::HLE::_SyscallHandler->Filename();
|
||||
}
|
||||
|
||||
uint64_t Result{};
|
||||
if (FEX::HLE::_SyscallHandler->IsInterpreterInstalled()) {
|
||||
// If the FEX interpreter is installed then just execve the thing
|
||||
|
||||
Reference in new issue
Block a user