// restoremodule - Restores all imports listed in the supplied patch table, and // which are imported by the specified module, to their original functions. // // Note: If the specified module does not import any of the functions listed // in the patch table, then nothing is changed for the specified module. // // - importmodule (IN): Handle (base address) of the target module which is to // have its imports restored. // // - patchtable (IN): Array of patchentry_t structures specifying all of the // imports to restore for the specified module. // // - tablesize (IN): Size, in entries, of the specified patch table. // // Return Value: // // None. // VOID restoremodule (HMODULE importmodule, moduleentry_t patchtable [], UINT tablesize) { moduleentry_t *entry; UINT index; // Loop through the import patch table, individually restoring each import // listed in the table. for (index = 0; index < tablesize; index++) { entry = &patchtable[index]; restoreimport(importmodule, entry); } }
// restoremodule - Restores all imports listed in the supplied patch table, and // which are imported by the specified module, to their original functions. // // Note: If the specified module does not import any of the functions listed // in the patch table, then nothing is changed for the specified module. // // - importmodule (IN): Handle (base address) of the target module which is to // have its imports restored. // // - patchtable (IN): Array of patchentry_t structures specifying all of the // imports to restore for the specified module. // // - tablesize (IN): Size, in entries, of the specified patch table. // // Return Value: // // None. // VOID restoremodule (HMODULE importmodule, patchentry_t patchtable [], UINT tablesize) { patchentry_t *entry; UINT index; // Loop through the import patch table, individually restoring each import // listed in the table. for (index = 0; index < tablesize; index++) { entry = &patchtable[index]; restoreimport(importmodule, (HMODULE)entry->modulebase, entry->exportmodulename, entry->importname, entry->replacement); } }