HelpC# DllMain

Posts 17 of 7 · Page 1 of 1
C# DllMain
Is there any way to give a DllMain to C#

I'm tried with Static Constructor:
Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;


namespace CodeTester
{
    static class Program
    {
        static Program()
        {
            MessageBox.Show("Static Constructor");
        }


        static void Main()
        {
            MessageBox.Show("Main Method");
        }
    }
}
Injected into CrossFire but don't really seem to work...
CLR hosting.. This forum has some downloads and info about, just look.
I'v injected C# dlls into CF without issue.
Quote Originally Posted by Pingo View Post
CLR hosting.. This forum has some downloads and info about, just look.
I'v injected C# dlls into CF without issue.
Can you sand a link please ?
Or the most simple C# code that will run if i inject into Cf...
Jason has something released.
My dll injector in the CF section injects c# dll but only if it's .net framework 3.5 or lower.
And iv seen someone using something that was open source. Can't remember the name but that was in the CF section.

My injection class has some errors though.. If you're interested, i could send you a fixed copy of it.

The dll i was testing in CF looked like this
Code:
        public static int DllMain(string arg)
        {
            new Thread(TheThread).Start();
            return 0;
        }
        static void TheThread()
        {
            MessageBox.Show("The C# dll injected", "DooDaa!");
        }
Quote Originally Posted by Pingo View Post
Jason has something released.
My dll injector in the CF section injects c# dll but only if it's .net framework 3.5 or lower.
And iv seen someone using something that was open source. Can't remember the name but that was in the CF section.

My injection class has some errors though.. If you're interested, i could send you a fixed copy of it.

The dll i was testing in CF looked like this
Code:
        public static int DllMain(string arg)
        {
            new Thread(TheThread).Start();
            return 0;
        }
        static void TheThread()
        {
            MessageBox.Show("The C# dll injected", "DooDaa!");
        }
Ok, so i found an easy example of CLR hosting than i have a Native Dll wich call the Function from the managed Dll right ?

But hey man, what about binding the 2 Dll ?
Would it work if the UnManaged CLR host call the same Dll as itself wich binded with the Managed Dll ?
I never used that method so i can't help you with that.
Just follow the tut and see how it goes.
C# when using CLR does not have dll entry, unlike native dlls.
Posts 17 of 7 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Need help?