Skip to content

Instantly share code, notes, and snippets.

@jtpaasch
Created August 27, 2020 21:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jtpaasch/67b189128b77db13002dd003616fbdad to your computer and use it in GitHub Desktop.
Save jtpaasch/67b189128b77db13002dd003616fbdad to your computer and use it in GitHub Desktop.
Custom BAP loader
module Loader = struct
let empty_with_program filename prog =
let arch = `unknown and code = Memmap.empty and data = Memmap.empty in
Project.Input.create arch filename ~code ~data
~finish:(fun proj -> Project.with_program proj prog)
let load filename =
let prog = Program.create () in (* empty prog for now *)
empty_with_program filename prog
end
let () = Project.Input.register_loader "my-loader" Loader.load
(* Compile with [bapbuild my_bap_loader.plugin && bapbundle install my_bap_loader.plugin] *)
(* Clean with [bapbundle remove my_bap_loader.plugin && bapbuild clean my_bap_loader.plugin] *)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment