disable marshalling

This commit is contained in:
Lightczx
2023-10-30 13:51:01 +08:00
parent cf0753c676
commit 4f7f0cdfd2
3 changed files with 18 additions and 18 deletions

View File

@@ -45,7 +45,7 @@ public static class Injector {
return new Win32Exception().PrintMsgAndReturnErrCode("WriteProcessMemory fail"); return new Win32Exception().PrintMsgAndReturnErrCode("WriteProcessMemory fail");
} }
} }
var lpStartAddress = pLoadLibrary.CreateDelegate<LPTHREAD_START_ROUTINE>(); var lpStartAddress = (delegate* unmanaged[Stdcall]<void*, uint>)pLoadLibrary.Value; //THREAD_START_ROUTINE
var hThread = Native.CreateRemoteThread(hProc, default, 0, lpStartAddress, pBase, 0); var hThread = Native.CreateRemoteThread(hProc, default, 0, lpStartAddress, pBase, 0);
if (hThread.IsNull) { if (hThread.IsNull) {
var e = new Win32Exception(); var e = new Win32Exception();

View File

@@ -1,6 +1,6 @@
{ {
"$schema": "https://aka.ms/CsWin32.schema.json", "$schema": "https://aka.ms/CsWin32.schema.json",
"className": "Native", "className": "Native",
"allowMarshaling": true, "allowMarshaling": false,
"public": true "public": true
} }

View File

@@ -1,21 +1,21 @@
CreateProcess CloseClipboard
CreateProcess
CreateRemoteThread
EmptyClipboard
GetConsoleMode
GetDC
GetDeviceCaps
GetModuleHandle GetModuleHandle
GetProcAddress GetProcAddress
VirtualAllocEx
WriteProcessMemory
CreateRemoteThread
VirtualFreeEx
WaitForSingleObject
OpenClipboard
EmptyClipboard
GlobalLock
SetClipboardData
GlobalUnlock
CloseClipboard
GetStdHandle GetStdHandle
GetConsoleMode GlobalLock
GlobalUnlock
OpenClipboard
ResumeThread
SetClipboardData
SetConsoleMode SetConsoleMode
TerminateProcess TerminateProcess
ResumeThread VirtualAllocEx
GetDeviceCaps VirtualFreeEx
GetDC WaitForSingleObject
WriteProcessMemory