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-11-13 17:00:55 +00:00
|
|
|
url "http://lcamtuf.coredump.cx/afl/releases/afl-1.95b.tgz"
|
|
|
|
sha256 "21ec6bb8c182fd821d25c8b67283f81a632c4f74419c9db5fec0135dd0c9ae2a"
|
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-11-13 18:57:21 +00:00
|
|
|
sha256 "5a3f8c04dbade911468c99df3026869e66c8571d8ed2b332c9864938391e58dd" => :el_capitan
|
|
|
|
sha256 "ee3a8fcdebea7cf5139079df7944066c163a01b836fa7c780b289471355c8446" => :yosemite
|
|
|
|
sha256 "ab8b6a0aadd6dc6d126d11f3990b58b2eeeaa8148c75cbc3ae430af4c554f088" => :mavericks
|
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
|