Module ida_idaapi :: Class loader_input_t
[frames] | no frames]

Class loader_input_t

object --+
         |
        loader_input_t

Proxy of C++ loader_input_t class

A helper class to work with linput_t related functions. This class is also used by file loaders scripts.

Instance Methods
 
__repr__(self)
repr(x)
loader_input_t
__init__(self, pycobject=None)
Closes the file
 
close(self)
 
__swig_destroy__(self)
 
__del__(self)
bool
open(self, filename, remote=False)
Opens a file (or a remote file)
 
set_linput(self, linput)
Links the current loader_input_t instance to a linput_t instance
linput_t *
get_linput(self)
bool
open_memory(self, start, 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, pos, whence=SEEK_SET)
Set input source position
int64
tell(self)
Returns the current position
PyObject *
getz(self, sz, fpos=-1)
Returns a zero terminated string at the given position
PyObject *
gets(self, len)
Reads a line from the input file.
PyObject *
read(self, size)
Reads from the file.
bool
opened(self)
Checks if the file is opened or not
PyObject *
readbytes(self, size, big_endian)
Similar to read() but it respect the endianness
int
file2base(self, pos, ea1, ea2, 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)
PyObject *
filename(self)
PyObject *
get_char(self)
Reads a single character from the file.

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__, __sizeof__, __str__, __subclasshook__

Static Methods
loader_input_t
from_linput(linput)
loader_input_t
from_cobject(pycobject)
loader_input_t
from_fp(fp)
A static method to construct an instance from a FILE*
Properties
  thisown
The membership flag
  __idc_cvt_id__
loader_input_t___idc_cvt_id___get(self) -> int

Inherited from object: __class__

Method Details

__repr__(self)
(Representation operator)

 

repr(x)

Overrides: object.__repr__
(inherited documentation)

__init__(self, pycobject=None)
(Constructor)

 

Closes the file

Returns: loader_input_t
Overrides: object.__init__

open(self, filename, remote=False)

 

Opens a file (or a remote file)

Returns: bool
Boolean

open_memory(self, start, 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

Parameters:
  • start - starting address of the input
  • size - size of the memory range to represent as linput if unknown, may be passed as 0
Returns: bool

seek(self, pos, whence=SEEK_SET)

 

Set input source position

Returns: int64
the new position (not 0 as fseek!)

getz(self, sz, fpos=-1)

 

Returns a zero terminated string at the given position

Parameters:
  • sz - maximum size of the string
  • fpos - if != -1 then seek will be performed before reading
Returns: PyObject *
The string or None on failure.

gets(self, len)

 

Reads a line from the input file. Returns the read line or None

Returns: PyObject *

read(self, size)

 

Reads from the file. Returns the buffer or None

Returns: PyObject *

file2base(self, pos, ea1, ea2, patchable)

 

Load portion of file into the database This function will include (ea1..ea2) into the addressing space of the program (make it enabled)

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: int
1-ok,0-read error, a warning is displayed

get_char(self)

 

Reads a single character from the file. Returns None if EOF or the read character

Returns: PyObject *

Property Details

thisown

The membership flag

Get Method:
unreachable(x)
Set Method:
unreachable(x, v)

__idc_cvt_id__

loader_input_t___idc_cvt_id___get(self) -> int

Get Method:
unreachable.loader_input_t___idc_cvt_id___get(self)
Set Method:
unreachable.loader_input_t___idc_cvt_id___set(self, __idc_cvt_id__)