Writing process memory

delphi package - easy access to kernel objects etc.
Post Reply
SpiderVenom
Posts: 8
Joined: Tue Jun 01, 2004 4:46 am
Location: New Zealand
Contact:

Writing process memory

Post by SpiderVenom »

Can someone give me a very basic example of how I would use functions in madKernel to write $909090 to $00ABCDEF in process "stupidname.exe" (I do my best to think up lame examples :p)

Thanks
madshi
Site Admin
Posts: 10753
Joined: Sun Mar 21, 2004 5:25 pm

Post by madshi »

Not tested, just from the top of my head:

Code: Select all

var dw : dword;
begin
  dw := $90909090;
  Process('stupidname.exe').WriteMemory(dw, pointer($00ABCDEF)^, 3);
The code posted above writes 3 bytes. I was not sure how $909090 is aligned in a dword variable, so I filled it with $90909090. But then I wrote 3 bytes only. If you want to write $00909090 (= 4 bytes), you need to give in "4" as the last parameter of WriteMemory, also you should use "dw := $00909090" then.
Post Reply