Exemple #1
0
        public void ThreadInitSearch(object[] args)
        {
            if (codes.ConnectAndAttach())
            {
                Form1.Instance.progBar.Value = 0;
                ncSearcher searcher = (ncSearcher)args[0];
                int        start    = (int)((uint)args[1]);
                int        stop     = (int)((uint)args[2]);
                ulong      addrFrom = (ulong)args[3];
                int        index    = (int)args[4];
                string[]   passArgs = (string[])args[5];
                searcher.InitialSearch(start, stop, addrFrom, index, passArgs);
                Form1.Instance.progBar.Value = 0;

                Form1.Instance.SetSearchStr("New Search");
                _shouldStopSearch = false;
            }
        }
Exemple #2
0
        public void LoadSearch()
        {
            //Search Comparisons
            ncSearcher ncS = new ncSearcher();

            //Equal To
            ncS.Name          = "Equal To";
            ncS.Args          = new string[] { "Old Val", "New Val" };
            ncS.InitialSearch = new InitialSearch(EqualTo_InitSearch);
            ncS.Exceptions    = new string[0];
            SearchComparisons.Add(ncS);

            //Not Equal To
            ncS.Name          = "Not Equal To";
            ncS.Args          = new string[] { "Old Val", "New Val" };
            ncS.InitialSearch = new InitialSearch(NotEqualTo_InitSearch);
            ncS.Exceptions    = new string[0];
            SearchComparisons.Add(ncS);

            //Less Than
            ncS.Name          = "Less Than";
            ncS.Args          = new string[] { "Old Val", "New Val" };
            ncS.InitialSearch = new InitialSearch(LessThan_InitSearch);
            ncS.Exceptions    = new string[0];
            SearchComparisons.Add(ncS);

            //Less Than or Equal
            ncS.Name          = "Less Than or Equal";
            ncS.Args          = new string[] { "Old Val", "New Val" };
            ncS.InitialSearch = new InitialSearch(LessThanEqualTo_InitSearch);
            ncS.Exceptions    = new string[0];
            SearchComparisons.Add(ncS);

            //Greater Than
            ncS.Name          = "Greater Than";
            ncS.Args          = new string[] { "Old Val", "New Val" };
            ncS.InitialSearch = new InitialSearch(GreaterThan_InitSearch);
            ncS.Exceptions    = new string[0];
            SearchComparisons.Add(ncS);

            //Greater Than or Equal
            ncS.Name          = "Greater Than or Equal";
            ncS.Args          = new string[] { "Old Val", "New Val" };
            ncS.InitialSearch = new InitialSearch(GreaterThanEqualTo_InitSearch);
            ncS.Exceptions    = new string[0];
            SearchComparisons.Add(ncS);

            //Search Types
            SearchControl.ncSearchType ncST = new SearchControl.ncSearchType();

            //1 byte
            ncST.ByteSize        = 1;
            ncST.Name            = "1 byte";
            ncST.ToItem          = new SearchControl.SearchToItem(standardByte_ToItem);
            ncST.BAToString      = new SearchControl.ByteAToString(sType1B_ToString);
            ncST.CheckboxName    = "Hex";
            ncST.DefaultValue    = "00";
            ncST.CheckboxConvert = new SearchControl.CheckboxConvert(ConvertHexDec);
            ncST.ToByteArray     = new SearchControl.StringToByteA(sType1B_ToByteArray);
            ncST.ItemToString    = new SearchControl.ToSListViewItem(sType1B_ItemToString);
            ncST.ItemToLString   = new SearchControl.ParseItemToListString(standardByte_ItemToLString);
            ncST.Initialize      = new SearchControl.TypeInitialize(NullTypeInitialize);
            ncST.ignoreAlignment = false;
            SearchTypes.Add(ncST);

            //2 bytes
            ncST.ByteSize        = 2;
            ncST.Name            = "2 bytes";
            ncST.ToItem          = new SearchControl.SearchToItem(standardByte_ToItem);
            ncST.BAToString      = new SearchControl.ByteAToString(sType2B_ToString);
            ncST.CheckboxName    = "Hex";
            ncST.DefaultValue    = "0000";
            ncST.CheckboxConvert = new SearchControl.CheckboxConvert(ConvertHexDec);
            ncST.ToByteArray     = new SearchControl.StringToByteA(sType2B_ToByteArray);
            ncST.ItemToString    = new SearchControl.ToSListViewItem(sType2B_ItemToString);
            ncST.ItemToLString   = new SearchControl.ParseItemToListString(standardByte_ItemToLString);
            ncST.Initialize      = new SearchControl.TypeInitialize(NullTypeInitialize);
            ncST.ignoreAlignment = false;
            SearchTypes.Add(ncST);

            //4 bytes
            ncST.ByteSize        = 4;
            ncST.Name            = "4 bytes";
            ncST.ToItem          = new SearchControl.SearchToItem(standardByte_ToItem);
            ncST.BAToString      = new SearchControl.ByteAToString(sType4B_ToString);
            ncST.CheckboxName    = "Hex";
            ncST.DefaultValue    = "00000000";
            ncST.CheckboxConvert = new SearchControl.CheckboxConvert(ConvertHexDec);
            ncST.ToByteArray     = new SearchControl.StringToByteA(sType4B_ToByteArray);
            ncST.ItemToString    = new SearchControl.ToSListViewItem(sType4B_ItemToString);
            ncST.ItemToLString   = new SearchControl.ParseItemToListString(standardByte_ItemToLString);
            ncST.Initialize      = new SearchControl.TypeInitialize(NullTypeInitialize);
            ncST.ignoreAlignment = false;
            SearchTypes.Add(ncST);

            //8 bytes
            ncST.ByteSize        = 8;
            ncST.Name            = "8 bytes";
            ncST.ToItem          = new SearchControl.SearchToItem(standardByte_ToItem);
            ncST.BAToString      = new SearchControl.ByteAToString(sType8B_ToString);
            ncST.CheckboxName    = "Hex";
            ncST.DefaultValue    = "0000000000000000";
            ncST.CheckboxConvert = new SearchControl.CheckboxConvert(ConvertHexDec);
            ncST.ToByteArray     = new SearchControl.StringToByteA(sType8B_ToByteArray);
            ncST.ItemToString    = new SearchControl.ToSListViewItem(sType8B_ItemToString);
            ncST.ItemToLString   = new SearchControl.ParseItemToListString(standardByte_ItemToLString);
            ncST.Initialize      = new SearchControl.TypeInitialize(NullTypeInitialize);
            ncST.ignoreAlignment = false;
            SearchTypes.Add(ncST);

            //X bytes
            ncST.ByteSize        = 0;
            ncST.Name            = "X bytes";
            ncST.ToItem          = new SearchControl.SearchToItem(standardByte_ToItem);
            ncST.BAToString      = new SearchControl.ByteAToString(sTypeXB_ToString);
            ncST.CheckboxName    = "";
            ncST.DefaultValue    = "00000000";
            ncST.CheckboxConvert = new SearchControl.CheckboxConvert(ConvertHexDec);
            ncST.ToByteArray     = new SearchControl.StringToByteA(sTypeXB_ToByteArray);
            ncST.ItemToString    = new SearchControl.ToSListViewItem(sTypeXB_ItemToString);
            ncST.ItemToLString   = new SearchControl.ParseItemToListString(standardByte_ItemToLString);
            ncST.Initialize      = new SearchControl.TypeInitialize(sTypeXB_Initialize);
            ncST.ignoreAlignment = true;
            SearchTypes.Add(ncST);

            //Populate Search combo box
            Form1.Instance.ResetSearchCompBox();
        }