The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 1,860 other subscribers

HInvoke and avoiding PInvoke | drakonia’s blog

Posted by jpluimers on 2024/12/26

On my research list [Wayback/Archive] HInvoke and avoiding PInvoke | drakonia’s blog.

A very minimalistic approach of calling .net runtime functions or accessing properties using only hashes as identifiers. It does not leave any strings or import references since we dynamically resolve the required member from the mscorlib assembly on runtime.

The underlying code is at [Wayback/Archive] S4ntiagoP/donut: Generates x86, x64, or AMD64+x86 position-independent shellcode that loads .NET Assemblies, PE files, and other Windows payloads from memory and runs them with parameters.

It is being used by [Wayback/Archive] Convert binary to a shellcode with donut and create a C# self injector from it via a combo of “Dynamic P/Invoke + H/Invoke” calls

Related are:

  1. the Windows PE (Portable Executable) loader for .NET: [Wayback/Archive] nettitude/RunPE: C# Reflective loader for unmanaged binaries.
  2. the [Wayback/Archive] daem0nc0re/TangledWinExec: C# PoCs for investigation of Windows process execution techniques investigation

Via:

–jeroen

 

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.