yaxpeax_core/
lib.rs

1extern crate smallvec;
2extern crate siphasher;
3pub extern crate goblin;
4#[macro_use] extern crate serde_derive;
5extern crate serde;
6extern crate serde_json;
7extern crate termion;
8extern crate petgraph;
9extern crate num_traits;
10extern crate nix;
11extern crate proc_maps;
12extern crate tracing;
13
14extern crate yaxpeax_arch;
15
16extern crate yaxpeax_arm;
17extern crate yaxpeax_x86;
18extern crate yaxpeax_msp430;
19extern crate yaxpeax_pic17;
20extern crate yaxpeax_pic18;
21
22#[macro_use]
23pub mod analyses;
24pub mod arch;
25pub mod data;
26pub mod debug;
27pub mod display;
28pub mod memory;
29pub mod parts;
30pub mod comment;
31pub mod serialize;
32pub mod timing;
33
34use yaxpeax_arch::{Arch, ColorSettings};
35
36use std::hash::Hash;
37use std::collections::HashMap;
38
39pub trait ContextTable<A: Arch + ?Sized, Ctx, CtxUpdate>: ContextRead<A, Ctx> + ContextWrite<A, CtxUpdate> { }
40
41pub trait ContextRead<A: Arch + ?Sized, Ctx> {
42    fn at(&self, address: &<A as Arch>::Address) -> Ctx;
43}
44
45pub trait ContextWrite<A: Arch + ?Sized, CtxUpdate> {
46    fn put(&mut self, address: <A as Arch>::Address, update: CtxUpdate);
47}
48
49// impl <'a, T, A: Arch, Ctx, CtxUpdate> ContextTable<A, Ctx, CtxUpdate> for &'a mut T where &'a mut T: ContextRead<A, Ctx> + ContextWrite<A, CtxUpdate> { }
50
51pub trait SyntaxedRender<A, T, F> {
52    fn render(&self, context: Option<&T>, function_table: &HashMap<A, F>) -> String;
53}
54
55use analyses::static_single_assignment::SSAValues;
56use analyses::static_single_assignment::SSA;
57use data::ValueLocations;
58pub trait SyntaxedSSARender<Architecture: Arch + SSAValues, T, F> where
59    <Architecture as Arch>::Address: Eq + Hash,
60    <Architecture as ValueLocations>::Location: Eq + Hash,
61{
62    fn render_with_ssa_values(
63        &self,
64        address: <Architecture as Arch>::Address,
65        colors: Option<&ColorSettings>,
66        context: Option<&T>,
67        function_table: &HashMap<<Architecture as Arch>::Address, F>,
68        ssa: &SSA<Architecture>) -> String;
69}