Autor Beitrag
SAiBOT
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 323
Erhaltene Danke: 6

XP SP2; 7
D7; D2009
BeitragVerfasst: Di 03.06.08 19:47 
Hi @ll, Ich bekomme es irgendwie nicht hin, den Speicher eines Prozesses, aus einer Injezierten Dll heraus zu ändern!
Von außerhalb ist das alles kein Problem!!! (CAPTION und Pointer sind KORREKT!!!).
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
    twnd := findWindow(nil, CAPTION);
    GetWindowThreadProcessId(twnd,@tpid);
    thprocess := OpenProcess(PROCESS_ALL_ACCESS, False, tpid);
    rr := WriteProcessMemory(thprocess, Ptr($00A3386F),@by, 1,fool);
    if not rr then
    messagebox(0, PChar(
      Format('wnd:%d|pid:%d|hprocess:%d',[twnd, tpid, thProcess])
      ), nil,0);


Die MessageBox zeigt 3 korrekte Werte an. (also <> 0, ProzessID überprüft, stimmt auch).
Trotzdem liefert WriteProcessMemory false, warum?
uall@ogc
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 1826
Erhaltene Danke: 11

Win 2000 & VMware
Delphi 3 Prof, Delphi 7 Prof
BeitragVerfasst: Mi 04.06.08 11:59 
Aus einer injezierten dll kannst du auch GetCurrentProcess benutzen, desweiteren vill mal mit VirtualPotect den Speicher beschreibbar machen. Und eigentlich kannst du den dann auch direkt ändern.

_________________
wer andern eine grube gräbt hat ein grubengrabgerät
- oder einfach zu viel zeit
SAiBOT Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 323
Erhaltene Danke: 6

XP SP2; 7
D7; D2009
BeitragVerfasst: Mi 04.06.08 16:17 
Das habe ich auch schon alles durch :nixweiss:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
var
  OldProtect: DWORD;
begin
  VirtualProtectEx(thprocess, Ptr($00A3386F), 1, PAGE_READWRITE, @OldProtect);
  asm
    mov [$00A3386F], $82;
  end;
  VirtualProtectEx(thprocess, Ptr($00A3386F), 1, OldProtect, @OldProtect);
end;


hilft leider nix -.-

Edit: Liegt daran das sich der Addressraum nach dem Injezieren verändert!