// listview injection by: lord_viper//
//www.dttp.com//
unit lviinjection;
interface
uses
classes,windows,messages,commctrl,sysutils;
procedure lviw32injection(h:hwnd;item:string);
implementation
procedure lviw32injection(h:hwnd;item:string);
var
handle:thandle;
lvi:TLVFindInfo;
p:pointer;
pid:dword;
i:integer;
w:cardinal;
begin
GetWindowThreadProcessId(h,pid);
handle:=OpenProcess(PROCESS_ALL_ACCESS,FALSE,pid);
p:=virtualallocex(handle,nil,sizeof(lvi),MEM_COMMI T,PAGE_READWRITE);
lvi.psz:=virtualallocex(handle,nil,sizeof(item),ME M_COMMIT,PAGE_READWRITE);
lvi.flags:=LVFI_STRING;
writeprocessmemory(handle,lvi.psz,pchar(item),leng th(item),w);
writeprocessmemory(handle,p,@lvi,sizeof(lvi),w);
i:= SendMessage(h, LVM_FINDITEM, WPARAM(-1), LPARAM(p));
ListView_DeleteItem(h,i);
VirtualFreeEx(handle,Lvi.psz, 0, MEM_RELEASE);
VirtualFreeEx(handle, p, 0, MEM_RELEASE);
end;
end.