use serde::Serialize;
use super::super::MethodRef;
#[derive(Debug, Clone, PartialEq, Eq, Serialize)]
#[non_exhaustive]
pub enum CallTarget {
Internal {
method: MethodRef,
},
MethodToken {
index: u16,
hash_le: String,
hash_be: String,
method: String,
parameters_count: u16,
has_return_value: bool,
call_flags: u8,
call_flags_description: String,
},
Syscall {
hash: u32,
name: Option<String>,
returns_value: bool,
},
Indirect {
opcode: String,
operand: Option<u16>,
},
UnresolvedInternal {
target: isize,
},
}
#[derive(Debug, Clone, PartialEq, Eq, Serialize)]
pub struct CallEdge {
pub caller: MethodRef,
pub call_offset: usize,
pub opcode: String,
pub target: CallTarget,
}
#[derive(Debug, Clone, Default, Serialize)]
pub struct CallGraph {
pub methods: Vec<MethodRef>,
pub edges: Vec<CallEdge>,
}