• Trainer
  • Forums
  • Suche
  • Members
  • Kalender
  • Hilfe
  • Extras
Forum stats
Show team
Neue Beiträge ansehen
Heutige Beiträge ansehen
Home of Gamehacking - Archiv
Login to account Create an account
Login
Benutzername:
Passwort: Passwort vergessen?
 



  Home of Gamehacking - Archiv Coding Delphi Kleine Hilfe zu WriteProcessMemory gesucht...

Ansichts-Optionen
Kleine Hilfe zu WriteProcessMemory gesucht...
darius83 Offline
Junior Member
**
Beiträge: 34
Themen: 2
Registriert seit: Sep 2012
Bewertung: 0
#30
11.09.2012, 23:45 (Dieser Beitrag wurde zuletzt bearbeitet: 12.09.2012, 22:38 von darius83.)
(11.09.2012, 16:03)Acubra schrieb:
(11.09.2012, 00:36)darius83 schrieb: Anscheinend erstellt CE über Auto Assemble - CodeCave extra Speicher für die Cave
Hey,
entweder du benutzt die "Scan for CodeCaves" Funktion von Cheat Engine (siehe mein CodeCave Tutorial), oder du verwendest die VirtualAlloc (bzw. VirtualAllocEx) Funktion (http://msdn.microsoft.com/en-us/library/...85%29.aspx) um selber Speicher zu alloziieren.
In C++ sieht das Ganze so aus : http://homeofgamehacking.de/showthread.php?tid=842

Hmm das mit VirtualAllocEx muss ich mir mal genauer anschaun... Weiss aber jetzt schon, dass ich da wieder Probleme bekomme, weil dann ja die JMP Befehle nicht mehr fest sind und ich ka habe, wie ich dann rausbekomme, welche Bytes ich dafür schreiben muss XD

Naja hier erstmal mein momentaner Code und @sILeNt heLLsCrEAm:
Du hast jetzt auch deinen Shortcut drin :P




[code=delphi]
unit Unit1;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, tlhelp32, ExtCtrls, StdCtrls;
type
TWMHotkey = record
Msg: Cardinal;
idHotKey: Word;
Modifiers: Integer;
VirtKey: Integer;
end;

type
TForm1 = class(TForm)
Timer1: TTimer;
Memo1: TMemo;
procedure Timer1Timer(Sender: TObject);
private
procedure WMHotKey(var Msg: TWMHotKey); message WM_HOTKEY;
public
end;

var
Form1: TForm1;
CheatAktiv: Boolean = False;

implementation

{$R *.dfm}

const
PROCESS : String = 'game.dat'; // Prozessname des Spiels
GOLDSAMMELN: Integer = $00566d77; // Adresse 1 Gold
GOLDAUSGEBEN: Integer = $00566cd5; // Adresse 2 Gold
CAVEADRESS1: Integer = $004001E6; // Einfache Caveadresse mit 30Bytes Platz
CAVEADRESS2: Integer = $00401529; // Einfache Caveadresse mit 30Bytes Platz
ID = $FF;
JmpGoldSammeln:array[0..10] of byte = ($E9,$6A,$94,$E9,$FF,$90,$90,$90,$90,$90,$90);
JmpGoldSammelnOriginal:array[0..10] of byte = ($89,$46,$04,$C7,$44,$24,$74,$FF,$FF,$FF,$FF);
JmpGoldAusgeben:array[0..10] of byte = ($E9,$4F,$A8,$E9,$FF,$90,$90,$90,$90,$90,$90);
JmpGoldAusgebenOriginal:array[0..10] of byte = ($89,$47,$04,$C7,$44,$24,$74,$FF,$FF,$FF,$FF);
// $00004E20; 20000 Gold (Bytes 2-5)
CodeCave1:array[0..20] of byte = ($B8,$20,$4E,$00,$00,$89,$46,$04,$C7,$44,$24,
$74,$FF,$FF,$FF,$FF,$E9,$87,$6B,$16,$00);
CodeCave2:array[0..20] of byte = ($B8,$20,$4E,$00,$00,$89,$47,$04,$C7,$44,$24,
$74,$FF,$FF,$FF,$FF,$E9,$A2,$57,$16,$00);

function GetID(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; // function GetID

function GetAdress(Pidhandle: Integer; BasePointer: Cardinal; Offsets: Array of Cardinal) : Cardinal;
var
i, Anzahl: Integer;
Written: Cardinal;
begin
Written := 0;
Result := BasePointer;
Anzahl := High(Offsets);
if Anzahl = 1 then
Result := Result + Offsets[1]
else begin
for i := 1 to Anzahl do begin
ReadProcessMemory(Pidhandle, Pointer(Result), @Result, 4, Written);
Result := Result + Offsets[i];
end;
end;
end; // function GetAdress

procedure WriteBytesToMem(Processhandle, Adress, Written: Cardinal;
ByteArray: Array of Byte);
var i: Cardinal;
begin
for i := 0 to high(ByteArray) do
WriteProcessMemory(Processhandle, Pointer(Adress+i),@ByteArray[i] , 1, Written);
end; // procedure WriteBytesToMem

procedure Start();
var
Pid: Integer;
Written, lpBuffer, lBuf, Adress, Pidhandle: Cardinal;
Offsets: Array of Cardinal;
begin
RegisterHotKey(Form1.Handle, ID, MOD_Alt, Ord('C'));
Pid := 0;
Adress := $0096c9b0;
SetLength (Offsets, 3);
Offsets[1] := $0C;
Offsets[2] := $34;
if GetID(PROCESS, Pid) then begin
Pidhandle := OpenProcess(PROCESS_ALL_ACCESS,False,Pid);
try
lBuf := GetAdress(Pidhandle, Adress, Offsets);
ReadProcessMemory(Pidhandle, Pointer(lBuf), @lBuf, 4, Written);
if lBuf > 0 then begin
VirtualProtectEx(Pidhandle, Pointer(CAVEADRESS1), 30, PAGE_EXECUTE_READWRITE, lpBuffer);
VirtualProtectEx(Pidhandle, Pointer(CAVEADRESS2), 30, PAGE_EXECUTE_READWRITE, lpBuffer);
WriteBytesToMem(Pidhandle, GOLDSAMMELN, Written, JmpGoldSammeln);
WriteBytesToMem(Pidhandle, GOLDAUSGEBEN, Written, JmpGoldAusgeben);
WriteBytesToMem(Pidhandle, CAVEADRESS1, Written, CodeCave1);
WriteBytesToMem(Pidhandle, CAVEADRESS2, Written, CodeCave2);
CheatAktiv := true;
Form1.Timer1.Enabled := false;
end;
finally
closehandle(Pidhandle);

end;
end;
end; // procedure Start

procedure Change();
var
Pid: Integer;
Written, Pidhandle: Cardinal;
begin
Pid := 0;
Written := 0;
if GetID(PROCESS, Pid) then begin
Pidhandle := OpenProcess(PROCESS_ALL_ACCESS,False,Pid);
try
if not CheatAktiv then begin
WriteBytesToMem(Pidhandle, GOLDSAMMELN, Written, JmpGoldSammeln);
WriteBytesToMem(Pidhandle, GOLDAUSGEBEN, Written, JmpGoldAusgeben);
CheatAktiv := true;
end else begin
WriteBytesToMem(Pidhandle, GOLDSAMMELN, Written, JmpGoldSammelnOriginal);
WriteBytesToMem(Pidhandle, GOLDAUSGEBEN, Written, JmpGoldAusgebenOriginal);
CheatAktiv := false;
end;
finally
closehandle(Pidhandle);
end;
end;
end; // procedure Change

procedure TForm1.Timer1Timer(Sender: TObject);
begin
Start();
end;

procedure TForm1.WMHotKey(var Msg: TWMHotkey);
begin
case Msg.IdHotKey of
ID:
begin
Change();
end;
// Abhängig von der ID wird entschieden, was getan werden soll.
end;
inherited;
end;

end.
[/code]

Es gibt 10 verschiedene Typen von Personen, die, die ich mag und die, die ich nicht verstehen kann...
Suchen
Antworten
Share Thread:            


Nachrichten in diesem Thema
Kleine Hilfe zu WriteProcessMemory gesucht... - von darius83 - 04.09.2012, 22:05
RE: Kleine Hilfe zu WriteProcessMemory gesucht... - von Mydayyy - 05.09.2012, 00:14
RE: Kleine Hilfe zu WriteProcessMemory gesucht... - von darius83 - 05.09.2012, 00:43
RE: Kleine Hilfe zu WriteProcessMemory gesucht... - von darius83 - 05.09.2012, 13:34
RE: Kleine Hilfe zu WriteProcessMemory gesucht... - von iNvIcTUs oRCuS - 05.09.2012, 16:21
RE: Kleine Hilfe zu WriteProcessMemory gesucht... - von darius83 - 05.09.2012, 18:17
RE: Kleine Hilfe zu WriteProcessMemory gesucht... - von iNvIcTUs oRCuS - 05.09.2012, 19:24
RE: Kleine Hilfe zu WriteProcessMemory gesucht... - von darius83 - 05.09.2012, 20:16
RE: Kleine Hilfe zu WriteProcessMemory gesucht... - von iNvIcTUs oRCuS - 05.09.2012, 21:44
RE: Kleine Hilfe zu WriteProcessMemory gesucht... - von iNvIcTUs oRCuS - 06.09.2012, 17:22
RE: Kleine Hilfe zu WriteProcessMemory gesucht... - von darius83 - 06.09.2012, 21:19
RE: Kleine Hilfe zu WriteProcessMemory gesucht... - von iNvIcTUs oRCuS - 07.09.2012, 01:23
RE: Kleine Hilfe zu WriteProcessMemory gesucht... - von darius83 - 07.09.2012, 20:25
RE: Kleine Hilfe zu WriteProcessMemory gesucht... - von iNvIcTUs oRCuS - 08.09.2012, 01:39
RE: Kleine Hilfe zu WriteProcessMemory gesucht... - von Acubra - 07.09.2012, 01:15
RE: Kleine Hilfe zu WriteProcessMemory gesucht... - von Mydayyy - 08.09.2012, 00:53
RE: Kleine Hilfe zu WriteProcessMemory gesucht... - von darius83 - 08.09.2012, 01:07
RE: Kleine Hilfe zu WriteProcessMemory gesucht... - von darius83 - 08.09.2012, 19:14
RE: Kleine Hilfe zu WriteProcessMemory gesucht... - von iNvIcTUs oRCuS - 09.09.2012, 00:42
RE: Kleine Hilfe zu WriteProcessMemory gesucht... - von darius83 - 09.09.2012, 01:11
RE: Kleine Hilfe zu WriteProcessMemory gesucht... - von iNvIcTUs oRCuS - 09.09.2012, 01:29
RE: Kleine Hilfe zu WriteProcessMemory gesucht... - von darius83 - 09.09.2012, 18:35
RE: Kleine Hilfe zu WriteProcessMemory gesucht... - von Acubra - 09.09.2012, 20:37
RE: Kleine Hilfe zu WriteProcessMemory gesucht... - von darius83 - 09.09.2012, 22:49
RE: Kleine Hilfe zu WriteProcessMemory gesucht... - von iNvIcTUs oRCuS - 10.09.2012, 00:32
RE: Kleine Hilfe zu WriteProcessMemory gesucht... - von darius83 - 10.09.2012, 01:37
RE: Kleine Hilfe zu WriteProcessMemory gesucht... - von iNvIcTUs oRCuS - 10.09.2012, 01:47
RE: Kleine Hilfe zu WriteProcessMemory gesucht... - von darius83 - 11.09.2012, 00:36
RE: Kleine Hilfe zu WriteProcessMemory gesucht... - von Acubra - 11.09.2012, 16:03
RE: Kleine Hilfe zu WriteProcessMemory gesucht... - von darius83 - 11.09.2012, 23:45
RE: Kleine Hilfe zu WriteProcessMemory gesucht... - von iNvIcTUs oRCuS - 12.09.2012, 05:48
RE: Kleine Hilfe zu WriteProcessMemory gesucht... - von darius83 - 12.09.2012, 23:30
RE: Kleine Hilfe zu WriteProcessMemory gesucht... - von iNvIcTUs oRCuS - 13.09.2012, 01:35
RE: Kleine Hilfe zu WriteProcessMemory gesucht... - von DNA - 13.09.2012, 12:16
RE: Kleine Hilfe zu WriteProcessMemory gesucht... - von iNvIcTUs oRCuS - 13.09.2012, 17:18
RE: Kleine Hilfe zu WriteProcessMemory gesucht... - von Acubra - 13.09.2012, 17:35
RE: Kleine Hilfe zu WriteProcessMemory gesucht... - von darius83 - 14.09.2012, 02:42
RE: Kleine Hilfe zu WriteProcessMemory gesucht... - von DNA - 14.09.2012, 12:06
RE: Kleine Hilfe zu WriteProcessMemory gesucht... - von darius83 - 14.09.2012, 15:04
RE: Kleine Hilfe zu WriteProcessMemory gesucht... - von iNvIcTUs oRCuS - 14.09.2012, 17:14
RE: Kleine Hilfe zu WriteProcessMemory gesucht... - von darius83 - 14.09.2012, 18:54
RE: Kleine Hilfe zu WriteProcessMemory gesucht... - von iNvIcTUs oRCuS - 15.09.2012, 17:21
RE: Kleine Hilfe zu WriteProcessMemory gesucht... - von darius83 - 15.09.2012, 19:54
RE: Kleine Hilfe zu WriteProcessMemory gesucht... - von iNvIcTUs oRCuS - 15.09.2012, 20:44
RE: Kleine Hilfe zu WriteProcessMemory gesucht... - von darius83 - 15.09.2012, 21:37
RE: Kleine Hilfe zu WriteProcessMemory gesucht... - von iNvIcTUs oRCuS - 15.09.2012, 22:00
RE: Kleine Hilfe zu WriteProcessMemory gesucht... - von darius83 - 16.09.2012, 00:17
RE: Kleine Hilfe zu WriteProcessMemory gesucht... - von iNvIcTUs oRCuS - 16.09.2012, 19:33
RE: Kleine Hilfe zu WriteProcessMemory gesucht... - von darius83 - 16.09.2012, 22:05
RE: Kleine Hilfe zu WriteProcessMemory gesucht... - von darius83 - 19.09.2012, 21:09
RE: Kleine Hilfe zu WriteProcessMemory gesucht... - von iNvIcTUs oRCuS - 20.09.2012, 19:25
RE: Kleine Hilfe zu WriteProcessMemory gesucht... - von iNvIcTUs oRCuS - 20.09.2012, 20:11
RE: Kleine Hilfe zu WriteProcessMemory gesucht... - von darius83 - 20.09.2012, 20:06
RE: Kleine Hilfe zu WriteProcessMemory gesucht... - von Acubra - 20.09.2012, 21:01
RE: Kleine Hilfe zu WriteProcessMemory gesucht... - von darius83 - 20.09.2012, 21:15
RE: Kleine Hilfe zu WriteProcessMemory gesucht... - von Acubra - 20.09.2012, 22:30
RE: Kleine Hilfe zu WriteProcessMemory gesucht... - von iNvIcTUs oRCuS - 21.09.2012, 08:06
RE: Kleine Hilfe zu WriteProcessMemory gesucht... - von darius83 - 25.09.2012, 18:13
RE: Kleine Hilfe zu WriteProcessMemory gesucht... - von iNvIcTUs oRCuS - 25.09.2012, 19:29
RE: Kleine Hilfe zu WriteProcessMemory gesucht... - von Acubra - 25.09.2012, 19:33
RE: Kleine Hilfe zu WriteProcessMemory gesucht... - von iNvIcTUs oRCuS - 25.09.2012, 20:06
RE: Kleine Hilfe zu WriteProcessMemory gesucht... - von darius83 - 27.09.2012, 22:19
RE: Kleine Hilfe zu WriteProcessMemory gesucht... - von iNvIcTUs oRCuS - 28.09.2012, 01:51
RE: Kleine Hilfe zu WriteProcessMemory gesucht... - von darius83 - 28.09.2012, 22:49
RE: Kleine Hilfe zu WriteProcessMemory gesucht... - von iNvIcTUs oRCuS - 29.09.2012, 02:50
RE: Kleine Hilfe zu WriteProcessMemory gesucht... - von Acubra - 29.09.2012, 15:20
RE: Kleine Hilfe zu WriteProcessMemory gesucht... - von iNvIcTUs oRCuS - 29.09.2012, 20:01

  • Druckversion anzeigen
  • Thema abonnieren


Benutzer, die gerade dieses Thema anschauen:
1 Gast/Gäste

  • Kontakt
  • Forum team
  • Forum stats
  • Nach oben
 
  • RSS-Synchronisation
  • Lite mode
  • Home of Gamehacking - Archiv
  • Help
 
Forum software by © MyBB - Theme © iAndrew 2014



Linearer Modus
Baumstrukturmodus