Blogs posts

Programming Sunday, April 28, 2024 Injecting a .NET Native AOT assembly to call internal functions

Injecting a .NET Native AOT assembly to call internal functions

#.NET #Csharp #Reversing #Ahead-of-time

When people think about injecting a library inside a native process, most people would directly associate this with C++ and the DllMain entry point. While this is valid, have you ever considered doing this in .NET(C#)?

Let me take you on an interesting adventure with Native AOT where we'll sneak our .NET DLL into Notepad.exe and have some fun calling its internal functions.

Read more
Programming Monday, January 2, 2023 Using .NET 7 Native AOT to call .NET functionality in C++

Using .NET 7 Native AOT to call .NET functionality in C++

#.NET #Csharp #C++

With the release of .NET 7, a new and exciting feature has been introduced - the Native AOT (Ahead of Time). This feature involves compiling an application's code into native machine code before it's executed. That is quite the difference from regular .NET compiled code!


One of the great advantages of using Native AOT in C++ is the ability to leverage the functionality written in C#. For example, with the use of System.Text.Json, developers can easily serialize and deserialize data in their C++ applications. In this tutorial, we will walk through a simple example of how to use this powerful feature to enhance the functionality of your C++ applications.

Read more
Programming Tuesday, September 20, 2022 C# Sending data using Memory-Mapped files

C# Sending data using Memory-Mapped files

#.NET #Csharp #Memory #Mapper

Sending data, be it a simple string or object(s) to a completely different application was easier than anticipated. While I was working on an application I actually encountered an instance where I was required to re-authenticate the user in a separate application, as I do not want to prompt the user to, once again sign in. I had several ideas of either storing the token on the user his system or why not create a static entry point and just overwrite the string from memory.

Apparently there was a much easier solution... Today we discuss MemoryMappedFile

Read more