AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Projekte WinSpy - Der Fenster Spion (Update 06.09.08)
Thema durchsuchen
Ansicht
Themen-Optionen

WinSpy - Der Fenster Spion (Update 06.09.08)

Ein Thema von toms · begonnen am 27. Jan 2004 · letzter Beitrag vom 16. Jul 2012
 
Departure

Registriert seit: 2. Aug 2008
2 Beiträge
 
#27

Re: WinSpy - Der Fenster Spion (Update 06.09.08)

  Alt 31. Okt 2008, 11:37
Thanks toms, I have looked over the source code it seems pretty old and uses units thats not in delphi latest releases but it end up all fine with some modifycations so i did'nt have to use UprocessMemManger unit which in retuned used old delphi units.

I used VirtuallAllocEx instead and the following is what resulted

Delphi-Quellcode:
Procedure TForm1.GetItemsSysListView(SysListHWND: Hwnd; Listbox: TListBox);
Var
iCount,i : integer;
lvItem : LV_ITEM;
plvRemoteItem : ^LV_ITEM;
pszItemText : PChar;
pszRemoteItemText : PChar;
nReadWritten : DWORD;
ProcessHND : THandle;
PID : DWORD;
stResult : string;
const
ITEM_BUFFER : Integer = $4000;

begin
if SysListHWND = 0 then RaiseLastWin32Error;
GetWindowThreadProcessId(SysListHWND, @PID);
ProcessHND:= OpenProcess(PROCESS_VM_OPERATION or PROCESS_VM_READ or PROCESS_VM_WRITE or PROCESS_QUERY_INFORMATION,false, PID);
  try
    pszItemText := AllocMem(ITEM_BUFFER);
    FillMemory(addr(lvItem), sizeof(LV_ITEM), 0);
    plvRemoteItem := VirtualAllocEx(ProcessHND, nil, sizeof(LV_ITEM), MEM_COMMIT, PAGE_READWRITE);
    pszRemoteItemText := VirtualAllocEx(ProcessHND, nil, ITEM_BUFFER, MEM_COMMIT, PAGE_READWRITE);

    iCount:= sendmessage(SysListHWND,LVM_GETITEMCOUNT,0,0);
    dec(iCount);
    lvItem.cchTextMax := ITEM_BUFFER;
    lvItem.iSubItem := 2;
    lvItem.pszText := pszRemoteItemText;
    stResult:= '';
    for i:= 0 to iCount do
    begin
      if (not WriteProcessMemory(ProcessHND, plvRemoteItem, addr(lvItem), sizeof(LV_ITEM), nReadWritten)) then
         showmessage(inttostr(getLastError));
         SendMessage(SysListHWND, LVM_GETITEMTEXT, WPARAM(i), LPARAM(plvRemoteItem));
      if (not ReadProcessMemory(ProcessHND, pszRemoteItemText, pszItemText, ITEM_BUFFER, nReadWritten)) then
         showmessage(inttostr(getLastError));
         stResult:= stResult + strpas(pszItemText);
         ListBox.Items.Append(pszItemText);
    end;
  finally
    FreeMem(pszItemText);
    VirtualFreeEx(ProcessHND, pszRemoteItemText, 0, MEM_RELEASE);
    VirtualFreeEx(ProcessHND, plvRemoteItem, 0, MEM_RELEASE);
  end;
end;
as you can see im actually after a specific subitem in systemlistview. Thanks for your help it was greatly appericated

[edit=Luckie]Inserted Delphi code tags. Mfg, Luckie[/edit]
  Mit Zitat antworten Zitat
 


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 04:28 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz