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/"
|
2016-04-01 02:36:01 +00:00
|
|
|
url "http://lcamtuf.coredump.cx/afl/releases/afl-2.10b.tgz"
|
|
|
|
sha256 "8141291646024dcdd2e67c51fb68b4205d34c52e4b5693c88f6ce4a6bf1ebfe3"
|
2014-12-04 21:00:45 +00:00
|
|
|
|
2014-12-06 22:36:01 +00:00
|
|
|
bottle do
|
2016-04-07 16:13:52 +00:00
|
|
|
revision 1
|
|
|
|
sha256 "cac3bcc7e0955afa373a4b3f13b8dced52d463557feac53bf284b57f2bcaa16f" => :el_capitan
|
|
|
|
sha256 "0e5c3298d296ab7ecb684a16ca6718c5d8de5b85cc17914f1db2bac62dff9677" => :yosemite
|
|
|
|
sha256 "b326e3657a81b0d9bb120cf715fd5bd19f96b1ceb5c28b4bf2e18ff9aaf990e7" => :mavericks
|
2014-12-06 22:36:01 +00:00
|
|
|
end
|
|
|
|
|
2014-12-04 21:00:45 +00:00
|
|
|
def install
|
2016-04-07 04:43:33 +00:00
|
|
|
# test_build dies with "Oops, the instrumentation does not seem to be
|
|
|
|
# behaving correctly!" in a nested login shell.
|
|
|
|
# Reported to lcamtuf@coredump.cx 6th Apr 2016.
|
|
|
|
inreplace "Makefile" do |s|
|
|
|
|
s.gsub! "all: test_x86 $(PROGS) afl-as test_build all_done", "all: test_x86 $(PROGS) afl-as all_done"
|
|
|
|
s.gsub! "all_done: test_build", "all_done:"
|
|
|
|
end
|
2014-12-04 21:00:45 +00:00
|
|
|
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
|