예제 #1
0
파일: App.cs 프로젝트: adiel2012/BMMTESTL
 public void create_control_repository(string filename)
 {
     ctrl_repo = new HashRepositoryController(Injector.getIstance().getIHashRepositoryHandler(filename), mainform);
     ctrl_repo.Display(filename);
     decorate_white(mainform.DGvResults);
     mainform.BtnResultCompare.Enabled = (ctrl_result != null && ctrl_repo != null);
 }
예제 #2
0
        // perform the comparisson between hash results and hash repository
        internal Match_result[] compare(HashRepositoryController ctrl_repo)
        {
            HashResultRecord[]     dataresult = repo.getAll();
            HashRepositoryRecord[] datarepo   = ctrl_repo.Repo.getAll();


            if (dataresult == null)
            {
                MessageBox.Show("Wrong File Format");
                return(null);
            }

            Match_result[] res = new Match_result[dataresult.Length];


            for (int i = 0; i < dataresult.Length; i++)
            {
                HashResultRecord curr_result   = dataresult[i];
                string           cad           = curr_result.FileFolderName.Trim(new char[] { ' ', '\"' });
                string           signaturetype = curr_result.SignatureType.Trim(new char[] { ' ', '\"' });
                string           signature     = curr_result.Signature.Trim(new char[] { ' ', '\"' });
                for (int j = 0; j < datarepo.Length; j++)
                {
                    HashRepositoryRecord repo_curr = datarepo[j];
                    res[i] = Match_result.NO_FILE;
                    string cad2 = repo_curr.ImageName.Trim(new char[] { ' ', '\"' });
                    if (cad == cad2)
                    {
                        int g = 0;

                        if (valid_hash(signaturetype, signature, repo_curr))
                        {
                            res[i] = Match_result.MATCH;
                        }
                        else
                        {
                            res[i] = Match_result.NO_MATCH;
                        }
                        break;
                    }
                }
            }

            return(res);
        }