Пример #1
0
        //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;
        }
Пример #2
0
        //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);
        }
Пример #3
0
        //fill the listview with the information from the interruptTable
        private void FillIntTableList()
        {
            for (int i = 0; i < interruptTable.Count; i++)
            {
                //our current entry in the list
                InterruptTableEntry entry = interruptTable.Get(i);

                //new item in list field
                ListViewItem item = new ListViewItem(String.Format("{0:000}", i), 0);

                //convert address into hex string
                string str = "0x" + Convert.ToString(entry.Address, 16);
                item.SubItems.Add(str);

                //add module name
                item.SubItems.Add(entry.Module.ToLower());

                //add item into listview
                listViewIntTable.Items.Add(item);
            }
        }
Пример #4
0
 public void Add(InterruptTableEntry intTableEntry)
 {
     interruptTable.Add(intTableEntry);
 }
Пример #5
0
 public void Add(InterruptTableEntry intTableEntry)
 {
     interruptTable.Add(intTableEntry);
 }