Module ida_fpro

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.

Global Variables

QMOVE_CROSS_FS

QMOVE_CROSS_FS = 1

QMOVE_OVERWRITE

QMOVE_OVERWRITE = 2

QMOVE_OVR_RO

QMOVE_OVR_RO = 4

Functions

qfclose(fp: FILE *) ‑> int

qfclose(fp) -> int

fp: FILE *

qfile_t_from_capsule(pycapsule: PyObject *) ‑> qfile_t *

from_capsule(pycapsule) -> qfile_t

pycapsule: PyObject *

qfile_t_from_fp(fp: FILE *) ‑> qfile_t *

from_fp(fp) -> qfile_t

fp: FILE *

qfile_t_tmpfile() ‑> qfile_t *

tmpfile() -> qfile_t A static method to construct an instance using a temporary file

Classes

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

  • from_capsule(pycapsule: PyObject *) ‑> qfile_t * from_capsule(pycapsule) -> qfile_t

    pycapsule: PyObject *


  • from_fp(fp: FILE *) ‑> qfile_t * from_fp(fp) -> qfile_t

    fp: FILE *


  • tmpfile() ‑> qfile_t * tmpfile() -> qfile_t A static method to construct an instance using a temporary file


Methods

  • close(self) ‑> void close(self) Closes the file


  • filename(self) ‑> PyObject * filename(self) -> PyObject *


  • flush(self) ‑> int flush(self) -> int


  • get_byte(self) ‑> PyObject * get_byte(self) -> PyObject * Reads a single byte from the file. Returns None if EOF or the read byte


  • get_fp(self) ‑> FILE * get_fp(self) -> FILE *


  • gets(self, size: int) ‑> PyObject * gets(self, size) -> PyObject * Reads a line from the input file. Returns the read line or None

    size: int


  • open(self, filename: char const *, mode: char const *) ‑> bool open(self, filename, mode) -> bool Opens a file

    filename: the file name mode: The mode string, ala fopen() style return: Boolean


  • opened(self) ‑> bool opened(self) -> bool Checks if the file is opened or not


  • put_byte(self, chr: int) ‑> int put_byte(self, chr) -> int Writes a single byte to the file

    chr: int


  • puts(self, str: char const *) ‑> int puts(self, str) -> int

    str: char const *


  • read(self, size: int) ‑> PyObject * read(self, size) -> PyObject * Reads from the file. Returns the buffer or None

    size: int


  • readbytes(self, size: int, big_endian: bool) ‑> PyObject * readbytes(self, size, big_endian) -> PyObject * Similar to read() but it respect the endianness

    size: int big_endian: bool


  • 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!)


  • size(self) ‑> int64 size(self) -> int64


  • tell(self) ‑> int64 tell(self) -> int64 Returns the current position


  • write(self, py_buf: PyObject *) ‑> int write(self, py_buf) -> int Writes to the file. Returns 0 or the number of bytes written

    py_buf: PyObject *


  • writebytes(self, py_buf: PyObject *, big_endian: bool) ‑> int writebytes(self, py_buf, big_endian) -> int Similar to write() but it respect the endianness

    py_buf: PyObject * big_endian: bool


Last updated