2
我'努力工作時的LdrLoadDll功能,並因與that..i沒有運氣也用Google搜索的一些例子有隻字不提知道它究竟沒有多少文檔或正確的示例..請檢查下面的代碼。狀態失敗LdrLoadDll
//declaration function pointer for LdrLoadDll
typedef NTSTATUS (_stdcall*fp_LdrLoadDll)(
IN PWCHAR PathToFile OPTIONAL,
IN ULONG Flags OPTIONAL,
IN PUNICODE_STRING ModuleFileName,
OUT PHANDLE ModuleHandle);
//calling LdrLoadDll using getprocaddress
HANDLE handle;
HMODULE module = LoadLibrary(L"ntdll.dll");
fp_LdrLoadDll loadDll;
loadDll = (fp_LdrLoadDll)GetProcAddress(module,"LdrLoadDll");
if(loadDll == NULL)
{
MessageBox(0,L"Not able to load the function",L"LdrLoadDll",&handle);
}
UNICODE_STRING input;
input.Buffer = L"C:\\Desktop\\myDll.dll";
input.Length = wcslen(input.Buffer)*2;
input.MaximumLength = wcslen(input.Buffer) +2;
NTSTATUS status = loadDll(NULL,LOAD_WITH_ALTERED_SEARCH_PATH,&input,0);
當我執行上述我沒有得到處理niether有效status.Please幫助我這一點。
希望我們看到更多的低層次的東西,像這樣的SO – unixman83 2011-07-01 05:05:10