2014-12-04 21:00:45 +00:00
|
|
|
require "formula"
|
|
|
|
|
|
|
|
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-06-15 11:50:10 +00:00
|
|
|
url "http://lcamtuf.coredump.cx/afl/releases/afl-1.83b.tgz"
|
|
|
|
sha256 "5b1083537b549c74250acb43023d4bf0551508afcb07daa90330d40adb4e6efe"
|
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-06-15 15:05:53 +00:00
|
|
|
sha256 "0c1f666cb9b1e564d1f08cd3f0186d410e16e1cf408d23c2ddd374f8cbcfef5f" => :yosemite
|
|
|
|
sha256 "7b3b32a1623059d186e3fa78b72de772501107c53eab62c87d8f5484d9d0a831" => :mavericks
|
|
|
|
sha256 "9d92d7eb9c958bf673fe5d8bd64bcc5ba4b502db9f8654773842b8cdac7b7d4b" => :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
|