From 47cebe349ca02adadb4ba6d3eb1aca0a75aa3129 Mon Sep 17 00:00:00 2001
From: Quentin Carbonneaux <quentin.carbonneaux@yale.edu>
Date: Fri, 18 Mar 2016 22:06:41 -0400
Subject: [PATCH] start work on an abi fuzzer

---
 lisc/tools/abi.ml | 30 ++++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)
 create mode 100644 lisc/tools/abi.ml

diff --git a/lisc/tools/abi.ml b/lisc/tools/abi.ml
new file mode 100644
index 0000000..0427454
--- /dev/null
+++ b/lisc/tools/abi.ml
@@ -0,0 +1,30 @@
+(* fuzzer *)
+
+module R = Random
+
+let maxargs = 10
+let maxmems = 16
+
+type _ basety =
+  | Char: int basety
+  | Short: int basety
+  | Int: int basety
+  | Long: int basety
+  | Float: float basety
+  | Double: float basety
+
+type _ structy =
+  | Field: 'a basety * 'b structy -> ('a * 'b) structy
+  | Empty: unit structy
+
+type _ abity =
+  | Base: 'a basety -> 'a abity
+  | Struct: 'a structy -> 'a abity
+
+let _ =
+  let f = open_in "/dev/urandom" in
+  let s = Char.code (input_char f) in
+  let s = Char.code (input_char f) + (s lsl 8) in
+  R.init s;
+  Printf.printf "Seed: %d\n" s;
+  ()