pub struct Disasm<'a> {
reader: MemReaderRef<'a>,
label_offsets: Vec<u32>,
user_message_functions: HashMap<u32, UserMessageFunction>,
variables: HashMap<u32, Operand>,
stack: Vec<Operand>,
strs: Vec<PalString>,
}
Available on crate feature
softpal
only.Fields§
§reader: MemReaderRef<'a>
§label_offsets: Vec<u32>
§user_message_functions: HashMap<u32, UserMessageFunction>
§variables: HashMap<u32, Operand>
§stack: Vec<Operand>
§strs: Vec<PalString>
Implementations§
Source§impl<'a> Disasm<'a>
impl<'a> Disasm<'a>
pub fn new(data: &'a [u8], label_offsets: &[u32]) -> Result<Self>
pub fn disassemble<W: Write + ?Sized>( self, writer: Option<&mut W>, ) -> Result<Vec<PalString>>
fn read_instruction(&mut self) -> Result<Instruction>
fn write_instruction_to( &self, instr: &Instruction, writer: &mut dyn Write, ) -> Result<()>
fn find_user_message_functions(&mut self) -> Result<()>
fn handle_mov_instruction(&mut self, instr: Instruction) -> Result<()>
fn handle_push_instruction(&mut self, instr: Instruction) -> Result<()>
fn handle_call_instruction(&mut self, instr: Instruction) -> Result<()>
fn handle_call_instruction_internal(&mut self, instr: Instruction) -> Result<()>
fn handle_syscall_instruction(&mut self, instr: Instruction) -> Result<()>
fn handle_message_instruction(&mut self) -> Result<()>
fn handle_message_instruction_internal(&mut self) -> Result<()>
fn handle_select_choice_instruction(&mut self) -> Result<()>
fn handle_select_choice_instruction_internal(&mut self) -> Result<()>
Auto Trait Implementations§
impl<'a> Freeze for Disasm<'a>
impl<'a> RefUnwindSafe for Disasm<'a>
impl<'a> Send for Disasm<'a>
impl<'a> Sync for Disasm<'a>
impl<'a> Unpin for Disasm<'a>
impl<'a> UnwindSafe for Disasm<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more