Skip to content

Support memoryview type in python binding decoder? #771

@RocketMaDev

Description

@RocketMaDev

When I used lief to slice elf text to decode, iced-x86 told me that only bytes and bytearray are supported. Apparently, for lief, memoryview slice could be more performant and low-level-oriented. Currently, I must use bytes() to convert memoryview object to bytes so that iced can accept it.

Looking into Python docs, it seems that memoryview can be a container of array, not just bytes objects. And the memory can be even not contiguous?

A simple repro:

from iced_x86 import Decoder
Decoder(64, memoryview(b'\xc3'))

It would be nice if iced can support memoryview Decoder.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions