|
IDAPython 9.0
|
A helper class to work with linput_t related functions. More...
Public Member Functions | |
| __init__ (self, "PyObject *" pycapsule=None) | |
| init(self, pycapsule=None) -> loader_input_t | |
| "void" | close (self) |
| close(self) Closes the file | |
| "bool" | open (self, "char const *" filename, "bool" remote=False) |
| open(self, filename, remote=False) -> bool Opens a file (or a remote file) | |
| "void" | set_linput (self, "linput_t *" linput) |
| set_linput(self, linput) Links the current loader_input_t instance to a linput_t instance | |
| "linput_t *" | get_linput (self) |
| get_linput(self) -> linput_t * | |
| "bool" | open_memory (self, "ea_t" start, "asize_t" size=0) |
| open_memory(self, start, size=0) -> bool Create a linput for process memory (By internally calling idaapi.create_memory_linput()) This linput will use dbg->read_memory() to read data | |
| "int64" | seek (self, *args) |
| seek(self, pos, whence=SEEK_SET) -> int64 Set input source position | |
| "int64" | tell (self) |
| tell(self) -> int64 Returns the current position | |
| "PyObject *" | getz (self, "size_t" sz, "int64" fpos=-1) |
| getz(self, sz, fpos=-1) -> PyObject Returns a zero terminated string at the given position | |
| "PyObject *" | gets (self, "size_t" len) |
| gets(self, len) -> str Reads a line from the input file. | |
| "PyObject *" | read (self, *args) |
| read(self, size=size_t(-1)) -> PyObject Read up to size bytes (all data if size is negative). | |
| "bool" | opened (self) |
| opened(self) -> bool Checks if the file is opened or not | |
| "PyObject *" | readbytes (self, "size_t" size, "bool" big_endian) |
| readbytes(self, size, big_endian) -> PyObject * Similar to read() but it respect the endianness | |
| "int" | file2base (self, "int64" pos, "ea_t" ea1, "ea_t" ea2, "int" patchable) |
| file2base(self, pos, ea1, ea2, patchable) -> int Load portion of file into the database This function will include (ea1..ea2) into the addressing space of the program (make it enabled) | |
| "int64" | size (self) |
| size(self) -> int64 | |
| "PyObject *" | filename (self) |
| filename(self) -> PyObject * | |
| "PyObject *" | get_byte (self) |
| get_byte(self) -> PyObject * Reads a single byte from the file. | |
Static Public Member Functions | |
| "loader_input_t *" | from_linput ("linput_t *" linput) |
| from_linput(linput) -> loader_input_t | |
| "loader_input_t *" | from_capsule ("PyObject *" pycapsule) |
| from_capsule(pycapsule) -> loader_input_t | |
| "loader_input_t *" | from_fp ("FILE *" fp) |
| from_fp(fp) -> loader_input_t A static method to construct an instance from a FILE* | |
Properties | |
| thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") | |
This class is also used by file loaders scripts.
| __init__ | ( | self, | |
| "PyObject *" | pycapsule = None ) |
| pycapsule | PyObject * |
| "void" close | ( | self | ) |
| "int" file2base | ( | self, | |
| "int64" | pos, | ||
| "ea_t" | ea1, | ||
| "ea_t" | ea2, | ||
| "int" | patchable ) |
| pos | position in the file |
| ea1 | ..ea2): range of destination linear addresses |
| ea1 | ..ea2): range of destination linear addresses |
| patchable | should the kernel remember correspondance of file offsets to linear addresses. |
| "PyObject *" filename | ( | self | ) |
|
static |
| pycapsule | PyObject * |
|
static |
| fp | FILE * |
|
static |
| linput | linput_t * |
| "PyObject *" get_byte | ( | self | ) |
Returns None if EOF or the read byte
| "linput_t *" get_linput | ( | self | ) |
| "PyObject *" gets | ( | self, | |
| "size_t" | len ) |
Returns the read line or None
| len | size_t |
| "PyObject *" getz | ( | self, | |
| "size_t" | sz, | ||
| "int64" | fpos = -1 ) |
| sz | maximum size of the string |
| fpos | if != -1 then seek will be performed before reading |
| "bool" open | ( | self, | |
| "char const *" | filename, | ||
| "bool" | remote = False ) |
| filename | char const * |
| remote | bool |
| "bool" open_memory | ( | self, | |
| "ea_t" | start, | ||
| "asize_t" | size = 0 ) |
| start | starting address of the input |
| size | size of the memory range to represent as linput if unknown, may be passed as 0 |
| "bool" opened | ( | self | ) |
| "PyObject *" read | ( | self, | |
| * | args ) |
Return an empty bytes object on EOF.
| size | size_t |
| "PyObject *" readbytes | ( | self, | |
| "size_t" | size, | ||
| "bool" | big_endian ) |
| size | size_t |
| big_endian | bool |
| "int64" seek | ( | self, | |
| * | args ) |
| pos | int64 |
| whence | int |
| "void" set_linput | ( | self, | |
| "linput_t *" | linput ) |
| linput | linput_t * |
| "int64" size | ( | self | ) |
| "int64" tell | ( | self | ) |
|
static |