[][src]Function libipt_sys::pt_image_add_file

pub unsafe extern "C" fn pt_image_add_file(
    image: *mut pt_image,
    filename: *const c_char,
    offset: u64,
    size: u64,
    asid: *const pt_asid,
    vaddr: u64
) -> c_int

Add a new file section to the traced memory image.

Adds @size bytes starting at @offset in @filename. The section is loaded at the virtual address @vaddr in the address space @asid.

The @asid may be NULL or (partially) invalid. In that case only the valid fields are considered when comparing with other address-spaces. Use this when tracing a single process or when adding sections to all processes.

The section is silently truncated to match the size of @filename.

Existing sections that would overlap with the new section will be shrunk or split.

Returns zero on success, a negative error code otherwise.

Returns -pte_invalid if @image or @filename is NULL. Returns -pte_invalid if @offset is too big.