open Core_kernel open Bap.Std open Bap_core_theory open Bap_main open Bap_primus.Std open KB.Syntax let show name = Toplevel.exec @@ begin Primus.Lisp.Unit.create Theory.Target.unknown >>= fun unit -> KB.Object.scoped Theory.Program.cls @@ fun obj -> KB.sequence [ KB.provide Theory.Label.unit obj (Some unit); KB.provide Theory.Label.name obj (Some name); ] >>= fun () -> KB.collect Theory.Semantics.slot obj >>| fun sema -> Format.eprintf "%s:@ %a@." name Bil.pp (Insn.bil sema) end let () = let open Extension in let names = Command.arguments Type.string in Extension.Command.(declare "lisp-demo" (args $ names)) @@ fun names _ctxt -> List.iter ~f:show names; Ok ()