- Timestamp:
- Sep 18, 2009 1:47:24 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/main.cpp
r22823 r23131 162 162 # include <sys/mman.h> 163 163 # include <iprt/asm.h> 164 # include <iprt/system.h> 164 165 165 166 /** Really ugly hack to shut up a silly check in AppKit. */ 166 167 static void ShutUpAppKit(void) 167 168 { 168 /* 169 * Find issetguid() and make it always return 0 by modifying the code. 170 */ 171 void *addr = dlsym(RTLD_DEFAULT, "issetugid"); 172 int rc = mprotect((void *)((uintptr_t)addr & ~(uintptr_t)0xfff), 0x2000, PROT_WRITE|PROT_READ|PROT_EXEC); 173 if (!rc) 174 ASMAtomicWriteU32((volatile uint32_t *)addr, 0xccc3c031); /* xor eax, eax; ret; int3 */ 169 /* Check for Snow Leopard or higher */ 170 char pszInfo[64]; 171 int rc = RTSystemQueryOSInfo (RTSYSOSINFO_RELEASE, pszInfo, sizeof(pszInfo)); 172 if (RT_SUCCESS (rc) && 173 pszInfo[0] == 1) /* higher than 1x.x.x */ 174 { 175 /* 176 * Find issetguid() and make it always return 0 by modifying the code. 177 */ 178 void *addr = dlsym(RTLD_DEFAULT, "issetugid"); 179 int rc = mprotect((void *)((uintptr_t)addr & ~(uintptr_t)0xfff), 0x2000, PROT_WRITE|PROT_READ|PROT_EXEC); 180 if (!rc) 181 ASMAtomicWriteU32((volatile uint32_t *)addr, 0xccc3c031); /* xor eax, eax; ret; int3 */ 182 } 175 183 } 176 184 #endif /* DARWIN */
Note:
See TracChangeset
for help on using the changeset viewer.