- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
function TSnifferMainForm.GetSetInjected(pID:Cardinal; Get:Boolean=False):Boolean;
type rParam=record _pID:Cardinal; _Get,_Res:Boolean; end;
const PE_STR='*RODC_PE ';
var Params:rParam;
function ProcCloseEnum(Handle:THandle; _Params:Integer):BOOL; stdcall;
var TempPID:Cardinal; hCap:string; lCap:integer;
begin
Result:=True;
GetWindowThreadProcessId(Handle,TempPID);
if TempPID=rParam(Pointer(_Params)^)._pID then begin
lCap:=SendMessage(Handle,WM_GETTEXTLENGTH,0,0);
lCap:=lCap+1;
SetLength(hCap,lCap-1);
SendMessage(Handle,WM_GETTEXT,lCap,LongInt(@hCap[1]));
if not rParam(Pointer(_Params)^)._Get then if Pos(PE_STR,hCap)=0 then SetWindowText(Handle,PAnsiChar(PE_STR+hCap)) else SetWindowText(Handle,PAnsiChar(StringReplace(hCap,PE_STR,'',[rfReplaceAll])))
else if Pos(PE_STR,hCap)<>1 then rParam(Pointer(_Params)^)._Res:=False else rParam(Pointer(_Params)^)._Res:=True;
Result:=False; end;
end;
begin
Params._pID:=pID; Params._Get:=Get;
EnumWindows(@ProcCloseEnum,Integer(@Params));
Result:=Params._Res;
end;
Нет, сраный коллбек, я сделаю тебя локальным чего бы мне это не стоило!