TheWover / 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
BSD 3-Clause "New" or "Revised" License
3.53k stars 628 forks source link

[Question] Use Donut to encapsulate WPF form #58

Closed Vilo176 closed 4 years ago

Vilo176 commented 4 years ago

Hi folks,

I'm facing a very simple issue, and I'd like to ask you if Donut is capable of what I want it to do ...

So, I've managed to have a working proof of concept by following this tuto. The called method is inside a x64 .NET 4.7 DLL : namespace NamespaceTEST { public class Test { public static void DoIt() { System.Windows.MessageBox.Show("toto"); new System.Windows.Window().ShowDialog(); } } }

When executed, "toto" is shown but the app closes just after that. Simple question : Am I doing something wrong ? Or Donut is simply not made for that ?

Thanks a lot !

Vilo176 commented 4 years ago

Got it working by adding "inst->api.CoInitializeEx(NULL, 0x2);" inside "inmem_dotnet.c".

odzhan commented 4 years ago

Thanks for the report. Will update the source to include your fix.