A helper class to work with linput_t related functions.
More...
|
| __init__ (self, "PyObject *" pycapsule=None) |
| init(self, pycapsule=None) -> loader_input_t
|
|
"void" | close (self) |
| Closes the file.
|
|
"bool" | open (self, "char const *" filename, "bool" remote=False) |
| Opens a file (or a remote file)
|
|
"void" | set_linput (self, "linput_t *" 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) |
| 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) |
| Set input source position.
|
|
"int64" | tell (self) |
| Returns the current position.
|
|
"PyObject *" | getz (self, "size_t" sz, "int64" fpos=-1) |
| Returns a zero terminated string at the given position.
|
|
"PyObject *" | gets (self, "size_t" len) |
| Reads a line from the input file.
|
|
"PyObject *" | read (self, *args) |
| Read up to size bytes (all data if size is negative).
|
|
"bool" | opened (self) |
| Checks if the file is opened or not.
|
|
"PyObject *" | readbytes (self, "size_t" size, "bool" big_endian) |
| Similar to read() but it respect the endianness.
|
|
"int" | file2base (self, "int64" pos, "ea_t" ea1, "ea_t" ea2, "int" patchable) |
| 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) |
| Reads a single byte from the file.
|
|
|
| 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__()
__init__ |
( |
| self, |
|
|
"PyObject *" | pycapsule = None ) |
◆ close()
◆ file2base()
"int" file2base |
( |
| self, |
|
|
"int64" | pos, |
|
|
"ea_t" | ea1, |
|
|
"ea_t" | ea2, |
|
|
"int" | patchable ) |
- Parameters
-
li | pointer ot input source |
pos | position in the file |
ea1 | ..ea2): range of destination linear addresses |
patchable | should the kernel remember correspondance of file offsets to linear addresses. |
- Returns
- : 1-ok,0-read error, a warning is displayed
◆ filename()
"PyObject *" filename |
( |
| self | ) |
|
◆ from_capsule()
"loader_input_t *" from_capsule |
( |
"PyObject *" | pycapsule | ) |
|
|
static |
◆ from_fp()
"loader_input_t *" from_fp |
( |
"FILE *" | fp | ) |
|
|
static |
- Parameters
-
- Returns
- : a new instance, or None
◆ from_linput()
"loader_input_t *" from_linput |
( |
"linput_t *" | linput | ) |
|
|
static |
◆ get_byte()
"PyObject *" get_byte |
( |
| self | ) |
|
Returns None if EOF or the read byte
◆ get_linput()
"linput_t *" get_linput |
( |
| self | ) |
|
◆ gets()
"PyObject *" gets |
( |
| self, |
|
|
"size_t" | len ) |
Returns the read line or None
- Parameters
-
len | the maximum line length |
- Returns
- : a str, or None
◆ getz()
"PyObject *" getz |
( |
| self, |
|
|
"size_t" | sz, |
|
|
"int64" | fpos = -1 ) |
- Parameters
-
sz | maximum size of the string |
fpos | if != -1 then seek will be performed before reading |
- Returns
- : The string or None on failure.
◆ open()
"bool" open |
( |
| self, |
|
|
"char const *" | filename, |
|
|
"bool" | remote = False ) |
- Parameters
-
filename | the file name |
remote | whether the file is local, or remote |
- Returns
- : Boolean
◆ open_memory()
"bool" open_memory |
( |
| self, |
|
|
"ea_t" | start, |
|
|
"asize_t" | size = 0 ) |
- Parameters
-
start | starting address of the input |
size | size of the memory range to represent as linput if unknown, may be passed as 0 |
◆ opened()
◆ read()
"PyObject *" read |
( |
| self, |
|
|
* | args ) |
Return an empty bytes object on EOF.
- Parameters
-
size | the maximum number of bytes to read |
- Returns
- : a bytes object
◆ readbytes()
"PyObject *" readbytes |
( |
| self, |
|
|
"size_t" | size, |
|
|
"bool" | big_endian ) |
- Parameters
-
size | the maximum number of bytes to read |
big_endian | endianness |
- Returns
- : a str, or None
◆ seek()
"int64" seek |
( |
| self, |
|
|
* | args ) |
- Parameters
-
offset | the seek offset |
whence | the position to seek from |
- Returns
- : the new position (not 0 as fseek!)
◆ set_linput()
"void" set_linput |
( |
| self, |
|
|
"linput_t *" | linput ) |
- Parameters
-
linput | the linput_t to link to |
◆ size()
◆ tell()
◆ thisown
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") |
|
static |
The documentation for this class was generated from the following file: