Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > General Coding
You last visited: Today at 05:44

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[DELPHI] ReadProcessMemory

Discussion on [DELPHI] ReadProcessMemory within the General Coding forum part of the Coders Den category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Oct 2009
Posts: 2
Received Thanks: 0
[DELPHI] ReadProcessMemory

Hallo zusammen.

Bin vor 2 Tagen auf das Tutorial für Delphi hier im Forum gestossen und habe es durchgearbeitet und bin nun bei den ReadProcessMemory / Write angekommen.

Nun habe ich das auf und ab probiert und verstehe die argumente die man mit der funktion ausführt nicht ganz, kann mir da wer auf die sprünge helfen?

nach mehreren fehlermeldungen konnte ich das programm entlich mal kompelieren, es kam dann aber der fehler " Project xyz raised exception class EAccessViolation with message ' Access violation at address 005A81B in module 'XYZ.exe'. Write of address 135CFED8' ", wie kann ich diesen beheben?

Der code ist momentan noch ziemlich kurz gehalten.


Code:
unit readmemory;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls;

type
  TForm1 = class(TForm)
    Label1: TLabel;
    procedure FormCreate(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.FormCreate(Sender: TObject);
var

  ThreadID: Integer;
  ProcessID, data: Integer;
  wnd: HWnd;
  write: cardinal;
  v1: Cardinal;
  buf: PWideChar;
  WindowHandle, mynumber: Integer;                                            
  address: Cardinal;
  size, number: NativeUInt;
 
begin

  v1 := 1000;  
  address := $72BC11AD3C;
  mynumber := 1;
  size := 1234567;
  number := 8;
  
  wnd := FindWindow(nil, 'Calculator');
  if wnd <> 0 then
  begin
    ThreadID := GetWindowThreadProcessID(wnd, @ProcessID);
    WindowHandle := OpenProcess(PROCESS_ALL_ACCESS, False, ProcessID);
      Label1.Caption := IntToStr(ThreadID);
    buf^ :=Chr(v1);
    WriteProcessMemory(WindowHandle, ptr(address), @buf, size, number); 
    
      Label1.Caption := string(buf);
    
    CloseHandle(WindowHandle);
    end
    else
      ShowMessage ('Fehler!');
     
  
  end;
end.
antierotic is offline  
Old 06/22/2013, 20:59   #2
 
elite*gold: 97
Join Date: Jun 2007
Posts: 2,246
Received Thanks: 4,851
- Sehe in deinem Code nur WriteProcessMemory.
- Adresse ist mit 0x0x72BC11AD3C definitiv falsch (Delphi wird dich da warnen)
- Ganzer Code sollte überdacht werden

Interessant wäre nun zu wissen was du überhaupt vorhast, mit WriteProcessMemory (wie der Name fast schon erahnen lässt) schreibst du etwas in den Prozess. Zumindest im Titel hast du nur Read erwähnt.


Cencil is offline  
Old 06/24/2013, 20:45   #3
 
elite*gold: 0
Join Date: Oct 2009
Posts: 2
Received Thanks: 0
habe es mit writeprocessmemory probiert, da in dem tutorial das ich gefunden habe er es mit write macht, bei mir würde ein read reichen.

ziel wäre es den gespeicherten wert in "calculator" auszulesen und in einem label darzustellen.

was stimmt an der addresse nicht?

ps: danke für die links.
antierotic is offline  
Old 06/25/2013, 11:08   #4


 
MrSm!th's Avatar
 
elite*gold: 7110
Join Date: Jun 2009
Posts: 28,904
Received Thanks: 25,394
Sie ist zu lang. Ich bezweifle mal, dass du eine 64bit Adresse hast, also sollten da maximal 4 Bytes und nicht 5 stehen. Ein Zahlenpaar ist zu viel.
MrSm!th is offline  
Reply


Similar Threads Similar Threads
[Delphi] Readprocessmemory() mit dezimal?
06/12/2010 - General Coding - 3 Replies
Hallo, ich hätte noch eine frage. ReadProcessMemory(Pidhndl,ptr(BaseAddr), @AtmTargetPointer, Data, written); readprocessmemory gibt mir 0 als ausgabe. Ich verwende als Baseaddr eine Dezimalzahl. Nun meine Frage : Kann man mit readprocessmemory auch Dezimale addressen auslesen? Ohne das ''$'' vor der addresse? -298
[delphi] ReadProcessMemory
10/30/2009 - General Coding - 1 Replies
Hey guys, I don't know how to use ReadProcessMemory to get a string. Code: ReadProcessMemory(PHandle,Pointer($3B98D104),@tem ,4,Read); ...:= string(tem); This gives me an error
[Help] Delphi + ReadProcessMemory
11/05/2008 - CO2 Programming - 7 Replies
I cant seem to get read process memory working in delphi i dont know why at all either, ive googled it for like 2 hours the other night and know luck. so i figured ima try here this is my source currently thanks in advance for help unit Unit1; interface
[Help!!!] Delphi + Readprocessmemory
11/02/2008 - General Coding - 1 Replies
I cant seem to get read process memory working in delphi i dont know why at all either, ive googled it for like 2 hours the other night and know luck. so i figured ima try here this is my source currently thanks in advance for help unit Unit1; interface



All times are GMT +2. The time now is 05:44.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2024 elitepvpers All Rights Reserved.