Пример #1
0
        private IntPtr CallMethod(IntPtr ptr, IntPtr arg)
        {
            IntPtr hThreadId;
            var    hThread = NativeImport.CreateRemoteThread(LoadedProcess.Handle, IntPtr.Zero, 0,
                                                             ptr, arg, 0, out hThreadId);

            return(hThread);
        }
Пример #2
0
        private int CallLoadLibraryA(IntPtr PointerToArg)
        {
            IntPtr hThreadId;
            var    hThread = NativeImport.CreateRemoteThread(LoadedProcess.Handle, IntPtr.Zero, 0, LoadLibraryPTR, PointerToArg, 0, out hThreadId);

            NativeImport.WaitForSingleObject(hThread, unchecked ((uint)-1));
            uint exitCode;

            NativeImport.GetExitCodeThread(hThread, out exitCode);
            return((int)exitCode);
        }