2014-12-04 21:00:45 +00:00
|
|
|
class AflFuzz < Formula
|
2015-05-19 00:00:59 +00:00
|
|
|
desc "American fuzzy lop: Security-oriented fuzzer"
|
2014-12-04 21:00:45 +00:00
|
|
|
homepage "http://lcamtuf.coredump.cx/afl/"
|
2015-08-01 23:30:09 +00:00
|
|
|
url "http://lcamtuf.coredump.cx/afl/releases/afl-1.85b.tgz"
|
|
|
|
sha256 "feb2bf6008d9f3a5c3e26295a9063168e98a2797e86b97b24ad8faa50fab8456"
|
2014-12-04 21:00:45 +00:00
|
|
|
head "http://lcamtuf.coredump.cx/afl/releases/afl-latest.tgz"
|
|
|
|
|
2014-12-06 22:36:01 +00:00
|
|
|
bottle do
|
2015-07-29 12:49:40 +00:00
|
|
|
sha256 "daf905b47531442caf0e5b9584e0b4d1d7bd2be1a4d6d9af9391d9e0b8deef2e" => :yosemite
|
|
|
|
sha256 "cf5a8517524d36590daf4c2d5faa887721b16a83981479f74746ec664a53daeb" => :mavericks
|
|
|
|
sha256 "ea2a25b1e69bd02d25b6164691bcc903a6bd088f44bf90f9839dd65797074a5f" => :mountain_lion
|
2014-12-06 22:36:01 +00:00
|
|
|
end
|
|
|
|
|
2014-12-04 21:00:45 +00:00
|
|
|
def install
|
|
|
|
system "make", "PREFIX=#{prefix}"
|
|
|
|
system "make", "install", "PREFIX=#{prefix}"
|
|
|
|
end
|
|
|
|
|
|
|
|
test do
|
|
|
|
cpp_file = testpath/"main.cpp"
|
2014-12-07 17:42:13 +00:00
|
|
|
exe_file = testpath/"test"
|
2014-12-04 21:00:45 +00:00
|
|
|
|
2014-12-07 17:42:13 +00:00
|
|
|
cpp_file.write <<-EOS.undent
|
2014-12-04 21:00:45 +00:00
|
|
|
#include <iostream>
|
|
|
|
|
|
|
|
int main() {
|
2014-12-07 17:42:13 +00:00
|
|
|
std::cout << "Hello, world!";
|
2014-12-04 21:00:45 +00:00
|
|
|
}
|
|
|
|
EOS
|
|
|
|
|
2014-12-07 17:42:13 +00:00
|
|
|
system "#{bin}/afl-clang++", "-g", cpp_file, "-o", exe_file
|
|
|
|
output = `#{exe_file}`
|
|
|
|
assert_equal 0, $?.exitstatus
|
|
|
|
assert_equal output, "Hello, world!"
|
2014-12-04 21:00:45 +00:00
|
|
|
end
|
|
|
|
end
|