Click here to Skip to main content
15,887,275 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hello, I was wondering if u can hook into a specific process memory and not the hole memory itself, I'm working on visual studios, and I'm trying to make a console app where you can hook a process by saying a console line, kind of like a command

What I have tried:

like if u imported kernal32.dll to the console app and then u write process memory by saying Select (Process)




Console.Write("selectProcessname")
{
}
Posted
Updated 3-Dec-22 5:41am
Comments
Richard MacCutchan 3-Dec-22 4:48am    
Firstly you need to get the name right: kernel32.dll. Secondly, you can only write into process memory that belongs to you, not space owned by other processes.
DF.EX 3-Dec-22 4:56am    
OH, i though using kernal32.dll was supposed to go into the process or at least writing process, with writeprocessmemory, sorry if I mis corrected that, but can u atleast show me how to hook into process?
[no name] 3-Dec-22 8:46am    
Whether you can or can not, "hook" by itself is pretty vague and useless. e.g. "keyboard hook" provides some clarity.

1 solution

First, stop saying "hook into a process" as it is meaningless in the context you're using it.

What you are looking at is OpenProcess[^], which will give a processHandle you're going to use with ReadProcessMemory[^]
 
Share this answer
 
Comments
DF.EX 3-Dec-22 17:46pm    
thank you so much, im a beginner i dont know much about c# but thx
DF.EX 3-Dec-22 18:03pm    
what if i wanted to find process by window then cant find window else openproccess and readprocessmemory.
Dave Kreskowiak 3-Dec-22 18:13pm    
That depends on how you are identifying the window.

Google for "C# Get process by window". There's a bunch of different ways to do this.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900