призываю тебя, о великий Indy_ ! подскажи матчасти, как реализовать GetProcAddress рандомного подгруженного модуля с irql driver entry
sn0w, Код (Text): NTKERNELAPI PVOID MmGetSystemRoutineAddress ( __in PUNICODE_STRING SystemRoutineName ) /*++ Routine Description: This function returns the address of the argument function pointer if it is in the kernel or HAL, NULL if it is not. Arguments: SystemRoutineName - Supplies the name of the desired routine. Return Value: Non-NULL function pointer if successful. NULL if not. Environment: Kernel mode, PASSIVE_LEVEL, arbitrary process context.
sn0w, Так в чём трудность, копипасть экспортный парсер он на си. wrk. Код (Text): PVOID MiLocateExportName ( IN PVOID DllBase, IN PCHAR FunctionName ) /*++ Routine Description: This function is invoked to locate a function name in an export directory. Arguments: DllBase - Supplies the image base. FunctionName - Supplies the the name to be located. Return Value: The address of the located function or NULL. --*/ { PVOID Func; PULONG NameTableBase; PUSHORT NameOrdinalTableBase; PIMAGE_EXPORT_DIRECTORY ExportDirectory; PULONG Addr; ULONG ExportSize; LONG Low; LONG Middle; LONG High; LONG Result; USHORT OrdinalNumber; PAGED_CODE(); Func = NULL; // // Locate the DLL's export directory. // ExportDirectory = (PIMAGE_EXPORT_DIRECTORY) RtlImageDirectoryEntryToData ( DllBase, TRUE, IMAGE_DIRECTORY_ENTRY_EXPORT, &ExportSize); if (ExportDirectory) { NameTableBase = (PULONG)((PCHAR)DllBase + (ULONG)ExportDirectory->AddressOfNames); NameOrdinalTableBase = (PUSHORT)((PCHAR)DllBase + (ULONG)ExportDirectory->AddressOfNameOrdinals); // // Look in the export name table for the specified function name. // Low = 0; Middle = 0; High = ExportDirectory->NumberOfNames - 1; while (High >= Low) { // // Compute the next probe index and compare the export name entry // with the specified function name. // Middle = (Low + High) >> 1; Result = strcmp(FunctionName, (PCHAR)((PCHAR)DllBase + NameTableBase[Middle])); if (Result < 0) { High = Middle - 1; } else if (Result > 0) { Low = Middle + 1; } else { break; } } // // If the high index is less than the low index, then a matching table // entry was not found. Otherwise, get the ordinal number from the // ordinal table and location the function address. // if (High >= Low) { OrdinalNumber = NameOrdinalTableBase[Middle]; Addr = (PULONG)((PCHAR)DllBase + (ULONG)ExportDirectory->AddressOfFunctions); Func = (PVOID)((ULONG_PTR)DllBase + Addr[OrdinalNumber]); // // If the function address is w/in range of the export directory, // then the function is forwarded, which is not allowed, so ignore // it. // if ((ULONG_PTR)Func > (ULONG_PTR)ExportDirectory && (ULONG_PTR)Func < ((ULONG_PTR)ExportDirectory + ExportSize)) { Func = NULL; } } } return Func; }