1
Fork 0
oelf/src/load_commands.rs

27 lines
531 B
Rust
Raw Normal View History

2023-12-11 16:42:42 +01:00
use pyo3::prelude::*;
#[derive(Debug, Clone)]
#[pyclass]
pub struct LoadCommand {
#[pyo3(get)]
offset: usize,
#[pyo3(get)]
command: String,
}
#[pymethods]
impl LoadCommand {
fn __repr__(&self) -> String {
format!("{:?}", self)
}
}
impl From<&goblin::mach::load_command::LoadCommand> for LoadCommand {
fn from(lcmd: &goblin::mach::load_command::LoadCommand) -> Self {
LoadCommand {
offset: lcmd.offset,
command: format!("{:?}", lcmd.command),
}
}
}