Autor Beitrag
ccdee
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 28

WinXP, Linux
PHP, Delphi, VB, Cobal, Pascal
BeitragVerfasst: Do 30.08.07 15:58 
Hallo,
Ich habe gerade versucht ein Programm zu schreiben, mit dem ich einen Task auswählen und dann verschiedene HEX Adressen auslesen bzw. beschreiebn kann.

Irgendwie funtzt er aber nicht. Ergibt mir Fehlmeldungen heraus.

ausblenden volle Höhe Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
unit test;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, tlhelp32, StdCtrls, ExtCtrls;

type
  TForm2 = class(TForm)
  personalhealthDATA: TEdit;

  private
    { Private-Deklarationen }
  public
    { Public-Deklarationen }
  end;

var
  Form2: TForm2;
  PidHandle: integer;
  PidID : integer;
  byteArr : Array of byte;
  Write: Cardinal;

Const
  ProgramName = 'Nksp.exe';

implementation

{$R *.dfm}

function GetProcessID(Const ExeFileName: string; var ProcessId: integer): boolean;
var
  ContinueLoop: BOOL;
  FSnapshotHandle: THandle;
  FProcessEntry32: TProcessEntry32;
begin
  result := false;
  FSnapshotHandle := CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
  FProcessEntry32.dwSize := Sizeof(FProcessEntry32);
  ContinueLoop := Process32First(FSnapshotHandle, FProcessEntry32);
  while integer(ContinueLoop) <> 0 do begin
    if (StrIComp(PChar(ExtractFileName(FProcessEntry32.szExeFile)), PChar(ExeFileName)) = 0)
       or (StrIComp(FProcessEntry32.szExeFile, PChar(ExeFileName)) = 0)  then begin
       ProcessId:= FProcessEntry32.th32ProcessID;
       result := true;
       break;
    end;
    ContinueLoop := Process32Next(FSnapshotHandle, FProcessEntry32);
  end;
  CloseHandle(FSnapshotHandle);
end;




procedure READ(Address: Cardinal; Data: Byte);
var
Written: Cardinal;
begin
if GetProcessID(ProgramName, PidId) then
  begin
    PidHandle  :=  OpenProcess(PROCESS_ALL_ACCESS,False,PidId);
    ReadProcessMemory(PidHandle, Pointer(Address), @Data, SizeOf(Data), Written);
    closehandle(PidHandle);
  end
end;


procedure TForm2.TimerTimer(Sender: TObject);
var
Personalhealth : Cardinal;
DATA : Byte;
begin
Personalhealth := $011C6838; //Adresse zum Auslesen

READ(Personalhealth, DATA);
personalhealthDATA.Text := Pchar(DATA);
end;

end.



villeicht hat einer ne idee..

Danke
elundril
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 3747
Erhaltene Danke: 123

Windows Vista, Ubuntu
Delphi 7 PE "Codename: Aurora", Eclipse Ganymede
BeitragVerfasst: Do 30.08.07 16:03 
das is zwar jetzt OT aber seh ích das richtig das du dir einen Cheat bastlen willst?

lg elundril
ccdee Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 28

WinXP, Linux
PHP, Delphi, VB, Cobal, Pascal
BeitragVerfasst: Do 30.08.07 16:07 
Jein

Will mir einen automatismus bauen, dass dieses Programm mein InGame Leben checked und wenn es zu tief ist automatisch die Potions nimmt um meinen Char zu heilen :D
GTA-Place
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
EE-Regisseur
Beiträge: 5248
Erhaltene Danke: 2

WIN XP, IE 7, FF 2.0
Delphi 7, Lazarus
BeitragVerfasst: Do 30.08.07 21:40 
Wie lautet die Fehlermeldung?

_________________
"Wer Ego-Shooter Killerspiele nennt, muss konsequenterweise jeden Horrorstreifen als Killerfilm bezeichnen." (Zeit.de)
elundril
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 3747
Erhaltene Danke: 123

Windows Vista, Ubuntu
Delphi 7 PE "Codename: Aurora", Eclipse Ganymede
BeitragVerfasst: Fr 31.08.07 11:49 
ich kenn mich zwar nicht so wirklich gut aus aber ich würd sagen (einfach nur ein gefühl) das bei zeile 79 etwas "falsch" ist.

lg elundril
ccdee Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 28

WinXP, Linux
PHP, Delphi, VB, Cobal, Pascal
BeitragVerfasst: Fr 31.08.07 15:16 
die fehlermeldungen ist was mit access violation und dann stehen noch einige $ adressen dahinter.
ccdee Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 28

WinXP, Linux
PHP, Delphi, VB, Cobal, Pascal
BeitragVerfasst: Fr 31.08.07 15:19 
FEHLERMELDUNG:


Zugriffsverletzung bei Adresse 0040484B in Modul 'program.exe'. Lesen von Adresse 00000078

un dieser Fehler erschient als Messagebox und zwar unendliche Male =)


Muss das Programm über den Taskmanager beenden
GTA-Place
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
EE-Regisseur
Beiträge: 5248
Erhaltene Danke: 2

WIN XP, IE 7, FF 2.0
Delphi 7, Lazarus
BeitragVerfasst: Fr 31.08.07 15:38 
Der Fehler liegt, wie elundril bereits gesagt hat, in Zeile 79. Verwende da mal statt PChar() z.B. IntToStr() o.Ä. Außerdem solltest du in Zeile 58 vor Date ein var setzen (var Data: Byte).

_________________
"Wer Ego-Shooter Killerspiele nennt, muss konsequenterweise jeden Horrorstreifen als Killerfilm bezeichnen." (Zeit.de)
ccdee Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 28

WinXP, Linux
PHP, Delphi, VB, Cobal, Pascal
BeitragVerfasst: Fr 31.08.07 15:44 
ok danke probeier das gleich mal aus wenn ich wieder zu hause bin