D
D
DIASWORD2020-08-08 16:16:45
C++ / C#
DIASWORD, 2020-08-08 16:16:45

Connecting external dll c#?

Good afternoon!
I asked myself the question of how to connect a dll (for example, FPSBOOSTER with a GUI) of an already compiled game on unity

Answer the question

In order to leave comments, you need to log in

2 answer(s)
G
Grish Poghosyan, 2020-08-09
@hovsepyann

using System;
using System.Runtime.InteropServices;

class Example
{
    // Use DllImport to import the Win32 MessageBox function.
    [DllImport("user32.dll", CharSet = CharSet.Unicode)]
    public static extern int MessageBox(IntPtr hWnd, String text, String caption, uint type);
    
    static void Main()
    {
        // Call the MessageBox function using platform invoke.
        MessageBox(new IntPtr(0), "Hello World!", "Hello Dialog", 0);
    }
}

Read more in the documentation: https://docs.microsoft.com/en-us/dotnet/api/system...

T
Timur Yakubov, 2020-08-09
@Kaidoz

The question is not well formulated.
You can connect DLL(.net) to the compiled game (not ill2cpp) using DnSpy.
To do this, you need to open Assembly-Csharp, find the desired class, which has a method for loading something. Right-click on the method => "Change method",
then in the lower left corner => "Add assembly reference" (or CTRL + O),
select your dll, and only then enter the method that activates the "FPS Booster".
To save the result, top left corner => "File" => "Save module".
The method will contain something like the following code: 6QT0t7hSRVSXq1ahT5qyEQ.png
Do not forget to transfer the dll to Managed after.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question