Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to Use C# to Call a Function Within a Seperate Running Native Process?

Can you use C# to call a function inside of another running process that is written in C/C++?

I know you can do this using C++ by injecting a DLL that starts a remote thread, listens for associated key-presses, and makes a call to the desired function whose signature and address has been defined.

The C++ to C++ tutorial is here: http://www.codeproject.com/Articles/29527/Reverse-Engineering-and-Function-Calling-by-Addres#Applying

If I remember correctly, I've also read in the past that you cannot inject a managed DLL (C#) into an unmanaged process (C++). But perhaps another way exists...

The reason that I'd like to do this is to reverse engineer a PC game and write little hacks in C#, a language I'm familiar with.

like image 658
David Button Avatar asked Mar 10 '16 08:03

David Button


People also ask

Is C easy for beginners?

Which programming language is easy to learn? C and C++ are both somewhat difficult to learn to program well. However, in many respects, they share many similarities with many other popular languages. In that sense they're just as easy (or as difficult) to learn, at first, as anything other programming language.

How can I learn C language perfectly?

Get started with C. Official C documentation - Might be hard to follow and understand for beginners. Visit official C Programming documentation. Write a lot of C programming code - The only way you can learn programming is by writing a lot of code.

Where is C language used?

C programming language is a machine-independent programming language that is mainly used to create many types of applications and operating systems such as Windows, and other complicated programs such as the Oracle database, Git, Python interpreter, and games and is considered a programming foundation in the process of ...


1 Answers

Take a look at the MemorySharp library, it does exactly what you want.

like image 53
Mark Jansen Avatar answered Oct 19 '22 17:10

Mark Jansen