Changeset 2924 for trunk/src/kWorker/kWorker.c
- Timestamp:
- Sep 15, 2016, 10:51:38 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kWorker/kWorker.c
r2923 r2924 785 785 extern KWREPLACEMENTFUNCTION const g_aSandboxNativeReplacements[]; 786 786 extern KU32 const g_cSandboxNativeReplacements; 787 788 extern KWREPLACEMENTFUNCTION const g_aSandboxGetProcReplacements[]; 789 extern KU32 const g_cSandboxGetProcReplacements; 790 787 791 788 792 /** Create a larget BSS blob that with help of /IMAGEBASE:0x10000 should … … 4088 4092 if (rc == 0) 4089 4093 { 4090 static int s_cDbgGets = 0; 4091 s_cDbgGets++; 4092 KW_LOG(("GetProcAddress(%s, %s) -> %p [%d]\n", pMod->pszPath, pszProc, (KUPTR)uValue, s_cDbgGets)); 4094 //static int s_cDbgGets = 0; 4095 KU32 cchProc = kHlpStrLen(pszProc); 4096 KU32 i = g_cSandboxGetProcReplacements; 4097 while (i-- > 0) 4098 if ( g_aSandboxGetProcReplacements[i].cchFunction == cchProc 4099 && kHlpMemComp(g_aSandboxGetProcReplacements[i].pszFunction, pszProc, cchProc) == 0) 4100 { 4101 if ( !g_aSandboxGetProcReplacements[i].pszModule 4102 || kHlpStrICompAscii(g_aSandboxGetProcReplacements[i].pszModule, &pMod->pszPath[pMod->offFilename]) == 0) 4103 { 4104 if ( pMod->fExe 4105 || !g_aSandboxGetProcReplacements[i].fOnlyExe) 4106 { 4107 uValue = g_aSandboxGetProcReplacements[i].pfnReplacement; 4108 KW_LOG(("GetProcAddress(%s, %s) -> %p replaced\n", pMod->pszPath, pszProc, (KUPTR)uValue)); 4109 } 4110 kwLdrModuleRelease(pMod); 4111 return (FARPROC)(KUPTR)uValue; 4112 } 4113 } 4114 4115 KW_LOG(("GetProcAddress(%s, %s) -> %p\n", pMod->pszPath, pszProc, (KUPTR)uValue)); 4093 4116 kwLdrModuleRelease(pMod); 4117 //s_cDbgGets++; 4094 4118 //if (s_cGets >= 3) 4095 4119 // return (FARPROC)kwSandbox_BreakIntoDebugger; … … 7530 7554 7531 7555 /** 7556 * Functions that needs replacing when queried by GetProcAddress. 7557 */ 7558 KWREPLACEMENTFUNCTION const g_aSandboxGetProcReplacements[] = 7559 { 7560 /* 7561 * Kernel32.dll and friends. 7562 */ 7563 { TUPLE("FlsAlloc"), NULL, (KUPTR)kwSandbox_Kernel32_FlsAlloc }, 7564 { TUPLE("FlsFree"), NULL, (KUPTR)kwSandbox_Kernel32_FlsFree }, 7565 }; 7566 /** Number of entries in g_aSandboxGetProcReplacements. */ 7567 KU32 const g_cSandboxGetProcReplacements = K_ELEMENTS(g_aSandboxGetProcReplacements); 7568 7569 7570 /** 7532 7571 * Control handler. 7533 7572 * … … 8307 8346 int rcExit; 8308 8347 PKWTOOL pTool; 8348 8349 KW_LOG(("\n\nkSubmitHandleJobUnpacked: '%s' in '%s' cArgs=%u cEnvVars=%u cPostCmdArgs=%u\n", 8350 pszExecutable, pszCwd, cArgs, cEnvVars, cPostCmdArgs)); 8351 #ifdef KW_LOG_ENABLED 8352 { 8353 KU32 i; 8354 for (i = 0; i < cArgs; i++) 8355 KW_LOG((" papszArgs[%u]=%s\n", i, papszArgs[i])); 8356 for (i = 0; i < cPostCmdArgs; i++) 8357 KW_LOG((" papszPostCmdArgs[%u]=%s\n", i, papszPostCmdArgs[i])); 8358 } 8359 #endif 8309 8360 8310 8361 /*
Note:
See TracChangeset
for help on using the changeset viewer.