def retraceApi(self, api): print ''' static HINSTANCE g_hDll = NULL; static PROC __getPublicProcAddress(LPCSTR lpProcName) { if (!g_hDll) { char szDll[MAX_PATH] = {0}; if (!GetSystemDirectoryA(szDll, MAX_PATH)) { return NULL; } strcat(szDll, "\\\\%s"); g_hDll = LoadLibraryA(szDll); if (!g_hDll) { return NULL; } } return GetProcAddress(g_hDll, lpProcName); } ''' % api.name dispatcher = Dispatcher() dispatcher.dispatch_api(api) Retracer.retraceApi(self, api)
def retraceApi(self, api): # Ensure pack function have side effects abort = False for function in api.getAllFunctions(): if not function.sideeffects and self.pack_function_regex.match(function.name): sys.stderr.write('error: function %s must have sideeffects\n' % function.name) abort = True if abort: sys.exit(1) Retracer.retraceApi(self, api)
def retraceApi(self, api): # Ensure pack function have side effects abort = False for function in api.getAllFunctions(): if not function.sideeffects and self.pack_function_regex.match(function.name): sys.stderr.write('error: function %s must have sideeffects\n' % function.name) abort = True if abort: sys.exit(1) Retracer.retraceApi(self, api)
def retraceApi(self, api): for module in api.modules: dispatcher = DllDispatcher() dispatcher.dispatchModule(module) Retracer.retraceApi(self, api)
def retraceApi(self, api): for module in api.modules: dispatcher = DllDispatcher() dispatcher.dispatchModule(module) Retracer.retraceApi(self, api)
def retraceApi(self, api): dispatcher = DllDispatcher() dispatcher.dispatchApi(api) Retracer.retraceApi(self, api)
def retraceApi(self, api): dispatcher = DllDispatcher() dispatcher.dispatchApi(api) Retracer.retraceApi(self, api)