Autor Beitrag
LittleBen
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 258
Erhaltene Danke: 4

Win 7, Mac OS
Delphi 7
BeitragVerfasst: Sa 21.05.11 18:42 
Hallo,
bin gerade dabei eine Art Trainer zu programmieren. Habe mir schon viele Tutorials angeguckt, doch bei allen muss ein Hilfsprogramm wie CheatEngine benutzt werden, um die Adresse herraus zu finden.
Alles was ich will ist, bei einem Spiel die Adresse eine Wertes (z.B Geld) zu finden (aber mit Delphi).
Wenn ich diese dann mal habe ist der Rest ja einfach.

Das ist mein erster Ansatz:
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:
procedure TForm1.Button1Click(Sender: TObject);
var WindowName: Integer;
    Window: Integer;
    Pidi: Integer;
    Wert: DWORD;
    nBuf: integer;
    cAdr: string;
    nPos: integer;
begin
 Active:= true;
 cAdr:= edit1.Text;   //Startadresse
 WindowName:= FindWindow(nil,'Test');
 GetWindowThreadProcessId(WindowName ,@Pidi);
 Window:= OpenProcess(PROCESS_VM_READ ,False , Pidi);

 while 0 = 0 do //Dreckige Endlosschleife
 begin
  nPos:= StrToInt('$'+cAdr);
  cAdr:= inttohex(nPos+4,nPos+4);

  ReadProcessMemory(Window ,ptr($+strtoint('$'+cAdr)),@nBuf,4,Wert);
  memo1.lines.add(cAdr+'  :  ' + IntToStr(nBuf));
  if nBuf = strtoint(edit2.Text) then
   memo2.Lines.Add(cAdr+'  :  ' + IntToStr(nBuf));

  Application.ProcessMessages;
  if Active = false then exit;  //Durch den Stop-Button setze ich Active auf false
 end;
 
CloseHandle(Window);
end;
Das ganze funktioniert eigentlich ganz gut.
Doch jetzt meine Fragen:
1)
Wenn ich bei $0 anfange, kommen erst noch tausende Adressen mit dem Wert 0.
Wo muss die Suche dann beginnen?
2)
Woher weiß ich, wann die Schleife beendet werden kann.
Also wo ist das Programmende?
3)
Was macht CheatEngine oder TSearch anderst, dass die Suche bei ihnen viel schneller ist?

Hoffe sehr, dass ihr mir helfen könnte!

Danke & Grüße,
Benny
jaenicke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19315
Erhaltene Danke: 1747

W11 x64 (Chrome, Edge)
Delphi 11 Pro, Oxygene, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: Sa 21.05.11 21:27 
user profile iconLittleBen hat folgendes geschrieben Zum zitierten Posting springen:
3)
Was macht CheatEngine oder TSearch anderst, dass die Suche bei ihnen viel schneller ist?
Lass die Memo-Ausgaben und die Stringumwandlungen weg... ;-)
Oder nimm zumindest BeginUpdate..EndUpdate beim Memo.
LittleBen Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 258
Erhaltene Danke: 4

Win 7, Mac OS
Delphi 7
BeitragVerfasst: Sa 21.05.11 22:25 
user profile iconjaenicke hat folgendes geschrieben Zum zitierten Posting springen:
Lass die Memo-Ausgaben und die Stringumwandlungen weg... ;-)

Mhh, dauert immer noch gut ne Stunde wenn ich von $0 starte...

EDIT: Wie wird denn eig. in der Assemblersprache das Programm beendet? Also was für ein Wert wird nBuf annehemen?
SAiBOT
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 323
Erhaltene Danke: 6

XP SP2; 7
D7; D2009
BeitragVerfasst: Di 24.05.11 22:23 
Es gab schonmal ein Thema hierzu, musst mal suchen.

Suche im MSDN VIRTUALQUERYEX

Zitat:
Retrieves information about a range of pages within the virtual address space of a specified process.

_________________
Debuggers don't remove bugs, they only show them in slow-motion.
LittleBen Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 258
Erhaltene Danke: 4

Win 7, Mac OS
Delphi 7
BeitragVerfasst: Fr 27.05.11 17:51 
Keiner eine Idee?
SAiBOT
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 323
Erhaltene Danke: 6

XP SP2; 7
D7; D2009
BeitragVerfasst: So 29.05.11 09:15 
Was gefällt dir an meiner denn nicht?

_________________
Debuggers don't remove bugs, they only show them in slow-motion.
LittleBen Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 258
Erhaltene Danke: 4

Win 7, Mac OS
Delphi 7
BeitragVerfasst: So 29.05.11 15:40 
Ich weiß nicht wirklich was du mir damit sagen wolltest.
MDX
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 595
Erhaltene Danke: 4

Windows 8.1, Linux Debian 8, Android Lollipop
Delphi, PHP, Java (Android)
BeitragVerfasst: So 29.05.11 17:44 
Du sollst dir das hier mal durchlesen msdn.microsoft.com/e...aa366907(VS.85).aspx
LittleBen Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 258
Erhaltene Danke: 4

Win 7, Mac OS
Delphi 7
BeitragVerfasst: So 29.05.11 17:49 
Bin daraus nicht wirklich schlauer geworden :gruebel:
Was soll mir das auch sagen??