Module Bap_wp.Symbol

This module exports utility functions for working with the objdump command. It currently uses objdump to get the names of symbols in the .data and .bss sections of a binary and their addresses.

module Constr = Constraint
exception ExecutionError of string
exception NonzeroExit of string
type t

symbol is a mapping of a name to its starting address.

val get_symbols : string -> t list

get_symbols filename creates a map of the names of symbols in the .data and .bss sections of a binary mapped to their addresses.

val offset_constraint : orig:t list -> modif:t list -> Z3.context -> Constr.z3_expr -> Constr.z3_expr

Given a list of symbols from the original and modified binaries, returns a function that maps the address of a memory read in the original binary to the address of the read in the modified binary.

val rewrite_addresses : orig:t list -> modif:t list -> Bap.Std.Sub.t -> Bap.Std.Sub.t

Rewrites the addresses in the modified subroutine to the corresponding addresses in the original subroutine given they point to the same symbols.