Exemplo n.º 1
0
        public bool Object_builder(string path_to_file, Signature sgntr, ref string virus_name)
        {
            CheckFile  chck_file  = new CheckFile(path_to_file);
            ScanObject scanObject = new ScanObject();

            if (chck_file.IsFilePE())
            {
                return(scanObject.Block_read(1, path_to_file, sgntr, ref virus_name));// flag = 1;
            }
            else
            {
                if (chck_file.IsFileZip())
                {
                    return(scanObject.Block_read(2, path_to_file, sgntr, ref virus_name));
                }
                else
                {
                    if (chck_file.IsFileDir())
                    {
                        Object_builder_for_dir(path_to_file, sgntr, ref virus_name);
                        return(false);
                    }
                    else
                    {
                        return(false);
                    }
                }
            }
        }
Exemplo n.º 2
0
        public bool Object_builder(string path_to_file, Signature sgntr, ref string virus_name, ref string path_to_infected_file)
        {
            CheckFile chck_file = new CheckFile(path_to_file);

            if (chck_file.IsFilePE())
            {
                if (scanObject.Block_read(1, path_to_file, sgntr, ref virus_name, ref path_to_infected_file))
                {
                    infected_files.Add(path_to_infected_file, virus_name);
                    return(true);
                }
                else
                {
                    scn_report.Add_record(false, not_a_virus, not_a_virus);
                    return(false);// flag = 1;
                }
            }
            else
            {
                if (chck_file.IsFileZip())
                {
                    if (scanObject.Block_read(2, path_to_file, sgntr, ref virus_name, ref path_to_infected_file))
                    {
                        infected_files.Add(path_to_infected_file, virus_name);
                        return(true);
                    }
                    else
                    {
                        scn_report.Add_record(false, not_a_virus, not_a_virus);
                        return(false);
                    }
                }
                else
                {
                    if (chck_file.IsFileDir())
                    {
                        Object_builder_for_dir(path_to_file, sgntr, ref virus_name, ref path_to_infected_file);
                        return(false);
                    }
                    else
                    {
                        scn_report.Add_record(false, not_a_virus, not_a_virus);
                        return(false);
                    }
                }
            }
        }