Skip to content

Commit

Permalink
updates bindings to the latest changes in core_kernel
Browse files Browse the repository at this point in the history
  • Loading branch information
ivg committed Nov 25, 2020
1 parent 1a30dd3 commit 3193cb3
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 10 deletions.
2 changes: 2 additions & 0 deletions bap/lib/.merlin
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
PKG bap
PKG ctypes
23 changes: 13 additions & 10 deletions bap/lib/bindings.ml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ open Graphlib.Std
open Bap_plugins.Std
open Format
module C = Ctypes
open Polymorphic_compare
open Poly

include Self()

Expand Down Expand Up @@ -444,7 +444,7 @@ struct
type t = elt seq
include (struct
include Seq
let mem = mem ~equal
let mem = Seq.mem ~equal:Poly.equal
end : Container.S1 with type 'a t := 'a seq)
end in
let name = Opaque.name elt in
Expand Down Expand Up @@ -1460,8 +1460,8 @@ struct

def "create" C.(string @-> string_opt @-> returning !?t)
(fun path backend ->
let backend = Option.value ~default:"llvm" backend in
lift_result (Image.create ~backend path));
let backend = Option.value ~default:"llvm" backend in
lift_result (Image.create ~backend path));

def "of_data"
C.(ptr char @-> int @-> string_opt @-> returning !?t )
Expand Down Expand Up @@ -1756,6 +1756,7 @@ struct
end

module Rooter = struct
[@@@warning "-D"]
let t : rooter opaque = Opaque.newtype "rooter"
let def fn = def ("rooter_" ^ fn);;
Source.factory (module Rooter.Factory) Source.rooter "rooter";
Expand All @@ -1765,11 +1766,13 @@ struct
end

module Brancher = struct
[@@@warning "-D"]
let t : brancher opaque = Opaque.newtype "brancher";;
Source.factory (module Brancher.Factory) Source.brancher "brancher"
end

module Symbolizer = struct
[@@@warning "-D"]
let t : symbolizer opaque = Opaque.newtype "symbolizer";;
Source.factory (module Symbolizer.Factory) Source.symbolizer "symbolizer"
end
Expand Down Expand Up @@ -2509,8 +2512,8 @@ struct

def "file" C.(string @-> string_opt @-> returning !!t)
(fun filename loader ->
let loader = Option.value ~default:"llvm" loader in
Project.Input.file ~loader ~filename);
let loader = Option.value ~default:"llvm" loader in
Project.Input.file ~loader ~filename);
def "binary"
C.(string @-> Arch.total @-> !?Word.t @-> returning !!t)
(fun filename arch base ->
Expand Down Expand Up @@ -2784,10 +2787,10 @@ struct
let check = function
| Ok () -> 0
| Error e ->
let _ =
Error.lift @@
Error.failf "%a" Bap_main.Extension.Error.pp e in
-1 in
let _ =
Error.lift @@
Error.failf "%a" Bap_main.Extension.Error.pp e in
-1 in
if C.is_null params then Bap_main.init () |> check
else
let features = listo features in
Expand Down

0 comments on commit 3193cb3

Please sign in to comment.