├── evaluation ├── 03_regex │ ├── kelinci_analysis │ │ ├── resources │ │ │ ├── regex.txt │ │ │ ├── regex-with-quotes.txt │ │ │ ├── popular-regexes │ │ │ │ ├── 10htmllink │ │ │ │ ├── 1username.txt │ │ │ │ ├── 9html │ │ │ │ ├── 3hexcolor │ │ │ │ ├── 7btime24hour │ │ │ │ ├── 5imageextension │ │ │ │ ├── 7atime12hour │ │ │ │ ├── 2password │ │ │ │ ├── 8date │ │ │ │ ├── 4email │ │ │ │ └── 6ipaddress │ │ │ └── lorem.txt │ │ └── resources-byte │ │ │ ├── regex-byte.txt │ │ │ ├── regex-with-quotes-byte.txt │ │ │ └── popular-regexes │ │ │ ├── 1username-byte.txt │ │ │ ├── 10htmllink-byte │ │ │ ├── 9html-byte │ │ │ ├── 7btime24hour-byte │ │ │ ├── 3hexcolor-byte │ │ │ ├── 5imageextension-byte │ │ │ ├── 7atime12hour-byte │ │ │ ├── 2password-byte │ │ │ ├── 8date-byte │ │ │ ├── 4email-byte │ │ │ └── 6ipaddress-byte │ ├── .gitignore │ ├── results │ │ ├── results_regex_8date.xlsx │ │ ├── results_regex_9html.xlsx │ │ ├── results_regex_text.xlsx │ │ ├── results_regex_4email.xlsx │ │ ├── results_regex_10htmllink.xlsx │ │ ├── results_regex_1username.xlsx │ │ ├── results_regex_2password.xlsx │ │ ├── results_regex_3hexcolor.xlsx │ │ ├── results_regex_6ipaddress.xlsx │ │ ├── results_regex_7atime12hour.xlsx │ │ ├── results_regex_7btime24hour.xlsx │ │ └── results_regex_5imageextension.xlsx │ ├── spf_analysis │ │ └── config │ └── scripts │ │ ├── run-regex-8date-spf.sh │ │ ├── run-regex-9html-spf.sh │ │ ├── run-regex-4email-spf.sh │ │ ├── run-regex-6ipaddress-spf.sh │ │ ├── run-regex-10htmllink-spf.sh │ │ ├── run-regex-2password-spf.sh │ │ ├── run-regex-3hexcolor-spf.sh │ │ ├── run-regex-1username-spf.sh │ │ ├── run-regex-7atime12hour-spf.sh │ │ ├── run-regex-7btime24hour-spf.sh │ │ └── run-regex-5imageextension-spf.sh ├── 05_compress │ ├── kelinci_analysis │ │ ├── in_dir │ │ │ └── example │ │ ├── commons-compress-1.4-instrumented.jar │ │ └── src │ │ │ ├── org │ │ │ └── apache │ │ │ │ └── commons │ │ │ │ └── compress │ │ │ │ ├── compressors │ │ │ │ ├── CompressorOutputStream.java │ │ │ │ ├── bzip2 │ │ │ │ │ └── BZip2Constants.java │ │ │ │ ├── pack200 │ │ │ │ │ ├── Pack200Strategy.java │ │ │ │ │ ├── InMemoryCachingStreamBridge.java │ │ │ │ │ └── TempFileCachingStreamBridge.java │ │ │ │ ├── CompressorException.java │ │ │ │ └── gzip │ │ │ │ │ └── GzipCompressorOutputStream.java │ │ │ │ └── archivers │ │ │ │ ├── dump │ │ │ │ ├── ShortFileException.java │ │ │ │ ├── UnrecognizedFormatException.java │ │ │ │ ├── DumpArchiveException.java │ │ │ │ ├── UnsupportedCompressionAlgorithmException.java │ │ │ │ └── InvalidFormatException.java │ │ │ │ ├── ArchiveEntry.java │ │ │ │ ├── zip │ │ │ │ ├── Zip64Mode.java │ │ │ │ ├── Zip64RequiredException.java │ │ │ │ ├── UnixStat.java │ │ │ │ └── ZipConstants.java │ │ │ │ ├── ArchiveException.java │ │ │ │ └── jar │ │ │ │ └── JarArchiveOutputStream.java │ │ │ └── driver │ │ │ ├── DriverDecompress.java │ │ │ └── Driver.java │ ├── .gitignore │ ├── results │ │ └── results_compress.xlsx │ ├── spf_analysis │ │ ├── config │ │ └── src │ │ │ ├── org │ │ │ └── apache │ │ │ │ └── commons │ │ │ │ └── compress │ │ │ │ ├── compressors │ │ │ │ ├── CompressorOutputStream.java │ │ │ │ ├── bzip2 │ │ │ │ │ └── BZip2Constants.java │ │ │ │ ├── pack200 │ │ │ │ │ ├── InMemoryCachingStreamBridge.java │ │ │ │ │ ├── Pack200Strategy.java │ │ │ │ │ └── TempFileCachingStreamBridge.java │ │ │ │ ├── CompressorException.java │ │ │ │ └── gzip │ │ │ │ │ └── GzipCompressorOutputStream.java │ │ │ │ └── archivers │ │ │ │ ├── dump │ │ │ │ ├── ShortFileException.java │ │ │ │ ├── UnrecognizedFormatException.java │ │ │ │ ├── DumpArchiveException.java │ │ │ │ ├── UnsupportedCompressionAlgorithmException.java │ │ │ │ └── InvalidFormatException.java │ │ │ │ ├── ArchiveEntry.java │ │ │ │ ├── zip │ │ │ │ ├── Zip64Mode.java │ │ │ │ ├── Zip64RequiredException.java │ │ │ │ ├── UnixStat.java │ │ │ │ └── ZipConstants.java │ │ │ │ ├── ArchiveException.java │ │ │ │ └── jar │ │ │ │ └── JarArchiveOutputStream.java │ │ │ └── driver │ │ │ └── DriverDecompress.java │ └── scripts │ │ └── run-compress-spf.sh ├── 01_insertionsort │ ├── .gitignore │ ├── kelinci_analysis │ │ └── in_dir │ │ │ └── example │ ├── results │ │ └── results_insertionsort.xlsx │ ├── spf_analysis │ │ └── config │ └── scripts │ │ └── run-insertion-spf.sh ├── 02_quicksort │ ├── .gitignore │ ├── kelinci_analysis │ │ ├── in_dir │ │ │ └── example │ │ └── src │ │ │ └── QuickSortJDK15.java │ ├── results │ │ └── results_quicksort.xlsx │ ├── spf_analysis │ │ ├── config │ │ └── src │ │ │ └── QuickSortJDK15.java │ └── scripts │ │ └── run-quicksort-spf.sh ├── 04_hashtable │ ├── .gitignore │ ├── results │ │ └── results_hashtable.xlsx │ ├── kelinci_analysis │ │ └── in_dir │ │ │ └── example │ ├── spf_analysis │ │ └── config │ └── scripts │ │ └── run-hashtable-spf.sh ├── 07_smart_contract │ ├── .gitignore │ ├── results │ │ └── results_governmental-n=50-10runs.xlsx │ ├── spf_analysis │ │ └── config │ └── scripts │ │ └── run-governmental-spf.sh └── 06_image_processor │ ├── .gitignore │ ├── spf_analysis │ ├── src │ │ ├── com │ │ │ └── stac │ │ │ │ ├── image │ │ │ │ ├── algorithms │ │ │ │ │ ├── generics │ │ │ │ │ │ ├── CannyEdgeDetect$1.java │ │ │ │ │ │ ├── Direction.java │ │ │ │ │ │ ├── Convolve.java │ │ │ │ │ │ └── ConvertImage.java │ │ │ │ │ ├── Filter.java │ │ │ │ │ ├── detectors │ │ │ │ │ │ ├── DummyDetector.java │ │ │ │ │ │ ├── EdgingDetector.java │ │ │ │ │ │ ├── BlackDetector.java │ │ │ │ │ │ ├── WhiteDetector.java │ │ │ │ │ │ ├── BlueDetector.java │ │ │ │ │ │ ├── GreenDetector.java │ │ │ │ │ │ └── RedDetector.java │ │ │ │ │ ├── Detector.java │ │ │ │ │ └── filters │ │ │ │ │ │ ├── Invert.java │ │ │ │ │ │ └── Intensify.java │ │ │ │ ├── ImageAlgorithm.java │ │ │ │ ├── utilities │ │ │ │ │ └── ShowImage.java │ │ │ │ ├── ImageAlgorithmStore.java │ │ │ │ └── ImageProcessing.java │ │ │ │ ├── learning │ │ │ │ ├── VectorFactory.java │ │ │ │ ├── EuclideanVectorFactory.java │ │ │ │ ├── VectorMap.java │ │ │ │ ├── EuclideanVector.java │ │ │ │ └── Vector.java │ │ │ │ └── MapCompare.java │ │ └── drivers │ │ │ ├── MainExp.java │ │ │ └── MainIntensify.java │ └── config │ ├── kelinci_analysis │ ├── src │ │ ├── com │ │ │ └── stac │ │ │ │ ├── image │ │ │ │ ├── algorithms │ │ │ │ │ ├── generics │ │ │ │ │ │ ├── CannyEdgeDetect$1.java │ │ │ │ │ │ ├── Direction.java │ │ │ │ │ │ ├── Convolve.java │ │ │ │ │ │ └── ConvertImage.java │ │ │ │ │ ├── Filter.java │ │ │ │ │ ├── detectors │ │ │ │ │ │ ├── DummyDetector.java │ │ │ │ │ │ ├── EdgingDetector.java │ │ │ │ │ │ ├── BlackDetector.java │ │ │ │ │ │ ├── WhiteDetector.java │ │ │ │ │ │ ├── RedDetector.java │ │ │ │ │ │ ├── BlueDetector.java │ │ │ │ │ │ └── GreenDetector.java │ │ │ │ │ ├── Detector.java │ │ │ │ │ └── filters │ │ │ │ │ │ ├── Invert.java │ │ │ │ │ │ └── Intensify.java │ │ │ │ ├── ImageAlgorithm.java │ │ │ │ ├── utilities │ │ │ │ │ └── ShowImage.java │ │ │ │ ├── ImageAlgorithmStore.java │ │ │ │ └── ImageProcessing.java │ │ │ │ ├── learning │ │ │ │ ├── VectorFactory.java │ │ │ │ ├── EuclideanVectorFactory.java │ │ │ │ ├── VectorMap.java │ │ │ │ ├── EuclideanVector.java │ │ │ │ └── Vector.java │ │ │ │ └── MapCompare.java │ │ └── drivers │ │ │ ├── DriverKelinci2.java │ │ │ └── DriverKelinci.java │ └── in_dir │ │ └── 2.2.5.1.jpg │ ├── results │ └── results_imageprocessor.xlsx │ └── scripts │ └── run-imageprocessor-spf.sh ├── badger ├── lib │ ├── asm-5.2.jar │ ├── commons-io-2.4.jar │ └── commons-lang3-3.7.jar ├── src │ └── main │ │ └── edu │ │ └── cmu │ │ └── sv │ │ └── badger │ │ ├── analysis │ │ ├── StateBuilderFactory.java │ │ ├── ExplorationHeuristic.java │ │ └── State.java │ │ ├── trie │ │ ├── TrieNodeType.java │ │ └── TriePrintToConsole.java │ │ ├── listener │ │ ├── IBehavior.java │ │ ├── MetricListener.java │ │ └── SolverCallListener.java │ │ ├── io │ │ ├── IOUtils.java │ │ ├── IntArrayIOUtils.java │ │ └── MultipleIntArrayIOUtils.java │ │ └── app │ │ └── BadgerRunner.java ├── .classpath ├── .project └── jpf.properties ├── example ├── kelinciwca_analysis │ └── in_dir │ │ └── example ├── .gitignore ├── config └── build-example.sh ├── .gitignore └── LICENSE /evaluation/03_regex/kelinci_analysis/resources/regex.txt: -------------------------------------------------------------------------------- 1 | [\s\S]* 2 | -------------------------------------------------------------------------------- /evaluation/05_compress/kelinci_analysis/in_dir/example: -------------------------------------------------------------------------------- 1 | hello 2 | -------------------------------------------------------------------------------- /evaluation/03_regex/kelinci_analysis/resources-byte/regex-byte.txt: -------------------------------------------------------------------------------- 1 | [\s\S]* -------------------------------------------------------------------------------- /evaluation/03_regex/kelinci_analysis/resources/regex-with-quotes.txt: -------------------------------------------------------------------------------- 1 | "[\s\S]*" 2 | -------------------------------------------------------------------------------- /badger/lib/asm-5.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/isstac/badger/HEAD/badger/lib/asm-5.2.jar -------------------------------------------------------------------------------- /evaluation/03_regex/kelinci_analysis/resources-byte/regex-with-quotes-byte.txt: -------------------------------------------------------------------------------- 1 | "[\s\S]*" -------------------------------------------------------------------------------- /evaluation/03_regex/kelinci_analysis/resources/popular-regexes/10htmllink: -------------------------------------------------------------------------------- 1 | (?i)]+)>(.+?) 2 | -------------------------------------------------------------------------------- /evaluation/03_regex/kelinci_analysis/resources/popular-regexes/1username.txt: -------------------------------------------------------------------------------- 1 | ^[a-z0-9_-]{3,15}$ 2 | -------------------------------------------------------------------------------- /evaluation/03_regex/kelinci_analysis/resources/popular-regexes/9html: -------------------------------------------------------------------------------- 1 | <("[^"]*"|'[^']*'|[^'">])*> 2 | -------------------------------------------------------------------------------- /badger/lib/commons-io-2.4.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/isstac/badger/HEAD/badger/lib/commons-io-2.4.jar -------------------------------------------------------------------------------- /evaluation/03_regex/.gitignore: -------------------------------------------------------------------------------- 1 | /kelinci_analysis/bin 2 | /kelinci_analysis/bin-instr 3 | /spf_analysis/bin -------------------------------------------------------------------------------- /evaluation/05_compress/.gitignore: -------------------------------------------------------------------------------- 1 | /kelinci_analysis/bin 2 | /kelinci_analysis/bin-instr 3 | /spf_analysis/bin -------------------------------------------------------------------------------- /badger/lib/commons-lang3-3.7.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/isstac/badger/HEAD/badger/lib/commons-lang3-3.7.jar -------------------------------------------------------------------------------- /evaluation/01_insertionsort/.gitignore: -------------------------------------------------------------------------------- 1 | /kelinci_analysis/bin 2 | /kelinci_analysis/bin-instr 3 | /spf_analysis/bin -------------------------------------------------------------------------------- /evaluation/02_quicksort/.gitignore: -------------------------------------------------------------------------------- 1 | /kelinci_analysis/bin 2 | /kelinci_analysis/bin-instr 3 | /spf_analysis/bin -------------------------------------------------------------------------------- /evaluation/03_regex/kelinci_analysis/resources/popular-regexes/3hexcolor: -------------------------------------------------------------------------------- 1 | ^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$ 2 | -------------------------------------------------------------------------------- /evaluation/03_regex/kelinci_analysis/resources/popular-regexes/7btime24hour: -------------------------------------------------------------------------------- 1 | ([01]?[0-9]|2[0-3]):[0-5][0-9] 2 | -------------------------------------------------------------------------------- /evaluation/04_hashtable/.gitignore: -------------------------------------------------------------------------------- 1 | /kelinci_analysis/bin 2 | /kelinci_analysis/bin-instr 3 | /spf_analysis/bin -------------------------------------------------------------------------------- /example/kelinciwca_analysis/in_dir/example: -------------------------------------------------------------------------------- 1 | %*0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz 2 | -------------------------------------------------------------------------------- /evaluation/03_regex/kelinci_analysis/resources/popular-regexes/5imageextension: -------------------------------------------------------------------------------- 1 | ([^\s]+(\.(?i)(jpg|png|gif|bmp))$) 2 | -------------------------------------------------------------------------------- /evaluation/07_smart_contract/.gitignore: -------------------------------------------------------------------------------- 1 | /kelinci_analysis/bin 2 | /kelinci_analysis/bin-instr 3 | /spf_analysis/bin -------------------------------------------------------------------------------- /evaluation/03_regex/kelinci_analysis/resources-byte/popular-regexes/1username-byte.txt: -------------------------------------------------------------------------------- 1 | ^[a-z0-9_-]{3,15}$ -------------------------------------------------------------------------------- /evaluation/03_regex/kelinci_analysis/resources/popular-regexes/7atime12hour: -------------------------------------------------------------------------------- 1 | (1[012]|[1-9]):[0-5][0-9](\\s)?(?i)(am|pm) 2 | -------------------------------------------------------------------------------- /evaluation/01_insertionsort/kelinci_analysis/in_dir/example: -------------------------------------------------------------------------------- 1 | %*0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz 2 | -------------------------------------------------------------------------------- /evaluation/03_regex/kelinci_analysis/resources/popular-regexes/2password: -------------------------------------------------------------------------------- 1 | ((?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[@#$%]).{6,20}) 2 | -------------------------------------------------------------------------------- /evaluation/03_regex/kelinci_analysis/resources-byte/popular-regexes/10htmllink-byte: -------------------------------------------------------------------------------- 1 | (?i)<a([^>]+)>(.+?)</a> -------------------------------------------------------------------------------- /evaluation/03_regex/kelinci_analysis/resources-byte/popular-regexes/9html-byte: -------------------------------------------------------------------------------- 1 | <("[^"]*"|'[^']*'|[^'">])*> -------------------------------------------------------------------------------- /evaluation/03_regex/kelinci_analysis/resources/popular-regexes/8date: -------------------------------------------------------------------------------- 1 | (0?[1-9]|[12][0-9]|3[01])/(0?[1-9]|1[012])/((19|20)\\d\\d) 2 | -------------------------------------------------------------------------------- /evaluation/02_quicksort/kelinci_analysis/in_dir/example: -------------------------------------------------------------------------------- 1 | iuytrewqasdfghjkl;'/.,mnbvcxz0987654321i7y6trfjghkTYUIOPLKJHGFDSXCVBNMKJDAHJKLD 2 | -------------------------------------------------------------------------------- /evaluation/03_regex/kelinci_analysis/resources-byte/popular-regexes/7btime24hour-byte: -------------------------------------------------------------------------------- 1 | ([01]?[0-9]|2[0-3]):[0-5][0-9] -------------------------------------------------------------------------------- /evaluation/06_image_processor/.gitignore: -------------------------------------------------------------------------------- 1 | /kelinci_analysis/bin 2 | /kelinci_analysis/bin-instr 3 | /spf_analysis/bin 4 | /kelinci_analysis/fuzzer-out -------------------------------------------------------------------------------- /evaluation/03_regex/kelinci_analysis/resources-byte/popular-regexes/3hexcolor-byte: -------------------------------------------------------------------------------- 1 | ^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$ -------------------------------------------------------------------------------- /evaluation/03_regex/results/results_regex_8date.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/isstac/badger/HEAD/evaluation/03_regex/results/results_regex_8date.xlsx -------------------------------------------------------------------------------- /evaluation/03_regex/results/results_regex_9html.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/isstac/badger/HEAD/evaluation/03_regex/results/results_regex_9html.xlsx -------------------------------------------------------------------------------- /evaluation/03_regex/results/results_regex_text.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/isstac/badger/HEAD/evaluation/03_regex/results/results_regex_text.xlsx -------------------------------------------------------------------------------- /evaluation/05_compress/results/results_compress.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/isstac/badger/HEAD/evaluation/05_compress/results/results_compress.xlsx -------------------------------------------------------------------------------- /evaluation/02_quicksort/results/results_quicksort.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/isstac/badger/HEAD/evaluation/02_quicksort/results/results_quicksort.xlsx -------------------------------------------------------------------------------- /evaluation/03_regex/kelinci_analysis/resources-byte/popular-regexes/5imageextension-byte: -------------------------------------------------------------------------------- 1 | ([^\s]+(\.(?i)(jpg|png|gif|bmp))$) -------------------------------------------------------------------------------- /evaluation/03_regex/results/results_regex_4email.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/isstac/badger/HEAD/evaluation/03_regex/results/results_regex_4email.xlsx -------------------------------------------------------------------------------- /evaluation/04_hashtable/results/results_hashtable.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/isstac/badger/HEAD/evaluation/04_hashtable/results/results_hashtable.xlsx -------------------------------------------------------------------------------- /evaluation/06_image_processor/spf_analysis/src/com/stac/image/algorithms/generics/CannyEdgeDetect$1.java: -------------------------------------------------------------------------------- 1 | package com.stac.image.algorithms.generics; 2 | 3 | -------------------------------------------------------------------------------- /evaluation/03_regex/kelinci_analysis/resources/popular-regexes/4email: -------------------------------------------------------------------------------- 1 | ^[_A-Za-z0-9-]+(\\.[_A-Za-z0-9-]+)*@[A-Za-z0-9]+ 2 | (\\.[A-Za-z0-9]+)*(\\.[A-Za-z]{2,})$ 3 | -------------------------------------------------------------------------------- /evaluation/03_regex/results/results_regex_10htmllink.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/isstac/badger/HEAD/evaluation/03_regex/results/results_regex_10htmllink.xlsx -------------------------------------------------------------------------------- /evaluation/03_regex/results/results_regex_1username.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/isstac/badger/HEAD/evaluation/03_regex/results/results_regex_1username.xlsx -------------------------------------------------------------------------------- /evaluation/03_regex/results/results_regex_2password.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/isstac/badger/HEAD/evaluation/03_regex/results/results_regex_2password.xlsx -------------------------------------------------------------------------------- /evaluation/03_regex/results/results_regex_3hexcolor.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/isstac/badger/HEAD/evaluation/03_regex/results/results_regex_3hexcolor.xlsx -------------------------------------------------------------------------------- /evaluation/03_regex/results/results_regex_6ipaddress.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/isstac/badger/HEAD/evaluation/03_regex/results/results_regex_6ipaddress.xlsx -------------------------------------------------------------------------------- /evaluation/06_image_processor/kelinci_analysis/src/com/stac/image/algorithms/generics/CannyEdgeDetect$1.java: -------------------------------------------------------------------------------- 1 | package com.stac.image.algorithms.generics; 2 | 3 | -------------------------------------------------------------------------------- /evaluation/03_regex/results/results_regex_7atime12hour.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/isstac/badger/HEAD/evaluation/03_regex/results/results_regex_7atime12hour.xlsx -------------------------------------------------------------------------------- /evaluation/03_regex/results/results_regex_7btime24hour.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/isstac/badger/HEAD/evaluation/03_regex/results/results_regex_7btime24hour.xlsx -------------------------------------------------------------------------------- /evaluation/01_insertionsort/results/results_insertionsort.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/isstac/badger/HEAD/evaluation/01_insertionsort/results/results_insertionsort.xlsx -------------------------------------------------------------------------------- /evaluation/03_regex/kelinci_analysis/resources-byte/popular-regexes/7atime12hour-byte: -------------------------------------------------------------------------------- 1 | (1[012]|[1-9]):[0-5][0-9](\\s)?(?i)(am|pm) -------------------------------------------------------------------------------- /evaluation/03_regex/results/results_regex_5imageextension.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/isstac/badger/HEAD/evaluation/03_regex/results/results_regex_5imageextension.xlsx -------------------------------------------------------------------------------- /evaluation/06_image_processor/kelinci_analysis/in_dir/2.2.5.1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/isstac/badger/HEAD/evaluation/06_image_processor/kelinci_analysis/in_dir/2.2.5.1.jpg -------------------------------------------------------------------------------- /evaluation/06_image_processor/results/results_imageprocessor.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/isstac/badger/HEAD/evaluation/06_image_processor/results/results_imageprocessor.xlsx -------------------------------------------------------------------------------- /evaluation/03_regex/kelinci_analysis/resources-byte/popular-regexes/2password-byte: -------------------------------------------------------------------------------- 1 | ((?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[@#$%]).{6,20}) -------------------------------------------------------------------------------- /evaluation/03_regex/kelinci_analysis/resources-byte/popular-regexes/8date-byte: -------------------------------------------------------------------------------- 1 | (0?[1-9]|[12][0-9]|3[01])/(0?[1-9]|1[012])/((19|20)\\d\\d) -------------------------------------------------------------------------------- /evaluation/07_smart_contract/results/results_governmental-n=50-10runs.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/isstac/badger/HEAD/evaluation/07_smart_contract/results/results_governmental-n=50-10runs.xlsx -------------------------------------------------------------------------------- /evaluation/05_compress/kelinci_analysis/commons-compress-1.4-instrumented.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/isstac/badger/HEAD/evaluation/05_compress/kelinci_analysis/commons-compress-1.4-instrumented.jar -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /badger/tmp/ 2 | /badger/build/ 3 | /badger/pcMap.txt 4 | /badger/import-statistic.txt 5 | /badger/generation-statistic.txt 6 | /badger/export-statistic.txt 7 | /badger/trie-statistic.txt 8 | *.dot 9 | *.pdf -------------------------------------------------------------------------------- /evaluation/03_regex/kelinci_analysis/resources/popular-regexes/6ipaddress: -------------------------------------------------------------------------------- 1 | ^([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\.([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\. 2 | ([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\.([01]?\\d\\d?|2[0-4]\\d|25[0-5])$ 3 | -------------------------------------------------------------------------------- /evaluation/06_image_processor/spf_analysis/src/com/stac/learning/VectorFactory.java: -------------------------------------------------------------------------------- 1 | package com.stac.learning; 2 | 3 | public abstract class VectorFactory 4 | { 5 | public abstract Vector get(final int p0); 6 | } 7 | -------------------------------------------------------------------------------- /evaluation/06_image_processor/kelinci_analysis/src/com/stac/learning/VectorFactory.java: -------------------------------------------------------------------------------- 1 | package com.stac.learning; 2 | 3 | public abstract class VectorFactory 4 | { 5 | public abstract Vector get(final int p0); 6 | } 7 | -------------------------------------------------------------------------------- /evaluation/03_regex/kelinci_analysis/resources-byte/popular-regexes/4email-byte: -------------------------------------------------------------------------------- 1 | ^[_A-Za-z0-9-]+(\\.[_A-Za-z0-9-]+)*@[A-Za-z0-9]+ 2 | (\\.[A-Za-z0-9]+)*(\\.[A-Za-z]{2,})$ -------------------------------------------------------------------------------- /example/.gitignore: -------------------------------------------------------------------------------- 1 | import-statistic.txt 2 | generation-statistic.txt 3 | export-statistic.txt 4 | trie-statistic.txt 5 | pcMap.txt 6 | *.dot 7 | *.pdf 8 | /tmp 9 | /symexe_analysis 10 | /kelinciwca_analysis/bin 11 | /kelinciwca_analysis/fuzzer-out 12 | /kelinciwca_analysis/src -------------------------------------------------------------------------------- /badger/src/main/edu/cmu/sv/badger/analysis/StateBuilderFactory.java: -------------------------------------------------------------------------------- 1 | package edu.cmu.sv.badger.analysis; 2 | 3 | /** 4 | * @author Yannic Noller - YN 5 | */ 6 | public abstract class StateBuilderFactory { 7 | public abstract StateBuilder createStateBuilder(); 8 | } 9 | -------------------------------------------------------------------------------- /evaluation/06_image_processor/kelinci_analysis/src/com/stac/learning/EuclideanVectorFactory.java: -------------------------------------------------------------------------------- 1 | package com.stac.learning; 2 | 3 | public class EuclideanVectorFactory extends VectorFactory 4 | { 5 | @Override 6 | public Vector get(final int n) { 7 | return new EuclideanVector(n); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /evaluation/06_image_processor/spf_analysis/src/com/stac/learning/EuclideanVectorFactory.java: -------------------------------------------------------------------------------- 1 | package com.stac.learning; 2 | 3 | public class EuclideanVectorFactory extends VectorFactory 4 | { 5 | @Override 6 | public Vector get(final int n) { 7 | return new EuclideanVector(n); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /evaluation/04_hashtable/kelinci_analysis/in_dir/example: -------------------------------------------------------------------------------- 1 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin aliquam nisl purus, sit amet tincidunt urna finibus sit amet. Nunc ut tincidunt nisl. Aliquam elementum sodales justo eu accumsan. Nulla non est luctus, volutpat nulla id, volutpat lacus. Nullam lacinia vestibullum bland 2 | -------------------------------------------------------------------------------- /evaluation/03_regex/kelinci_analysis/resources-byte/popular-regexes/6ipaddress-byte: -------------------------------------------------------------------------------- 1 | ^([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\.([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\. 2 | ([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\.([01]?\\d\\d?|2[0-4]\\d|25[0-5])$ -------------------------------------------------------------------------------- /badger/src/main/edu/cmu/sv/badger/trie/TrieNodeType.java: -------------------------------------------------------------------------------- 1 | package edu.cmu.sv.badger.trie; 2 | 3 | /** 4 | * Help class for different trie node types 5 | * 6 | * @author Guowei Yang (guoweiyang@utexas.edu) 7 | * 8 | */ 9 | 10 | public enum TrieNodeType { 11 | 12 | REGULAR_NODE, // regular node 13 | UNSAT_NODE, // unsatisfiable node 14 | FRONTIER_NODE, // frontier node 15 | LEAF_NODE; // end of exection trace; 16 | 17 | } 18 | 19 | 20 | -------------------------------------------------------------------------------- /evaluation/06_image_processor/spf_analysis/src/com/stac/image/algorithms/Filter.java: -------------------------------------------------------------------------------- 1 | package com.stac.image.algorithms; 2 | 3 | import com.stac.image.*; 4 | import java.awt.image.*; 5 | 6 | public abstract class Filter extends ImageAlgorithm 7 | { 8 | @Override 9 | public void runAlgorithm(final BufferedImage image) { 10 | this.filter(image); 11 | } 12 | 13 | public abstract void filter(final BufferedImage p0); 14 | } 15 | -------------------------------------------------------------------------------- /evaluation/06_image_processor/kelinci_analysis/src/com/stac/image/algorithms/Filter.java: -------------------------------------------------------------------------------- 1 | package com.stac.image.algorithms; 2 | 3 | import com.stac.image.*; 4 | import java.awt.image.*; 5 | 6 | public abstract class Filter extends ImageAlgorithm 7 | { 8 | @Override 9 | public void runAlgorithm(final BufferedImage image) { 10 | this.filter(image); 11 | } 12 | 13 | public abstract void filter(final BufferedImage p0); 14 | } 15 | -------------------------------------------------------------------------------- /evaluation/06_image_processor/kelinci_analysis/src/com/stac/image/ImageAlgorithm.java: -------------------------------------------------------------------------------- 1 | package com.stac.image; 2 | 3 | import java.awt.image.*; 4 | 5 | public abstract class ImageAlgorithm 6 | { 7 | public boolean hasValue() { 8 | return false; 9 | } 10 | 11 | public float getValue() { 12 | throw new RuntimeException("This image algorithm does not implement values"); 13 | } 14 | 15 | public abstract void runAlgorithm(final BufferedImage p0); 16 | } 17 | -------------------------------------------------------------------------------- /evaluation/06_image_processor/spf_analysis/src/com/stac/MapCompare.java: -------------------------------------------------------------------------------- 1 | package com.stac; 2 | 3 | import java.util.Comparator; 4 | import java.util.Map; 5 | import java.util.Objects; 6 | 7 | class MapCompare implements Comparator> 8 | { 9 | @Override 10 | public int compare(final Map.Entry o1, final Map.Entry o2) { 11 | return Objects.requireNonNull(o2.getValue()) - Objects.requireNonNull(o1.getValue()); 12 | } 13 | } -------------------------------------------------------------------------------- /evaluation/06_image_processor/spf_analysis/src/com/stac/image/ImageAlgorithm.java: -------------------------------------------------------------------------------- 1 | package com.stac.image; 2 | 3 | import java.awt.image.*; 4 | 5 | public abstract class ImageAlgorithm 6 | { 7 | public boolean hasValue() { 8 | return false; 9 | } 10 | 11 | public float getValue() { 12 | throw new RuntimeException("This image algorithm does not implement values"); 13 | } 14 | 15 | public abstract void runAlgorithm(final BufferedImage p0); 16 | } 17 | -------------------------------------------------------------------------------- /evaluation/06_image_processor/kelinci_analysis/src/com/stac/MapCompare.java: -------------------------------------------------------------------------------- 1 | package com.stac; 2 | 3 | import java.util.Comparator; 4 | import java.util.Map; 5 | import java.util.Objects; 6 | 7 | class MapCompare implements Comparator> 8 | { 9 | @Override 10 | public int compare(final Map.Entry o1, final Map.Entry o2) { 11 | return Objects.requireNonNull(o2.getValue()) - Objects.requireNonNull(o1.getValue()); 12 | } 13 | } -------------------------------------------------------------------------------- /evaluation/06_image_processor/spf_analysis/src/com/stac/image/algorithms/detectors/DummyDetector.java: -------------------------------------------------------------------------------- 1 | package com.stac.image.algorithms.detectors; 2 | 3 | import com.stac.image.algorithms.*; 4 | import java.awt.image.*; 5 | 6 | //import gov.nasa.jpf.symbc.Debug; 7 | 8 | public class DummyDetector extends Detector 9 | { 10 | static int INDEX = 0; 11 | 12 | @Override 13 | public float detect(final BufferedImage image) { 14 | return 0.5f;//(float) Debug.makeSymbolicReal("feat"+INDEX++); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /evaluation/06_image_processor/spf_analysis/src/drivers/MainExp.java: -------------------------------------------------------------------------------- 1 | package drivers; 2 | 3 | import com.stac.mathematics.Mathematics; 4 | import gov.nasa.jpf.symbc.Debug; 5 | 6 | public class MainExp { 7 | 8 | public static int N; 9 | 10 | public static void main(final String[] args) { 11 | 12 | N = Integer.parseInt(args[0]); 13 | 14 | // check complexity of Mathematics.exp() 15 | int x = Debug.makeSymbolicInteger("x"); 16 | Mathematics.exp(x,N); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /evaluation/06_image_processor/kelinci_analysis/src/com/stac/image/algorithms/detectors/DummyDetector.java: -------------------------------------------------------------------------------- 1 | package com.stac.image.algorithms.detectors; 2 | 3 | import com.stac.image.algorithms.*; 4 | import java.awt.image.*; 5 | 6 | //import gov.nasa.jpf.symbc.Debug; 7 | 8 | public class DummyDetector extends Detector 9 | { 10 | static int INDEX = 0; 11 | 12 | @Override 13 | public float detect(final BufferedImage image) { 14 | return 0.5f;//(float) Debug.makeSymbolicReal("feat"+INDEX++); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /evaluation/06_image_processor/spf_analysis/src/com/stac/image/algorithms/generics/Direction.java: -------------------------------------------------------------------------------- 1 | package com.stac.image.algorithms.generics; 2 | 3 | public enum Direction 4 | { 5 | UP45, 6 | DOWN45, 7 | HORIZONTAL, 8 | VERTICAL; 9 | 10 | public static Direction getDirection(final int ord) { 11 | for (final Direction direction : values()) { 12 | if (direction.ordinal() == ord) { 13 | return direction; 14 | } 15 | } 16 | return null; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /evaluation/06_image_processor/kelinci_analysis/src/com/stac/image/algorithms/generics/Direction.java: -------------------------------------------------------------------------------- 1 | package com.stac.image.algorithms.generics; 2 | 3 | public enum Direction 4 | { 5 | UP45, 6 | DOWN45, 7 | HORIZONTAL, 8 | VERTICAL; 9 | 10 | public static Direction getDirection(final int ord) { 11 | for (final Direction direction : values()) { 12 | if (direction.ordinal() == ord) { 13 | return direction; 14 | } 15 | } 16 | return null; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /evaluation/06_image_processor/kelinci_analysis/src/com/stac/image/algorithms/detectors/EdgingDetector.java: -------------------------------------------------------------------------------- 1 | package com.stac.image.algorithms.detectors; 2 | 3 | import com.stac.image.algorithms.*; 4 | import java.awt.image.*; 5 | import com.stac.image.algorithms.generics.*; 6 | 7 | public class EdgingDetector extends Detector 8 | { 9 | @Override 10 | public float detect(final BufferedImage image) { 11 | final BufferedImage cannied = CannyEdgeDetect.detect(image, 125, 220); 12 | return new WhiteDetector().detect(cannied); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /evaluation/06_image_processor/spf_analysis/src/com/stac/image/algorithms/detectors/EdgingDetector.java: -------------------------------------------------------------------------------- 1 | package com.stac.image.algorithms.detectors; 2 | 3 | import com.stac.image.algorithms.*; 4 | import java.awt.image.*; 5 | import com.stac.image.algorithms.generics.*; 6 | 7 | public class EdgingDetector extends Detector 8 | { 9 | @Override 10 | public float detect(final BufferedImage image) { 11 | final BufferedImage cannied = CannyEdgeDetect.detect(image, 125, 220); 12 | return new WhiteDetector().detect(cannied); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /badger/src/main/edu/cmu/sv/badger/listener/IBehavior.java: -------------------------------------------------------------------------------- 1 | package edu.cmu.sv.badger.listener; 2 | 3 | /** 4 | * Defines methods that are necessary to decide whether an input, i.e. the execution driven by this input, exposed a new 5 | * behavior, for which for example the symbolic execution part of Badger should export the input to the fuzzer. 6 | * 7 | * @author Yannic Noller - YN 8 | * 9 | */ 10 | public interface IBehavior { 11 | 12 | public boolean didExposeNewBranch(); 13 | 14 | public boolean didObserveBetterScore(); 15 | 16 | } 17 | -------------------------------------------------------------------------------- /example/config: -------------------------------------------------------------------------------- 1 | dir.initial.input=./kelinciwca_analysis/in_dir 2 | #dir.sync.input=./kelinciwca_analysis/fuzzer-out/afl/queue 3 | dir.export=./kelinciwca_analysis/fuzzer-out/symexe/queue 4 | 5 | jpf.classpath=./symexe_analysis/bin 6 | jpf.target=InsertionSortSym 7 | symbolic.method=InsertionSortSym.sort(con) 8 | symbolic.dp=z3 9 | symbolic.min_int=0 10 | symbolic.max_int=255 11 | 12 | symexe.wait.sec=60 13 | symexe.iterations=10 14 | 15 | analysis.method=wca 16 | analysis.wca.metric=jumps 17 | analysis.heuristic=highest-cost-lowest-node 18 | 19 | io.utils=int-byte-array 20 | io.input.sizes=64 21 | -------------------------------------------------------------------------------- /evaluation/06_image_processor/spf_analysis/src/com/stac/learning/VectorMap.java: -------------------------------------------------------------------------------- 1 | package com.stac.learning; 2 | 3 | import java.util.*; 4 | 5 | public class VectorMap extends HashMap 6 | { 7 | public String get(final Vector key) { 8 | return super.get(key); 9 | } 10 | 11 | public boolean containsKey(final Vector key) { 12 | return super.containsKey(key); 13 | } 14 | 15 | public String remove(final Vector key) { 16 | return super.remove(key); 17 | } 18 | 19 | public boolean containsValue(final Vector value) { 20 | return super.containsValue(value); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /evaluation/06_image_processor/kelinci_analysis/src/com/stac/learning/VectorMap.java: -------------------------------------------------------------------------------- 1 | package com.stac.learning; 2 | 3 | import java.util.*; 4 | 5 | public class VectorMap extends HashMap 6 | { 7 | public String get(final Vector key) { 8 | return super.get(key); 9 | } 10 | 11 | public boolean containsKey(final Vector key) { 12 | return super.containsKey(key); 13 | } 14 | 15 | public String remove(final Vector key) { 16 | return super.remove(key); 17 | } 18 | 19 | public boolean containsValue(final Vector value) { 20 | return super.containsValue(value); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /badger/src/main/edu/cmu/sv/badger/io/IOUtils.java: -------------------------------------------------------------------------------- 1 | package edu.cmu.sv.badger.io; 2 | 3 | import java.util.List; 4 | import java.util.Map; 5 | 6 | import gov.nasa.jpf.symbc.numeric.PathCondition; 7 | 8 | /** 9 | * @author Yannic Noller - YN 10 | */ 11 | public abstract class IOUtils { 12 | 13 | /** 14 | * Preprocesses the input if necessary. 15 | * 16 | * @param inputFiles 17 | * @return key= original, value= processed 18 | */ 19 | public abstract Map processInput(List inputFiles); 20 | 21 | public abstract void generateInputFiles(PathCondition pc, Map solution, String outputFile); 22 | 23 | } 24 | -------------------------------------------------------------------------------- /badger/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /evaluation/06_image_processor/spf_analysis/src/drivers/MainIntensify.java: -------------------------------------------------------------------------------- 1 | package drivers; 2 | 3 | import com.stac.image.algorithms.filters.Intensify; 4 | import java.awt.image.BufferedImage; 5 | 6 | public class MainIntensify 7 | { 8 | public static int N; 9 | 10 | public static void main(final String[] args) { 11 | 12 | N = Integer.parseInt(args[0]); 13 | 14 | int width = N; 15 | int height = N; 16 | 17 | // The model of BufferedImage in jpf-symbc makes an image with symbolic pixel values 18 | BufferedImage bi = new BufferedImage(width,height,0); 19 | 20 | // test the Intensify filter 21 | Intensify i = new Intensify(); 22 | i.filter(bi); 23 | } 24 | } -------------------------------------------------------------------------------- /evaluation/06_image_processor/spf_analysis/src/com/stac/image/algorithms/Detector.java: -------------------------------------------------------------------------------- 1 | package com.stac.image.algorithms; 2 | 3 | import com.stac.image.*; 4 | import java.awt.image.*; 5 | 6 | public abstract class Detector extends ImageAlgorithm 7 | { 8 | private float value; 9 | 10 | public Detector() { 11 | this.value = 0.0f; 12 | } 13 | 14 | @Override 15 | public void runAlgorithm(final BufferedImage image) { 16 | this.value = this.detect(image); 17 | } 18 | 19 | @Override 20 | public boolean hasValue() { 21 | return true; 22 | } 23 | 24 | @Override 25 | public float getValue() { 26 | return this.value; 27 | } 28 | 29 | public abstract float detect(final BufferedImage p0); 30 | } 31 | -------------------------------------------------------------------------------- /evaluation/06_image_processor/kelinci_analysis/src/com/stac/image/algorithms/Detector.java: -------------------------------------------------------------------------------- 1 | package com.stac.image.algorithms; 2 | 3 | import com.stac.image.*; 4 | import java.awt.image.*; 5 | 6 | public abstract class Detector extends ImageAlgorithm 7 | { 8 | private float value; 9 | 10 | public Detector() { 11 | this.value = 0.0f; 12 | } 13 | 14 | @Override 15 | public void runAlgorithm(final BufferedImage image) { 16 | this.value = this.detect(image); 17 | } 18 | 19 | @Override 20 | public boolean hasValue() { 21 | return true; 22 | } 23 | 24 | @Override 25 | public float getValue() { 26 | return this.value; 27 | } 28 | 29 | public abstract float detect(final BufferedImage p0); 30 | } 31 | -------------------------------------------------------------------------------- /badger/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | badger 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.ui.externaltools.ExternalToolBuilder 15 | clean,full,incremental, 16 | 17 | 18 | LaunchConfigHandle 19 | <project>/.externalToolBuilders/AntBuilder.launch 20 | 21 | 22 | 23 | 24 | 25 | org.eclipse.jdt.core.javanature 26 | 27 | 28 | -------------------------------------------------------------------------------- /evaluation/06_image_processor/kelinci_analysis/src/com/stac/image/utilities/ShowImage.java: -------------------------------------------------------------------------------- 1 | package com.stac.image.utilities; 2 | 3 | import java.awt.image.*; 4 | import javax.swing.*; 5 | import java.awt.*; 6 | 7 | public class ShowImage extends JFrame 8 | { 9 | // public ShowImage(final String name, final BufferedImage im) { 10 | // this(name, im, true); 11 | // } 12 | // 13 | // public ShowImage(final String name, final BufferedImage im, final boolean vis) { 14 | // this.setTitle(name); 15 | // this.setSize(im.getWidth(), im.getHeight()); 16 | // this.setDefaultCloseOperation(3); 17 | // final JLabel lbl = new JLabel(new ImageIcon(im)); 18 | // final JPanel jPanel = new JPanel(); 19 | // jPanel.add(lbl); 20 | // this.add(jPanel); 21 | // this.setVisible(vis); 22 | // } 23 | } 24 | -------------------------------------------------------------------------------- /evaluation/06_image_processor/spf_analysis/src/com/stac/image/utilities/ShowImage.java: -------------------------------------------------------------------------------- 1 | package com.stac.image.utilities; 2 | 3 | import java.awt.image.*; 4 | import javax.swing.*; 5 | import java.awt.*; 6 | 7 | public class ShowImage extends JFrame 8 | { 9 | // public ShowImage(final String name, final BufferedImage im) { 10 | // this(name, im, true); 11 | // } 12 | // 13 | // public ShowImage(final String name, final BufferedImage im, final boolean vis) { 14 | // this.setTitle(name); 15 | // this.setSize(im.getWidth(), im.getHeight()); 16 | // this.setDefaultCloseOperation(3); 17 | // final JLabel lbl = new JLabel(new ImageIcon(im)); 18 | // final JPanel jPanel = new JPanel(); 19 | // jPanel.add(lbl); 20 | // this.add(jPanel); 21 | // this.setVisible(vis); 22 | // } 23 | } 24 | -------------------------------------------------------------------------------- /evaluation/06_image_processor/kelinci_analysis/src/com/stac/image/algorithms/detectors/BlackDetector.java: -------------------------------------------------------------------------------- 1 | package com.stac.image.algorithms.detectors; 2 | 3 | import com.stac.image.algorithms.*; 4 | import java.awt.image.*; 5 | import com.stac.image.utilities.*; 6 | 7 | public class BlackDetector extends Detector 8 | { 9 | @Override 10 | public float detect(final BufferedImage image) { 11 | final int width = image.getWidth(); 12 | final int height = image.getHeight(); 13 | int count = 0; 14 | for (int x = 0; x < width; ++x) { 15 | for (int y = 0; y < height; ++y) { 16 | final float[] hsva = ARGB.toHSVA(image.getRGB(x, y)); 17 | if (hsva[2] <= 0.05) { 18 | ++count; 19 | } 20 | } 21 | } 22 | return count / (width * height); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /evaluation/06_image_processor/spf_analysis/src/com/stac/image/algorithms/detectors/BlackDetector.java: -------------------------------------------------------------------------------- 1 | package com.stac.image.algorithms.detectors; 2 | 3 | import com.stac.image.algorithms.*; 4 | import java.awt.image.*; 5 | import com.stac.image.utilities.*; 6 | 7 | public class BlackDetector extends Detector 8 | { 9 | @Override 10 | public float detect(final BufferedImage image) { 11 | final int width = image.getWidth(); 12 | final int height = image.getHeight(); 13 | int count = 0; 14 | for (int x = 0; x < width; ++x) { 15 | for (int y = 0; y < height; ++y) { 16 | final float[] hsva = ARGB.toHSVA(image.getRGB(x, y)); 17 | if (hsva[2] <= 0.05) { 18 | ++count; 19 | } 20 | } 21 | } 22 | return count / (width * height); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /evaluation/06_image_processor/spf_analysis/src/com/stac/image/algorithms/detectors/WhiteDetector.java: -------------------------------------------------------------------------------- 1 | package com.stac.image.algorithms.detectors; 2 | 3 | import com.stac.image.algorithms.*; 4 | import java.awt.image.*; 5 | import com.stac.image.utilities.*; 6 | 7 | public class WhiteDetector extends Detector 8 | { 9 | @Override 10 | public float detect(final BufferedImage image) { 11 | final int width = image.getWidth(); 12 | final int height = image.getHeight(); 13 | int count = 0; 14 | for (int x = 0; x < width; ++x) { 15 | for (int y = 0; y < height; ++y) { 16 | final float[] hsva = ARGB.toHSVA(image.getRGB(x, y)); 17 | if (hsva[2] >= 0.5 && hsva[1] <= 0.15) { 18 | ++count; 19 | } 20 | } 21 | } 22 | return count / (width * height); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /evaluation/06_image_processor/kelinci_analysis/src/com/stac/image/algorithms/detectors/WhiteDetector.java: -------------------------------------------------------------------------------- 1 | package com.stac.image.algorithms.detectors; 2 | 3 | import com.stac.image.algorithms.*; 4 | import java.awt.image.*; 5 | import com.stac.image.utilities.*; 6 | 7 | public class WhiteDetector extends Detector 8 | { 9 | @Override 10 | public float detect(final BufferedImage image) { 11 | final int width = image.getWidth(); 12 | final int height = image.getHeight(); 13 | int count = 0; 14 | for (int x = 0; x < width; ++x) { 15 | for (int y = 0; y < height; ++y) { 16 | final float[] hsva = ARGB.toHSVA(image.getRGB(x, y)); 17 | if (hsva[2] >= 0.5 && hsva[1] <= 0.15) { 18 | ++count; 19 | } 20 | } 21 | } 22 | return count / (width * height); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /evaluation/02_quicksort/spf_analysis/config: -------------------------------------------------------------------------------- 1 | inputDir=./kelinci_analysis/fuzzer-out/afl/queue 2 | exportDir=./kelinci_analysis/fuzzer-out/spf/queue 3 | tmpDir=./tmp 4 | classpath=./spf_analysis/bin 5 | 6 | target=QuickSortJDK15 7 | symbolic.method=Arrays.sort(con) 8 | symbolic.dp=z3 9 | symbolic.min_int=0 10 | symbolic.max_int=255 11 | 12 | cycleWaitingSec=600 13 | secUntilFirstCycle=60 14 | 15 | analysis.method=wca 16 | analysis.wca.metric=jumps 17 | analysis.wca.selection.heuristic=highest-score-lowest-node 18 | 19 | io.utils=int-byte-array 20 | io.array.size=64 21 | 22 | numberOfAdditionalDecisions=0 23 | maximumNumberOfNodesExploredPerRun=10 24 | initialId=0 25 | 26 | import.statistics.file=import-statistics.txt 27 | generation.statistics.file=generation-statistics.txt 28 | export.statistics.file=export-statistics.txt 29 | pc.mapping.file=pcMap.txt 30 | trie.statistics.file=trie-statistics.txt 31 | 32 | debug.print=false -------------------------------------------------------------------------------- /evaluation/01_insertionsort/spf_analysis/config: -------------------------------------------------------------------------------- 1 | inputDir=./kelinci_analysis/fuzzer-out/afl/queue 2 | exportDir=./kelinci_analysis/fuzzer-out/spf/queue 3 | tmpDir=./tmp 4 | classpath=./spf_analysis/bin 5 | 6 | target=InsertionSort 7 | symbolic.method=InsertionSort.sort(con) 8 | symbolic.dp=z3 9 | symbolic.min_int=0 10 | symbolic.max_int=255 11 | 12 | cycleWaitingSec=600 13 | secUntilFirstCycle=60 14 | 15 | analysis.method=wca 16 | analysis.wca.metric=jumps 17 | analysis.wca.selection.heuristic=highest-score-lowest-node 18 | 19 | io.utils=int-byte-array 20 | io.array.size=64 21 | 22 | numberOfAdditionalDecisions=0 23 | maximumNumberOfNodesExploredPerRun=10 24 | initialId=0 25 | 26 | import.statistics.file=import-statistics.txt 27 | generation.statistics.file=generation-statistics.txt 28 | export.statistics.file=export-statistics.txt 29 | pc.mapping.file=pcMap.txt 30 | trie.statistics.file=trie-statistics.txt 31 | 32 | debug.print=false -------------------------------------------------------------------------------- /evaluation/04_hashtable/spf_analysis/config: -------------------------------------------------------------------------------- 1 | inputDir=./kelinci_analysis/fuzzer-out/afl/queue 2 | exportDir=./kelinci_analysis/fuzzer-out/spf/queue 3 | tmpDir=./tmp 4 | classpath=./spf_analysis/bin 5 | 6 | target=HashTable 7 | symbolic.method=HashTable.put(con#con) 8 | symbolic.dp=z3bitvector 9 | symbolic.max_char=255 10 | 11 | cycleWaitingSec=600 12 | secUntilFirstCycle=60 13 | 14 | analysis.method=wca 15 | analysis.wca.metric=jumps 16 | analysis.wca.selection.heuristic=highest-score-highest-node 17 | 18 | io.utils=byte-text 19 | io.text.size=64 20 | io.text.string.size=8 21 | 22 | numberOfAdditionalDecisions=0 23 | maximumNumberOfNodesExploredPerRun=10 24 | initialId=0 25 | 26 | import.statistics.file=import-statistics.txt 27 | generation.statistics.file=generation-statistics.txt 28 | export.statistics.file=export-statistics.txt 29 | pc.mapping.file=pcMap.txt 30 | trie.statistics.file=trie-statistics.txt 31 | 32 | debug.print=false 33 | -------------------------------------------------------------------------------- /evaluation/06_image_processor/kelinci_analysis/src/com/stac/image/algorithms/detectors/RedDetector.java: -------------------------------------------------------------------------------- 1 | package com.stac.image.algorithms.detectors; 2 | 3 | import com.stac.image.algorithms.*; 4 | import java.awt.image.*; 5 | import com.stac.image.utilities.*; 6 | 7 | public class RedDetector extends Detector 8 | { 9 | @Override 10 | public float detect(final BufferedImage image) { 11 | final int width = image.getWidth(); 12 | final int height = image.getHeight(); 13 | int count = 0; 14 | for (int x = 0; x < width; ++x) { 15 | for (int y = 0; y < height; ++y) { 16 | final float[] hsva = ARGB.toHSVA(image.getRGB(x, y)); 17 | if (hsva[2] >= 0.5 && hsva[1] >= 0.15 && (hsva[0] > 300.0f || hsva[0] < 60.0f)) { 18 | ++count; 19 | } 20 | } 21 | } 22 | return count / (width * height); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /evaluation/06_image_processor/spf_analysis/src/com/stac/image/algorithms/detectors/BlueDetector.java: -------------------------------------------------------------------------------- 1 | package com.stac.image.algorithms.detectors; 2 | 3 | import com.stac.image.algorithms.*; 4 | import java.awt.image.*; 5 | import com.stac.image.utilities.*; 6 | 7 | public class BlueDetector extends Detector 8 | { 9 | @Override 10 | public float detect(final BufferedImage image) { 11 | final int width = image.getWidth(); 12 | final int height = image.getHeight(); 13 | int count = 0; 14 | for (int x = 0; x < width; ++x) { 15 | for (int y = 0; y < height; ++y) { 16 | final float[] hsva = ARGB.toHSVA(image.getRGB(x, y)); 17 | if (hsva[2] >= 0.5 && hsva[1] >= 0.15 && hsva[0] > 180.0f && hsva[0] < 300.0f) { 18 | ++count; 19 | } 20 | } 21 | } 22 | return count / (width * height); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /evaluation/06_image_processor/spf_analysis/src/com/stac/image/algorithms/detectors/GreenDetector.java: -------------------------------------------------------------------------------- 1 | package com.stac.image.algorithms.detectors; 2 | 3 | import com.stac.image.algorithms.*; 4 | import java.awt.image.*; 5 | import com.stac.image.utilities.*; 6 | 7 | public class GreenDetector extends Detector 8 | { 9 | @Override 10 | public float detect(final BufferedImage image) { 11 | final int width = image.getWidth(); 12 | final int height = image.getHeight(); 13 | int count = 0; 14 | for (int x = 0; x < width; ++x) { 15 | for (int y = 0; y < height; ++y) { 16 | final float[] hsva = ARGB.toHSVA(image.getRGB(x, y)); 17 | if (hsva[2] >= 0.5 && hsva[1] >= 0.15 && hsva[0] > 80.0f && hsva[0] < 180.0f) { 18 | ++count; 19 | } 20 | } 21 | } 22 | return count / (width * height); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /evaluation/06_image_processor/spf_analysis/src/com/stac/image/algorithms/detectors/RedDetector.java: -------------------------------------------------------------------------------- 1 | package com.stac.image.algorithms.detectors; 2 | 3 | import com.stac.image.algorithms.*; 4 | import java.awt.image.*; 5 | import com.stac.image.utilities.*; 6 | 7 | public class RedDetector extends Detector 8 | { 9 | @Override 10 | public float detect(final BufferedImage image) { 11 | final int width = image.getWidth(); 12 | final int height = image.getHeight(); 13 | int count = 0; 14 | for (int x = 0; x < width; ++x) { 15 | for (int y = 0; y < height; ++y) { 16 | final float[] hsva = ARGB.toHSVA(image.getRGB(x, y)); 17 | if (hsva[2] >= 0.5 && hsva[1] >= 0.15 && (hsva[0] > 300.0f || hsva[0] < 60.0f)) { 18 | ++count; 19 | } 20 | } 21 | } 22 | return count / (width * height); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /evaluation/06_image_processor/kelinci_analysis/src/com/stac/image/algorithms/detectors/BlueDetector.java: -------------------------------------------------------------------------------- 1 | package com.stac.image.algorithms.detectors; 2 | 3 | import com.stac.image.algorithms.*; 4 | import java.awt.image.*; 5 | import com.stac.image.utilities.*; 6 | 7 | public class BlueDetector extends Detector 8 | { 9 | @Override 10 | public float detect(final BufferedImage image) { 11 | final int width = image.getWidth(); 12 | final int height = image.getHeight(); 13 | int count = 0; 14 | for (int x = 0; x < width; ++x) { 15 | for (int y = 0; y < height; ++y) { 16 | final float[] hsva = ARGB.toHSVA(image.getRGB(x, y)); 17 | if (hsva[2] >= 0.5 && hsva[1] >= 0.15 && hsva[0] > 180.0f && hsva[0] < 300.0f) { 18 | ++count; 19 | } 20 | } 21 | } 22 | return count / (width * height); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /evaluation/06_image_processor/kelinci_analysis/src/com/stac/image/algorithms/detectors/GreenDetector.java: -------------------------------------------------------------------------------- 1 | package com.stac.image.algorithms.detectors; 2 | 3 | import com.stac.image.algorithms.*; 4 | import java.awt.image.*; 5 | import com.stac.image.utilities.*; 6 | 7 | public class GreenDetector extends Detector 8 | { 9 | @Override 10 | public float detect(final BufferedImage image) { 11 | final int width = image.getWidth(); 12 | final int height = image.getHeight(); 13 | int count = 0; 14 | for (int x = 0; x < width; ++x) { 15 | for (int y = 0; y < height; ++y) { 16 | final float[] hsva = ARGB.toHSVA(image.getRGB(x, y)); 17 | if (hsva[2] >= 0.5 && hsva[1] >= 0.15 && hsva[0] > 80.0f && hsva[0] < 180.0f) { 18 | ++count; 19 | } 20 | } 21 | } 22 | return count / (width * height); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /example/build-example.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # chmod +x build-example.sh 3 | # ./build-example.sh 4 | 5 | trap "exit" INT 6 | 7 | #kelinciPath="/Users/yannic/repositories/cmu/kelinciwca/instrumentor/build/libs/kelinci.jar" 8 | 9 | echo "Create KelinciWCA folder and copy files" 10 | mkdir -p ./kelinciwca_analysis/src 11 | cp ../badger/src/examples/InsertionSortFuzz.java ./kelinciwca_analysis/src 12 | mkdir -p ./kelinciwca_analysis/bin 13 | cp ../badger/build/examples/InsertionSortFuzz.class ./kelinciwca_analysis/bin 14 | 15 | echo "Create SymExe folder and copy files" 16 | mkdir -p ./symexe_analysis/src 17 | cp ../badger/src/examples/InsertionSortSym.java ./symexe_analysis/src 18 | mkdir -p ./symexe_analysis/bin 19 | cp ../badger/build/examples/InsertionSortSym.class ./symexe_analysis/bin 20 | 21 | #echo "Instrument Kelinci code" 22 | #cd ./kelinciwca_analysis 23 | #java -jar $kelinciPath -i ./bin/ -o ./bin-instr -skipmain 24 | 25 | echo "Done." 26 | -------------------------------------------------------------------------------- /evaluation/05_compress/spf_analysis/config: -------------------------------------------------------------------------------- 1 | inputDir=./kelinci_analysis/fuzzer-out/afl/queue 2 | exportDir=./kelinci_analysis/fuzzer-out/spf/queue 3 | tmpDir=./tmp 4 | classpath=./spf_analysis/bin 5 | 6 | target=driver.Driver 7 | symbolic.method=BZip2CompressorOutputStream.write(con) 8 | symbolic.dp=z3bitvector 9 | symbolic.min_int=0 10 | symbolic.max_int=255 11 | 12 | cycleWaitingSec=600 13 | secUntilFirstCycle=60 14 | 15 | analysis.method=wca 16 | analysis.wca.metric=jumps 17 | analysis.wca.selection.heuristic=highest-score-highest-node 18 | 19 | io.utils=int-byte-array 20 | io.array.size=250 21 | 22 | numberOfAdditionalDecisions=0 23 | maximumNumberOfNodesExploredPerRun=10 24 | initialId=0 25 | 26 | import.statistics.file=import-statistics.txt 27 | generation.statistics.file=generation-statistics.txt 28 | export.statistics.file=export-statistics.txt 29 | pc.mapping.file=pcMap.txt 30 | trie.statistics.file=trie-statistics.txt 31 | 32 | debug.print=false 33 | -------------------------------------------------------------------------------- /evaluation/02_quicksort/kelinci_analysis/src/QuickSortJDK15.java: -------------------------------------------------------------------------------- 1 | import java.io.FileInputStream; 2 | import java.io.IOException; 3 | 4 | /** 5 | * @author Rody Kersten 6 | **/ 7 | public class QuickSortJDK15 { 8 | 9 | public static void main(String[] args) { 10 | if (args.length != 1) { 11 | System.out.println("Expects file name as parameter"); 12 | return; 13 | } 14 | 15 | 16 | int N = 64; 17 | int a[] = new int[N]; 18 | 19 | try (FileInputStream fis = new FileInputStream(args[0])) { 20 | int b; 21 | int i = 0; 22 | while (((b = fis.read()) != -1) && (i < N) ) { 23 | a[i] = b; 24 | i++; 25 | } 26 | } catch (IOException e) { 27 | System.err.println("Error reading input"); 28 | e.printStackTrace(); 29 | return; 30 | } 31 | 32 | System.out.println("Read int array: " + java.util.Arrays.toString(a)); 33 | Arrays.sort(a); 34 | System.out.println("Sorted: " + java.util.Arrays.toString(a)); 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /evaluation/06_image_processor/spf_analysis/config: -------------------------------------------------------------------------------- 1 | dir.initial.input=/Users/yannic/repositories/isstac/badger/evaluation/06_image_processor/kelinci_analysis/in_dir 2 | dir.sync.input=/Users/yannic/repositories/isstac/badger/evaluation/06_image_processor/kelinci_analysis/fuzzer-out/afl/queue 3 | dir.export=/Users/yannic/repositories/isstac/badger/evaluation/06_image_processor/kelinci_analysis/fuzzer-out/spf/queue 4 | 5 | jpf.classpath=/Users/yannic/repositories/isstac/badger/evaluation/06_image_processor/spf_analysis/bin 6 | #jpf.target=drivers.ByteImageDriver 7 | jpf.target=drivers.FullImageDriver 8 | symbolic.method=com.stac.image.algorithms.filters.Intensify.filter(con) 9 | symbolic.dp=z3bitvector 10 | 11 | symexe.wait.sec=600 12 | symexe.iterations=10 13 | 14 | analysis.method=wca 15 | analysis.wca.metric=jumps 16 | analysis.heuristic=highest-cost-highest-node 17 | 18 | #io.utils=byte-image 19 | io.utils=image 20 | io.input.sizes=2 2 21 | #not used by io utils in this case -------------------------------------------------------------------------------- /badger/src/main/edu/cmu/sv/badger/analysis/ExplorationHeuristic.java: -------------------------------------------------------------------------------- 1 | package edu.cmu.sv.badger.analysis; 2 | 3 | import java.util.Comparator; 4 | 5 | import edu.cmu.sv.badger.listener.IBehavior; 6 | import edu.cmu.sv.badger.trie.TrieNode; 7 | 8 | /** 9 | * Exploration heuristic for symbolic execution search. 10 | * 11 | * @author Yannic Noller - YN 12 | * 13 | */ 14 | public abstract class ExplorationHeuristic implements Comparator { 15 | 16 | /** 17 | * Unique id for each exploration heuristic. 18 | */ 19 | public final String ID; 20 | 21 | protected ExplorationHeuristic(String id) { 22 | this.ID = id; 23 | } 24 | 25 | /** 26 | * Determines meaning of "new" behavior. 27 | * 28 | * @param behaviorListener 29 | * - IBehavior 30 | * @return true or false 31 | */ 32 | public abstract boolean didObserveNewBehavior(IBehavior behaviorListener); 33 | 34 | } 35 | -------------------------------------------------------------------------------- /evaluation/07_smart_contract/spf_analysis/config: -------------------------------------------------------------------------------- 1 | inputDir=./kelinci_analysis/fuzzer-out/afl/queue 2 | exportDir=./kelinci_analysis/fuzzer-out/spf/queue 3 | tmpDir=./tmp 4 | classpath=./spf_analysis/bin 5 | 6 | target=GovernMental 7 | symbolic.method=GovernMental.lendGovernmentMoney(con#con#con#con#con#con) 8 | symbolic.dp=z3optimize 9 | symbolic.min_int=0 10 | #symbolic.max_int=100000 11 | 12 | cycleWaitingSec=60 13 | secUntilFirstCycle=60 14 | 15 | analysis.method=wca 16 | analysis.wca.metric=userdefined 17 | analysis.wca.selection.heuristic=highest-score-highest-node 18 | 19 | io.utils=full-int-byte-array 20 | io.array.size=15 21 | 22 | numberOfAdditionalDecisions=0 23 | maximumNumberOfNodesExploredPerRun=10 24 | initialId=0 25 | 26 | import.statistics.file=import-statistics.txt 27 | generation.statistics.file=generation-statistics.txt 28 | export.statistics.file=export-statistics.txt 29 | pc.mapping.file=pcMap.txt 30 | trie.statistics.file=trie-statistics.txt 31 | 32 | debug.print=false -------------------------------------------------------------------------------- /evaluation/06_image_processor/spf_analysis/src/com/stac/learning/EuclideanVector.java: -------------------------------------------------------------------------------- 1 | package com.stac.learning; 2 | 3 | import java.util.*; 4 | 5 | public class EuclideanVector extends com.stac.learning.Vector 6 | { 7 | EuclideanVector(final int n) { 8 | super(n); 9 | } 10 | 11 | @Override 12 | public float compareTo(final Vector other) { 13 | Objects.requireNonNull(this.attributes); 14 | Objects.requireNonNull(other.attributes); 15 | if (this.attributes.length != other.attributes.length) { 16 | throw new IllegalArgumentException("Vector lengths do not match."); 17 | } 18 | if (!this.attributes.getClass().getComponentType().equals(other.attributes.getClass().getComponentType())) { 19 | throw new IllegalArgumentException("Arrays must be of the same type."); 20 | } 21 | double sum = 0.0; 22 | for (int i = 0; i < this.attributes.length; ++i) { 23 | sum += (this.attributes[i] - other.attributes[i]) * (this.attributes[i] - other.attributes[i]); 24 | } 25 | return (float)(1.0 - Math.sqrt(sum)); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /evaluation/06_image_processor/kelinci_analysis/src/com/stac/learning/EuclideanVector.java: -------------------------------------------------------------------------------- 1 | package com.stac.learning; 2 | 3 | import java.util.*; 4 | 5 | public class EuclideanVector extends com.stac.learning.Vector 6 | { 7 | EuclideanVector(final int n) { 8 | super(n); 9 | } 10 | 11 | @Override 12 | public float compareTo(final Vector other) { 13 | Objects.requireNonNull(this.attributes); 14 | Objects.requireNonNull(other.attributes); 15 | if (this.attributes.length != other.attributes.length) { 16 | throw new IllegalArgumentException("Vector lengths do not match."); 17 | } 18 | if (!this.attributes.getClass().getComponentType().equals(other.attributes.getClass().getComponentType())) { 19 | throw new IllegalArgumentException("Arrays must be of the same type."); 20 | } 21 | double sum = 0.0; 22 | for (int i = 0; i < this.attributes.length; ++i) { 23 | sum += (this.attributes[i] - other.attributes[i]) * (this.attributes[i] - other.attributes[i]); 24 | } 25 | return (float)(1.0 - Math.sqrt(sum)); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /evaluation/03_regex/spf_analysis/config: -------------------------------------------------------------------------------- 1 | inputDir=./kelinci_analysis/fuzzer-out/afl/queue 2 | exportDir=./kelinci_analysis/fuzzer-out/spf/queue 3 | tmpDir=./tmp 4 | classpath=./spf_analysis/bin 5 | 6 | target=Regex 7 | 8 | symbolic.method=regexjdk8.Pattern.matches(con#con) 9 | symbolic.dp=z3bitvector 10 | 11 | cycleWaitingSec=600 12 | secUntilFirstCycle=60 13 | 14 | analysis.method=wca 15 | analysis.wca.metric=jumps 16 | analysis.wca.selection.heuristic=highest-score-highest-node 17 | 18 | io.utils=char-byte-array 19 | 20 | # Regex is fixed and we mutate the text: 21 | #argument=./kelinci_analysis/resources-byte/popular-regexes/2password-byte @@ 22 | #io.array.size=100 23 | 24 | # Text is fixed and we mutate the regex: 25 | argument=./kelinci_analysis/resources-byte/lorem-byte.txt @@ 26 | io.array.size=10 27 | 28 | numberOfAdditionalDecisions=0 29 | maximumNumberOfNodesExploredPerRun=10 30 | initialId=0 31 | 32 | import.statistics.file=import-statistics.txt 33 | generation.statistics.file=generation-statistics.txt 34 | export.statistics.file=export-statistics.txt 35 | pc.mapping.file=pcMap.txt 36 | trie.statistics.file=trie-statistics.txt 37 | 38 | debug.print=false -------------------------------------------------------------------------------- /evaluation/05_compress/spf_analysis/src/org/apache/commons/compress/compressors/CompressorOutputStream.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.commons.compress.compressors; 20 | 21 | import java.io.OutputStream; 22 | 23 | public abstract class CompressorOutputStream extends OutputStream { 24 | // TODO 25 | } 26 | -------------------------------------------------------------------------------- /evaluation/05_compress/kelinci_analysis/src/org/apache/commons/compress/compressors/CompressorOutputStream.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.commons.compress.compressors; 20 | 21 | import java.io.OutputStream; 22 | 23 | public abstract class CompressorOutputStream extends OutputStream { 24 | // TODO 25 | } 26 | -------------------------------------------------------------------------------- /evaluation/06_image_processor/spf_analysis/src/com/stac/image/algorithms/generics/Convolve.java: -------------------------------------------------------------------------------- 1 | package com.stac.image.algorithms.generics; 2 | 3 | import java.awt.image.*; 4 | import java.awt.*; 5 | 6 | public class Convolve 7 | { 8 | public static final Kernel Gausian5x5; 9 | // public static final Kernel Gausian3x3; 10 | 11 | public static BufferedImage convolve(final BufferedImage image, final Kernel kernel) { 12 | // removed library call 13 | return image; 14 | // return new ConvolveOp(kernel, 1, null).filter(image, null); 15 | } 16 | 17 | static { 18 | Gausian5x5 = new Kernel(5, 5, new float[] { 0.003021148f, 0.012084592f, 0.021148037f, 0.012084592f, 0.003021148f, 0.012084592f, 0.06042296f, 0.09969789f, 0.06042296f, 0.012084592f, 0.021148037f, 0.09969789f, 0.16616315f, 0.09969789f, 0.021148037f, 0.012084592f, 0.06042296f, 0.09969789f, 0.06042296f, 0.012084592f, 0.003021148f, 0.012084592f, 0.021148037f, 0.012084592f, 0.003021148f }); 19 | // Gausian3x3 = new Kernel(3, 3, new float[] { 0.06666667f, 0.13333334f, 0.06666667f, 0.13333334f, 0.2f, 0.13333334f, 0.06666667f, 0.13333334f, 0.06666667f }); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Yannic Noller, Rody Kersten, Corina Pasareanu 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /evaluation/06_image_processor/kelinci_analysis/src/com/stac/image/algorithms/generics/Convolve.java: -------------------------------------------------------------------------------- 1 | package com.stac.image.algorithms.generics; 2 | 3 | import java.awt.image.*; 4 | import java.awt.*; 5 | 6 | public class Convolve 7 | { 8 | public static final Kernel Gausian5x5; 9 | // public static final Kernel Gausian3x3; 10 | 11 | public static BufferedImage convolve(final BufferedImage image, final Kernel kernel) { 12 | // removed library call 13 | return image; 14 | // return new ConvolveOp(kernel, 1, null).filter(image, null); 15 | } 16 | 17 | static { 18 | Gausian5x5 = new Kernel(5, 5, new float[] { 0.003021148f, 0.012084592f, 0.021148037f, 0.012084592f, 0.003021148f, 0.012084592f, 0.06042296f, 0.09969789f, 0.06042296f, 0.012084592f, 0.021148037f, 0.09969789f, 0.16616315f, 0.09969789f, 0.021148037f, 0.012084592f, 0.06042296f, 0.09969789f, 0.06042296f, 0.012084592f, 0.003021148f, 0.012084592f, 0.021148037f, 0.012084592f, 0.003021148f }); 19 | // Gausian3x3 = new Kernel(3, 3, new float[] { 0.06666667f, 0.13333334f, 0.06666667f, 0.13333334f, 0.2f, 0.13333334f, 0.06666667f, 0.13333334f, 0.06666667f }); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /evaluation/06_image_processor/spf_analysis/src/com/stac/image/algorithms/filters/Invert.java: -------------------------------------------------------------------------------- 1 | package com.stac.image.algorithms.filters; 2 | 3 | import com.stac.image.algorithms.*; 4 | import java.awt.image.*; 5 | 6 | public class Invert extends Filter 7 | { 8 | private boolean invertAlpha; 9 | 10 | public Invert() { 11 | this.invertAlpha = false; 12 | } 13 | 14 | public Invert(final boolean invertAlpha) { 15 | this.invertAlpha = false; 16 | this.invertAlpha = invertAlpha; 17 | } 18 | 19 | @Override 20 | public void filter(final BufferedImage image) { 21 | final int width = image.getWidth(); 22 | final int height = image.getHeight(); 23 | for (int x = 0; x < width; ++x) { 24 | for (int y = 0; y < height; ++y) { 25 | final int argbIn = image.getRGB(x, y); 26 | int alpha = argbIn >> 24 & 0xFF; 27 | if (this.invertAlpha) { 28 | alpha = 255 - alpha; 29 | } 30 | image.setRGB(x, y, alpha << 24 | 255 - (argbIn >> 16 & 0xFF) << 16 | 255 - (argbIn >> 8 & 0xFF) << 8 | 255 - (argbIn & 0xFF)); 31 | } 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /evaluation/05_compress/spf_analysis/src/driver/DriverDecompress.java: -------------------------------------------------------------------------------- 1 | package driver; 2 | 3 | import java.io.FileInputStream; 4 | import java.io.IOException; 5 | import java.io.InputStream; 6 | 7 | import org.apache.commons.compress.compressors.bzip2.BZip2CompressorInputStream; 8 | 9 | import org.apache.commons.io.input.BoundedInputStream; 10 | 11 | public class DriverDecompress { 12 | public static void main(String args[]) { 13 | if (args.length != 1) { 14 | System.err.println("Usage: Driver "); 15 | return; 16 | } 17 | 18 | try (FileInputStream fis = new FileInputStream(args[0])) { 19 | 20 | // bound bzip2 archive size to 250 bytes 21 | BoundedInputStream bis = new BoundedInputStream(fis, 250); 22 | 23 | // decompress 24 | BZip2CompressorInputStream in = new BZip2CompressorInputStream(bis); 25 | 26 | int b; 27 | int i = 0; 28 | while (((b = fis.read()) != -1) && (i < 250) ) { // read 250 bytes max 29 | // should we do something with the bytes read from the stream here? 30 | i++; 31 | } 32 | 33 | } catch (IOException e) { 34 | System.err.println("Error reading input file"); 35 | e.printStackTrace(); 36 | } 37 | 38 | System.out.println("Done."); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /evaluation/06_image_processor/kelinci_analysis/src/com/stac/image/algorithms/filters/Invert.java: -------------------------------------------------------------------------------- 1 | package com.stac.image.algorithms.filters; 2 | 3 | import com.stac.image.algorithms.*; 4 | import java.awt.image.*; 5 | 6 | public class Invert extends Filter 7 | { 8 | private boolean invertAlpha; 9 | 10 | public Invert() { 11 | this.invertAlpha = false; 12 | } 13 | 14 | public Invert(final boolean invertAlpha) { 15 | this.invertAlpha = false; 16 | this.invertAlpha = invertAlpha; 17 | } 18 | 19 | @Override 20 | public void filter(final BufferedImage image) { 21 | final int width = image.getWidth(); 22 | final int height = image.getHeight(); 23 | for (int x = 0; x < width; ++x) { 24 | for (int y = 0; y < height; ++y) { 25 | final int argbIn = image.getRGB(x, y); 26 | int alpha = argbIn >> 24 & 0xFF; 27 | if (this.invertAlpha) { 28 | alpha = 255 - alpha; 29 | } 30 | image.setRGB(x, y, alpha << 24 | 255 - (argbIn >> 16 & 0xFF) << 16 | 255 - (argbIn >> 8 & 0xFF) << 8 | 255 - (argbIn & 0xFF)); 31 | } 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /evaluation/05_compress/kelinci_analysis/src/driver/DriverDecompress.java: -------------------------------------------------------------------------------- 1 | package driver; 2 | 3 | import java.io.FileInputStream; 4 | import java.io.IOException; 5 | import java.io.InputStream; 6 | 7 | import org.apache.commons.compress.compressors.bzip2.BZip2CompressorInputStream; 8 | 9 | import org.apache.commons.io.input.BoundedInputStream; 10 | 11 | public class DriverDecompress { 12 | public static void main(String args[]) { 13 | if (args.length != 1) { 14 | System.err.println("Usage: Driver "); 15 | return; 16 | } 17 | 18 | try (FileInputStream fis = new FileInputStream(args[0])) { 19 | 20 | // bound bzip2 archive size to 250 bytes 21 | BoundedInputStream bis = new BoundedInputStream(fis, 250); 22 | 23 | // decompress 24 | BZip2CompressorInputStream in = new BZip2CompressorInputStream(bis); 25 | 26 | int b; 27 | int i = 0; 28 | while (((b = fis.read()) != -1) && (i < 250) ) { // read 250 bytes max 29 | // should we do something with the bytes read from the stream here? 30 | i++; 31 | } 32 | 33 | } catch (IOException e) { 34 | System.err.println("Error reading input file"); 35 | e.printStackTrace(); 36 | } 37 | 38 | System.out.println("Done."); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /badger/src/main/edu/cmu/sv/badger/listener/MetricListener.java: -------------------------------------------------------------------------------- 1 | package edu.cmu.sv.badger.listener; 2 | 3 | import edu.cmu.sv.badger.analysis.StateBuilder; 4 | import gov.nasa.jpf.Config; 5 | import gov.nasa.jpf.JPF; 6 | import gov.nasa.jpf.PropertyListenerAdapter; 7 | import gov.nasa.jpf.vm.Instruction; 8 | import gov.nasa.jpf.vm.ThreadInfo; 9 | import gov.nasa.jpf.vm.VM; 10 | 11 | public class MetricListener extends PropertyListenerAdapter { 12 | 13 | private StateBuilder stateBuilder; 14 | 15 | public MetricListener(Config jpfConf, JPF jpf, StateBuilder stateBuilder) { 16 | this.stateBuilder = stateBuilder; 17 | } 18 | 19 | @Override 20 | public void executeInstruction(VM vm, ThreadInfo currentThread, Instruction instructionToExecute) { 21 | if (!currentThread.isFirstStepInsn()) { 22 | this.stateBuilder.handleExecuteInstruction(vm, currentThread, instructionToExecute); 23 | } 24 | } 25 | 26 | @Override 27 | public void instructionExecuted(VM vm, ThreadInfo currentThread, Instruction nextInstruction, 28 | Instruction executedInstruction) { 29 | this.stateBuilder.handleInstructionExecuted(vm, currentThread, nextInstruction, executedInstruction); 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /evaluation/03_regex/kelinci_analysis/resources/lorem.txt: -------------------------------------------------------------------------------- 1 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas sed volutpat nulla. Phasellus eleifend quam augue. Suspendisse efficitur magna magna, non euismod est placerat ultrices. In at ipsum metus. Pellentesque fringilla augue vel efficitur dignissim. Morbi in ante commodo, pellentesque orci eget, dignissim orci. Integer at pellentesque lorem, a rutrum est. Sed tristique, augue quis vulputate sodales, tellus tellus ultrices lorem, quis interdum neque leo eu odio. Duis vestibulum velit massa, eget dignissim risus laoreet eget. Proin aliquam non quam non maximus. Ut mi libero, bibendum in accumsan in, pretium ac nunc. Quisque in quam sit amet eros porta pellentesque. Vivamus nec ligula ac sapien lacinia pulvinar non sit amet enim. Sed tempor laoreet nibh vitae suscipit. Praesent vel egestas sem, feugiat condimentum mi. 2 | 3 | Nulla tincidunt nunc id lacus elementum, id placerat tellus pellentesque. Nulla fringilla, libero non semper convallis, purus ligula elementum turpis, nec accumsan dui mi quis ligula. Proin tellus ligula, faucibus eget lorem ac, egestas feugiat est. Quisque vel mi fermentum, sagittis odio et, mattis massa. Vestibulum placerat arcu velit, eget volutpat ex viverra eu. Phasellus in condimentum felis. Vivamus quis risus tellus. 4 | -------------------------------------------------------------------------------- /evaluation/05_compress/kelinci_analysis/src/org/apache/commons/compress/archivers/dump/ShortFileException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.commons.compress.archivers.dump; 20 | 21 | 22 | /** 23 | * Short File Exception. There was an unexpected EOF when reading 24 | * the input stream. 25 | */ 26 | public class ShortFileException extends DumpArchiveException { 27 | private static final long serialVersionUID = 1L; 28 | 29 | public ShortFileException() { 30 | super("unexpected EOF"); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /evaluation/05_compress/spf_analysis/src/org/apache/commons/compress/archivers/dump/ShortFileException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.commons.compress.archivers.dump; 20 | 21 | 22 | /** 23 | * Short File Exception. There was an unexpected EOF when reading 24 | * the input stream. 25 | */ 26 | public class ShortFileException extends DumpArchiveException { 27 | private static final long serialVersionUID = 1L; 28 | 29 | public ShortFileException() { 30 | super("unexpected EOF"); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /evaluation/05_compress/spf_analysis/src/org/apache/commons/compress/archivers/dump/UnrecognizedFormatException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.commons.compress.archivers.dump; 20 | 21 | 22 | /** 23 | * Unrecognized Format Exception. This is either not a recognized dump archive or there's 24 | * a bad tape segment header. 25 | */ 26 | public class UnrecognizedFormatException extends DumpArchiveException { 27 | private static final long serialVersionUID = 1L; 28 | 29 | public UnrecognizedFormatException() { 30 | super("this is not a recognized format."); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /evaluation/05_compress/kelinci_analysis/src/org/apache/commons/compress/archivers/dump/UnrecognizedFormatException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.commons.compress.archivers.dump; 20 | 21 | 22 | /** 23 | * Unrecognized Format Exception. This is either not a recognized dump archive or there's 24 | * a bad tape segment header. 25 | */ 26 | public class UnrecognizedFormatException extends DumpArchiveException { 27 | private static final long serialVersionUID = 1L; 28 | 29 | public UnrecognizedFormatException() { 30 | super("this is not a recognized format."); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /evaluation/06_image_processor/kelinci_analysis/src/drivers/DriverKelinci2.java: -------------------------------------------------------------------------------- 1 | package drivers; 2 | 3 | import com.stac.image.algorithms.filters.Intensify; 4 | 5 | import java.awt.image.BufferedImage; 6 | import java.io.FileInputStream; 7 | import java.io.IOException; 8 | import java.nio.ByteBuffer; 9 | 10 | public class DriverKelinci2 11 | { 12 | public static void main(final String[] args) { 13 | 14 | if (args.length != 1) { 15 | System.out.println("Expects file name as parameter"); 16 | return; 17 | } 18 | 19 | System.out.println("Loading image: " + args[0]); 20 | 21 | // image size 22 | int X = 2; 23 | int Y = 2; 24 | 25 | BufferedImage bi = new BufferedImage(X, Y, BufferedImage.TYPE_INT_RGB); 26 | 27 | try (FileInputStream fis = new FileInputStream(args[0])) { 28 | 29 | byte[] bytes = new byte[4]; 30 | int pixels_read = 0; 31 | 32 | while ( (fis.read(bytes) != -1) && (pixels_read < X*Y) ) { 33 | int pixel = ByteBuffer.wrap(bytes).getInt(); 34 | int x = pixels_read % X; 35 | int y = pixels_read / X; 36 | System.out.println("pixel["+x+"]["+y+"] = " + pixel); 37 | bi.setRGB(x, y, pixel); 38 | pixels_read++; 39 | } 40 | 41 | // test the Intensify filter 42 | Intensify i = new Intensify(); 43 | i.filter(bi); 44 | } catch (IOException e) { 45 | // TODO Auto-generated catch block 46 | e.printStackTrace(); 47 | } 48 | 49 | System.out.println("Done."); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /evaluation/05_compress/kelinci_analysis/src/org/apache/commons/compress/compressors/bzip2/BZip2Constants.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | package org.apache.commons.compress.compressors.bzip2; 21 | 22 | /** 23 | * Constants for both the compress and decompress BZip2 classes. 24 | */ 25 | interface BZip2Constants { 26 | 27 | int BASEBLOCKSIZE = 100000; 28 | int MAX_ALPHA_SIZE = 258; 29 | int MAX_CODE_LEN = 23; 30 | int RUNA = 0; 31 | int RUNB = 1; 32 | int N_GROUPS = 6; 33 | int G_SIZE = 50; 34 | int N_ITERS = 4; 35 | int MAX_SELECTORS = (2 + (900000 / G_SIZE)); 36 | int NUM_OVERSHOOT_BYTES = 20; 37 | 38 | } -------------------------------------------------------------------------------- /evaluation/05_compress/spf_analysis/src/org/apache/commons/compress/compressors/bzip2/BZip2Constants.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | package org.apache.commons.compress.compressors.bzip2; 21 | 22 | /** 23 | * Constants for both the compress and decompress BZip2 classes. 24 | */ 25 | interface BZip2Constants { 26 | 27 | int BASEBLOCKSIZE = 100000; 28 | int MAX_ALPHA_SIZE = 258; 29 | int MAX_CODE_LEN = 23; 30 | int RUNA = 0; 31 | int RUNB = 1; 32 | int N_GROUPS = 6; 33 | int G_SIZE = 50; 34 | int N_ITERS = 4; 35 | int MAX_SELECTORS = (2 + (900000 / G_SIZE)); 36 | int NUM_OVERSHOOT_BYTES = 20; 37 | 38 | } -------------------------------------------------------------------------------- /evaluation/06_image_processor/kelinci_analysis/src/com/stac/image/ImageAlgorithmStore.java: -------------------------------------------------------------------------------- 1 | package com.stac.image; 2 | 3 | import java.util.*; 4 | import com.stac.image.algorithms.detectors.*; 5 | import com.stac.image.algorithms.filters.*; 6 | 7 | public class ImageAlgorithmStore 8 | { 9 | private static Map store; 10 | 11 | private static void addAlgorithm(final Class algo) { 12 | try { 13 | ImageAlgorithmStore.store.put(algo.getSimpleName(), (ImageAlgorithm)algo.newInstance()); 14 | } 15 | catch (InstantiationException | IllegalAccessException ex2) { 16 | // final ReflectiveOperationException ex; 17 | // final ReflectiveOperationException e = ex; 18 | throw new RuntimeException("Fatal initialization error has occurred"); 19 | } 20 | } 21 | 22 | public static ImageAlgorithm getAlgorithm(final String name) { 23 | return ImageAlgorithmStore.store.get(name); 24 | } 25 | 26 | static { 27 | ImageAlgorithmStore.store = new HashMap(); 28 | addAlgorithm(BlackDetector.class); 29 | addAlgorithm(BlueDetector.class); 30 | addAlgorithm(EdgingDetector.class); 31 | addAlgorithm(GreenDetector.class); 32 | addAlgorithm(RedDetector.class); 33 | addAlgorithm(WhiteDetector.class); 34 | addAlgorithm(Intensify.class); 35 | addAlgorithm(Invert.class); 36 | addAlgorithm(DummyDetector.class); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /evaluation/06_image_processor/spf_analysis/src/com/stac/image/ImageAlgorithmStore.java: -------------------------------------------------------------------------------- 1 | package com.stac.image; 2 | 3 | import java.util.*; 4 | import com.stac.image.algorithms.detectors.*; 5 | import com.stac.image.algorithms.filters.*; 6 | 7 | public class ImageAlgorithmStore 8 | { 9 | private static Map store; 10 | 11 | private static void addAlgorithm(final Class algo) { 12 | try { 13 | ImageAlgorithmStore.store.put(algo.getSimpleName(), (ImageAlgorithm)algo.newInstance()); 14 | } 15 | catch (InstantiationException | IllegalAccessException ex2) { 16 | // final ReflectiveOperationException ex; 17 | // final ReflectiveOperationException e = ex; 18 | throw new RuntimeException("Fatal initialization error has occurred"); 19 | } 20 | } 21 | 22 | public static ImageAlgorithm getAlgorithm(final String name) { 23 | return ImageAlgorithmStore.store.get(name); 24 | } 25 | 26 | static { 27 | ImageAlgorithmStore.store = new HashMap(); 28 | addAlgorithm(BlackDetector.class); 29 | addAlgorithm(BlueDetector.class); 30 | addAlgorithm(EdgingDetector.class); 31 | addAlgorithm(GreenDetector.class); 32 | addAlgorithm(RedDetector.class); 33 | addAlgorithm(WhiteDetector.class); 34 | addAlgorithm(Intensify.class); 35 | addAlgorithm(Invert.class); 36 | addAlgorithm(DummyDetector.class); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /badger/src/main/edu/cmu/sv/badger/app/BadgerRunner.java: -------------------------------------------------------------------------------- 1 | package edu.cmu.sv.badger.app; 2 | 3 | import java.io.File; 4 | import java.io.IOException; 5 | 6 | import org.apache.commons.io.FileUtils; 7 | 8 | import edu.cmu.sv.badger.util.Statistics; 9 | 10 | /** 11 | * Main class to start Badger execution. 12 | * 13 | * @author Yannic Noller - YN 14 | */ 15 | public class BadgerRunner { 16 | 17 | public static void main(String[] args) { 18 | 19 | String configFilePath = args[0]; 20 | BadgerInput input = BadgerInput.loadFromConfigFile(configFilePath); 21 | 22 | ensureAndCleanOutputDirectoriesExist(input); 23 | Statistics.initFiles(input); 24 | 25 | SymExe symExe = new SymExe(input); 26 | symExe.run(); 27 | 28 | } 29 | 30 | private static void ensureAndCleanOutputDirectoriesExist(BadgerInput input) { 31 | 32 | File tmpDir = new File(input.tmpDir); 33 | try { 34 | FileUtils.forceMkdir(tmpDir); 35 | FileUtils.cleanDirectory(tmpDir); 36 | } catch (IOException e) { 37 | throw new RuntimeException("[ERROR] Unable to create tmp directory: " + input.tmpDir, e); 38 | } 39 | 40 | File exportDir = new File(input.exportDir); 41 | try { 42 | FileUtils.forceMkdir(exportDir); 43 | FileUtils.cleanDirectory(exportDir); 44 | } catch (IOException e) { 45 | throw new RuntimeException("[ERROR] Unable to create tmp directory: " + input.exportDir, e); 46 | } 47 | } 48 | 49 | } 50 | -------------------------------------------------------------------------------- /evaluation/02_quicksort/spf_analysis/src/QuickSortJDK15.java: -------------------------------------------------------------------------------- 1 | import java.io.FileInputStream; 2 | import java.io.IOException; 3 | 4 | import gov.nasa.jpf.symbc.Debug; 5 | 6 | /** 7 | * @author Rody Kersten 8 | * Adapted for symbolic analysis by Yannic Noller - YN 9 | **/ 10 | public class QuickSortJDK15 { 11 | 12 | public static void main(String[] args) { 13 | int N = 64; 14 | int a[] = new int[N]; 15 | 16 | if (args.length == 1) { 17 | 18 | String fileName = args[0].replace("#", ","); 19 | 20 | try (FileInputStream fis = new FileInputStream(fileName)) { 21 | int b; 22 | int i = 0; 23 | while (((b = fis.read()) != -1) && (i < N)) { 24 | a[i] = b; 25 | i++; 26 | } 27 | } catch (IOException e) { 28 | System.err.println("Error reading input"); 29 | e.printStackTrace(); 30 | return; 31 | } 32 | // Insert symbolic variables. 33 | for (int i = 0; i < N; i++) { 34 | a[i] = Debug.addSymbolicInt(a[i], "sym_" + i); 35 | } 36 | 37 | } else { 38 | for (int i = 0; i < N; i++) { 39 | a[i] = Debug.makeSymbolicInteger("sym_" + i); 40 | } 41 | } 42 | 43 | // System.out.println("Read int array: " + Arrays.toString(a)); 44 | Arrays.sort(a); 45 | // System.out.println("Sorted: " + Arrays.toString(a)); 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /evaluation/06_image_processor/kelinci_analysis/src/com/stac/image/algorithms/generics/ConvertImage.java: -------------------------------------------------------------------------------- 1 | package com.stac.image.algorithms.generics; 2 | 3 | import java.awt.color.*; 4 | import com.stac.image.utilities.*; 5 | import java.awt.image.*; 6 | import java.awt.*; 7 | 8 | public class ConvertImage 9 | { 10 | public static BufferedImage grayscale(final BufferedImage image) { 11 | return new ColorConvertOp(ColorSpace.getInstance(1003), null).filter(image, null); 12 | } 13 | 14 | public static BufferedImage boostedGray(final BufferedImage image) { 15 | final BufferedImage out = new BufferedImage(image.getWidth(), image.getHeight(), 2); 16 | for (int i = 0; i < image.getWidth(); ++i) { 17 | for (int j = 0; j < image.getHeight(); ++j) { 18 | final int argb = image.getRGB(i, j); 19 | final int a = ARGB.rawA(argb); 20 | final int r = ARGB.rawR(argb); 21 | final int g = ARGB.rawG(argb); 22 | final int b = ARGB.rawB(argb); 23 | final int val = (r + r + r + b + g + g + g + g) / 8; 24 | out.setRGB(i, j, ARGB.toARGB(a, val, val, val)); 25 | } 26 | } 27 | return out; 28 | } 29 | 30 | // Seems to convert image into grayscale 31 | public static BufferedImage otherGray(final BufferedImage image) { 32 | // final BufferedImage out = new BufferedImage(image.getWidth(), image.getHeight(), 10); 33 | // final Graphics g = out.getGraphics(); 34 | // g.drawImage(image, 0, 0, null); 35 | // return out; 36 | return image; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /evaluation/06_image_processor/spf_analysis/src/com/stac/image/algorithms/generics/ConvertImage.java: -------------------------------------------------------------------------------- 1 | package com.stac.image.algorithms.generics; 2 | 3 | import java.awt.color.*; 4 | import com.stac.image.utilities.*; 5 | import java.awt.image.*; 6 | import java.awt.*; 7 | 8 | public class ConvertImage 9 | { 10 | public static BufferedImage grayscale(final BufferedImage image) { 11 | return new ColorConvertOp(ColorSpace.getInstance(1003), null).filter(image, null); 12 | } 13 | 14 | public static BufferedImage boostedGray(final BufferedImage image) { 15 | final BufferedImage out = new BufferedImage(image.getWidth(), image.getHeight(), 2); 16 | for (int i = 0; i < image.getWidth(); ++i) { 17 | for (int j = 0; j < image.getHeight(); ++j) { 18 | final int argb = image.getRGB(i, j); 19 | final int a = ARGB.rawA(argb); 20 | final int r = ARGB.rawR(argb); 21 | final int g = ARGB.rawG(argb); 22 | final int b = ARGB.rawB(argb); 23 | final int val = (r + r + r + b + g + g + g + g) / 8; 24 | out.setRGB(i, j, ARGB.toARGB(a, val, val, val)); 25 | } 26 | } 27 | return out; 28 | } 29 | 30 | // Seems to convert image into grayscale 31 | public static BufferedImage otherGray(final BufferedImage image) { 32 | // final BufferedImage out = new BufferedImage(image.getWidth(), image.getHeight(), 10); 33 | // final Graphics g = out.getGraphics(); 34 | // g.drawImage(image, 0, 0, null); 35 | // return out; 36 | return image; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /evaluation/05_compress/spf_analysis/src/org/apache/commons/compress/archivers/dump/DumpArchiveException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.commons.compress.archivers.dump; 20 | 21 | import java.io.IOException; 22 | 23 | 24 | /** 25 | * Dump Archive Exception 26 | */ 27 | public class DumpArchiveException extends IOException { 28 | private static final long serialVersionUID = 1L; 29 | 30 | public DumpArchiveException() { 31 | } 32 | 33 | public DumpArchiveException(String msg) { 34 | super(msg); 35 | } 36 | 37 | public DumpArchiveException(Throwable cause) { 38 | super(); 39 | initCause(cause); 40 | } 41 | 42 | public DumpArchiveException(String msg, Throwable cause) { 43 | super(msg); 44 | initCause(cause); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /evaluation/05_compress/kelinci_analysis/src/org/apache/commons/compress/archivers/dump/DumpArchiveException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.commons.compress.archivers.dump; 20 | 21 | import java.io.IOException; 22 | 23 | 24 | /** 25 | * Dump Archive Exception 26 | */ 27 | public class DumpArchiveException extends IOException { 28 | private static final long serialVersionUID = 1L; 29 | 30 | public DumpArchiveException() { 31 | } 32 | 33 | public DumpArchiveException(String msg) { 34 | super(msg); 35 | } 36 | 37 | public DumpArchiveException(Throwable cause) { 38 | super(); 39 | initCause(cause); 40 | } 41 | 42 | public DumpArchiveException(String msg, Throwable cause) { 43 | super(msg); 44 | initCause(cause); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /evaluation/06_image_processor/kelinci_analysis/src/drivers/DriverKelinci.java: -------------------------------------------------------------------------------- 1 | package drivers; 2 | 3 | import com.stac.image.algorithms.filters.Intensify; 4 | import java.awt.image.BufferedImage; 5 | import java.io.File; 6 | import java.io.IOException; 7 | 8 | import javax.imageio.ImageIO; 9 | 10 | public class DriverKelinci 11 | { 12 | public static void main(final String[] args) { 13 | 14 | if (args.length != 1) { 15 | System.out.println("Expects file name as parameter"); 16 | return; 17 | } 18 | 19 | try { 20 | System.out.println("Loading image: " + args[0]); 21 | File imageFile = new File(args[0]); 22 | BufferedImage bi = ImageIO.read(imageFile); 23 | 24 | /*System.out.println("Pixels values:"); 25 | for (int y = 0; y < bi.getHeight(); y++) { 26 | for (int x = 0; x < bi.getWidth(); x++) { 27 | System.out.println("bi["+y+"]["+x+"] = " + bi.getRGB(x, y)); 28 | } 29 | }*/ 30 | 31 | // RK: added this check from Engagement 2 32 | /*if (bi.getWidth() * bi.getHeight() > 4) { 33 | throw new RuntimeException("This image is too large. Please reduce your image size to less than 250000 pixels"); 34 | }*/ 35 | // YN: only allow 2x2 images 36 | if (bi.getWidth() != 2 || bi.getHeight() != 2) { 37 | throw new RuntimeException("it is not an 2x2 image"); 38 | } 39 | 40 | // test the Intensify filter 41 | Intensify i = new Intensify(); 42 | i.filter(bi); 43 | } catch (IOException e) { 44 | // TODO Auto-generated catch block 45 | e.printStackTrace(); 46 | } 47 | 48 | System.out.println("Done."); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /evaluation/05_compress/spf_analysis/src/org/apache/commons/compress/archivers/dump/UnsupportedCompressionAlgorithmException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.commons.compress.archivers.dump; 20 | 21 | 22 | /** 23 | * Unsupported compression algorithm. The dump archive uses an unsupported 24 | * compression algorithm (BZLIB2 or LZO). 25 | */ 26 | public class UnsupportedCompressionAlgorithmException 27 | extends DumpArchiveException { 28 | private static final long serialVersionUID = 1L; 29 | 30 | public UnsupportedCompressionAlgorithmException() { 31 | super("this file uses an unsupported compression algorithm."); 32 | } 33 | 34 | public UnsupportedCompressionAlgorithmException(String alg) { 35 | super("this file uses an unsupported compression algorithm: " + alg + 36 | "."); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /evaluation/05_compress/kelinci_analysis/src/org/apache/commons/compress/archivers/dump/UnsupportedCompressionAlgorithmException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.commons.compress.archivers.dump; 20 | 21 | 22 | /** 23 | * Unsupported compression algorithm. The dump archive uses an unsupported 24 | * compression algorithm (BZLIB2 or LZO). 25 | */ 26 | public class UnsupportedCompressionAlgorithmException 27 | extends DumpArchiveException { 28 | private static final long serialVersionUID = 1L; 29 | 30 | public UnsupportedCompressionAlgorithmException() { 31 | super("this file uses an unsupported compression algorithm."); 32 | } 33 | 34 | public UnsupportedCompressionAlgorithmException(String alg) { 35 | super("this file uses an unsupported compression algorithm: " + alg + 36 | "."); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /badger/src/main/edu/cmu/sv/badger/trie/TriePrintToConsole.java: -------------------------------------------------------------------------------- 1 | package edu.cmu.sv.badger.trie; 2 | 3 | import java.io.FileInputStream; 4 | import java.io.ObjectInputStream; 5 | 6 | /** 7 | * Help class to print a trie to the console 8 | * 9 | * @author Guowei Yang (guoweiyang@utexas.edu) 10 | * 11 | */ 12 | 13 | public class TriePrintToConsole { 14 | Trie trie; 15 | 16 | public void loadTrie(){ 17 | // de-serialize the stored trie from the disk 18 | try { 19 | FileInputStream fin = new FileInputStream("trie_ex.dat"); 20 | ObjectInputStream ois = new ObjectInputStream(fin); 21 | trie = (Trie) ois.readObject(); 22 | ois.close(); 23 | } catch (Exception e) { 24 | System.err.println("something wrong with trie de-serializing"); 25 | e.printStackTrace(); 26 | } 27 | 28 | } 29 | 30 | public void print(){ 31 | assert(trie!=null); 32 | TrieNode n = trie.getRoot(); 33 | if(n == null){ 34 | System.out.println("Trie is null"); 35 | return; 36 | } 37 | printNode(n); 38 | } 39 | 40 | static void printNode(TrieNode n){ 41 | System.out.println("\n Node " + n.hashCode()); 42 | System.out.println(">>> choice: " + n.getChoice()); 43 | System.out.println(">>> offset: " + n.getOffset()); 44 | System.out.println(">>> methodName: " + n.getMethodName()); 45 | System.out.println(">>> type: " + n.getType()); 46 | 47 | System.out.println(""); 48 | 49 | //print the children's children recursively 50 | for(TrieNode child: n.getChildren()){ 51 | printNode(child); 52 | } 53 | } 54 | 55 | public static void main(String[] args){ 56 | TriePrintToConsole tp = new TriePrintToConsole(); 57 | tp.loadTrie(); 58 | tp.print(); 59 | } 60 | 61 | 62 | } 63 | -------------------------------------------------------------------------------- /badger/jpf.properties: -------------------------------------------------------------------------------- 1 | # project config for jpf-regression extension 2 | 3 | badger = ${config_path} 4 | 5 | badger.native_classpath=\ 6 | ${badger}/build/badger.jar;\ 7 | ${jpf-symbc}/lib/commons-lang-2.4.jar; 8 | 9 | badger.classpath=\ 10 | ${badger}/build/tests;\ 11 | ${badger}/build/examples; 12 | 13 | peer_packages= gov.nasa.jpf.symbc,${peer_packages} 14 | 15 | # The following JPF options are usually used for SPF as well: 16 | 17 | # no state matching 18 | 19 | vm.storage.class=nil 20 | 21 | # instruct jpf not to stop at first error 22 | 23 | search.multiple_errors=true 24 | 25 | # specify the search strategy (default is DFS) 26 | 27 | #search.class = .search.heuristic.BFSHeuristic 28 | 29 | # limit the search depth (number of choices along the path) 30 | 31 | #search.depth_limit = 10 32 | 33 | #You can specify multiple methods to be executed symbolically as follows: 34 | #symbolic.method= 35 | 36 | #You can pick which decision procedure to choose (if unspecified, choco is used as default):ss 37 | 38 | #symbolic.dp=choco 39 | 40 | #symbolic.dp=iasolver 41 | 42 | #symbolic.dp=cvc3 43 | 44 | #symbolic.dp=cvc3bitvec 45 | 46 | #symbolic.dp=no_solver 47 | 48 | #A new option was added to implement lazy initialization (see [TACAS'03] paper) 49 | #symbolic.lazy=on 50 | 51 | #(default is off) -- for now it is incompatible with Strings 52 | 53 | #New options have been added, to specify min/max values for symbolic variables and also to give the default for don't care values. 54 | #symbolic.minint=-100 55 | 56 | #symbolic.maxint=100 57 | 58 | #symbolic.minreal=-1000.0 59 | 60 | #symbolic.maxreal=1000.0 61 | 62 | #symbolic.undefined=0 63 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /evaluation/05_compress/kelinci_analysis/src/org/apache/commons/compress/archivers/dump/InvalidFormatException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.commons.compress.archivers.dump; 20 | 21 | 22 | /** 23 | * Invalid Format Exception. There was an error decoding a 24 | * tape segment header. 25 | */ 26 | public class InvalidFormatException extends DumpArchiveException { 27 | private static final long serialVersionUID = 1L; 28 | protected long offset; 29 | 30 | public InvalidFormatException() { 31 | super("there was an error decoding a tape segment"); 32 | } 33 | 34 | public InvalidFormatException(long offset) { 35 | super("there was an error decoding a tape segment header at offset " + 36 | offset + "."); 37 | this.offset = offset; 38 | } 39 | 40 | public long getOffset() { 41 | return offset; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /evaluation/05_compress/spf_analysis/src/org/apache/commons/compress/archivers/dump/InvalidFormatException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.commons.compress.archivers.dump; 20 | 21 | 22 | /** 23 | * Invalid Format Exception. There was an error decoding a 24 | * tape segment header. 25 | */ 26 | public class InvalidFormatException extends DumpArchiveException { 27 | private static final long serialVersionUID = 1L; 28 | protected long offset; 29 | 30 | public InvalidFormatException() { 31 | super("there was an error decoding a tape segment"); 32 | } 33 | 34 | public InvalidFormatException(long offset) { 35 | super("there was an error decoding a tape segment header at offset " + 36 | offset + "."); 37 | this.offset = offset; 38 | } 39 | 40 | public long getOffset() { 41 | return offset; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /evaluation/05_compress/kelinci_analysis/src/org/apache/commons/compress/compressors/pack200/Pack200Strategy.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | package org.apache.commons.compress.compressors.pack200; 21 | 22 | import java.io.IOException; 23 | 24 | /** 25 | * The different modes the Pack200 streams can use to wrap input and 26 | * output. 27 | * @since 1.3 28 | */ 29 | public enum Pack200Strategy { 30 | /** Cache output in memory */ 31 | IN_MEMORY() { 32 | @Override 33 | StreamBridge newStreamBridge() { 34 | return new InMemoryCachingStreamBridge(); 35 | } 36 | }, 37 | /** Cache output in a temporary file */ 38 | TEMP_FILE() { 39 | @Override 40 | StreamBridge newStreamBridge() throws IOException { 41 | return new TempFileCachingStreamBridge(); 42 | } 43 | }; 44 | 45 | abstract StreamBridge newStreamBridge() throws IOException; 46 | } -------------------------------------------------------------------------------- /evaluation/05_compress/spf_analysis/src/org/apache/commons/compress/compressors/pack200/InMemoryCachingStreamBridge.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | package org.apache.commons.compress.compressors.pack200; 21 | 22 | import java.io.ByteArrayInputStream; 23 | import java.io.ByteArrayOutputStream; 24 | import java.io.IOException; 25 | import java.io.InputStream; 26 | 27 | /** 28 | * StreamSwitcher that caches all data written to the output side in 29 | * memory. 30 | * @since 1.3 31 | */ 32 | class InMemoryCachingStreamBridge extends StreamBridge { 33 | InMemoryCachingStreamBridge() { 34 | super(new ByteArrayOutputStream()); 35 | } 36 | 37 | /** 38 | * {@inheritDoc} 39 | */ 40 | @Override 41 | InputStream getInputView() throws IOException { 42 | return new ByteArrayInputStream(((ByteArrayOutputStream) out) 43 | .toByteArray()); 44 | } 45 | } -------------------------------------------------------------------------------- /evaluation/05_compress/spf_analysis/src/org/apache/commons/compress/compressors/pack200/Pack200Strategy.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | package org.apache.commons.compress.compressors.pack200; 21 | 22 | import java.io.IOException; 23 | 24 | /** 25 | * The different modes the Pack200 streams can use to wrap input and 26 | * output. 27 | * @since 1.3 28 | */ 29 | public enum Pack200Strategy { 30 | /** Cache output in memory */ 31 | IN_MEMORY() { 32 | @Override 33 | StreamBridge newStreamBridge() { 34 | return new InMemoryCachingStreamBridge(); 35 | } 36 | }, 37 | /** Cache output in a temporary file */ 38 | TEMP_FILE() { 39 | @Override 40 | StreamBridge newStreamBridge() throws IOException { 41 | return new TempFileCachingStreamBridge(); 42 | } 43 | }; 44 | 45 | abstract StreamBridge newStreamBridge() throws IOException; 46 | } -------------------------------------------------------------------------------- /evaluation/05_compress/kelinci_analysis/src/org/apache/commons/compress/compressors/pack200/InMemoryCachingStreamBridge.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | package org.apache.commons.compress.compressors.pack200; 21 | 22 | import java.io.ByteArrayInputStream; 23 | import java.io.ByteArrayOutputStream; 24 | import java.io.IOException; 25 | import java.io.InputStream; 26 | 27 | /** 28 | * StreamSwitcher that caches all data written to the output side in 29 | * memory. 30 | * @since 1.3 31 | */ 32 | class InMemoryCachingStreamBridge extends StreamBridge { 33 | InMemoryCachingStreamBridge() { 34 | super(new ByteArrayOutputStream()); 35 | } 36 | 37 | /** 38 | * {@inheritDoc} 39 | */ 40 | @Override 41 | InputStream getInputView() throws IOException { 42 | return new ByteArrayInputStream(((ByteArrayOutputStream) out) 43 | .toByteArray()); 44 | } 45 | } -------------------------------------------------------------------------------- /evaluation/05_compress/kelinci_analysis/src/driver/Driver.java: -------------------------------------------------------------------------------- 1 | package driver; 2 | 3 | import java.io.FileInputStream; 4 | import java.io.IOException; 5 | import java.io.OutputStream; 6 | import java.io.ByteArrayOutputStream; 7 | 8 | import org.apache.commons.compress.compressors.bzip2.BZip2CompressorOutputStream; 9 | 10 | public class Driver { 11 | public static void main(String args[]) { 12 | if (args.length != 1) { 13 | System.err.println("Usage: Driver "); 14 | return; 15 | } 16 | 17 | try (FileInputStream fis = new FileInputStream(args[0])) { 18 | 19 | // the BZIP2 compressor that contains a vulnerability 20 | BZip2CompressorOutputStream out = new BZip2CompressorOutputStream(new NullOutputStream()); 21 | 22 | int b; 23 | int i = 0; 24 | while (((b = fis.read()) != -1) && (i < 250) ) { // read 250 bytes max 25 | out.write(b); 26 | i++; 27 | } 28 | 29 | out.flush(); 30 | out.finish(); 31 | 32 | } catch (IOException e) { 33 | System.err.println("Error reading input file"); 34 | e.printStackTrace(); 35 | } 36 | 37 | System.out.println("Done."); 38 | } 39 | 40 | /** 41 | * Stream to /dev/null. Used to redirect output of target program. 42 | * 43 | * I know something like this is also in Apache Commons IO, but if I include it here, 44 | * we don't need any libs on the classpath when running the Kelinci server. 45 | * 46 | * @author rodykers 47 | * 48 | */ 49 | private static class NullOutputStream extends ByteArrayOutputStream { 50 | 51 | @Override 52 | public void write(int b) {} 53 | 54 | @Override 55 | public void write(byte[] b, int off, int len) {} 56 | 57 | @Override 58 | public void writeTo(OutputStream out) throws IOException {} 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /evaluation/05_compress/spf_analysis/src/org/apache/commons/compress/archivers/ArchiveEntry.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.commons.compress.archivers; 20 | 21 | import java.util.Date; 22 | 23 | /** 24 | * Represents an entry of an archive. 25 | */ 26 | public interface ArchiveEntry { 27 | 28 | /** The name of the entry in the archive. May refer to a file or directory or other item */ 29 | public String getName(); 30 | 31 | /** The (uncompressed) size of the entry. May be -1 (SIZE_UNKNOWN) if the size is unknown */ 32 | public long getSize(); 33 | 34 | /** Special value indicating that the size is unknown */ 35 | public static final long SIZE_UNKNOWN = -1; 36 | 37 | /** True if the entry refers to a directory */ 38 | public boolean isDirectory(); 39 | 40 | /** 41 | * The last modified date of the entry. 42 | * 43 | * @since 1.1 44 | */ 45 | public Date getLastModifiedDate(); 46 | } 47 | -------------------------------------------------------------------------------- /evaluation/05_compress/kelinci_analysis/src/org/apache/commons/compress/archivers/ArchiveEntry.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.commons.compress.archivers; 20 | 21 | import java.util.Date; 22 | 23 | /** 24 | * Represents an entry of an archive. 25 | */ 26 | public interface ArchiveEntry { 27 | 28 | /** The name of the entry in the archive. May refer to a file or directory or other item */ 29 | public String getName(); 30 | 31 | /** The (uncompressed) size of the entry. May be -1 (SIZE_UNKNOWN) if the size is unknown */ 32 | public long getSize(); 33 | 34 | /** Special value indicating that the size is unknown */ 35 | public static final long SIZE_UNKNOWN = -1; 36 | 37 | /** True if the entry refers to a directory */ 38 | public boolean isDirectory(); 39 | 40 | /** 41 | * The last modified date of the entry. 42 | * 43 | * @since 1.1 44 | */ 45 | public Date getLastModifiedDate(); 46 | } 47 | -------------------------------------------------------------------------------- /evaluation/05_compress/spf_analysis/src/org/apache/commons/compress/archivers/zip/Zip64Mode.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | */ 18 | 19 | package org.apache.commons.compress.archivers.zip; 20 | 21 | /** 22 | * The different modes {@link ZipArchiveOutputStream} can operate in. 23 | * 24 | * @see ZipArchiveOutputStream#setUseZip64 25 | * 26 | * @since 1.3 27 | */ 28 | public enum Zip64Mode { 29 | /** 30 | * Use Zip64 extensions for all entries, even if it is clear it is 31 | * not required. 32 | */ 33 | Always, 34 | /** 35 | * Don't use Zip64 extensions for any entries. 36 | * 37 | *

This will cause a {@link Zip64RequiredException} to be 38 | * thrown if {@link ZipArchiveOutputStream} detects it needs Zip64 39 | * support.

40 | */ 41 | Never, 42 | /** 43 | * Use Zip64 extensions for all entries where they are required, 44 | * don't use them for entries that clearly don't require them. 45 | */ 46 | AsNeeded 47 | } 48 | -------------------------------------------------------------------------------- /evaluation/05_compress/kelinci_analysis/src/org/apache/commons/compress/archivers/zip/Zip64Mode.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | */ 18 | 19 | package org.apache.commons.compress.archivers.zip; 20 | 21 | /** 22 | * The different modes {@link ZipArchiveOutputStream} can operate in. 23 | * 24 | * @see ZipArchiveOutputStream#setUseZip64 25 | * 26 | * @since 1.3 27 | */ 28 | public enum Zip64Mode { 29 | /** 30 | * Use Zip64 extensions for all entries, even if it is clear it is 31 | * not required. 32 | */ 33 | Always, 34 | /** 35 | * Don't use Zip64 extensions for any entries. 36 | * 37 | *

This will cause a {@link Zip64RequiredException} to be 38 | * thrown if {@link ZipArchiveOutputStream} detects it needs Zip64 39 | * support.

40 | */ 41 | Never, 42 | /** 43 | * Use Zip64 extensions for all entries where they are required, 44 | * don't use them for entries that clearly don't require them. 45 | */ 46 | AsNeeded 47 | } 48 | -------------------------------------------------------------------------------- /badger/src/main/edu/cmu/sv/badger/analysis/State.java: -------------------------------------------------------------------------------- 1 | /* 2 | * MIT License 3 | * 4 | * Copyright (c) 2017 The ISSTAC Authors 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package edu.cmu.sv.badger.analysis; 26 | 27 | import gov.nasa.jpf.symbc.numeric.PathCondition; 28 | 29 | /** 30 | * @author Kasper Luckow 31 | */ 32 | public abstract class State implements Comparable { 33 | private final PathCondition pc; 34 | 35 | public State(PathCondition pc) { 36 | this.pc = pc; 37 | } 38 | 39 | public PathCondition getPathCondition() { 40 | return this.pc; 41 | } 42 | 43 | // Should this return a double, or would we like to parameterize this (e.g. to subclasses of Number)? 44 | public abstract double getWC(); 45 | } 46 | -------------------------------------------------------------------------------- /evaluation/05_compress/spf_analysis/src/org/apache/commons/compress/compressors/CompressorException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.commons.compress.compressors; 20 | 21 | /** 22 | * Compressor related exception 23 | */ 24 | public class CompressorException extends Exception { 25 | 26 | /** Serial */ 27 | private static final long serialVersionUID = -2932901310255908814L; 28 | 29 | /** 30 | * Constructs a new exception with the specified detail message. The cause 31 | * is not initialized. 32 | * 33 | * @param message 34 | * the detail message 35 | */ 36 | public CompressorException(String message) { 37 | super(message); 38 | } 39 | 40 | /** 41 | * Constructs a new exception with the specified detail message and cause. 42 | * 43 | * @param message 44 | * the detail message 45 | * @param cause 46 | * the cause 47 | */ 48 | public CompressorException(String message, Throwable cause) { 49 | super(message, cause); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /badger/src/main/edu/cmu/sv/badger/listener/SolverCallListener.java: -------------------------------------------------------------------------------- 1 | package edu.cmu.sv.badger.listener; 2 | 3 | import gov.nasa.jpf.Config; 4 | import gov.nasa.jpf.JPF; 5 | import gov.nasa.jpf.ListenerAdapter; 6 | import gov.nasa.jpf.vm.ChoiceGenerator; 7 | import gov.nasa.jpf.vm.ThreadChoiceGenerator; 8 | import gov.nasa.jpf.search.Search; 9 | import gov.nasa.jpf.symbc.numeric.PCChoiceGenerator; 10 | import gov.nasa.jpf.symbc.sequences.SequenceChoiceGenerator; 11 | 12 | /** 13 | * This listener class records the number of solver calls 14 | * 15 | * @author Guowei Yang (guoweiyang@utexas.edu) 16 | * 17 | */ 18 | 19 | public class SolverCallListener extends ListenerAdapter { 20 | 21 | int count; // number of solver calls, assuming one solver call 22 | // is made whenever state is advanced because of PCChoiceGenerator advancing 23 | 24 | private static final boolean DEBUG = false; 25 | 26 | public SolverCallListener(Config config, JPF jpf) throws Exception { 27 | count=0; 28 | } 29 | 30 | public void searchFinished(Search search) { 31 | if (DEBUG) { 32 | System.out.println(">>> searchFinished"); 33 | } 34 | System.out.println("# solver calls: " + count); 35 | } 36 | 37 | 38 | public void stateAdvanced(Search search) { 39 | if (DEBUG) { 40 | System.out.println(">>> stateAdvanced"); 41 | } 42 | 43 | ChoiceGenerator cg = search.getVM().getChoiceGenerator(); 44 | if (DEBUG) { 45 | System.out.println("cg: " + cg); 46 | } 47 | 48 | // thread choice instead of pc choice 49 | if (cg instanceof ThreadChoiceGenerator) { 50 | return; 51 | } 52 | if (cg instanceof SequenceChoiceGenerator) { 53 | return; 54 | } 55 | 56 | if (cg instanceof PCChoiceGenerator) { 57 | int offset = ((PCChoiceGenerator) cg).getOffset(); 58 | if (offset == 0) { 59 | return; 60 | } 61 | } 62 | 63 | count++; 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /evaluation/05_compress/kelinci_analysis/src/org/apache/commons/compress/compressors/CompressorException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.commons.compress.compressors; 20 | 21 | /** 22 | * Compressor related exception 23 | */ 24 | public class CompressorException extends Exception { 25 | 26 | /** Serial */ 27 | private static final long serialVersionUID = -2932901310255908814L; 28 | 29 | /** 30 | * Constructs a new exception with the specified detail message. The cause 31 | * is not initialized. 32 | * 33 | * @param message 34 | * the detail message 35 | */ 36 | public CompressorException(String message) { 37 | super(message); 38 | } 39 | 40 | /** 41 | * Constructs a new exception with the specified detail message and cause. 42 | * 43 | * @param message 44 | * the detail message 45 | * @param cause 46 | * the cause 47 | */ 48 | public CompressorException(String message, Throwable cause) { 49 | super(message, cause); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /evaluation/05_compress/spf_analysis/src/org/apache/commons/compress/archivers/ArchiveException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.commons.compress.archivers; 20 | 21 | /** 22 | * Archiver related Exception 23 | */ 24 | public class ArchiveException extends Exception { 25 | 26 | /** Serial */ 27 | private static final long serialVersionUID = 2772690708123267100L; 28 | 29 | /** 30 | * Constructs a new exception with the specified detail message. The cause 31 | * is not initialized. 32 | * 33 | * @param message 34 | * the detail message 35 | */ 36 | public ArchiveException(String message) { 37 | super(message); 38 | } 39 | 40 | /** 41 | * Constructs a new exception with the specified detail message and cause. 42 | * 43 | * @param message 44 | * the detail message 45 | * @param cause 46 | * the cause 47 | */ 48 | public ArchiveException(String message, Exception cause) { 49 | super(message); 50 | this.initCause(cause); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /evaluation/05_compress/kelinci_analysis/src/org/apache/commons/compress/archivers/ArchiveException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.commons.compress.archivers; 20 | 21 | /** 22 | * Archiver related Exception 23 | */ 24 | public class ArchiveException extends Exception { 25 | 26 | /** Serial */ 27 | private static final long serialVersionUID = 2772690708123267100L; 28 | 29 | /** 30 | * Constructs a new exception with the specified detail message. The cause 31 | * is not initialized. 32 | * 33 | * @param message 34 | * the detail message 35 | */ 36 | public ArchiveException(String message) { 37 | super(message); 38 | } 39 | 40 | /** 41 | * Constructs a new exception with the specified detail message and cause. 42 | * 43 | * @param message 44 | * the detail message 45 | * @param cause 46 | * the cause 47 | */ 48 | public ArchiveException(String message, Exception cause) { 49 | super(message); 50 | this.initCause(cause); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /badger/src/main/edu/cmu/sv/badger/io/IntArrayIOUtils.java: -------------------------------------------------------------------------------- 1 | package edu.cmu.sv.badger.io; 2 | 3 | import java.io.FileNotFoundException; 4 | import java.io.IOException; 5 | import java.nio.file.Files; 6 | import java.nio.file.Paths; 7 | import java.util.HashMap; 8 | import java.util.List; 9 | import java.util.Map; 10 | 11 | import gov.nasa.jpf.symbc.numeric.PathCondition; 12 | 13 | /*! problems with negative integers*/ 14 | public class IntArrayIOUtils extends IOUtils { 15 | 16 | public static final String ID = "int-byte-array"; 17 | 18 | public int N; 19 | 20 | public IntArrayIOUtils(int N) { 21 | this.N = N; 22 | } 23 | 24 | @Override 25 | public Map processInput(List inputFiles) { 26 | // here we don't need to process anything 27 | Map res = new HashMap<>(); 28 | for (String inputfile : inputFiles) { 29 | res.put(inputfile, inputfile); 30 | } 31 | return res; 32 | } 33 | 34 | @Override 35 | public void generateInputFiles(PathCondition pc, Map solution, String outputFile) { 36 | generateByteArrayInput(pc, solution, outputFile); 37 | } 38 | 39 | private void generateByteArrayInput(PathCondition pc, Map solution, String outputFile) { 40 | byte[] data = new byte[N]; 41 | for (int i = 0; i < data.length; i++) { 42 | Object value = solution.get("sym_" + i); 43 | int intValue; 44 | if (value == null) { 45 | intValue = 0; 46 | } else { 47 | intValue = Math.toIntExact((long) value); 48 | } 49 | data[i] = (byte) intValue; 50 | } 51 | try { 52 | Files.write(Paths.get(outputFile), data); 53 | } catch (FileNotFoundException e) { 54 | e.printStackTrace(); 55 | } catch (IOException e) { 56 | e.printStackTrace(); 57 | } 58 | } 59 | 60 | } 61 | -------------------------------------------------------------------------------- /evaluation/05_compress/spf_analysis/src/org/apache/commons/compress/archivers/zip/Zip64RequiredException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | */ 18 | 19 | package org.apache.commons.compress.archivers.zip; 20 | 21 | import java.util.zip.ZipException; 22 | 23 | /** 24 | * Exception thrown when attempting to write data that requires Zip64 25 | * support to an archive and {@link ZipArchiveOutputStream#setUseZip64 26 | * UseZip64} has been set to {@link Zip64Mode#Never Never}. 27 | * @since 1.3 28 | */ 29 | public class Zip64RequiredException extends ZipException { 30 | 31 | private static final long serialVersionUID = 20110809L; 32 | 33 | /** 34 | * Helper to format "entry too big" messages. 35 | */ 36 | static String getEntryTooBigMessage(ZipArchiveEntry ze) { 37 | return ze.getName() + "'s size exceeds the limit of 4GByte."; 38 | } 39 | 40 | static final String ARCHIVE_TOO_BIG_MESSAGE = 41 | "archive's size exceeds the limit of 4GByte."; 42 | 43 | static final String TOO_MANY_ENTRIES_MESSAGE = 44 | "archive contains more than 65535 entries."; 45 | 46 | public Zip64RequiredException(String reason) { 47 | super(reason); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /evaluation/05_compress/kelinci_analysis/src/org/apache/commons/compress/archivers/zip/Zip64RequiredException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | */ 18 | 19 | package org.apache.commons.compress.archivers.zip; 20 | 21 | import java.util.zip.ZipException; 22 | 23 | /** 24 | * Exception thrown when attempting to write data that requires Zip64 25 | * support to an archive and {@link ZipArchiveOutputStream#setUseZip64 26 | * UseZip64} has been set to {@link Zip64Mode#Never Never}. 27 | * @since 1.3 28 | */ 29 | public class Zip64RequiredException extends ZipException { 30 | 31 | private static final long serialVersionUID = 20110809L; 32 | 33 | /** 34 | * Helper to format "entry too big" messages. 35 | */ 36 | static String getEntryTooBigMessage(ZipArchiveEntry ze) { 37 | return ze.getName() + "'s size exceeds the limit of 4GByte."; 38 | } 39 | 40 | static final String ARCHIVE_TOO_BIG_MESSAGE = 41 | "archive's size exceeds the limit of 4GByte."; 42 | 43 | static final String TOO_MANY_ENTRIES_MESSAGE = 44 | "archive contains more than 65535 entries."; 45 | 46 | public Zip64RequiredException(String reason) { 47 | super(reason); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /evaluation/05_compress/spf_analysis/src/org/apache/commons/compress/compressors/pack200/TempFileCachingStreamBridge.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | package org.apache.commons.compress.compressors.pack200; 21 | 22 | import java.io.File; 23 | import java.io.FileInputStream; 24 | import java.io.FileOutputStream; 25 | import java.io.IOException; 26 | import java.io.InputStream; 27 | 28 | /** 29 | * StreamSwitcher that caches all data written to the output side in 30 | * a temporary file. 31 | * @since 1.3 32 | */ 33 | class TempFileCachingStreamBridge extends StreamBridge { 34 | private final File f; 35 | 36 | TempFileCachingStreamBridge() throws IOException { 37 | f = File.createTempFile("commons-compress", "packtemp"); 38 | f.deleteOnExit(); 39 | out = new FileOutputStream(f); 40 | } 41 | 42 | /** 43 | * {@inheritDoc} 44 | */ 45 | @Override 46 | InputStream getInputView() throws IOException { 47 | out.close(); 48 | return new FileInputStream(f) { 49 | @Override 50 | public void close() throws IOException { 51 | super.close(); 52 | f.delete(); 53 | } 54 | }; 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /evaluation/05_compress/kelinci_analysis/src/org/apache/commons/compress/compressors/pack200/TempFileCachingStreamBridge.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | package org.apache.commons.compress.compressors.pack200; 21 | 22 | import java.io.File; 23 | import java.io.FileInputStream; 24 | import java.io.FileOutputStream; 25 | import java.io.IOException; 26 | import java.io.InputStream; 27 | 28 | /** 29 | * StreamSwitcher that caches all data written to the output side in 30 | * a temporary file. 31 | * @since 1.3 32 | */ 33 | class TempFileCachingStreamBridge extends StreamBridge { 34 | private final File f; 35 | 36 | TempFileCachingStreamBridge() throws IOException { 37 | f = File.createTempFile("commons-compress", "packtemp"); 38 | f.deleteOnExit(); 39 | out = new FileOutputStream(f); 40 | } 41 | 42 | /** 43 | * {@inheritDoc} 44 | */ 45 | @Override 46 | InputStream getInputView() throws IOException { 47 | out.close(); 48 | return new FileInputStream(f) { 49 | @Override 50 | public void close() throws IOException { 51 | super.close(); 52 | f.delete(); 53 | } 54 | }; 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /evaluation/05_compress/spf_analysis/src/org/apache/commons/compress/archivers/zip/UnixStat.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.commons.compress.archivers.zip; 20 | 21 | /** 22 | * Constants from stat.h on Unix systems. 23 | */ 24 | public interface UnixStat 25 | { 26 | /** 27 | * Bits used for permissions (and sticky bit) 28 | */ 29 | int PERM_MASK = 07777; 30 | /** 31 | * Indicates symbolic links. 32 | */ 33 | int LINK_FLAG = 0120000; 34 | /** 35 | * Indicates plain files. 36 | */ 37 | int FILE_FLAG = 0100000; 38 | /** 39 | * Indicates directories. 40 | */ 41 | int DIR_FLAG = 040000; 42 | 43 | // ---------------------------------------------------------- 44 | // somewhat arbitrary choices that are quite common for shared 45 | // installations 46 | // ----------------------------------------------------------- 47 | 48 | /** 49 | * Default permissions for symbolic links. 50 | */ 51 | int DEFAULT_LINK_PERM = 0777; 52 | 53 | /** 54 | * Default permissions for directories. 55 | */ 56 | int DEFAULT_DIR_PERM = 0755; 57 | 58 | /** 59 | * Default permissions for plain files. 60 | */ 61 | int DEFAULT_FILE_PERM = 0644; 62 | } 63 | -------------------------------------------------------------------------------- /evaluation/05_compress/kelinci_analysis/src/org/apache/commons/compress/archivers/zip/UnixStat.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.commons.compress.archivers.zip; 20 | 21 | /** 22 | * Constants from stat.h on Unix systems. 23 | */ 24 | public interface UnixStat 25 | { 26 | /** 27 | * Bits used for permissions (and sticky bit) 28 | */ 29 | int PERM_MASK = 07777; 30 | /** 31 | * Indicates symbolic links. 32 | */ 33 | int LINK_FLAG = 0120000; 34 | /** 35 | * Indicates plain files. 36 | */ 37 | int FILE_FLAG = 0100000; 38 | /** 39 | * Indicates directories. 40 | */ 41 | int DIR_FLAG = 040000; 42 | 43 | // ---------------------------------------------------------- 44 | // somewhat arbitrary choices that are quite common for shared 45 | // installations 46 | // ----------------------------------------------------------- 47 | 48 | /** 49 | * Default permissions for symbolic links. 50 | */ 51 | int DEFAULT_LINK_PERM = 0777; 52 | 53 | /** 54 | * Default permissions for directories. 55 | */ 56 | int DEFAULT_DIR_PERM = 0755; 57 | 58 | /** 59 | * Default permissions for plain files. 60 | */ 61 | int DEFAULT_FILE_PERM = 0644; 62 | } 63 | -------------------------------------------------------------------------------- /badger/src/main/edu/cmu/sv/badger/io/MultipleIntArrayIOUtils.java: -------------------------------------------------------------------------------- 1 | package edu.cmu.sv.badger.io; 2 | 3 | import java.io.FileNotFoundException; 4 | import java.io.IOException; 5 | import java.nio.file.Files; 6 | import java.nio.file.Paths; 7 | import java.util.HashMap; 8 | import java.util.List; 9 | import java.util.Map; 10 | 11 | import gov.nasa.jpf.symbc.numeric.PathCondition; 12 | 13 | public class MultipleIntArrayIOUtils extends IOUtils { 14 | 15 | public static final String ID = "multi-int-byte-array"; 16 | 17 | public int n; 18 | public int m; 19 | 20 | public MultipleIntArrayIOUtils(int n, int m) { 21 | this.n = n; 22 | this.m = m; 23 | } 24 | 25 | @Override 26 | public Map processInput(List inputFiles) { 27 | // here we don't need to process anything 28 | Map res = new HashMap<>(); 29 | for (String inputfile : inputFiles) { 30 | res.put(inputfile, inputfile); 31 | } 32 | return res; 33 | } 34 | 35 | @Override 36 | public void generateInputFiles(PathCondition pc, Map solution, String outputFile) { 37 | generateByteArrayInput(pc, solution, outputFile); 38 | } 39 | 40 | private void generateByteArrayInput(PathCondition pc, Map solution, String outputFile) { 41 | byte[] data = new byte[n * m]; 42 | for (int i = 0; i < n; i++) { 43 | for (int j = 0; j < m; j++) { 44 | Object value = solution.get("sym_" + i + "_" + j); 45 | int intValue; 46 | if (value == null) { 47 | intValue = 0; 48 | } else { 49 | intValue = Math.toIntExact((long) value); 50 | } 51 | data[i*m+j] = (byte) intValue; 52 | } 53 | } 54 | 55 | try { 56 | Files.write(Paths.get(outputFile), data); 57 | } catch (FileNotFoundException e) { 58 | e.printStackTrace(); 59 | } catch (IOException e) { 60 | e.printStackTrace(); 61 | } 62 | } 63 | 64 | } 65 | -------------------------------------------------------------------------------- /evaluation/06_image_processor/kelinci_analysis/src/com/stac/image/algorithms/filters/Intensify.java: -------------------------------------------------------------------------------- 1 | package com.stac.image.algorithms.filters; 2 | 3 | import com.stac.image.algorithms.*; 4 | import java.awt.image.*; 5 | import com.stac.image.utilities.*; 6 | import com.stac.mathematics.*; 7 | 8 | public class Intensify extends Filter 9 | { 10 | @Override 11 | public void filter(final BufferedImage image) { 12 | for (int i = 0; i < image.getWidth(); ++i) { 13 | for (int j = 0; j < image.getHeight(); ++j) { 14 | final int rgb00 = image.getRGB(this.bound(0, image.getWidth(), i - 1), this.bound(0, image.getHeight(), j - 1)); 15 | final int rgb2 = image.getRGB(this.bound(0, image.getWidth(), i - 1), this.bound(0, image.getHeight(), j)); 16 | final int rgb3 = image.getRGB(this.bound(0, image.getWidth(), i - 1), this.bound(0, image.getHeight(), j + 1)); 17 | final int rgb4 = image.getRGB(i, j); 18 | final int rgb5 = image.getRGB(this.bound(0, image.getWidth(), i + 1), this.bound(0, image.getHeight(), j - 1)); 19 | final int rgb6 = image.getRGB(this.bound(0, image.getWidth(), i + 1), this.bound(0, image.getHeight(), j)); 20 | final int rgb7 = image.getRGB(this.bound(0, image.getWidth(), i + 1), this.bound(0, image.getHeight(), j + 1)); 21 | final int m = Mathematics.intensify(ARGB.rawA(rgb4), ARGB.rawR(rgb00), ARGB.rawG(rgb4), ARGB.rawB(rgb7)); 22 | final int n = Mathematics.intensify(ARGB.rawA(rgb4), ARGB.rawR(rgb2), ARGB.rawG(rgb4), ARGB.rawB(rgb6)); 23 | final int o = Mathematics.intensify(ARGB.rawA(rgb4), ARGB.rawR(rgb3), ARGB.rawG(rgb4), ARGB.rawB(rgb5)); 24 | final long avg = m + m + m + n + n + o + o + o; 25 | image.setRGB(i, j, (int)avg >> 3 | 0xFF000000); 26 | } 27 | } 28 | } 29 | 30 | private int bound(final int min, final int max, final int i) { 31 | if (i < min) { 32 | return 0; 33 | } 34 | if (i < max) { 35 | return i; 36 | } 37 | return max - 1; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /evaluation/05_compress/scripts/run-compress-spf.sh: -------------------------------------------------------------------------------- 1 | ### Define here local variables ##### 2 | ##################################### 3 | # chmod +x run_experiments.sh 4 | # ./run_experiments.sh 5 | # 6 | # Besure to already build the source files in the directories: 7 | # /kelinci_analysis/bin, /kelinci_analysis/bin-instr, /spf_analysis/bin 8 | # 9 | # and create the folder: 10 | # /kelinci_analysis/fuzzer-out/spf/queue 11 | # 12 | 13 | # time bound for each run (in hours): 14 | time_bound=60 #18000 = 5 hours 15 | 16 | # number of iterations 17 | number_of_runs=1 #5 18 | 19 | # folder with sources 20 | src=/vol/home-vol2/se/nollerya/fuzzing/memoise/issta-experiments/05-compress 21 | 22 | # folder for runtime 23 | target=/vol/home-vol2/se/nollerya/fuzzing/experiments/05-compress-spf 24 | 25 | # kelinci=1, kelinci-spf=2 26 | execution_mode=3 27 | 28 | # server parameter 29 | server_param="driver.Driver @@" 30 | 31 | ##################################### 32 | 33 | echo "Running experiments for:" 34 | echo "execution_mode=$execution_mode" 35 | echo "time_bound=$time_bound" 36 | echo "number_of_runs=$number_of_runs" 37 | echo "src=$src" 38 | echo "target=$target" 39 | echo "server_param=$server_param" 40 | echo "" 41 | 42 | for i in `seq 1 $number_of_runs` 43 | do 44 | current_target="$target-$i" 45 | echo "Initializing experiment environment for run=$i" 46 | 47 | mkdir "$current_target" 48 | cp -r "$src/kelinci_analysis" "$current_target/" 49 | 50 | cp -r "$src/spf_analysis" "$current_target/" 51 | mkdir "$current_target/tmp" 52 | cp "/vol/home-vol2/se/nollerya/fuzzing/memoise/KelinciSPFRunner.jar" "$current_target" 53 | cp "$src/config-server-berlin" "$current_target" 54 | 55 | cd "$current_target" 56 | echo "Starting SPF.." 57 | export PATH=$PATH:/vol/home-vol2/se/nollerya/fuzzing/z3/build 58 | export LD_LIBRARY_PATH=/vol/home-vol2/se/nollerya/fuzzing/z3/build 59 | screen -S spf -d -m java -Xmx10240m -jar KelinciSPFRunner.jar config-server-berlin 60 | 61 | echo "Waiting for $time_bound seconds.." 62 | sleep $time_bound 63 | 64 | echo "Stopping SPF.." 65 | screen -r spf -X kill 66 | 67 | echo "Finished run=$i" 68 | echo "" 69 | 70 | done 71 | 72 | echo "Done." 73 | -------------------------------------------------------------------------------- /evaluation/04_hashtable/scripts/run-hashtable-spf.sh: -------------------------------------------------------------------------------- 1 | ### Define here local variables ##### 2 | ##################################### 3 | # chmod +x run_experiments.sh 4 | # ./run_experiments.sh 5 | # 6 | # Besure to already build the source files in the directories: 7 | # /kelinci_analysis/bin, /kelinci_analysis/bin-instr, /spf_analysis/bin 8 | # 9 | # and create the folder: 10 | # /kelinci_analysis/fuzzer-out/spf/queue 11 | # 12 | 13 | # time bound for each run (in hours): 14 | time_bound=18000 #18000 = 5 hours 15 | 16 | # number of iterations 17 | number_of_runs=5 #5 18 | 19 | # folder with sources 20 | src=/vol/home-vol2/se/nollerya/fuzzing/memoise/issta-experiments/04-hashtable 21 | 22 | # folder for runtime 23 | target=/vol/home-vol2/se/nollerya/fuzzing/experiments/04-hashtable-spf 24 | 25 | # kelinci=1, kelinci-spf=2 26 | execution_mode=3 27 | 28 | # server parameter 29 | server_param="HashTable @@" 30 | 31 | ##################################### 32 | 33 | echo "Running experiments for:" 34 | echo "execution_mode=$execution_mode" 35 | echo "time_bound=$time_bound" 36 | echo "number_of_runs=$number_of_runs" 37 | echo "src=$src" 38 | echo "target=$target" 39 | echo "server_param=$server_param" 40 | echo "" 41 | 42 | for i in `seq 1 $number_of_runs` 43 | do 44 | current_target="$target-$i" 45 | echo "Initializing experiment environment for run=$i" 46 | 47 | mkdir "$current_target" 48 | cp -r "$src/kelinci_analysis" "$current_target/" 49 | 50 | cp -r "$src/spf_analysis" "$current_target/" 51 | mkdir "$current_target/tmp" 52 | cp "/vol/home-vol2/se/nollerya/fuzzing/memoise/KelinciSPFRunner.jar" "$current_target" 53 | cp "$src/config-server-berlin" "$current_target" 54 | 55 | cd "$current_target" 56 | echo "Starting SPF.." 57 | export PATH=$PATH:/vol/home-vol2/se/nollerya/fuzzing/z3/build 58 | export LD_LIBRARY_PATH=/vol/home-vol2/se/nollerya/fuzzing/z3/build 59 | screen -S spf -d -m java -Xmx10240m -jar KelinciSPFRunner.jar config-server-berlin 60 | 61 | echo "Waiting for $time_bound seconds.." 62 | sleep $time_bound 63 | 64 | echo "Stopping SPF.." 65 | screen -r spf -X kill 66 | 67 | echo "Finished run=$i" 68 | echo "" 69 | 70 | done 71 | 72 | echo "Done." 73 | -------------------------------------------------------------------------------- /evaluation/01_insertionsort/scripts/run-insertion-spf.sh: -------------------------------------------------------------------------------- 1 | ### Define here local variables ##### 2 | ##################################### 3 | # chmod +x run_experiments.sh 4 | # ./run_experiments.sh 5 | # 6 | # Besure to already build the source files in the directories: 7 | # /kelinci_analysis/bin, /kelinci_analysis/bin-instr, /spf_analysis/bin 8 | # 9 | # and create the folder: 10 | # /kelinci_analysis/fuzzer-out/spf/queue 11 | # 12 | 13 | # time bound for each run (in hours): 14 | time_bound=18000 # = 5 hours 15 | 16 | # number of iterations 17 | number_of_runs=5 18 | 19 | # folder with sources 20 | src=/vol/home-vol2/se/nollerya/fuzzing/memoise/issta-experiments/01-insertionsort 21 | 22 | # folder for runtime 23 | target=/vol/home-vol2/se/nollerya/fuzzing/experiments/01-insertionsort-spf 24 | 25 | # kelinci=1, kelinci-spf=2 26 | execution_mode=3 27 | 28 | # server parameter 29 | server_param="InsertionSort @@" 30 | 31 | ##################################### 32 | 33 | echo "Running experiments for:" 34 | echo "execution_mode=$execution_mode" 35 | echo "time_bound=$time_bound" 36 | echo "number_of_runs=$number_of_runs" 37 | echo "src=$src" 38 | echo "target=$target" 39 | echo "server_param=$server_param" 40 | echo "" 41 | 42 | for i in `seq 1 $number_of_runs` 43 | do 44 | current_target="$target-$i" 45 | echo "Initializing experiment environment for run=$i" 46 | 47 | mkdir "$current_target" 48 | cp -r "$src/kelinci_analysis" "$current_target/" 49 | 50 | cp -r "$src/spf_analysis" "$current_target/" 51 | mkdir "$current_target/tmp" 52 | cp "/vol/home-vol2/se/nollerya/fuzzing/memoise/KelinciSPFRunner.jar" "$current_target" 53 | cp "$src/config-server-berlin" "$current_target" 54 | 55 | cd "$current_target" 56 | echo "Starting SPF.." 57 | export PATH=$PATH:/vol/home-vol2/se/nollerya/fuzzing/z3/build 58 | export LD_LIBRARY_PATH=/vol/home-vol2/se/nollerya/fuzzing/z3/build 59 | screen -S spf -d -m java -Xmx10240m -jar KelinciSPFRunner.jar config-server-berlin 60 | 61 | echo "Waiting for $time_bound seconds.." 62 | sleep $time_bound 63 | 64 | echo "Stopping SPF.." 65 | screen -r spf -X kill 66 | 67 | echo "Finished run=$i" 68 | echo "" 69 | 70 | done 71 | 72 | echo "Done." 73 | -------------------------------------------------------------------------------- /evaluation/02_quicksort/scripts/run-quicksort-spf.sh: -------------------------------------------------------------------------------- 1 | ### Define here local variables ##### 2 | ##################################### 3 | # chmod +x run_experiments.sh 4 | # ./run_experiments.sh 5 | # 6 | # Besure to already build the source files in the directories: 7 | # /kelinci_analysis/bin, /kelinci_analysis/bin-instr, /spf_analysis/bin 8 | # 9 | # and create the folder: 10 | # /kelinci_analysis/fuzzer-out/spf/queue 11 | # 12 | 13 | # time bound for each run (in hours): 14 | time_bound=18000 #18000 = 5 hours 15 | 16 | # number of iterations 17 | number_of_runs=5 #5 18 | 19 | # folder with sources 20 | src=/vol/home-vol2/se/nollerya/fuzzing/memoise/issta-experiments/02-quicksort 21 | 22 | # folder for runtime 23 | target=/vol/home-vol2/se/nollerya/fuzzing/experiments/02-quicksort-spf 24 | 25 | # kelinci=1, kelinci-spf=2 26 | execution_mode=3 27 | 28 | # server parameter 29 | server_param="QuickSortJDK15 @@" 30 | 31 | ##################################### 32 | 33 | echo "Running experiments for:" 34 | echo "execution_mode=$execution_mode" 35 | echo "time_bound=$time_bound" 36 | echo "number_of_runs=$number_of_runs" 37 | echo "src=$src" 38 | echo "target=$target" 39 | echo "server_param=$server_param" 40 | echo "" 41 | 42 | for i in `seq 1 $number_of_runs` 43 | do 44 | current_target="$target-$i" 45 | echo "Initializing experiment environment for run=$i" 46 | 47 | mkdir "$current_target" 48 | cp -r "$src/kelinci_analysis" "$current_target/" 49 | 50 | cp -r "$src/spf_analysis" "$current_target/" 51 | mkdir "$current_target/tmp" 52 | cp "/vol/home-vol2/se/nollerya/fuzzing/memoise/KelinciSPFRunner.jar" "$current_target" 53 | cp "$src/config-server-berlin" "$current_target" 54 | 55 | cd "$current_target" 56 | echo "Starting SPF.." 57 | export PATH=$PATH:/vol/home-vol2/se/nollerya/fuzzing/z3/build 58 | export LD_LIBRARY_PATH=/vol/home-vol2/se/nollerya/fuzzing/z3/build 59 | screen -S spf -d -m java -Xmx10240m -jar KelinciSPFRunner.jar config-server-berlin 60 | 61 | echo "Waiting for $time_bound seconds.." 62 | sleep $time_bound 63 | 64 | echo "Stopping SPF.." 65 | screen -r spf -X kill 66 | 67 | echo "Finished run=$i" 68 | echo "" 69 | 70 | done 71 | 72 | echo "Done." 73 | -------------------------------------------------------------------------------- /evaluation/06_image_processor/spf_analysis/src/com/stac/image/algorithms/filters/Intensify.java: -------------------------------------------------------------------------------- 1 | package com.stac.image.algorithms.filters; 2 | 3 | import com.stac.image.algorithms.*; 4 | import java.awt.image.*; 5 | import com.stac.image.utilities.*; 6 | import com.stac.mathematics.*; 7 | 8 | public class Intensify extends Filter 9 | { 10 | @Override 11 | public void filter(final BufferedImage image) { 12 | for (int i = 0; i < image.getWidth(); ++i) { 13 | for (int j = 0; j < image.getHeight(); ++j) { 14 | final int rgb00 = image.getRGB(this.bound(0, image.getWidth(), i - 1), this.bound(0, image.getHeight(), j - 1)); 15 | final int rgb2 = image.getRGB(this.bound(0, image.getWidth(), i - 1), this.bound(0, image.getHeight(), j)); 16 | final int rgb3 = image.getRGB(this.bound(0, image.getWidth(), i - 1), this.bound(0, image.getHeight(), j + 1)); 17 | final int rgb4 = image.getRGB(i, j); 18 | final int rgb5 = image.getRGB(this.bound(0, image.getWidth(), i + 1), this.bound(0, image.getHeight(), j - 1)); 19 | final int rgb6 = image.getRGB(this.bound(0, image.getWidth(), i + 1), this.bound(0, image.getHeight(), j)); 20 | final int rgb7 = image.getRGB(this.bound(0, image.getWidth(), i + 1), this.bound(0, image.getHeight(), j + 1)); 21 | final int m = Mathematics.intensify(ARGB.rawA(rgb4), ARGB.rawR(rgb00), ARGB.rawG(rgb4), ARGB.rawB(rgb7)); 22 | final int n = Mathematics.intensify(ARGB.rawA(rgb4), ARGB.rawR(rgb2), ARGB.rawG(rgb4), ARGB.rawB(rgb6)); 23 | final int o = Mathematics.intensify(ARGB.rawA(rgb4), ARGB.rawR(rgb3), ARGB.rawG(rgb4), ARGB.rawB(rgb5)); 24 | final long avg = m + m + m + n + n + o + o + o; 25 | // image.setRGB(i, j, (int)avg >> 3 | 0xFF000000); 26 | image.setRGB(i, j, (int)avg); 27 | } 28 | } 29 | } 30 | 31 | private int bound(final int min, final int max, final int i) { 32 | if (i < min) { 33 | return 0; 34 | } 35 | if (i < max) { 36 | return i; 37 | } 38 | return max - 1; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /evaluation/07_smart_contract/scripts/run-governmental-spf.sh: -------------------------------------------------------------------------------- 1 | ### Define here local variables ##### 2 | ##################################### 3 | # chmod +x run_experiments.sh 4 | # ./run_experiments.sh 5 | # 6 | # Besure to already build the source files in the directories: 7 | # /kelinci_analysis/bin, /kelinci_analysis/bin-instr, /spf_analysis/bin 8 | # 9 | # and create the folder: 10 | # /kelinci_analysis/fuzzer-out/spf/queue 11 | # 12 | 13 | # time bound for each run (in hours): 14 | time_bound=100 #3600 #3600 = 1 hour 15 | 16 | # number of iterations 17 | number_of_runs=5 #5 18 | 19 | # folder with sources 20 | src=/vol/home-vol2/se/nollerya/fuzzing/07-GovernMental 21 | 22 | # folder for runtime 23 | target=/vol/home-vol2/se/nollerya/fuzzing/experiments/07-governmental-spf 24 | 25 | # kelinci=1, kelinci-spf=2 26 | execution_mode=3 27 | 28 | # server parameter 29 | server_param="GovernMental @@" 30 | 31 | ##################################### 32 | 33 | echo "Running experiments for:" 34 | echo "execution_mode=$execution_mode" 35 | echo "time_bound=$time_bound" 36 | echo "number_of_runs=$number_of_runs" 37 | echo "src=$src" 38 | echo "target=$target" 39 | echo "server_param=$server_param" 40 | echo "" 41 | 42 | for i in `seq 1 $number_of_runs` 43 | do 44 | current_target="$target-$i" 45 | echo "Initializing experiment environment for run=$i" 46 | 47 | mkdir "$current_target" 48 | cp -r "$src/kelinci_analysis" "$current_target/" 49 | 50 | cp -r "$src/spf_analysis" "$current_target/" 51 | mkdir "$current_target/tmp" 52 | cp "/vol/home-vol2/se/nollerya/fuzzing/badger-source/badger/build/BadgerRunnerJar.jar" "$current_target" 53 | cp "$src/config-server-berlin-spf" "$current_target" 54 | 55 | cd "$current_target" 56 | echo "Starting SPF.." 57 | export PATH=$PATH:/vol/home-vol2/se/nollerya/fuzzing/z3/build 58 | export LD_LIBRARY_PATH=/vol/home-vol2/se/nollerya/fuzzing/z3/build 59 | screen -S spf -d -m java -Xmx10240m -jar BadgerRunnerJar.jar config-server-berlin-spf 60 | 61 | echo "Waiting for $time_bound seconds.." 62 | sleep $time_bound 63 | 64 | echo "Stopping SPF.." 65 | screen -r spf -X kill 66 | 67 | echo "Finished run=$i" 68 | echo "" 69 | 70 | done 71 | 72 | echo "Done." 73 | -------------------------------------------------------------------------------- /evaluation/06_image_processor/spf_analysis/src/com/stac/learning/Vector.java: -------------------------------------------------------------------------------- 1 | package com.stac.learning; 2 | 3 | import java.util.*; 4 | import java.io.*; 5 | 6 | public abstract class Vector 7 | { 8 | final float[] attributes; 9 | 10 | Vector(final int n) { 11 | this.attributes = new float[n]; 12 | } 13 | 14 | public final int size() { 15 | return this.attributes.length; 16 | } 17 | 18 | final float[] getAttributes() { 19 | return this.attributes; 20 | } 21 | 22 | public abstract float compareTo(final Vector p0); 23 | 24 | @Override 25 | public String toString() { 26 | final StringBuilder sb = new StringBuilder(); 27 | sb.append("Vector ["); 28 | int i; 29 | for (i = 0; i < this.attributes.length - 1; ++i) { 30 | sb.append(this.attributes[i]).append(", "); 31 | } 32 | sb.append(this.attributes[i]); 33 | sb.append("]"); 34 | return sb.toString(); 35 | } 36 | 37 | public static class VectorBuilder 38 | { 39 | private int trackedIndex; 40 | private final VectorFactory ctor; 41 | private Vector vector; 42 | 43 | public VectorBuilder(final VectorFactory vectorFactory, final int size) { 44 | this.trackedIndex = 0; 45 | this.ctor = Objects.requireNonNull(vectorFactory, "Vector Supplier must not be null"); 46 | this.vector = this.ctor.get(size); 47 | } 48 | 49 | public VectorBuilder add(final float attr) { 50 | if (attr >= 0.0f && attr <= 1.0f) { 51 | this.vector.attributes[this.trackedIndex++] = attr; 52 | return this; 53 | } 54 | throw new IllegalArgumentException("Attribute 'attr': must be in the range (0,1)"); 55 | } 56 | 57 | public Vector build() throws InvalidObjectException { 58 | if (this.vector == null) { 59 | throw new InvalidObjectException("This vector has been built."); 60 | } 61 | final Vector v = this.vector; 62 | this.vector = null; 63 | return v; 64 | } 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /evaluation/06_image_processor/kelinci_analysis/src/com/stac/learning/Vector.java: -------------------------------------------------------------------------------- 1 | package com.stac.learning; 2 | 3 | import java.util.*; 4 | import java.io.*; 5 | 6 | public abstract class Vector 7 | { 8 | final float[] attributes; 9 | 10 | Vector(final int n) { 11 | this.attributes = new float[n]; 12 | } 13 | 14 | public final int size() { 15 | return this.attributes.length; 16 | } 17 | 18 | final float[] getAttributes() { 19 | return this.attributes; 20 | } 21 | 22 | public abstract float compareTo(final Vector p0); 23 | 24 | @Override 25 | public String toString() { 26 | final StringBuilder sb = new StringBuilder(); 27 | sb.append("Vector ["); 28 | int i; 29 | for (i = 0; i < this.attributes.length - 1; ++i) { 30 | sb.append(this.attributes[i]).append(", "); 31 | } 32 | sb.append(this.attributes[i]); 33 | sb.append("]"); 34 | return sb.toString(); 35 | } 36 | 37 | public static class VectorBuilder 38 | { 39 | private int trackedIndex; 40 | private final VectorFactory ctor; 41 | private Vector vector; 42 | 43 | public VectorBuilder(final VectorFactory vectorFactory, final int size) { 44 | this.trackedIndex = 0; 45 | this.ctor = Objects.requireNonNull(vectorFactory, "Vector Supplier must not be null"); 46 | this.vector = this.ctor.get(size); 47 | } 48 | 49 | public VectorBuilder add(final float attr) { 50 | if (attr >= 0.0f && attr <= 1.0f) { 51 | this.vector.attributes[this.trackedIndex++] = attr; 52 | return this; 53 | } 54 | throw new IllegalArgumentException("Attribute 'attr': must be in the range (0,1)"); 55 | } 56 | 57 | public Vector build() throws InvalidObjectException { 58 | if (this.vector == null) { 59 | throw new InvalidObjectException("This vector has been built."); 60 | } 61 | final Vector v = this.vector; 62 | this.vector = null; 63 | return v; 64 | } 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /evaluation/05_compress/spf_analysis/src/org/apache/commons/compress/archivers/jar/JarArchiveOutputStream.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.commons.compress.archivers.jar; 20 | 21 | import java.io.IOException; 22 | import java.io.OutputStream; 23 | 24 | import org.apache.commons.compress.archivers.ArchiveEntry; 25 | import org.apache.commons.compress.archivers.zip.JarMarker; 26 | import org.apache.commons.compress.archivers.zip.ZipArchiveEntry; 27 | import org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream; 28 | 29 | /** 30 | * Subclass that adds a special extra field to the very first entry 31 | * which allows the created archive to be used as an executable jar on 32 | * Solaris. 33 | * 34 | * @NotThreadSafe 35 | */ 36 | public class JarArchiveOutputStream extends ZipArchiveOutputStream { 37 | 38 | private boolean jarMarkerAdded = false; 39 | 40 | public JarArchiveOutputStream(final OutputStream out) { 41 | super(out); 42 | } 43 | 44 | // @throws ClassCastException if entry is not an instance of ZipArchiveEntry 45 | @Override 46 | public void putArchiveEntry(ArchiveEntry ze) throws IOException { 47 | if (!jarMarkerAdded) { 48 | ((ZipArchiveEntry)ze).addAsFirstExtraField(JarMarker.getInstance()); 49 | jarMarkerAdded = true; 50 | } 51 | super.putArchiveEntry(ze); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /evaluation/05_compress/kelinci_analysis/src/org/apache/commons/compress/archivers/jar/JarArchiveOutputStream.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.commons.compress.archivers.jar; 20 | 21 | import java.io.IOException; 22 | import java.io.OutputStream; 23 | 24 | import org.apache.commons.compress.archivers.ArchiveEntry; 25 | import org.apache.commons.compress.archivers.zip.JarMarker; 26 | import org.apache.commons.compress.archivers.zip.ZipArchiveEntry; 27 | import org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream; 28 | 29 | /** 30 | * Subclass that adds a special extra field to the very first entry 31 | * which allows the created archive to be used as an executable jar on 32 | * Solaris. 33 | * 34 | * @NotThreadSafe 35 | */ 36 | public class JarArchiveOutputStream extends ZipArchiveOutputStream { 37 | 38 | private boolean jarMarkerAdded = false; 39 | 40 | public JarArchiveOutputStream(final OutputStream out) { 41 | super(out); 42 | } 43 | 44 | // @throws ClassCastException if entry is not an instance of ZipArchiveEntry 45 | @Override 46 | public void putArchiveEntry(ArchiveEntry ze) throws IOException { 47 | if (!jarMarkerAdded) { 48 | ((ZipArchiveEntry)ze).addAsFirstExtraField(JarMarker.getInstance()); 49 | jarMarkerAdded = true; 50 | } 51 | super.putArchiveEntry(ze); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /evaluation/05_compress/kelinci_analysis/src/org/apache/commons/compress/compressors/gzip/GzipCompressorOutputStream.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.commons.compress.compressors.gzip; 20 | 21 | import java.io.IOException; 22 | import java.io.OutputStream; 23 | import java.util.zip.GZIPOutputStream; 24 | 25 | import org.apache.commons.compress.compressors.CompressorOutputStream; 26 | 27 | public class GzipCompressorOutputStream extends CompressorOutputStream { 28 | 29 | private final GZIPOutputStream out; 30 | 31 | public GzipCompressorOutputStream( final OutputStream outputStream ) throws IOException { 32 | out = new GZIPOutputStream(outputStream); 33 | } 34 | 35 | /** {@inheritDoc} */ 36 | @Override 37 | public void write(int b) throws IOException { 38 | out.write(b); 39 | } 40 | 41 | /** 42 | * {@inheritDoc} 43 | * 44 | * @since 1.1 45 | */ 46 | @Override 47 | public void write(byte[] b) throws IOException { 48 | out.write(b); 49 | } 50 | 51 | /** 52 | * {@inheritDoc} 53 | * 54 | * @since 1.1 55 | */ 56 | @Override 57 | public void write(byte[] b, int from, int length) throws IOException { 58 | out.write(b, from, length); 59 | } 60 | 61 | @Override 62 | public void close() throws IOException { 63 | out.close(); 64 | } 65 | 66 | } 67 | -------------------------------------------------------------------------------- /evaluation/05_compress/spf_analysis/src/org/apache/commons/compress/compressors/gzip/GzipCompressorOutputStream.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.commons.compress.compressors.gzip; 20 | 21 | import java.io.IOException; 22 | import java.io.OutputStream; 23 | import java.util.zip.GZIPOutputStream; 24 | 25 | import org.apache.commons.compress.compressors.CompressorOutputStream; 26 | 27 | public class GzipCompressorOutputStream extends CompressorOutputStream { 28 | 29 | private final GZIPOutputStream out; 30 | 31 | public GzipCompressorOutputStream( final OutputStream outputStream ) throws IOException { 32 | out = new GZIPOutputStream(outputStream); 33 | } 34 | 35 | /** {@inheritDoc} */ 36 | @Override 37 | public void write(int b) throws IOException { 38 | out.write(b); 39 | } 40 | 41 | /** 42 | * {@inheritDoc} 43 | * 44 | * @since 1.1 45 | */ 46 | @Override 47 | public void write(byte[] b) throws IOException { 48 | out.write(b); 49 | } 50 | 51 | /** 52 | * {@inheritDoc} 53 | * 54 | * @since 1.1 55 | */ 56 | @Override 57 | public void write(byte[] b, int from, int length) throws IOException { 58 | out.write(b, from, length); 59 | } 60 | 61 | @Override 62 | public void close() throws IOException { 63 | out.close(); 64 | } 65 | 66 | } 67 | -------------------------------------------------------------------------------- /evaluation/06_image_processor/scripts/run-imageprocessor-spf.sh: -------------------------------------------------------------------------------- 1 | ### Define here local variables ##### 2 | ##################################### 3 | # chmod +x run_experiments.sh 4 | # ./run_experiments.sh 5 | # 6 | # Besure to already build the source files in the directories: 7 | # /kelinci_analysis/bin, /kelinci_analysis/bin-instr, /spf_analysis/bin 8 | # 9 | # and create the folder: 10 | # /kelinci_analysis/fuzzer-out/spf/queue 11 | # 12 | 13 | # time bound for each run (in hours): 14 | time_bound=120 #18000 #18000 # = 5 hours 15 | 16 | # number of iterations 17 | number_of_runs=1 18 | 19 | # folder with sources 20 | src=/vol/home-vol2/se/nollerya/fuzzing/memoise/engagements/01_engagement1_image_processor 21 | 22 | # folder for runtime 23 | target=/vol/home-vol2/se/nollerya/fuzzing/experiments/06-imageprocessor-fullimage-spf 24 | 25 | # kelinci=1, kelinci-spf=2 26 | execution_mode=3 27 | 28 | # server parameter 29 | server_param="drivers.DriverKelinci @@" 30 | 31 | ##################################### 32 | 33 | echo "Running experiments for:" 34 | echo "execution_mode=$execution_mode" 35 | echo "time_bound=$time_bound" 36 | echo "number_of_runs=$number_of_runs" 37 | echo "src=$src" 38 | echo "target=$target" 39 | echo "server_param=$server_param" 40 | echo "" 41 | 42 | for i in `seq 1 $number_of_runs` 43 | do 44 | current_target="$target-$i" 45 | echo "Initializing experiment environment for run=$i" 46 | 47 | mkdir "$current_target" 48 | cp -r "$src/kelinci_analysis" "$current_target/" 49 | 50 | cp -r "$src/spf_analysis" "$current_target/" 51 | mkdir "$current_target/tmp" 52 | cp "/vol/home-vol2/se/nollerya/fuzzing/memoise/KelinciSPFRunner.jar" "$current_target" 53 | cp "$src/config-server-berlin-spf" "$current_target" 54 | 55 | cd "$current_target" 56 | echo "Starting SPF.." 57 | export PATH=$PATH:/vol/home-vol2/se/nollerya/fuzzing/z3/build 58 | export LD_LIBRARY_PATH=/vol/home-vol2/se/nollerya/fuzzing/z3/build 59 | screen -S spf -d -m java -Xmx10240m -jar KelinciSPFRunner.jar config-server-berlin-spf 60 | 61 | echo "Waiting for $time_bound seconds.." 62 | sleep $time_bound 63 | 64 | echo "Stopping SPF.." 65 | screen -r spf -X kill 66 | 67 | echo "Finished run=$i" 68 | echo "" 69 | 70 | done 71 | 72 | echo "Done." 73 | -------------------------------------------------------------------------------- /evaluation/03_regex/scripts/run-regex-8date-spf.sh: -------------------------------------------------------------------------------- 1 | ### Define here local variables ##### 2 | ##################################### 3 | # chmod +x run_experiments.sh 4 | # ./run_experiments.sh 5 | # 6 | # Besure to already build the source files in the directories: 7 | # /kelinci_analysis/bin, /kelinci_analysis/bin-instr, /spf_analysis/bin 8 | # 9 | # and create the folder: 10 | # /kelinci_analysis/fuzzer-out/spf/queue 11 | # 12 | 13 | # time bound for each run (in hours): 14 | time_bound=18000 #18000 = 5 hours 15 | 16 | # number of iterations 17 | number_of_runs=1 #5 18 | 19 | # folder with sources 20 | src=/vol/home-vol2/se/nollerya/fuzzing/memoise/issta-experiments/03-regex 21 | 22 | # folder for runtime 23 | target=/vol/home-vol2/se/nollerya/fuzzing/experiments/03-regex-8date-spf 24 | 25 | # kelinci=1, kelinci-spf=2 26 | execution_mode=3 27 | 28 | # server parameter 29 | server_param="Regex resources-byte/popular-regexes/8date-byte @@" 30 | 31 | ##################################### 32 | 33 | echo "Running experiments for:" 34 | echo "execution_mode=$execution_mode" 35 | echo "time_bound=$time_bound" 36 | echo "number_of_runs=$number_of_runs" 37 | echo "src=$src" 38 | echo "target=$target" 39 | echo "server_param=$server_param" 40 | echo "" 41 | 42 | sleep 185400 43 | 44 | for i in `seq 1 $number_of_runs` 45 | do 46 | current_target="$target-$i" 47 | echo "Initializing experiment environment for run=$i" 48 | 49 | mkdir "$current_target" 50 | cp -r "$src/kelinci_analysis" "$current_target/" 51 | 52 | cp -r "$src/spf_analysis" "$current_target/" 53 | mkdir "$current_target/tmp" 54 | cp "/vol/home-vol2/se/nollerya/fuzzing/memoise/KelinciSPFRunner.jar" "$current_target" 55 | cp "$src/config-server-berlin-8date-spf" "$current_target" 56 | 57 | cd "$current_target" 58 | echo "Starting SPF.." 59 | export PATH=$PATH:/vol/home-vol2/se/nollerya/fuzzing/z3/build 60 | export LD_LIBRARY_PATH=/vol/home-vol2/se/nollerya/fuzzing/z3/build 61 | screen -S spf -d -m java -Xmx10240m -jar KelinciSPFRunner.jar config-server-berlin-8date-spf 62 | 63 | echo "Waiting for $time_bound seconds.." 64 | sleep $time_bound 65 | 66 | echo "Stopping SPF.." 67 | screen -r spf -X kill 68 | 69 | echo "Finished run=$i" 70 | echo "" 71 | 72 | done 73 | 74 | echo "Done." 75 | -------------------------------------------------------------------------------- /evaluation/03_regex/scripts/run-regex-9html-spf.sh: -------------------------------------------------------------------------------- 1 | ### Define here local variables ##### 2 | ##################################### 3 | # chmod +x run_experiments.sh 4 | # ./run_experiments.sh 5 | # 6 | # Besure to already build the source files in the directories: 7 | # /kelinci_analysis/bin, /kelinci_analysis/bin-instr, /spf_analysis/bin 8 | # 9 | # and create the folder: 10 | # /kelinci_analysis/fuzzer-out/spf/queue 11 | # 12 | 13 | # time bound for each run (in hours): 14 | time_bound=18000 #18000 = 5 hours 15 | 16 | # number of iterations 17 | number_of_runs=1 #5 18 | 19 | # folder with sources 20 | src=/vol/home-vol2/se/nollerya/fuzzing/memoise/issta-experiments/03-regex 21 | 22 | # folder for runtime 23 | target=/vol/home-vol2/se/nollerya/fuzzing/experiments/03-regex-9html-spf 24 | 25 | # kelinci=1, kelinci-spf=2 26 | execution_mode=3 27 | 28 | # server parameter 29 | server_param="Regex resources-byte/popular-regexes/9html-byte @@" 30 | 31 | ##################################### 32 | 33 | echo "Running experiments for:" 34 | echo "execution_mode=$execution_mode" 35 | echo "time_bound=$time_bound" 36 | echo "number_of_runs=$number_of_runs" 37 | echo "src=$src" 38 | echo "target=$target" 39 | echo "server_param=$server_param" 40 | echo "" 41 | 42 | sleep 204300 43 | 44 | for i in `seq 1 $number_of_runs` 45 | do 46 | current_target="$target-$i" 47 | echo "Initializing experiment environment for run=$i" 48 | 49 | mkdir "$current_target" 50 | cp -r "$src/kelinci_analysis" "$current_target/" 51 | 52 | cp -r "$src/spf_analysis" "$current_target/" 53 | mkdir "$current_target/tmp" 54 | cp "/vol/home-vol2/se/nollerya/fuzzing/memoise/KelinciSPFRunner.jar" "$current_target" 55 | cp "$src/config-server-berlin-9html-spf" "$current_target" 56 | 57 | cd "$current_target" 58 | echo "Starting SPF.." 59 | export PATH=$PATH:/vol/home-vol2/se/nollerya/fuzzing/z3/build 60 | export LD_LIBRARY_PATH=/vol/home-vol2/se/nollerya/fuzzing/z3/build 61 | screen -S spf -d -m java -Xmx10240m -jar KelinciSPFRunner.jar config-server-berlin-9html-spf 62 | 63 | echo "Waiting for $time_bound seconds.." 64 | sleep $time_bound 65 | 66 | echo "Stopping SPF.." 67 | screen -r spf -X kill 68 | 69 | echo "Finished run=$i" 70 | echo "" 71 | 72 | done 73 | 74 | echo "Done." 75 | -------------------------------------------------------------------------------- /evaluation/03_regex/scripts/run-regex-4email-spf.sh: -------------------------------------------------------------------------------- 1 | ### Define here local variables ##### 2 | ##################################### 3 | # chmod +x run_experiments.sh 4 | # ./run_experiments.sh 5 | # 6 | # Besure to already build the source files in the directories: 7 | # /kelinci_analysis/bin, /kelinci_analysis/bin-instr, /spf_analysis/bin 8 | # 9 | # and create the folder: 10 | # /kelinci_analysis/fuzzer-out/spf/queue 11 | # 12 | 13 | # time bound for each run (in hours): 14 | time_bound=18000 #18000 = 5 hours 15 | 16 | # number of iterations 17 | number_of_runs=1 #5 18 | 19 | # folder with sources 20 | src=/vol/home-vol2/se/nollerya/fuzzing/memoise/issta-experiments/03-regex 21 | 22 | # folder for runtime 23 | target=/vol/home-vol2/se/nollerya/fuzzing/experiments/03-regex-4email-spf 24 | 25 | # kelinci=1, kelinci-spf=2 26 | execution_mode=3 27 | 28 | # server parameter 29 | server_param="Regex resources-byte/popular-regexes/4email-byte @@" 30 | 31 | ##################################### 32 | 33 | echo "Running experiments for:" 34 | echo "execution_mode=$execution_mode" 35 | echo "time_bound=$time_bound" 36 | echo "number_of_runs=$number_of_runs" 37 | echo "src=$src" 38 | echo "target=$target" 39 | echo "server_param=$server_param" 40 | echo "" 41 | 42 | sleep 90900 43 | 44 | for i in `seq 1 $number_of_runs` 45 | do 46 | current_target="$target-$i" 47 | echo "Initializing experiment environment for run=$i" 48 | 49 | mkdir "$current_target" 50 | cp -r "$src/kelinci_analysis" "$current_target/" 51 | 52 | cp -r "$src/spf_analysis" "$current_target/" 53 | mkdir "$current_target/tmp" 54 | cp "/vol/home-vol2/se/nollerya/fuzzing/memoise/KelinciSPFRunner.jar" "$current_target" 55 | cp "$src/config-server-berlin-4email-spf" "$current_target" 56 | 57 | cd "$current_target" 58 | echo "Starting SPF.." 59 | export PATH=$PATH:/vol/home-vol2/se/nollerya/fuzzing/z3/build 60 | export LD_LIBRARY_PATH=/vol/home-vol2/se/nollerya/fuzzing/z3/build 61 | screen -S spf -d -m java -Xmx10240m -jar KelinciSPFRunner.jar config-server-berlin-4email-spf 62 | 63 | echo "Waiting for $time_bound seconds.." 64 | sleep $time_bound 65 | 66 | echo "Stopping SPF.." 67 | screen -r spf -X kill 68 | 69 | echo "Finished run=$i" 70 | echo "" 71 | 72 | done 73 | 74 | echo "Done." 75 | -------------------------------------------------------------------------------- /evaluation/03_regex/scripts/run-regex-6ipaddress-spf.sh: -------------------------------------------------------------------------------- 1 | ### Define here local variables ##### 2 | ##################################### 3 | # chmod +x run_experiments.sh 4 | # ./run_experiments.sh 5 | # 6 | # Besure to already build the source files in the directories: 7 | # /kelinci_analysis/bin, /kelinci_analysis/bin-instr, /spf_analysis/bin 8 | # 9 | # and create the folder: 10 | # /kelinci_analysis/fuzzer-out/spf/queue 11 | # 12 | 13 | # time bound for each run (in hours): 14 | time_bound=18000 #18000 = 5 hours 15 | 16 | # number of iterations 17 | number_of_runs=1 #5 18 | 19 | # folder with sources 20 | src=/vol/home-vol2/se/nollerya/fuzzing/memoise/issta-experiments/03-regex 21 | 22 | # folder for runtime 23 | target=/vol/home-vol2/se/nollerya/fuzzing/experiments/03-regex-6ipaddress-spf 24 | 25 | # kelinci=1, kelinci-spf=2 26 | execution_mode=3 27 | 28 | # server parameter 29 | server_param="Regex resources-byte/popular-regexes/6ipaddress-byte @@" 30 | 31 | ##################################### 32 | 33 | echo "Running experiments for:" 34 | echo "execution_mode=$execution_mode" 35 | echo "time_bound=$time_bound" 36 | echo "number_of_runs=$number_of_runs" 37 | echo "src=$src" 38 | echo "target=$target" 39 | echo "server_param=$server_param" 40 | echo "" 41 | 42 | sleep 128700 43 | 44 | for i in `seq 1 $number_of_runs` 45 | do 46 | current_target="$target-$i" 47 | echo "Initializing experiment environment for run=$i" 48 | 49 | mkdir "$current_target" 50 | cp -r "$src/kelinci_analysis" "$current_target/" 51 | 52 | cp -r "$src/spf_analysis" "$current_target/" 53 | mkdir "$current_target/tmp" 54 | cp "/vol/home-vol2/se/nollerya/fuzzing/memoise/KelinciSPFRunner.jar" "$current_target" 55 | cp "$src/config-server-berlin-6ip-spf" "$current_target" 56 | 57 | cd "$current_target" 58 | echo "Starting SPF.." 59 | export PATH=$PATH:/vol/home-vol2/se/nollerya/fuzzing/z3/build 60 | export LD_LIBRARY_PATH=/vol/home-vol2/se/nollerya/fuzzing/z3/build 61 | screen -S spf -d -m java -Xmx10240m -jar KelinciSPFRunner.jar config-server-berlin-6ip-spf 62 | 63 | echo "Waiting for $time_bound seconds.." 64 | sleep $time_bound 65 | 66 | echo "Stopping SPF.." 67 | screen -r spf -X kill 68 | 69 | echo "Finished run=$i" 70 | echo "" 71 | 72 | done 73 | 74 | echo "Done." 75 | -------------------------------------------------------------------------------- /evaluation/03_regex/scripts/run-regex-10htmllink-spf.sh: -------------------------------------------------------------------------------- 1 | ### Define here local variables ##### 2 | ##################################### 3 | # chmod +x run_experiments.sh 4 | # ./run_experiments.sh 5 | # 6 | # Besure to already build the source files in the directories: 7 | # /kelinci_analysis/bin, /kelinci_analysis/bin-instr, /spf_analysis/bin 8 | # 9 | # and create the folder: 10 | # /kelinci_analysis/fuzzer-out/spf/queue 11 | # 12 | 13 | # time bound for each run (in hours): 14 | time_bound=18000 #18000 = 5 hours 15 | 16 | # number of iterations 17 | number_of_runs=1 #5 18 | 19 | # folder with sources 20 | src=/vol/home-vol2/se/nollerya/fuzzing/memoise/issta-experiments/03-regex 21 | 22 | # folder for runtime 23 | target=/vol/home-vol2/se/nollerya/fuzzing/experiments/03-regex-10htmllink-spf 24 | 25 | # kelinci=1, kelinci-spf=2 26 | execution_mode=3 27 | 28 | # server parameter 29 | server_param="Regex resources-byte/popular-regexes/10htmllink-byte @@" 30 | 31 | ##################################### 32 | 33 | echo "Running experiments for:" 34 | echo "execution_mode=$execution_mode" 35 | echo "time_bound=$time_bound" 36 | echo "number_of_runs=$number_of_runs" 37 | echo "src=$src" 38 | echo "target=$target" 39 | echo "server_param=$server_param" 40 | echo "" 41 | 42 | sleep 223200 43 | 44 | for i in `seq 1 $number_of_runs` 45 | do 46 | current_target="$target-$i" 47 | echo "Initializing experiment environment for run=$i" 48 | 49 | mkdir "$current_target" 50 | cp -r "$src/kelinci_analysis" "$current_target/" 51 | 52 | cp -r "$src/spf_analysis" "$current_target/" 53 | mkdir "$current_target/tmp" 54 | cp "/vol/home-vol2/se/nollerya/fuzzing/memoise/KelinciSPFRunner.jar" "$current_target" 55 | cp "$src/config-server-berlin-10link-spf" "$current_target" 56 | 57 | cd "$current_target" 58 | echo "Starting SPF.." 59 | export PATH=$PATH:/vol/home-vol2/se/nollerya/fuzzing/z3/build 60 | export LD_LIBRARY_PATH=/vol/home-vol2/se/nollerya/fuzzing/z3/build 61 | screen -S spf -d -m java -Xmx10240m -jar KelinciSPFRunner.jar config-server-berlin-10link-spf 62 | 63 | echo "Waiting for $time_bound seconds.." 64 | sleep $time_bound 65 | 66 | echo "Stopping SPF.." 67 | screen -r spf -X kill 68 | 69 | echo "Finished run=$i" 70 | echo "" 71 | 72 | done 73 | 74 | echo "Done." 75 | -------------------------------------------------------------------------------- /evaluation/03_regex/scripts/run-regex-2password-spf.sh: -------------------------------------------------------------------------------- 1 | ### Define here local variables ##### 2 | ##################################### 3 | # chmod +x run_experiments.sh 4 | # ./run_experiments.sh 5 | # 6 | # Besure to already build the source files in the directories: 7 | # /kelinci_analysis/bin, /kelinci_analysis/bin-instr, /spf_analysis/bin 8 | # 9 | # and create the folder: 10 | # /kelinci_analysis/fuzzer-out/spf/queue 11 | # 12 | 13 | # time bound for each run (in hours): 14 | time_bound=18000 #18000 = 5 hours 15 | 16 | # number of iterations 17 | number_of_runs=1 #5 18 | 19 | # folder with sources 20 | src=/vol/home-vol2/se/nollerya/fuzzing/memoise/issta-experiments/03-regex 21 | 22 | # folder for runtime 23 | target=/vol/home-vol2/se/nollerya/fuzzing/experiments/03-regex-2password-spf 24 | 25 | # kelinci=1, kelinci-spf=2 26 | execution_mode=3 27 | 28 | # server parameter 29 | server_param="Regex resources-byte/popular-regexes/2password-byte @@" 30 | 31 | ##################################### 32 | 33 | echo "Running experiments for:" 34 | echo "execution_mode=$execution_mode" 35 | echo "time_bound=$time_bound" 36 | echo "number_of_runs=$number_of_runs" 37 | echo "src=$src" 38 | echo "target=$target" 39 | echo "server_param=$server_param" 40 | echo "" 41 | 42 | sleep 53100 43 | 44 | for i in `seq 1 $number_of_runs` 45 | do 46 | current_target="$target-$i" 47 | echo "Initializing experiment environment for run=$i" 48 | 49 | mkdir "$current_target" 50 | cp -r "$src/kelinci_analysis" "$current_target/" 51 | 52 | cp -r "$src/spf_analysis" "$current_target/" 53 | mkdir "$current_target/tmp" 54 | cp "/vol/home-vol2/se/nollerya/fuzzing/memoise/KelinciSPFRunner.jar" "$current_target" 55 | cp "$src/config-server-berlin-2password-spf" "$current_target" 56 | 57 | cd "$current_target" 58 | echo "Starting SPF.." 59 | export PATH=$PATH:/vol/home-vol2/se/nollerya/fuzzing/z3/build 60 | export LD_LIBRARY_PATH=/vol/home-vol2/se/nollerya/fuzzing/z3/build 61 | screen -S spf -d -m java -Xmx10240m -jar KelinciSPFRunner.jar config-server-berlin-2password-spf 62 | 63 | echo "Waiting for $time_bound seconds.." 64 | sleep $time_bound 65 | 66 | echo "Stopping SPF.." 67 | screen -r spf -X kill 68 | 69 | echo "Finished run=$i" 70 | echo "" 71 | 72 | done 73 | 74 | echo "Done." 75 | -------------------------------------------------------------------------------- /evaluation/03_regex/scripts/run-regex-3hexcolor-spf.sh: -------------------------------------------------------------------------------- 1 | ### Define here local variables ##### 2 | ##################################### 3 | # chmod +x run_experiments.sh 4 | # ./run_experiments.sh 5 | # 6 | # Besure to already build the source files in the directories: 7 | # /kelinci_analysis/bin, /kelinci_analysis/bin-instr, /spf_analysis/bin 8 | # 9 | # and create the folder: 10 | # /kelinci_analysis/fuzzer-out/spf/queue 11 | # 12 | 13 | # time bound for each run (in hours): 14 | time_bound=18000 #18000 = 5 hours 15 | 16 | # number of iterations 17 | number_of_runs=1 #5 18 | 19 | # folder with sources 20 | src=/vol/home-vol2/se/nollerya/fuzzing/memoise/issta-experiments/03-regex 21 | 22 | # folder for runtime 23 | target=/vol/home-vol2/se/nollerya/fuzzing/experiments/03-regex-3hexcolor-spf 24 | 25 | # kelinci=1, kelinci-spf=2 26 | execution_mode=3 27 | 28 | # server parameter 29 | server_param="Regex resources-byte/popular-regexes/3hexcolor-byte @@" 30 | 31 | ##################################### 32 | 33 | echo "Running experiments for:" 34 | echo "execution_mode=$execution_mode" 35 | echo "time_bound=$time_bound" 36 | echo "number_of_runs=$number_of_runs" 37 | echo "src=$src" 38 | echo "target=$target" 39 | echo "server_param=$server_param" 40 | echo "" 41 | 42 | sleep 72000 43 | 44 | for i in `seq 1 $number_of_runs` 45 | do 46 | current_target="$target-$i" 47 | echo "Initializing experiment environment for run=$i" 48 | 49 | mkdir "$current_target" 50 | cp -r "$src/kelinci_analysis" "$current_target/" 51 | 52 | cp -r "$src/spf_analysis" "$current_target/" 53 | mkdir "$current_target/tmp" 54 | cp "/vol/home-vol2/se/nollerya/fuzzing/memoise/KelinciSPFRunner.jar" "$current_target" 55 | cp "$src/config-server-berlin-3hexcolor-spf" "$current_target" 56 | 57 | cd "$current_target" 58 | echo "Starting SPF.." 59 | export PATH=$PATH:/vol/home-vol2/se/nollerya/fuzzing/z3/build 60 | export LD_LIBRARY_PATH=/vol/home-vol2/se/nollerya/fuzzing/z3/build 61 | screen -S spf -d -m java -Xmx10240m -jar KelinciSPFRunner.jar config-server-berlin-3hexcolor-spf 62 | 63 | echo "Waiting for $time_bound seconds.." 64 | sleep $time_bound 65 | 66 | echo "Stopping SPF.." 67 | screen -r spf -X kill 68 | 69 | echo "Finished run=$i" 70 | echo "" 71 | 72 | done 73 | 74 | echo "Done." 75 | -------------------------------------------------------------------------------- /evaluation/05_compress/kelinci_analysis/src/org/apache/commons/compress/archivers/zip/ZipConstants.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | */ 18 | package org.apache.commons.compress.archivers.zip; 19 | 20 | /** 21 | * Various constants used throughout the package. 22 | * 23 | * @since 1.3 24 | */ 25 | final class ZipConstants { 26 | private ZipConstants() { } 27 | 28 | /** Masks last eight bits */ 29 | static final int BYTE_MASK = 0xFF; 30 | 31 | /** length of a ZipShort in bytes */ 32 | static final int SHORT = 2; 33 | 34 | /** length of a ZipLong in bytes */ 35 | static final int WORD = 4; 36 | 37 | /** length of a ZipEightByteInteger in bytes */ 38 | static final int DWORD = 8; 39 | 40 | /** Initial ZIP specification version */ 41 | static final int INITIAL_VERSION = 10; 42 | 43 | /** ZIP specification version that introduced data descriptor method */ 44 | static final int DATA_DESCRIPTOR_MIN_VERSION = 20; 45 | 46 | /** ZIP specification version that introduced ZIP64 */ 47 | static final int ZIP64_MIN_VERSION = 45; 48 | 49 | /** 50 | * Value stored in two-byte size and similar fields if ZIP64 51 | * extensions are used. 52 | */ 53 | static final int ZIP64_MAGIC_SHORT = 0xFFFF; 54 | 55 | /** 56 | * Value stored in four-byte size and similar fields if ZIP64 57 | * extensions are used. 58 | */ 59 | static final long ZIP64_MAGIC = 0xFFFFFFFFL; 60 | 61 | } 62 | -------------------------------------------------------------------------------- /evaluation/05_compress/spf_analysis/src/org/apache/commons/compress/archivers/zip/ZipConstants.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | */ 18 | package org.apache.commons.compress.archivers.zip; 19 | 20 | /** 21 | * Various constants used throughout the package. 22 | * 23 | * @since 1.3 24 | */ 25 | final class ZipConstants { 26 | private ZipConstants() { } 27 | 28 | /** Masks last eight bits */ 29 | static final int BYTE_MASK = 0xFF; 30 | 31 | /** length of a ZipShort in bytes */ 32 | static final int SHORT = 2; 33 | 34 | /** length of a ZipLong in bytes */ 35 | static final int WORD = 4; 36 | 37 | /** length of a ZipEightByteInteger in bytes */ 38 | static final int DWORD = 8; 39 | 40 | /** Initial ZIP specification version */ 41 | static final int INITIAL_VERSION = 10; 42 | 43 | /** ZIP specification version that introduced data descriptor method */ 44 | static final int DATA_DESCRIPTOR_MIN_VERSION = 20; 45 | 46 | /** ZIP specification version that introduced ZIP64 */ 47 | static final int ZIP64_MIN_VERSION = 45; 48 | 49 | /** 50 | * Value stored in two-byte size and similar fields if ZIP64 51 | * extensions are used. 52 | */ 53 | static final int ZIP64_MAGIC_SHORT = 0xFFFF; 54 | 55 | /** 56 | * Value stored in four-byte size and similar fields if ZIP64 57 | * extensions are used. 58 | */ 59 | static final long ZIP64_MAGIC = 0xFFFFFFFFL; 60 | 61 | } 62 | -------------------------------------------------------------------------------- /evaluation/03_regex/scripts/run-regex-1username-spf.sh: -------------------------------------------------------------------------------- 1 | ### Define here local variables ##### 2 | ##################################### 3 | # chmod +x run_experiments.sh 4 | # ./run_experiments.sh 5 | # 6 | # Besure to already build the source files in the directories: 7 | # /kelinci_analysis/bin, /kelinci_analysis/bin-instr, /spf_analysis/bin 8 | # 9 | # and create the folder: 10 | # /kelinci_analysis/fuzzer-out/spf/queue 11 | # 12 | 13 | # time bound for each run (in hours): 14 | time_bound=18000 #18000 = 5 hours 15 | 16 | # number of iterations 17 | number_of_runs=1 #5 18 | 19 | # folder with sources 20 | src=/vol/home-vol2/se/nollerya/fuzzing/memoise/issta-experiments/03-regex 21 | 22 | # folder for runtime 23 | target=/vol/home-vol2/se/nollerya/fuzzing/experiments/03-regex-1username-spf 24 | 25 | # kelinci=1, kelinci-spf=2 26 | execution_mode=3 27 | 28 | # server parameter 29 | server_param="Regex resources-byte/popular-regexes/1username-byte.txt @@" 30 | 31 | ##################################### 32 | 33 | echo "Running experiments for:" 34 | echo "execution_mode=$execution_mode" 35 | echo "time_bound=$time_bound" 36 | echo "number_of_runs=$number_of_runs" 37 | echo "src=$src" 38 | echo "target=$target" 39 | echo "server_param=$server_param" 40 | echo "" 41 | 42 | sleep 34200 43 | 44 | for i in `seq 1 $number_of_runs` 45 | do 46 | current_target="$target-$i" 47 | echo "Initializing experiment environment for run=$i" 48 | 49 | mkdir "$current_target" 50 | cp -r "$src/kelinci_analysis" "$current_target/" 51 | 52 | cp -r "$src/spf_analysis" "$current_target/" 53 | mkdir "$current_target/tmp" 54 | cp "/vol/home-vol2/se/nollerya/fuzzing/memoise/KelinciSPFRunner.jar" "$current_target" 55 | cp "$src/config-server-berlin-1username-spf" "$current_target" 56 | 57 | cd "$current_target" 58 | echo "Starting SPF.." 59 | export PATH=$PATH:/vol/home-vol2/se/nollerya/fuzzing/z3/build 60 | export LD_LIBRARY_PATH=/vol/home-vol2/se/nollerya/fuzzing/z3/build 61 | screen -S spf -d -m java -Xmx10240m -jar KelinciSPFRunner.jar config-server-berlin-1username-spf 62 | 63 | echo "Waiting for $time_bound seconds.." 64 | sleep $time_bound 65 | 66 | echo "Stopping SPF.." 67 | screen -r spf -X kill 68 | 69 | echo "Finished run=$i" 70 | echo "" 71 | 72 | done 73 | 74 | echo "Done." 75 | -------------------------------------------------------------------------------- /evaluation/03_regex/scripts/run-regex-7atime12hour-spf.sh: -------------------------------------------------------------------------------- 1 | ### Define here local variables ##### 2 | ##################################### 3 | # chmod +x run_experiments.sh 4 | # ./run_experiments.sh 5 | # 6 | # Besure to already build the source files in the directories: 7 | # /kelinci_analysis/bin, /kelinci_analysis/bin-instr, /spf_analysis/bin 8 | # 9 | # and create the folder: 10 | # /kelinci_analysis/fuzzer-out/spf/queue 11 | # 12 | 13 | # time bound for each run (in hours): 14 | time_bound=18000 #18000 = 5 hours 15 | 16 | # number of iterations 17 | number_of_runs=1 #5 18 | 19 | # folder with sources 20 | src=/vol/home-vol2/se/nollerya/fuzzing/memoise/issta-experiments/03-regex 21 | 22 | # folder for runtime 23 | target=/vol/home-vol2/se/nollerya/fuzzing/experiments/03-regex-7atime12hour-spf 24 | 25 | # kelinci=1, kelinci-spf=2 26 | execution_mode=3 27 | 28 | # server parameter 29 | server_param="Regex resources-byte/popular-regexes/7atime12hour-byte @@" 30 | 31 | ##################################### 32 | 33 | echo "Running experiments for:" 34 | echo "execution_mode=$execution_mode" 35 | echo "time_bound=$time_bound" 36 | echo "number_of_runs=$number_of_runs" 37 | echo "src=$src" 38 | echo "target=$target" 39 | echo "server_param=$server_param" 40 | echo "" 41 | 42 | sleep 147600 43 | 44 | for i in `seq 1 $number_of_runs` 45 | do 46 | current_target="$target-$i" 47 | echo "Initializing experiment environment for run=$i" 48 | 49 | mkdir "$current_target" 50 | cp -r "$src/kelinci_analysis" "$current_target/" 51 | 52 | cp -r "$src/spf_analysis" "$current_target/" 53 | mkdir "$current_target/tmp" 54 | cp "/vol/home-vol2/se/nollerya/fuzzing/memoise/KelinciSPFRunner.jar" "$current_target" 55 | cp "$src/config-server-berlin-7time12-spf" "$current_target" 56 | 57 | cd "$current_target" 58 | echo "Starting SPF.." 59 | export PATH=$PATH:/vol/home-vol2/se/nollerya/fuzzing/z3/build 60 | export LD_LIBRARY_PATH=/vol/home-vol2/se/nollerya/fuzzing/z3/build 61 | screen -S spf -d -m java -Xmx10240m -jar KelinciSPFRunner.jar config-server-berlin-7time12-spf 62 | 63 | echo "Waiting for $time_bound seconds.." 64 | sleep $time_bound 65 | 66 | echo "Stopping SPF.." 67 | screen -r spf -X kill 68 | 69 | echo "Finished run=$i" 70 | echo "" 71 | 72 | done 73 | 74 | echo "Done." 75 | -------------------------------------------------------------------------------- /evaluation/03_regex/scripts/run-regex-7btime24hour-spf.sh: -------------------------------------------------------------------------------- 1 | ### Define here local variables ##### 2 | ##################################### 3 | # chmod +x run_experiments.sh 4 | # ./run_experiments.sh 5 | # 6 | # Besure to already build the source files in the directories: 7 | # /kelinci_analysis/bin, /kelinci_analysis/bin-instr, /spf_analysis/bin 8 | # 9 | # and create the folder: 10 | # /kelinci_analysis/fuzzer-out/spf/queue 11 | # 12 | 13 | # time bound for each run (in hours): 14 | time_bound=18000 #18000 = 5 hours 15 | 16 | # number of iterations 17 | number_of_runs=1 #5 18 | 19 | # folder with sources 20 | src=/vol/home-vol2/se/nollerya/fuzzing/memoise/issta-experiments/03-regex 21 | 22 | # folder for runtime 23 | target=/vol/home-vol2/se/nollerya/fuzzing/experiments/03-regex-7btime24hour-spf 24 | 25 | # kelinci=1, kelinci-spf=2 26 | execution_mode=3 27 | 28 | # server parameter 29 | server_param="Regex resources-byte/popular-regexes/7btime24hour-byte @@" 30 | 31 | ##################################### 32 | 33 | echo "Running experiments for:" 34 | echo "execution_mode=$execution_mode" 35 | echo "time_bound=$time_bound" 36 | echo "number_of_runs=$number_of_runs" 37 | echo "src=$src" 38 | echo "target=$target" 39 | echo "server_param=$server_param" 40 | echo "" 41 | 42 | sleep 166500 43 | 44 | for i in `seq 1 $number_of_runs` 45 | do 46 | current_target="$target-$i" 47 | echo "Initializing experiment environment for run=$i" 48 | 49 | mkdir "$current_target" 50 | cp -r "$src/kelinci_analysis" "$current_target/" 51 | 52 | cp -r "$src/spf_analysis" "$current_target/" 53 | mkdir "$current_target/tmp" 54 | cp "/vol/home-vol2/se/nollerya/fuzzing/memoise/KelinciSPFRunner.jar" "$current_target" 55 | cp "$src/config-server-berlin-7time24-spf" "$current_target" 56 | 57 | cd "$current_target" 58 | echo "Starting SPF.." 59 | export PATH=$PATH:/vol/home-vol2/se/nollerya/fuzzing/z3/build 60 | export LD_LIBRARY_PATH=/vol/home-vol2/se/nollerya/fuzzing/z3/build 61 | screen -S spf -d -m java -Xmx10240m -jar KelinciSPFRunner.jar config-server-berlin-7time24-spf 62 | 63 | echo "Waiting for $time_bound seconds.." 64 | sleep $time_bound 65 | 66 | echo "Stopping SPF.." 67 | screen -r spf -X kill 68 | 69 | echo "Finished run=$i" 70 | echo "" 71 | 72 | done 73 | 74 | echo "Done." 75 | -------------------------------------------------------------------------------- /evaluation/06_image_processor/spf_analysis/src/com/stac/image/ImageProcessing.java: -------------------------------------------------------------------------------- 1 | package com.stac.image; 2 | 3 | import java.awt.image.*; 4 | import javax.imageio.*; 5 | import java.util.*; 6 | import java.io.*; 7 | import com.stac.learning.*; 8 | import com.stac.learning.Vector; 9 | 10 | public class ImageProcessing 11 | { 12 | private static final VectorFactory VECTOR_FACTORY; 13 | private final ArrayList ALGORITHMS; 14 | private final BufferedImage image; 15 | 16 | public ImageProcessing(final File imageFile, final String processingChain) throws IOException { 17 | this.ALGORITHMS = new ArrayList(); 18 | this.image = ImageIO.read(imageFile); 19 | final String[] arr$; 20 | final String[] algorithms = arr$ = processingChain.split(",\\s*"); 21 | for (final String algorithm : arr$) { 22 | final ImageAlgorithm ia = ImageAlgorithmStore.getAlgorithm(algorithm); 23 | if (ia == null) { 24 | throw new RuntimeException("Unknown algorithm: " + algorithm); 25 | } 26 | this.ALGORITHMS.add(ia); 27 | } 28 | } 29 | 30 | private int countDetectors() { 31 | int c = 0; 32 | for (final ImageAlgorithm algorithm : this.ALGORITHMS) { 33 | if (algorithm.hasValue()) { 34 | ++c; 35 | } 36 | } 37 | return c; 38 | } 39 | 40 | private Vector featureExtract() throws InvalidObjectException { 41 | final Vector.VectorBuilder vectorBuilder = new Vector.VectorBuilder(ImageProcessing.VECTOR_FACTORY, this.countDetectors()); 42 | for (final ImageAlgorithm imageAlgorithm : this.ALGORITHMS) { 43 | imageAlgorithm.runAlgorithm(this.image); 44 | if (imageAlgorithm.hasValue()) { 45 | vectorBuilder.add(imageAlgorithm.getValue()); 46 | } 47 | } 48 | return vectorBuilder.build(); 49 | } 50 | 51 | public static Vector getAttributeVector(final File imageFile, final String processingChain) throws IOException { 52 | return new ImageProcessing(imageFile, processingChain).featureExtract(); 53 | } 54 | 55 | static { 56 | VECTOR_FACTORY = new EuclideanVectorFactory(); 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /evaluation/03_regex/scripts/run-regex-5imageextension-spf.sh: -------------------------------------------------------------------------------- 1 | ### Define here local variables ##### 2 | ##################################### 3 | # chmod +x run_experiments.sh 4 | # ./run_experiments.sh 5 | # 6 | # Besure to already build the source files in the directories: 7 | # /kelinci_analysis/bin, /kelinci_analysis/bin-instr, /spf_analysis/bin 8 | # 9 | # and create the folder: 10 | # /kelinci_analysis/fuzzer-out/spf/queue 11 | # 12 | 13 | # time bound for each run (in hours): 14 | time_bound=18000 #18000 = 5 hours 15 | 16 | # number of iterations 17 | number_of_runs=1 #5 18 | 19 | # folder with sources 20 | src=/vol/home-vol2/se/nollerya/fuzzing/memoise/issta-experiments/03-regex 21 | 22 | # folder for runtime 23 | target=/vol/home-vol2/se/nollerya/fuzzing/experiments/03-regex-5imageextension-spf 24 | 25 | # kelinci=1, kelinci-spf=2 26 | execution_mode=3 27 | 28 | # server parameter 29 | server_param="Regex resources-byte/popular-regexes/5imageextension-byte @@" 30 | 31 | ##################################### 32 | 33 | echo "Running experiments for:" 34 | echo "execution_mode=$execution_mode" 35 | echo "time_bound=$time_bound" 36 | echo "number_of_runs=$number_of_runs" 37 | echo "src=$src" 38 | echo "target=$target" 39 | echo "server_param=$server_param" 40 | echo "" 41 | 42 | sleep 109800 43 | 44 | for i in `seq 1 $number_of_runs` 45 | do 46 | current_target="$target-$i" 47 | echo "Initializing experiment environment for run=$i" 48 | 49 | mkdir "$current_target" 50 | cp -r "$src/kelinci_analysis" "$current_target/" 51 | 52 | cp -r "$src/spf_analysis" "$current_target/" 53 | mkdir "$current_target/tmp" 54 | cp "/vol/home-vol2/se/nollerya/fuzzing/memoise/KelinciSPFRunner.jar" "$current_target" 55 | cp "$src/config-server-berlin-5image-spf" "$current_target" 56 | 57 | cd "$current_target" 58 | echo "Starting SPF.." 59 | export PATH=$PATH:/vol/home-vol2/se/nollerya/fuzzing/z3/build 60 | export LD_LIBRARY_PATH=/vol/home-vol2/se/nollerya/fuzzing/z3/build 61 | screen -S spf -d -m java -Xmx10240m -jar KelinciSPFRunner.jar config-server-berlin-5image-spf 62 | 63 | echo "Waiting for $time_bound seconds.." 64 | sleep $time_bound 65 | 66 | echo "Stopping SPF.." 67 | screen -r spf -X kill 68 | 69 | echo "Finished run=$i" 70 | echo "" 71 | 72 | done 73 | 74 | echo "Done." 75 | -------------------------------------------------------------------------------- /evaluation/06_image_processor/kelinci_analysis/src/com/stac/image/ImageProcessing.java: -------------------------------------------------------------------------------- 1 | package com.stac.image; 2 | 3 | import java.awt.image.*; 4 | import javax.imageio.*; 5 | import java.util.*; 6 | import java.io.*; 7 | import com.stac.learning.*; 8 | import com.stac.learning.Vector; 9 | 10 | public class ImageProcessing 11 | { 12 | private static final VectorFactory VECTOR_FACTORY; 13 | private final ArrayList ALGORITHMS; 14 | private final BufferedImage image; 15 | 16 | public ImageProcessing(final File imageFile, final String processingChain) throws IOException { 17 | this.ALGORITHMS = new ArrayList(); 18 | this.image = ImageIO.read(imageFile); 19 | final String[] arr$; 20 | final String[] algorithms = arr$ = processingChain.split(",\\s*"); 21 | for (final String algorithm : arr$) { 22 | final ImageAlgorithm ia = ImageAlgorithmStore.getAlgorithm(algorithm); 23 | if (ia == null) { 24 | throw new RuntimeException("Unknown algorithm: " + algorithm); 25 | } 26 | this.ALGORITHMS.add(ia); 27 | } 28 | } 29 | 30 | private int countDetectors() { 31 | int c = 0; 32 | for (final ImageAlgorithm algorithm : this.ALGORITHMS) { 33 | if (algorithm.hasValue()) { 34 | ++c; 35 | } 36 | } 37 | return c; 38 | } 39 | 40 | private Vector featureExtract() throws InvalidObjectException { 41 | final Vector.VectorBuilder vectorBuilder = new Vector.VectorBuilder(ImageProcessing.VECTOR_FACTORY, this.countDetectors()); 42 | for (final ImageAlgorithm imageAlgorithm : this.ALGORITHMS) { 43 | imageAlgorithm.runAlgorithm(this.image); 44 | if (imageAlgorithm.hasValue()) { 45 | vectorBuilder.add(imageAlgorithm.getValue()); 46 | } 47 | } 48 | return vectorBuilder.build(); 49 | } 50 | 51 | public static Vector getAttributeVector(final File imageFile, final String processingChain) throws IOException { 52 | return new ImageProcessing(imageFile, processingChain).featureExtract(); 53 | } 54 | 55 | static { 56 | VECTOR_FACTORY = new EuclideanVectorFactory(); 57 | } 58 | } 59 | --------------------------------------------------------------------------------