2 REM ###########################################################################
3 REM Script generated by HPE Security Fortify SCA Scan Wizard (c) 2011-2016 Hewlett Packard Enterprise Development LP
4 REM Created on 2016/11/09 09:06:13
5 REM ###########################################################################
6 REM Generated for the following languages:
10 REM ###########################################################################
11 REM DEBUG - if set to true, runs SCA in debug mode
12 REM SOURCEANALYZER - the name of the SCA executable
13 REM FPR - the name of analysis result file
14 REM BUILDID - the SCA build id
15 REM ARGFILE - the name of the argument file that's extracted and passed to SCA
16 REM BYTECODE_ARGFILE - the name of the argument file for Java Bytecode translation that's extracted and passed to SCA
17 REM MEMORY - the memory settings for SCA
18 REM LAUNCHERSWITCHES - the launcher settings that are used to invoke SCA
19 REM OLDFILENUMBER - this defines the file which contains the number of files within the project, it is automatically generated
20 REM FILENOMAXDIFF - this is the percentage of difference between the number of files which will trigger a warning by the script
21 REM ###########################################################################
24 set SOURCEANALYZER
=sourceanalyzer
25 set FPR
="Fortifytestcms-final-anon.fpr"
26 set BUILDID
="testcms-final-anon"
27 set ARGFILE
="Fortifytestcms-final-anon.bat.args"
28 set BYTECODE_ARGFILE
="Fortifytestcms-final-anon.bat.bytecode.args"
29 set MEMORY
=-Xmx682M
-Xms400M
-Xss24M
30 set LAUNCHERSWITCHES
=""
31 set OLDFILENUMBER
=Fortifytestcms
-final
-anon.bat.fileno
33 set ENABLE_BYTECODE
=false
35 set PROJECTROOT0
="C:\Users\mrl\Desktop\ssproject1617\testcms-final-anon"
36 IF NOT EXIST %PROJECTROOT0% (
37 ECHO ERROR
: This script is being
run on a different machine than it was
38 ECHO generated on or the targeted project has been moved. This script is
39 ECHO configured to locate
files at
41 ECHO Please modify the
%%PROJECTROOT0%% variable found
42 ECHO at the top of this script to point to the corresponding directory
43 ECHO located on this machine.
47 IF %DEBUG%==true
set LAUNCHERSWITCHES
=-debug %LAUNCHERSWITCHES%
48 echo Extracting Arguments File
52 echo.
>%BYTECODE_ARGFILE%
53 SETLOCAL ENABLEDELAYEDEXPANSION
57 set SCAScriptFile
=%0.bat
60 set PROJECTROOT0
=%PROJECTROOT0
:)=^
)%
61 FOR /f
"delims=" %%a IN
('findstr /B /C:"REM ARGS" %SCAScriptFile%' ) DO (
63 set argVal
=!argVal
:PROJECTROOT0_MARKER=%PROJECTROOT0
:~
1,-1%!
64 echo !argVal
:~
9! >> %ARGFILE%
66 set PROJECTROOT0
=%PROJECTROOT0
:)=^
)%
67 FOR /f
"delims=" %%a IN
('findstr /B /C:"REM BYTECODE_ARGS" %SCAScriptFile%' ) DO (
68 set ENABLE_BYTECODE
=true
70 set argVal
=!argVal
:PROJECTROOT0_MARKER=%PROJECTROOT0
:~
1,-1%!
71 echo !argVal
:~
18! >> %BYTECODE_ARGFILE%
73 ENDLOCAL && set ENABLE_BYTECODE
=%ENABLE_BYTECODE%
75 REM ###########################################################################
76 echo Cleaning previous scan artifacts
77 %SOURCEANALYZER% %MEMORY% %LAUNCHERSWITCHES% -b
%BUILDID% -clean
79 echo Sourceanalyzer failed
, exiting
82 REM ###########################################################################
83 echo Translating
files
84 %SOURCEANALYZER% %MEMORY% %LAUNCHERSWITCHES% -b
%BUILDID% @
%ARGFILE%
86 echo Sourceanalyzer failed
, exiting
89 REM ###########################################################################
90 IF %ENABLE_BYTECODE%==true
(
91 echo Translating Java bytecode
files
92 %SOURCEANALYZER% %MEMORY% %LAUNCHERSWITCHES% -b
%BUILDID% @
%BYTECODE_ARGFILE%
94 echo Sourceanalyzer failed
, exiting
98 REM ###########################################################################
99 echo Testing Difference between Translations
101 FOR /F
"delims=" %%A in
('%SOURCEANALYZER% -b %BUILDID% -show-files ^| findstr /R /N "^" ^| find /C ":" ') DO SET FILENUMBER
=%%A
102 IF NOT EXIST %OLDFILENUMBER% (
103 ECHO It appears to be the first
time running this script
, setting
%OLDFILENUMBER% to
%FILENUMBER%
104 ECHO %FILENUMBER% > %OLDFILENUMBER%
108 FOR /F
"delims=" %%i IN
(%OLDFILENUMBER%) DO SET OLDFILENO
=%%i
109 set /a DIFF
=%OLDFILENO% * %FILENOMAXDIFF%
111 set /a MAX
=%OLDFILENO% + %DIFF%
112 set /a MIN
=%OLDFILENO% - %DIFF%
114 IF %FILENUMBER% LSS
%MIN% set SHOWWARNING
=true
115 IF %FILENUMBER% GTR
%MAX% set SHOWWARNING
=true
117 IF DEFINED SHOWWARNING
(
118 ECHO WARNING
: The number of
files has changed by over
%FILENOMAXDIFF%%%, it is recommended
119 ECHO that this script is regenerated with the ScanWizard
124 REM ###########################################################################
126 %SOURCEANALYZER% %MEMORY% %LAUNCHERSWITCHES% -b
%BUILDID% -scan
-f
%FPR%
128 echo Sourceanalyzer failed
, exiting
131 REM ###########################################################################
134 REM ARGS "-Dcom.fortify.sca.fileextensions.sql=PLSQL"
135 REM ARGS "PROJECTROOT0_MARKER"