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 


[C#] WriteProcessMemory

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
yoyonerd
Grandmaster Cheater
Reputation: 0

Joined: 26 Apr 2008
Posts: 699
Location: -->formerly yoyonerd<--

PostPosted: Wed Feb 11, 2009 1:37 am    Post subject: [C#] WriteProcessMemory Reply with quote

Simple enough, I am 95% sure I've done all the other arguments right, but the first one, with open process stumps me, i'll put my code here, if some1 could please tell me what went wrong

Code:
System.Diagnostics.Process[] proc = System.Diagnostics.Process.GetProcessesByName("MapleStory");

IntPtr hProcess = OpenProcess(0x1F0FFF, 0, (UInt32)proc[0].Id);

byte[] Kill_Ad = { 0x90, 0x90, 0x90, 0x90, 0x90 };

//Kill Ad
                WriteProcessMemory(hProcess, (IntPtr)0x007C66E3, Kill_Ad, (UIntPtr)Kill_Ad.Length, out bytesout);


this is for a maplestory v62 private server, if anybody can help, my AIM and msn are below in the button links

thanks, any type of comment is appreciated

_________________
Back to top
View user's profile Send private message AIM Address
Anden100
Grandmaster Cheater
Reputation: 0

Joined: 20 Apr 2007
Posts: 668

PostPosted: Wed Feb 11, 2009 4:37 am    Post subject: Reply with quote

Did you try to call GetLastError(), and see what it returns?
Back to top
View user's profile Send private message
dnsi0
I post too much
Reputation: 0

Joined: 04 Jan 2007
Posts: 2674

PostPosted: Wed Feb 11, 2009 8:56 am    Post subject: Re: [C#] WriteProcessMemory Reply with quote

yoyonerd wrote:
Simple enough, I am 95% sure I've done all the other arguments right, but the first one, with open process stumps me, i'll put my code here, if some1 could please tell me what went wrong

Code:
System.Diagnostics.Process[] proc = System.Diagnostics.Process.GetProcessesByName("MapleStory");

IntPtr hProcess = OpenProcess(0x1F0FFF, 0, (UInt32)proc[0].Id);

byte[] Kill_Ad = { 0x90, 0x90, 0x90, 0x90, 0x90 };

//Kill Ad
                WriteProcessMemory(hProcess, (IntPtr)0x007C66E3, Kill_Ad, (UIntPtr)Kill_Ad.Length, out bytesout);


this is for a maplestory v62 private server, if anybody can help, my AIM and msn are below in the button links

thanks, any type of comment is appreciated


see if proc[0].Id actucally returned anything.
then see if hProcess Returned anything then see if wpm returned true. I dont have .NET so Can't help you.
Back to top
View user's profile Send private message
Zerith
Master Cheater
Reputation: 1

Joined: 07 Oct 2007
Posts: 468

PostPosted: Wed Feb 11, 2009 9:04 am    Post subject: Re: [C#] WriteProcessMemory Reply with quote

dnsi0 wrote:
yoyonerd wrote:
Simple enough, I am 95% sure I've done all the other arguments right, but the first one, with open process stumps me, i'll put my code here, if some1 could please tell me what went wrong

Code:
System.Diagnostics.Process[] proc = System.Diagnostics.Process.GetProcessesByName("MapleStory");

IntPtr hProcess = OpenProcess(0x1F0FFF, 0, (UInt32)proc[0].Id);

byte[] Kill_Ad = { 0x90, 0x90, 0x90, 0x90, 0x90 };

//Kill Ad
                WriteProcessMemory(hProcess, (IntPtr)0x007C66E3, Kill_Ad, (UIntPtr)Kill_Ad.Length, out bytesout);


this is for a maplestory v62 private server, if anybody can help, my AIM and msn are below in the button links

thanks, any type of comment is appreciated


see if proc[0].Id actucally returned anything.
then see if hProcess Returned anything then see if wpm returned true. I dont have .NET so Can't help you.

If any process was found then it's inserted into the Process array, or else it doesn't, so if proc[0] exist then proc[0].Id is a valid ID aswell.

Are you using PROCESS_ALL_ACCESS? just use PROCESS_VM_WRITE and PROCESS_VM_READ if needed, you don't need anything else.
Or you could get debug priviliges, which seems like a waste to me.
Back to top
View user's profile Send private message MSN Messenger
NINTENDO
Grandmaster Cheater Supreme
Reputation: 0

Joined: 02 Nov 2007
Posts: 1371

PostPosted: Wed Feb 11, 2009 12:02 pm    Post subject: Reply with quote

Offtopic but why not just import the System.Diagnostics namespace?
_________________
Intel over amd yes.
Back to top
View user's profile Send private message Send e-mail AIM Address Yahoo Messenger MSN Messenger
samuri25404
Grandmaster Cheater
Reputation: 7

Joined: 04 May 2007
Posts: 955
Location: Why do you care?

PostPosted: Wed Feb 11, 2009 5:06 pm    Post subject: Re: [C#] WriteProcessMemory Reply with quote

Code:
System.Diagnostics.Process[] proc = System.Diagnostics.Process.GetProcessesByName("MapleStory");
MessageBox.Show(Marshal.GetLastWin32Error().ToString()); //Or you can use Console.WriteLine(), or whatever you want

IntPtr hProcess = OpenProcess(0x1F0FFF, 0, (UInt32)proc[0].Id);

byte[] Kill_Ad = { 0x90, 0x90, 0x90, 0x90, 0x90 };

//Kill Ad
                WriteProcessMemory(hProcess, (IntPtr)0x007C66E3, Kill_Ad, (UIntPtr)Kill_Ad.Length, out bytesout);
Messagebox.Show(Marshal.GetLastWin32Error.ToString());

_________________
Wiccaan wrote:

Oh jeez, watchout I'm a bias person! Locked.


Auto Assembly Tuts:
In Depth Tutorial on AA
Extended
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