Example #1
0
 private void btStart_Click(object sender, EventArgs e)
 {
     if (!ResultGui.Searching)
     {
         if (OnPrepareStart())
         {
             btStart.Text = SimPe.Localization.GetString("Stop");
             btStart.Tag  = true;
             ResultGui.StartSearch(this);
         }
     }
     else
     {
         ResultGui.StopSearch();
     }
 }
Example #2
0
        public override void SearchPackage(SimPe.Interfaces.Files.IPackageFile pkg, SimPe.Interfaces.Files.IPackedFileDescriptor pfd)
        {
            if (type != 0)
            {
                if (pfd.Type != type)
                {
                    return;
                }
            }
            else
            {
                if (pfd.Type != Data.MetaData.GZPS && pfd.Type != Data.MetaData.MMAT)
                {
                    return;
                }
            }

            SimPe.PackedFiles.Wrapper.Cpf cpf = new SimPe.PackedFiles.Wrapper.Cpf();
            cpf.ProcessData(pfd, pkg);


            bool found = false;

            if (field != "")
            {
                found = FindInField(cpf, found, field);
            }
            else
            {
                foreach (SimPe.PackedFiles.Wrapper.CpfItem item in cpf.Items)
                {
                    found = FindInField(cpf, found, item.Name);
                    if (found)
                    {
                        break;
                    }
                }
            }

            //we have a match, so add the result item
            if (found)
            {
                ResultGui.AddResult(pkg, pfd);
            }
        }
Example #3
0
        public override void SearchPackage(SimPe.Interfaces.Files.IPackageFile pkg, SimPe.Interfaces.Files.IPackedFileDescriptor pfd)
        {
            if (pfd.Type != Data.MetaData.STRING_FILE && pfd.Type != Data.MetaData.CTSS_FILE)
            {
                return;
            }

            SimPe.PackedFiles.Wrapper.Str str = new SimPe.PackedFiles.Wrapper.Str();
            str.ProcessData(pfd, pkg);

            SimPe.PackedFiles.Wrapper.StrItemList sitems = str.Items;
            //check all stored nMap entries for a match
            foreach (SimPe.PackedFiles.Wrapper.StrToken item in sitems)
            {
                bool   found = false;
                string n     = item.Title.Trim().ToLower();
                if (compareType == CompareType.Equal)
                {
                    found = n == name;
                }
                else if (compareType == CompareType.Start)
                {
                    found = n.StartsWith(name);
                }
                else if (compareType == CompareType.End)
                {
                    found = n.EndsWith(name);
                }
                else if (compareType == CompareType.Contain)
                {
                    found = n.IndexOf(name) > -1;
                }
                else if (compareType == CompareType.RegExp && reg != null)
                {
                    found = reg.IsMatch(n);
                }

                //we have a match, so add the result item
                if (found)
                {
                    ResultGui.AddResult(pkg, pfd);
                    break;
                }
            }
        }
Example #4
0
        public void DoSearchPackage(SimPe.Interfaces.Files.IPackageFile pkg, SimPe.Interfaces.Files.IPackedFileDescriptor pfd)
        {
            SimPe.PackedFiles.Wrapper.ExtObjd obj = new SimPe.PackedFiles.Wrapper.ExtObjd();
            obj.ProcessData(pfd, pkg);

            bool found = false;

            if (name != "")
            {
                string n = obj.FileName.Trim().ToLower();
                if (compareType == CompareType.Equal)
                {
                    found = n == name;
                }
                else if (compareType == CompareType.Start)
                {
                    found = n.StartsWith(name);
                }
                else if (compareType == CompareType.End)
                {
                    found = n.EndsWith(name);
                }
                else if (compareType == CompareType.Contain)
                {
                    found = n.IndexOf(name) > -1;
                }
                else if (compareType == CompareType.RegExp && reg != null)
                {
                    found = reg.IsMatch(n);
                }
            }

            if (guid > 0 && (found || name == ""))
            {
                found = obj.Guid == guid;
            }

            //we have a match, so add the result item
            if (found)
            {
                ResultGui.AddResult(pkg, pfd);
            }
        }
Example #5
0
        public override void SearchPackage(SimPe.Interfaces.Files.IPackageFile pkg, SimPe.Interfaces.Files.IPackedFileDescriptor pfd)
        {
            if (pfd.Type != 0x4E524546)
            {
                return;
            }
            SimPe.PackedFiles.Wrapper.Nref nref = new Nref();
            nref.ProcessData(pfd, pkg);


            bool   found = false;
            string n     = nref.FileName.Trim().ToLower();

            if (compareType == CompareType.Equal)
            {
                found = n == name;
            }
            else if (compareType == CompareType.Start)
            {
                found = n.StartsWith(name);
            }
            else if (compareType == CompareType.End)
            {
                found = n.EndsWith(name);
            }
            else if (compareType == CompareType.Contain)
            {
                found = n.IndexOf(name) > -1;
            }
            else if (compareType == CompareType.RegExp && reg != null)
            {
                found = reg.IsMatch(n);
            }

            //we have a match, so add the result item
            if (found)
            {
                ResultGui.AddResult(pkg, pfd);
            }
        }