04-04-2020, 03:05 AM
(04-04-2020, 02:26 AM)Hs32-Idir كتب : في حالتي ، تتحقق الوظيفة مما إذا كانت process is Being Debugged ، لذا إذا كان صحيحًا ، فيمكنك محاولة فصلها عن Debugger
هذه ترجمة C ++ ، في دلفي PVOID = POINTER
لجعلها تعمل حاولRunAsAdmin
اجعله يعمل تحت المؤقت (Timer)
فيمكنك محاولة فصلها ب NtRemoveProcessDebug
آسف للغتي ، لدي لوحة مفاتيح ,qwerty
هل يمكنني النشر باللغة الإنجليزية أو لغات أخرى
للتحقق ما اذا كان ال Process تحت التنقيح يكفي كتابة الكود التالي و استبدال dword ptr fs:[$30] بمؤشر للبنية PEB و يمكن جلبه بالدلة NtQueryInformationProcess التي يجب ان يكون المقبض الممرر اليها هو مقبض ال Process
PHP كود :
begin
asm
mov eax, dword ptr fs:[$30] // pointer to PEB struct
movzx eax, byte ptr ds:[eax+$2] {eax + $2 holds the value of
mov check,eax BeingDebugged Flag}
end;
if check <> 0 then
showmessage('The application is under a Debugger');
حسنا أعتقد انني اوشكت على ايجاد الحل , قمت بجلب مقبض الملف الذي هو قيد التنقيح و قمت بجلب قيمة ال Flag BeingDebugged الان المشكل في استعمالي للدالة WriteProcessMemory اريد تغيير البايت 01 (BeingDebbuged) لكن لا يتم تغييره
أكرر المشكل الوحيد الان هو بالسطر :
PHP كود :
writeprocessmemory(debugee,@EB.BeingDebugged,@buffer,1,length);
النموذج كاملا :
PHP كود :
library AADebug;
uses
SysUtils,
plugin,
windows,
Classes;
{$R *.res}
type
PEB = record
Reserved1: array [0 .. 1] of Byte;
BeingDebugged: Byte;
Reserved2: Byte;
Reserved3: array [0 .. 1] of Pointer;
Ldr: Pointer;
Reserved4: array [0 .. 102] of Byte;
Reserved5: array [0 .. 51] of Pointer;
PostProcessInitRoutine: Pointer;
Reserved6: array [0 .. 127] of Byte;
Reserved7: Pointer;
SessionId: ULONG;
end;
PROCESS_BASIC_INFORMATION = record
Reserved1: Pointer;
PebBaseAddress: Pointer;
Reserved2: array [0 .. 1] of Pointer;
UniqueProcessId: cardinal;
Reserved3: Pointer;
end;
resourcestring
PLUGIN_NAME = 'Anti IsDebuggerPresent';
var
g_hwndOlly: HWND; // OllyDbg Window Handle
ProcessBasicInfo : PROCESS_BASIC_INFORMATION;
Length:cardinal;
EB : PEB;
function ODBG_Plugininit(ollydbgversion:Integer;hWndOlly:HWND;features:PULONG):Integer;cdecl;
begin
g_hwndOlly := hWndOlly;
Addtolist(0, 0, pchar(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;
var
debugee,PID : THandle;
buffer : Byte;
begin
buffer := $00;
PID := PluginGetValue(VAL_PROCESSID);
debugee := OpenProcess(PROCESS_ALL_ACCESS,False,PID);
NtQueryInformationProcess(debugee,0,@ProcessBasicInfo,sizeof(ProcessBasicInfo),@length);
readprocessmemory(debugee,ProcessBasicInfo.PebBaseAddress,@EB,sizeof(EB),length);
writeprocessmemory(debugee,@EB.BeingDebugged,@buffer,1,length);
messagebox(g_hwndOlly,pchar('BeingDebuggedFlag : '+ inttostr(EB.beingDebugged)),pchar('info'),MB_ICONINFORMATION);
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.

