static HINSTANCE hMyMyNtQuerySystemInformation;
int (_cdecl *pfnHook)(DWORD);
hMyMyNtQuerySystemInformation= LoadLibrary(("QSI.dll"));
if(hMyMyNtQuerySystemInformation){
pfnHook = (int(*)(DWORD))GetProcAddresshMyMyNtQuerySystemInformation,"Hook");
pfnHook(GetCurrentProcessId());
}
else{
MessageBox(NULL,("Failed to load HookNTQSI.dll "),NULL,MB_OK | MB_APPLMODAL | MB_ICONWARNING);
}procedure TForm1.Button1Click(Sender: TObject);
var
pfnHook: function(dwProcessID: DWord): integer; CDecl;
DllName:string;
Buffer:array [0..127] of char;
hLib: Cardinal;
begin
DllName:='QSI.dll';
strPcopy(buffer,Dllname);
hLib := LoadLibrary(buffer);
if hLib <> 0 then begin
try
@pfnHook := GetProcAddress(hLib, 'Hook');
if pfnHook(GetCurrentProcessId)>0 then
MessageDlg('调用函数成功!',mtInformation,[mbOk],0)
else
MessageDlg('调用函数失败!',mtError,[mbOk],0);
finally
FreeLibrary(hLib);
end;
end else begin
MessageDlg('载入库失败!',mtError,[mbOk],0);
end;
end;
int (_cdecl *pfnHook)(DWORD);
hMyMyNtQuerySystemInformation= LoadLibrary(("QSI.dll"));
if(hMyMyNtQuerySystemInformation){
pfnHook = (int(*)(DWORD))GetProcAddresshMyMyNtQuerySystemInformation,"Hook");
pfnHook(GetCurrentProcessId());
}
else{
MessageBox(NULL,("Failed to load HookNTQSI.dll "),NULL,MB_OK | MB_APPLMODAL | MB_ICONWARNING);
}procedure TForm1.Button1Click(Sender: TObject);
var
pfnHook: function(dwProcessID: DWord): integer; CDecl;
DllName:string;
Buffer:array [0..127] of char;
hLib: Cardinal;
begin
DllName:='QSI.dll';
strPcopy(buffer,Dllname);
hLib := LoadLibrary(buffer);
if hLib <> 0 then begin
try
@pfnHook := GetProcAddress(hLib, 'Hook');
if pfnHook(GetCurrentProcessId)>0 then
MessageDlg('调用函数成功!',mtInformation,[mbOk],0)
else
MessageDlg('调用函数失败!',mtError,[mbOk],0);
finally
FreeLibrary(hLib);
end;
end else begin
MessageDlg('载入库失败!',mtError,[mbOk],0);
end;
end;
procedure TForm1.Button1Click(Sender: TObject);
var
pfnHook: function(dwProcessID: DWord): integer; CDecl;;
hLib: Cardinal;
begin
hLib := LoadLibrary('QSI.dll');
if hLib <> 0 then begin
try
@pfnHook := Pointer(GetProcAddress(hLib, 'Hook'));
if Assigned(@pfnHook) then
begin
pfnHook(GetCurrentProcessId());
MessageDlg('调用函数成功!',mtInformation,[mbOk],0)
end
else
MessageDlg('调用函数失败!',mtError,[mbOk],0);
finally
FreeLibrary(hLib);
end;
end
else
MessageDlg('载入库失败!',mtError,[mbOk],0);
end;
pfnHook: function(dwProcessID: DWord): integer; CDecl;;不好意思写成两个“;”了
那么有没有c++转delphi的?