2018-10-23 19:21:57 +02:00
|
|
|
(** dwarfsynth
|
|
|
|
*
|
|
|
|
* Entry point for the BAP plugin `dwarfsynth`, defining the command line
|
|
|
|
* interface
|
|
|
|
**)
|
|
|
|
|
|
|
|
module Self = struct
|
|
|
|
include Bap.Std.Self()
|
|
|
|
end
|
|
|
|
|
|
|
|
let main = DwarfSynth.Main.main
|
|
|
|
|
|
|
|
module Cmdline = struct
|
|
|
|
module Cnf = Self.Config
|
|
|
|
|
|
|
|
let outfile = Cnf.(
|
2019-03-18 14:20:53 +01:00
|
|
|
param (string) "output"
|
|
|
|
~doc:("The file in which the output marshalled data will be written. "
|
|
|
|
^ "Output goes to ./tmp.marshal by default.")
|
|
|
|
~default:"tmp.marshal"
|
2018-10-23 19:21:57 +02:00
|
|
|
)
|
|
|
|
|
2019-04-04 11:52:47 +02:00
|
|
|
let no_rbp_undef = Cnf.(
|
|
|
|
param (bool) "no-rbp-undef"
|
|
|
|
~doc:("Do not unset %rbp after it has been set once in a FDE. "
|
|
|
|
^"This mimics gcc eh_frame for ease of validation.")
|
|
|
|
~as_flag:true
|
|
|
|
~default:false
|
|
|
|
)
|
|
|
|
|
2018-10-23 19:21:57 +02:00
|
|
|
let () = Cnf.(
|
|
|
|
when_ready ((fun {get=(!!)} ->
|
2019-04-04 11:52:47 +02:00
|
|
|
Bap.Std.Project.register_pass' (main
|
|
|
|
~no_rbp_undef:!!no_rbp_undef
|
|
|
|
!!outfile )))
|
2018-10-23 19:21:57 +02:00
|
|
|
)
|
|
|
|
end
|