02-04-2020, 08:03 AM
هذا نموذج اولي Plugin ...
وجدت طريقة جلب الملف التي يتم تنقيحه ....
المشكل الان هو ان نقاط التوقف لا تعمل داخل دلفي ؟ (أريد ان اتفقد ما اذا تم ملأ البنية PocessBasicInfo)
وجدت طريقة جلب الملف التي يتم تنقيحه ....
المشكل الان هو ان نقاط التوقف لا تعمل داخل دلفي ؟ (أريد ان اتفقد ما اذا تم ملأ البنية PocessBasicInfo)
كود :
library AADebug;
uses
SysUtils, plugin, Windows, Classes;
{$R *.res}
type
PEB = record
Reserved1: array [0 .. 1] of Byte;
BeingDebugged: Byte;
end;
PROCESS_BASIC_INFORMATION = record
Reserved1: Pointer;
PebBaseAddress: Pointer;
end;
resourcestring
PLUGIN_NAME = 'Anti IsDebuggerPresent';
var
g_hwndOlly: HWND; // OllyDbg Window Handle
ProcessBasicInfo : PROCESS_BASIC_INFORMATION;
Length: Cardinal;
EB : PEB;
targethandle : Integer;
function ODBG_Plugininit(ollydbgversion: Integer; hWndOlly: HWND; features: PULONG): Integer; cdecl;
begin
g_hwndOlly := hWndOlly;
Addtolist(0, 0, PAnsiChar(PLUGIN_NAME));
Result := 0;
end;
function ODBG_Plugindata(name: PChar): Integer; cdecl;
begin
StrLCopy(name, PChar(PLUGIN_NAME), 32);
Result := PLUGIN_VERSION;
end;
function NtQueryInformationProcess(ProcessHandle: THANDLE;
ProcessInformationClass: DWORD;
ProcessInformation: Pointer;
ProcessInformationLength: ULONG;
ReturnLength: PULONG): LongInt;
stdcall; external 'ntdll.dll';
procedure Getinfo;
begin
targethandle := PluginGetValue(VAL_HPROCESS);
MessageBox(g_hwndOlly, PChar(IntToHex(targethandle,8)), PChar('info'), MB_ICONINFORMATION);
NtQueryInformationProcess(targethandle, 0, @ProcessBasicInfo, sizeof(PEB), @length);
end;
procedure ODBG_Pluginaction(origin: Integer; action: Integer; pItem: Pointer); cdecl;
begin
if (origin = PM_MAIN) then
begin
Getinfo;
end;
end;
exports
ODBG_Plugininit name '_ODBG_Plugininit',
ODBG_Plugindata name '_ODBG_Plugindata',
ODBG_Pluginaction name '_ODBG_Pluginaction';
begin
end.

![[-]](https://delphi4arab.net/forum/D4A2020/collapse.png)