Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


WPM delphi

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
Reak
I post too much
Reputation: 0

Joined: 15 May 2007
Posts: 3496

PostPosted: Fri Nov 23, 2007 11:44 am    Post subject: WPM delphi Reply with quote

Well since I had problems with kaspers TUT, I searched for another, with results.

It's really nice and it WORKS. First I tried to nop a adress:
Code:
procedure TForm1.Button1Click(Sender: TObject);
var
  WindowName: Integer;
  ProcessId: Integer;
  ThreadId: Integer;
  buf: PChar;
  HandleWindow: Integer;
  Write: Cardinal;
const
  Address = $00488C02;
  PokeValue = $90;
  NumberOfBytes = 2;
begin
  WindowName := FindWindow(NIL, 'MapleStory');

  if WindowName = 0 then
  begin
    MessageDlg('Program not running.', mtWarning, [mbOK], 0);
  end;

  ThreadId := GetWindowThreadProcessId(WindowName, @ProcessId);
  HandleWindow := OpenProcess(PROCESS_ALL_ACCESS, False, ProcessId);

  GetMem(buf, 1);
  buf^ := Chr(PokeValue);
  WriteProcessMemory(HandleWindow, ptr(Address), buf, NumberOfBytes, Write);
  FreeMem(buf);
  CloseHandle(HandleWindow);
end;


Worked perfect, but how to I use more bytes like
Code:
0F 86 6C FF FF FF 83 FA 7B 0F 87 63 FF FF FF A1


I can't get it working, HLP PLIZ
Back to top
View user's profile Send private message
Flyte
Peanuts!!!!
Reputation: 6

Joined: 19 Apr 2006
Posts: 1887
Location: Canada

PostPosted: Fri Nov 23, 2007 12:02 pm    Post subject: Reply with quote

Stick the bytes into an array then write that array.
Back to top
View user's profile Send private message
slippppppppp
Grandmaster Cheater
Reputation: 0

Joined: 08 Aug 2006
Posts: 929

PostPosted: Fri Nov 23, 2007 12:10 pm    Post subject: Reply with quote

Im not sure, but couldnt you just set the poke value as

$0F $86 $6C $FF $FF $FF $83 $FA $7B $0F $87 $63 $FF $FF $FF $A1

, im not sure if you add commas, but just try it and see if it works Wink
Back to top
View user's profile Send private message AIM Address MSN Messenger
Reak
I post too much
Reputation: 0

Joined: 15 May 2007
Posts: 3496

PostPosted: Fri Nov 23, 2007 12:17 pm    Post subject: Reply with quote

slippppppppp wrote:
Im not sure, but couldnt you just set the poke value as

$0F $86 $6C $FF $FF $FF $83 $FA $7B $0F $87 $63 $FF $FF $FF $A1

, im not sure if you add commas, but just try it and see if it works Wink


Already tried, no. Sad

Flyte: Ok, now how do I inject it?
Back to top
View user's profile Send private message
Flyte
Peanuts!!!!
Reputation: 6

Joined: 19 Apr 2006
Posts: 1887
Location: Canada

PostPosted: Fri Nov 23, 2007 12:24 pm    Post subject: Reply with quote

rEakW0n wrote:
Flyte: Ok, now how do I inject it?


Give WPM the address of the array and for the number of bytes you want to write put the size of the array.
Back to top
View user's profile Send private message
Reak
I post too much
Reputation: 0

Joined: 15 May 2007
Posts: 3496

PostPosted: Fri Nov 23, 2007 12:34 pm    Post subject: Reply with quote

so like that:
Code:
  iNJECTArray: Array [0..15] of Byte =($0F, $86, $6C, $FF, $FF, $FF, $83, $FA, $7B, $0F, $87, $63, $FF, $FF, $FF, $A1);


But I dont get it how to add it in the WPM() procedure.
HAPL PLOX
Back to top
View user's profile Send private message
DeletedUser14087
I post too much
Reputation: 2

Joined: 21 Jun 2006
Posts: 3069

PostPosted: Fri Nov 23, 2007 12:35 pm    Post subject: Reply with quote

the array of byte method is by Renko, the Hex is by me

Edit: What makes me confused is that it works perfect to me in C but in Delphi it does trouble Confused
Back to top
View user's profile Send private message
Flyte
Peanuts!!!!
Reputation: 6

Joined: 19 Apr 2006
Posts: 1887
Location: Canada

PostPosted: Fri Nov 23, 2007 12:39 pm    Post subject: Reply with quote

rEakW0n wrote:
so like that:
Code:
  iNJECTArray: Array [0..15] of Byte =($0F, $86, $6C, $FF, $FF, $FF, $83, $FA, $7B, $0F, $87, $63, $FF, $FF, $FF, $A1);


But I dont get it how to add it in the WPM() procedure.
HAPL PLOX


I really don't know Delphi, I only know how to read the code. So don't be surprised if this is riddled with errors.

Code:
 bytearraay: Array [0..15] of Byte =($0F, $86, $6C, $FF, $FF, $FF, $83, $FA, $7B, $0F, $87, $63, $FF, $FF, $FF, $A1);
... Junk here ...
  WriteProcessMemory(HandleWindow, ptr(Address), PChar(bytearray), 16, Write);
Back to top
View user's profile Send private message
rapion124
Grandmaster Cheater Supreme
Reputation: 0

Joined: 25 Mar 2007
Posts: 1095

PostPosted: Fri Nov 23, 2007 1:25 pm    Post subject: Reply with quote

@Flyte: You can't store values in an array like that. The compiler will throw an error. You must store each array separately.

The easiest way would be to use the inline asm compiler. Declare poke bytes as an array of bytes [0..15]. Then add this to the beginning of your code.

Code:

begin
asm
   PokeBytes:
   DB $0F $86 $6C $FF $FF $FF $83 $FA $7B $0F $87 $63 $FF $FF $FF $A1
end;
end;

   
Back to top
View user's profile Send private message
appalsap
Moderator
Reputation: 0

Joined: 27 Apr 2006
Posts: 6753
Location: Pakistan

PostPosted: Fri Nov 23, 2007 1:47 pm    Post subject: Reply with quote

rapion124 wrote:
@Flyte: You can't store values in an array like that. The compiler will throw an error. You must store each array separately.


Just tested it, and the compiler did not throw an error, it worked perfectly. Check again.

_________________
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites