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 


vb.net dll help writeprocessmemory

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

Joined: 08 Feb 2015
Posts: 607

PostPosted: Wed Sep 28, 2016 2:52 am    Post subject: Reply with quote

Is that really all of your source code?
Back to top
View user's profile Send private message
hhhuut
Grandmaster Cheater
Reputation: 6

Joined: 08 Feb 2015
Posts: 607

PostPosted: Thu Sep 29, 2016 9:52 am    Post subject: Reply with quote

Well, let's start with the core, the "WriteProcessMemory" function, which is a function from the windows API and can't be called without arguments: https://msdn.microsoft.com/de-de/library/windows/desktop/ms681674(v=vs.85).aspx
Back to top
View user's profile Send private message
atom0s
Moderator
Reputation: 205

Joined: 25 Jan 2006
Posts: 8587
Location: 127.0.0.1

PostPosted: Thu Sep 29, 2016 9:33 pm    Post subject: Reply with quote

You don't seem to understand what you are doing at all. You should stop and actually learn what you are doing and learn the language you are coding in rather than get spoonfed things you don't understand in general. It will just lead to you posting more questions because you are unfamiliar with what you are doing.
_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
hhhuut
Grandmaster Cheater
Reputation: 6

Joined: 08 Feb 2015
Posts: 607

PostPosted: Fri Sep 30, 2016 2:55 am    Post subject: Reply with quote

Well, I can give you some pseudo-code to get the order in which to do things, but as atom0s said, you need to understand what you're doing.

1) Obtain a handle to the target process (using OpenProcess)
2) Get your desired address (if it's static, better use the module+offset combo instead of an absolute hex address, else follow a pointer or something)
3) Call the WriteProcessMemory function with all the arguments and also pay attention to the value size (because if the value you want to change is a 0/1 byte flag, then you don't want to write the whole integer size of 4 bytes)
4) Close the handle to the target process

In addition, I'd always recommend to do some basic exception handling, so i.e. analyze the function results, do some basic checks yourself (address=0), use try-except/finally blocks, etc.

Fun fact: All the above doesn't even require you to inject a complete dll into other processes.
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