Module index

Module ida_fpro

System independent counterparts of FILE* related functions from Clib.
You should not use C standard I/O functions in your modules. The reason: Each module compiled with Borland (and statically linked to Borland's library) will host a copy of the FILE * information.
So, if you open a file in the plugin and pass the handle to the kernel, the kernel will not be able to use it.
If you really need to use the standard functions, define USE_STANDARD_FILE_FUNCTIONS. In this case do not mix them with q... functions.


def qfile_t_from_capsule(*args) ‑> qfile_t *
qfile_t_from_capsule(pycapsule) -> qfile_t
pycapsule: PyObject *
def qfile_t_from_fp(*args) ‑> qfile_t *
qfile_t_from_fp(fp) -> qfile_t
fp: FILE *
def qfile_t_tmpfile(*args) ‑> qfile_t *
qfile_t_tmpfile() -> qfile_t


class qfile_t (*args)
A helper class to work with FILE related functions.
__init__(self, rhs) -> qfile_t
rhs: qfile_t const &
__init__(self, pycapsule=None) -> qfile_t
pycapsule: PyObject *

Static methods

def from_capsule(*args) ‑> qfile_t *
from_capsule(pycapsule) -> qfile_t
pycapsule: PyObject *
def from_fp(*args) ‑> qfile_t *
from_fp(fp) -> qfile_t
fp: FILE *
def tmpfile(*args) ‑> qfile_t *
tmpfile() -> qfile_t
A static method to construct an instance using a temporary file


def close(self, *args) ‑> void
Closes the file
def filename(self, *args) ‑> PyObject *
filename(self) -> PyObject *
def flush(self, *args) ‑> int
flush(self) -> int
def get_byte(self, *args) ‑> PyObject *
get_byte(self) -> PyObject *
Reads a single byte from the file. Returns None if EOF or the read byte
def get_fp(self, *args) ‑> FILE *
get_fp(self) -> FILE *
def gets(self, *args) ‑> PyObject *
gets(self, size) -> PyObject *
Reads a line from the input file. Returns the read line or None
size: int
def open(self, *args) ‑> bool
open(self, filename, mode) -> bool
Opens a file
filename: the file name
mode: The mode string, ala fopen() style
return: Boolean
def opened(self, *args) ‑> bool
opened(self) -> bool
Checks if the file is opened or not
def put_byte(self, *args) ‑> int
put_byte(self, chr) -> int
Writes a single byte to the file
chr: int
def puts(self, *args) ‑> int
puts(self, str) -> int
str: char const *
def read(self, *args) ‑> PyObject *
read(self, size) -> PyObject *
Reads from the file. Returns the buffer or None
size: int
def readbytes(self, *args) ‑> PyObject *
readbytes(self, size, big_endian) -> PyObject *
Similar to read() but it respect the endianness
size: int
big_endian: bool
def seek(self, *args) ‑> int
seek(self, offset, whence=SEEK_SET) -> int
Set input source position
offset: int64
whence: int
return: the new position (not 0 as fseek!)
def size(self, *args) ‑> int64
size(self) -> int64
def tell(self, *args) ‑> int64
tell(self) -> int64
Returns the current position
def write(self, *args) ‑> int
write(self, py_buf) -> int
Writes to the file. Returns 0 or the number of bytes written
py_buf: PyObject *
def writebytes(self, *args) ‑> int
writebytes(self, py_buf, big_endian) -> int
Similar to write() but it respect the endianness
py_buf: PyObject *
big_endian: bool