diff --git a/src/Injector.cs b/src/Injector.cs index 4714786..3c3a627 100644 --- a/src/Injector.cs +++ b/src/Injector.cs @@ -45,7 +45,7 @@ public static class Injector { return new Win32Exception().PrintMsgAndReturnErrCode("WriteProcessMemory fail"); } } - var lpStartAddress = pLoadLibrary.CreateDelegate(); + var lpStartAddress = (delegate* unmanaged[Stdcall])pLoadLibrary.Value; //THREAD_START_ROUTINE var hThread = Native.CreateRemoteThread(hProc, default, 0, lpStartAddress, pBase, 0); if (hThread.IsNull) { var e = new Win32Exception(); diff --git a/src/NativeMethods.json b/src/NativeMethods.json index 1372a02..2fc0fd4 100644 --- a/src/NativeMethods.json +++ b/src/NativeMethods.json @@ -1,6 +1,6 @@ { "$schema": "https://aka.ms/CsWin32.schema.json", "className": "Native", - "allowMarshaling": true, + "allowMarshaling": false, "public": true } \ No newline at end of file diff --git a/src/NativeMethods.txt b/src/NativeMethods.txt index d3adb67..941cb92 100644 --- a/src/NativeMethods.txt +++ b/src/NativeMethods.txt @@ -1,21 +1,21 @@ -CreateProcess +CloseClipboard +CreateProcess +CreateRemoteThread +EmptyClipboard +GetConsoleMode +GetDC +GetDeviceCaps GetModuleHandle GetProcAddress -VirtualAllocEx -WriteProcessMemory -CreateRemoteThread -VirtualFreeEx -WaitForSingleObject -OpenClipboard -EmptyClipboard -GlobalLock -SetClipboardData -GlobalUnlock -CloseClipboard GetStdHandle -GetConsoleMode +GlobalLock +GlobalUnlock +OpenClipboard +ResumeThread +SetClipboardData SetConsoleMode TerminateProcess -ResumeThread -GetDeviceCaps -GetDC \ No newline at end of file +VirtualAllocEx +VirtualFreeEx +WaitForSingleObject +WriteProcessMemory \ No newline at end of file