IDAPython 9.0
Loading...
Searching...
No Matches
loader_input_t Class Reference
Inheritance diagram for loader_input_t:

Public Member Functions

 __init__ (self, pycapsule=None)
 
 close (self)
 
 open (self, filename, remote=False)
 
 set_linput (self, linput)
 
'linput_t *' get_linput (self)
 
 open_memory (self, ea_t start, int size)
 
 seek (self, int offset, whence=SEEK_SET)
 
 tell (self)
 
 getz (self, int size, int fpos=-1)
 
 gets (self, int len)
 
 read (self, int size=-1)
 
 opened (self)
 
 readbytes (self, int size, bool big_endian)
 
 file2base (self, int pos, ea_t ea1, ea_t ea2, bool patchable)
 
'int64' size (self)
 
'PyObject *' filename (self)
 
 get_byte (self)
 

Static Public Member Functions

'loader_input_t *' from_linput ('linput_t *' linput)
 
'loader_input_t *' from_capsule ('PyObject *' pycapsule)
 
 from_fp (fp)
 

Properties

 thisown
 

Detailed Description

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

Constructor & Destructor Documentation

◆ __init__()

__init__ ( self,
pycapsule = None )

Member Function Documentation

◆ close()

close ( self)
Closes the file

◆ file2base()

file2base ( self,
int pos,
ea_t ea1,
ea_t ea2,
bool patchable )
Load portion of file into the database
This function will include (ea1..ea2) into the addressing space of the
program (make it enabled)

@param li: pointer ot input source
@param pos: position in the file
@param (ea1..ea2): range of destination linear addresses
@param patchable: should the kernel remember correspondance of
          file offsets to linear addresses.
@return: 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()

from_fp ( fp)
static
A static method to construct an instance from a FILE*

@param fp: a FILE pointer
@return: a new instance, or None

◆ from_linput()

'loader_input_t *' from_linput ( 'linput_t *' linput)
static

◆ get_byte()

get_byte ( self)
Reads a single byte from the file. Returns None if EOF or the read byte

◆ get_linput()

'linput_t *' get_linput ( self)

◆ gets()

gets ( self,
int len )
Reads a line from the input file. Returns the read line or None

@param len: the maximum line length
@return: a str, or None

◆ getz()

getz ( self,
int size,
int fpos = -1 )
Returns a zero terminated string at the given position

@param size: maximum size of the string
@param fpos: if != -1 then seek will be performed before reading
@return: The string or None on failure.

◆ open()

open ( self,
filename,
remote = False )
Opens a file (or a remote file)

@param filename: the file name
@param remote: whether the file is local, or remote
@return: Boolean

◆ open_memory()

open_memory ( self,
ea_t start,
int size )
Create a linput for process memory (By internally calling idaapi.create_memory_linput())
This linput will use dbg->read_memory() to read data

@param start: starting address of the input
@param size: size of the memory range to represent as linput
    if unknown, may be passed as 0

◆ opened()

opened ( self)
Checks if the file is opened or not

◆ read()

read ( self,
int size = -1 )
Read up to size bytes (all data if size is negative). Return an empty bytes object on EOF.

@param size: the maximum number of bytes to read
@return a bytes object

◆ readbytes()

readbytes ( self,
int size,
bool big_endian )
Similar to read() but it respect the endianness

@param size: the maximum number of bytes to read
@param big_endian: endianness
@return a str, or None

◆ seek()

seek ( self,
int offset,
whence = SEEK_SET )
Set input source position

@param offset: the seek offset
@param whence: the position to seek from
@return: the new position (not 0 as fseek!)

◆ set_linput()

set_linput ( self,
linput )
Links the current loader_input_t instance to a linput_t instance

@param linput: the linput_t to link to

◆ size()

'int64' size ( self)

◆ tell()

tell ( self)
Returns the current position

Property Documentation

◆ thisown

thisown
static
Initial value:
= property(lambda x: x.this.own(), lambda x, v: x.this.own(v),
doc='The membership flag')

The documentation for this class was generated from the following file: