//calls the driver and recieve complete idt public unsafe InterruptTable GetInterruptTable() { //new idt, we will return this object later InterruptTable interruptTable = new InterruptTable(); int Count; try { //our in and out buffer byte[] inBuffer = new byte[0]; byte[] outBuffer = new byte[256 * 4]; //call driver and recieve data Interact(IOCTL_GET_INT_TABLE(), inBuffer, outBuffer); Count = 0; fixed (byte* pOut = outBuffer) //unmanaged data { //first dword is cnt Count = ((int*)pOut)[0]; //afterwards is the idt for (int cnt = 0; cnt < Count; cnt++) { //get address uint address = ((uint*)pOut)[cnt+1]; //create new entry InterruptTableEntry entry = new InterruptTableEntry(address); //reslove module name for that address entry.Module = GetModuleName(address); //and add into our table for later display interruptTable.Add(entry); } } } catch (Exception e) { string msg = e.StackTrace + "\n\n" + e.Message + "\n\n" + e.HelpLink + "\n please contact the developer"; MessageBox.Show(msg); } return interruptTable; }
//calls the driver and recieve complete idt public unsafe InterruptTable GetInterruptTable() { //new idt, we will return this object later InterruptTable interruptTable = new InterruptTable(); int Count; try { //our in and out buffer byte[] inBuffer = new byte[0]; byte[] outBuffer = new byte[256 * 4]; //call driver and recieve data Interact(IOCTL_GET_INT_TABLE(), inBuffer, outBuffer); Count = 0; fixed(byte *pOut = outBuffer) //unmanaged data { //first dword is cnt Count = ((int *)pOut)[0]; //afterwards is the idt for (int cnt = 0; cnt < Count; cnt++) { //get address uint address = ((uint *)pOut)[cnt + 1]; //create new entry InterruptTableEntry entry = new InterruptTableEntry(address); //reslove module name for that address entry.Module = GetModuleName(address); //and add into our table for later display interruptTable.Add(entry); } } } catch (Exception e) { string msg = e.StackTrace + "\n\n" + e.Message + "\n\n" + e.HelpLink + "\n please contact the developer"; MessageBox.Show(msg); } return(interruptTable); }