Changeset 74856 in vbox for trunk/src/VBox/Runtime/testcase/tstLdr-3.cpp
- Timestamp:
- Oct 16, 2018 12:49:25 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/testcase/tstLdr-3.cpp
r74647 r74856 46 46 static void *g_pvBits; 47 47 static uint8_t g_cBits; 48 static uint8_t g_fNearImports; 48 49 49 50 /** … … 215 216 { 216 217 RT_NOREF5(hLdrMod, pszModule, pszSymbol, uSymbol, pvUser); 217 #if 1218 218 RTUINTPTR BaseAddr = *(PCRTUINTPTR)pvUser; 219 *pValue = BaseAddr + UINT32_C(0x604020f0); 220 #else 221 *pValue = UINT64_C(0xffffff7f820df000); 222 #endif 219 if (g_fNearImports) 220 *pValue = BaseAddr + UINT32_C(0x604020f0); 221 else if ( BaseAddr < UINT64_C(0xffffff7f820df000) - _4G 222 || BaseAddr > UINT64_C(0xffffff7f820df000) + _4G) 223 *pValue = UINT64_C(0xffffff7f820df000); 224 else 225 *pValue = UINT64_C(0xffffff7c820df000); 223 226 if (g_cBits == 32) 224 227 *pValue &= UINT32_MAX; … … 289 292 RTR3InitExe(argc, &argv, 0); 290 293 291 int rcRet = 0;292 if (argc <= 2)293 {294 RTPrintf("usage: %s <load-addr> <module> [addr1 []]\n", argv[0]);295 return 1;296 }297 298 294 /* 299 295 * Module & code bitness (optional). 300 296 */ 301 297 g_cBits = ARCH_BITS; 302 if (!strcmp(argv[1], "--32")) 303 { 304 g_cBits = 32; 298 #if !defined(RT_OS_WINDOWS) || defined(RT_OS_DARWIN) 299 g_fNearImports = false; 300 #else 301 g_fNearImports = true; 302 #endif 303 while (argc > 1) 304 { 305 if (!strcmp(argv[1], "--32")) 306 g_cBits = 32; 307 else if (!strcmp(argv[1], "--64")) 308 g_cBits = 64; 309 else if (!strcmp(argv[1], "--near-imports")) 310 g_fNearImports = true; 311 else if (!strcmp(argv[1], "--wide-imports")) 312 g_fNearImports = false; 313 else 314 break; 305 315 argc--; 306 316 argv++; 307 317 } 308 else if (!strcmp(argv[1], "--64")) 309 { 310 g_cBits = 64; 311 argc--; 312 argv++; 318 319 int rcRet = 0; 320 if (argc <= 2) 321 { 322 RTPrintf("usage: %s [--32|--64] [--<near|wide>-imports] <load-addr> <module> [addr1 []]\n", argv[0]); 323 return 1; 313 324 } 314 325
Note:
See TracChangeset
for help on using the changeset viewer.