insert_command

Function insert_command 

Source
pub fn insert_command(
    buffer: &mut Vec<u8>,
    header: &mut HeaderContainer,
    offset: usize,
    new_cmd_size: u32,
    load_data: Vec<u8>,
) -> Result<(), MachoError>
Expand description

Insert a new load command at the given offset.

ยงArguments

  • buffer - Mutable byte buffer representing the Mach-O file.
  • header - Header of the macho. It will be updated after removing the load command.
  • offset - Offset to insert the new load command.
  • new_cmd_size - Size of the new command.
  • load_command - Load Command raw data to insert.