using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Runtime.InteropServices; using System.Text; using System.Threading.Tasks; using System.Windows; using System.Xml.Linq; namespace QYDongDongTool.Unitls { public class MP { [DllImport("DllInLine.dll", EntryPoint = "Hook", CallingConvention = CallingConvention.Cdecl)] public static extern int DllHook(int pid, string dLLPath); [DllImport("DllInLine.dll", EntryPoint = "UnHook", CallingConvention = CallingConvention.Cdecl)] public static extern int UnHookDll(int pid); public static bool Hook(int pid) { string sDllPath = System.Environment.CurrentDirectory+ "\\sendPhone.dll"; return DllHook(pid, sDllPath) ==0; } public static bool UnHook(int pid) { int val= UnHookDll(pid); return val==0; } } }