You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
overhauls the target/architecture abstraction (3/n) (#1227)
In this episode, we liberate `bap mc` and `bap objdump` from the bonds
of the `Arch.t` representation. We also add the systemz lifter for
demonstration purposes. Of course, the lifter is minimal and far from
being usable, but that serves well its didactic purposes.
The interface of the `bap mc` command is preserved but is extended
with a few more command-line options that provide a great deal of
flexibility. Not only it is now possible to specify the target and
encoding, but it is now possible to pass options directly to the
backend, which is useful for disassembling targets that are not yet
known to BAP. Below is an excerpt from the bap-mc man page
(see bap mc --help)
```
SETTING ARCHITECHTURE
The target architecture is controlled by several groups of options that
can not be used together:
- arch;
- target and encoding;
- triple, backend, cpu, bits, and order.
The arch option provides the least control but is easiest to use. It
relies on the dependency-injection mechanism and lets the target
support packages (plugins that implement support for the given
architecture) do their best to guess the target and encoding that
matches the provided name. Use the common names for the architecture
and it should work. You can use the bits and order options to give more
hints to the target support packages. They default to 32 and little
correspondingly.
The target and encoding provides precise control over the selection of
the target and the encoding that is used to represent machine
instructions. The encoding field can be omitted and will be deduced
from the target. Use bap list targets and bap list encodings to get
the list of supported targets and encodings respectivly.
Finally, the triple, backend, cpu,... group of options provides the
full control over the disassembler backend and bypasses the
dependency-injection mechanism to pass the specified options directly
to the corresponding backends. This enables disassembling of targets
and encodings that are not yet supported by BAP. The meanings of the
options totally depend on the selected backend and they are passed as
is to the corresponding arguments of the Disasm_expert.Basic.create
function. The bits and order defaults to 32 and little corresondingly
and are used to specify the number of bits in the target's addresses
and the order of bytes in the word. This group of options is useful
during the implementation and debugging of new targets and thus is
reserved for experts. Note, when this group is used the semantics of
the instructions will not be provided as it commonly requires the
target specification.
```
0 commit comments