Ich möchte einige Nt-Funktion von Ntdll.dll aufrufen, mache ich das oben so.Aufruf von Nt-Funktion von Ntdll.dll in Win32-Umgebung, C++
Zum Aufrufen von: NtTestAlert(), benötigen Sie typische ntcall Kernel-Routine, Zugriff über Int 2Eh. (von hier ich Nt Funktionen bekam http://undocumented.ntinternals.net/)
-Code ist auch unvollendet, erhalte ich:
* error C2664: '_ ntcall': kann nicht Parameter konvertieren 1 von 'int' zu ‚MESS ( _stdcall )‘
#include <iostream>
#include <windows.h>
#include <Ntsecapi.h>
using namespace std;
typedef int(__stdcall MESS)(unsigned int);
void __ntcall(MESS *msg)
{
__asm
{
int 2Eh;
}
}
int main(void)
{
MESS *me = 0;
int result = 0;
HINSTANCE__ *hModule= LoadLibrary(L"C:\\Windows\\System32\\ntdll.dll");
if(hModule != 0)
{
me = (MESS*)GetProcAddress(hModule, "NtTestAlert");
if(me != 0)
{
unsigned int type = 1;
result = (__ntcall((*me)(type)));
}
else
{
cout << "Error Load function!" << endl;
}
FreeLibrary(hModule);
}
else
{
cout << "Error load Dll!" << endl;
}
return 0;
}
hat meine Antwort für Sie funktioniert? Wenn nicht, bitte frage zurück. Ansonsten wäre es schön wenn du es annehmen könntest :) – 0xC0000022L