Skip to main content

thumb_nop_buffer

Function thumb_nop_buffer 

Source
pub fn thumb_nop_buffer(len: usize) -> Result<Vec<u8>>
Expand description

Fill len bytes with the Thumb 16-bit NOP hint.

len must be a multiple of THUMB_HALFWORD_BYTES so the resulting buffer ends on an instruction boundary. Used by the patcher to NOP-out Thumb conditional branches whose original footprint is 2 or 4 bytes (a single Thumb half-word or a Thumb-2 32-bit branch).

ยงErrors

Returns Error::Parse if len is not a multiple of 2.