Beispiel #1
0
        private void setupScanEnvironment()
        {
            try
            {
                string project = ScanSupport.DotNet.createTempProjectFileForProject(Target, WorkDirectory, false);
                ApplicationFile = ScanSupport.createTempApplicationFileForProject(project, false, WorkDirectory);
                fileName        = Path.GetFileName(Target);
                // todo: move this code to a function to create a Scan Package for .net (so normally scan from the local place

                /*
                 *
                 * //      Files.deleteFolder(sTempDirectory);
                 * dllInTempDirectory = Files.Copy(Target, Path.Combine(workDirectory, Path.GetFileName(Target)));
                 * // setup temp project file
                 * project = ScanSupport.DotNet.createTempProjectFileForProject(dllInTempDirectory, workDirectory, false);
                 * // setup temp Application file
                 * application = ScanSupport.createTempApplicationFileForProject(project, false);
                 * // check for pdb file
                 * pdbFile = Target.Replace(Path.GetExtension(Target), ".pdb");
                 * if (false == File.Exists(pdbFile))
                 *   DI.log.debug("Could not find pdb file, there might be problems scanning this dll");
                 * else
                 *  pdbInTempDirectory = Files.Copy(pdbFile, Path.Combine(workDirectory, Path.GetFileName(pdbFile)));
                 * */
            }
            catch (Exception ex)
            {
                DI.log.ex(ex, "in ScanTarget_DotNet.setupScanEnvironment");
            }
        }
 private void setupScanEnvironment()
 {
     try
     {
         string project = ScanSupport.Java.createTempProjectFileForProject(Target, WorkDirectory, false);
         ApplicationFile = ScanSupport.createTempApplicationFileForProject(project, false, WorkDirectory);
         fileName        = Path.GetFileName(Target);
     }
     catch (Exception ex)
     {
         DI.log.ex(ex, "in ScanTarget_Java.setupScanEnvironment");
     }
 }
Beispiel #3
0
        public bool scanProject(string sProjectToScan, string sPathToSaveAssessmentFile)
        {
            String sTempApplicationFile = ScanSupport.createTempApplicationFileForProject(sProjectToScan);

            if (sTempApplicationFile != "")
            {
                return(false);
            }

            bool bResult = scanApplication(sTempApplicationFile, sPathToSaveAssessmentFile, null, null);

            File.Delete(sTempApplicationFile);
            return(bResult);
        }