Custom memory allocation in C# Part 18 — Hijacking methods on .NET 5 with modifying machine code

This is the eighteenth part of the Custom memory allocation series. For your convenience you can find other parts in the table of contents in Part 1 — Allocating object on a stack Today we are going to see a rewritten way of hijacking method with machine code. It works in Windows and Linux, for … Continue reading Custom memory allocation in C# Part 18 — Hijacking methods on .NET 5 with modifying machine code

Custom memory allocation in C# Part 17 — Hijacking methods on .NET 5 with modifying metadata curious thing

This is the seventeenth part of the Custom memory allocation series. For your convenience you can find other parts in the table of contents in Part 1 — Allocating object on a stack I was rewriting my method hijacking samples to .NET 5 and I found an interesting behavior. Let’s take this code: If you … Continue reading Custom memory allocation in C# Part 17 — Hijacking methods on .NET 5 with modifying metadata curious thing

Custom memory allocation in C# Part 16 — Hijacking new on Linux with .NET 5

This is the sixteenth part of the Custom memory allocation series. For your convenience you can find other parts in the table of contents in Part 1 — Allocating object on a stack I was recently asked if it’s possible to hijack the new operator in Linux. We’ve already seen that we can do it … Continue reading Custom memory allocation in C# Part 16 — Hijacking new on Linux with .NET 5

.NET Inside Out Part 24 – Synchronous waiting for the Task in the same frame

This is the twentieth fourth part of the .NET Inside Out series. For your convenience you can find other parts in the table of contents in Part 1 – Virtual and non-virtual calls in C# Let’s take this code: and compare it with this one: They look very similar, however, they give different outputs. First … Continue reading .NET Inside Out Part 24 – Synchronous waiting for the Task in the same frame

.NET Inside Out Part 23 – Machine code address of any .NET Core method

This is the twentieth third part of the .NET Inside Out series. For your convenience you can find other parts in the table of contents in Part 1 – Virtual and non-virtual calls in C# .NET Core introduced tiered compilation and reworked AOT compilation. Previously, we could get address of machine code by calling GetFunctionPointer … Continue reading .NET Inside Out Part 23 – Machine code address of any .NET Core method