Module ida_diskio

You should not use standard C file I/O functions in modules. Use functions from this header, pro.h and fpro.h instead.

This file also declares a call_system() function.

Global Variables

CFG_SUBDIR

CFG_SUBDIR = 'cfg'

CSIDL_APPDATA

CSIDL_APPDATA = 26

CSIDL_LOCAL_APPDATA

CSIDL_LOCAL_APPDATA = 28

CSIDL_PROGRAM_FILES

CSIDL_PROGRAM_FILES = 38

CSIDL_PROGRAM_FILESX86

CSIDL_PROGRAM_FILESX86 = 42

CSIDL_PROGRAM_FILES_COMMON

CSIDL_PROGRAM_FILES_COMMON = 43

IDA_SUBDIR_IDADIR_FIRST

IDA_SUBDIR_IDADIR_FIRST = 2

IDA_SUBDIR_IDP

IDA_SUBDIR_IDP = 1

IDA_SUBDIR_ONLY_EXISTING

IDA_SUBDIR_ONLY_EXISTING = 4

IDC_SUBDIR

IDC_SUBDIR = 'idc'

IDP_SUBDIR

IDP_SUBDIR = 'procs'

IDS_SUBDIR

IDS_SUBDIR = 'ids'

LDR_SUBDIR

LDR_SUBDIR = 'loaders'

LINPUT_GENERIC

LINPUT_GENERIC = 4

LINPUT_LOCAL

LINPUT_LOCAL = 1

LINPUT_NONE

LINPUT_NONE = 0

LINPUT_PROCMEM

LINPUT_PROCMEM = 3

LINPUT_RFILE

LINPUT_RFILE = 2

PLG_SUBDIR

PLG_SUBDIR = 'plugins'

SIG_SUBDIR

SIG_SUBDIR = 'sig'

THM_SUBDIR

THM_SUBDIR = 'themes'

TIL_SUBDIR

TIL_SUBDIR = 'til'

Functions

choose_ioport_device2(_device: qstring *, file: char const *, parse_params: choose_ioport_parser_t) ‑> bool

choose_ioport_device2(_device, file, parse_params) -> bool

_device: qstring *
file: char const *
parse_params: choose_ioport_parser_t *

close_linput(li: linput_t *) ‑> void

close_linput(li) Close loader input.

li: (C++: linput_t *)

create_bytearray_linput(s: qstring const &) ‑> linput_t *

create_bytearray_linput(s) -> linput_t * Trivial memory linput.

s: qstring const &

create_generic_linput(gl: generic_linput_t) ‑> linput_t *

create_generic_linput(gl) -> linput_t * Create a generic linput

gl: (C++: generic_linput_t *) linput description. this object will be destroyed by close_linput()
          using "delete gl;"

create_memory_linput(start: ea_t, size: asize_t) ‑> linput_t *

create_memory_linput(start, size) -> linput_t * Create a linput for process memory. This linput will use read_dbg_memory() to read data.

start: (C++: ea_t) starting address of the input
size: (C++: asize_t) size of the memory area to represent as linput if unknown, may be
            passed as 0

enumerate_files(path: PyObject *, fname: PyObject *, callback: PyObject *) ‑> PyObject *

enumerate_files(path, fname, callback) -> PyObject * Enumerate files in the specified directory while the callback returns 0.

path: directory to enumerate files in
fname: mask of file names to enumerate
callback: a callable object that takes the filename as
                its first argument and it returns 0 to continue
                enumeration or non-zero to stop enumeration.
return:     None in case of script errors
   tuple(code, fname) : If the callback returns non-zero

fopenA(file: char const *) ‑> FILE *

fopenA(file) -> FILE * Open a file for append in text mode, deny none.

file: (C++: const char *) char const *
return: nullptr if failure

fopenM(file: char const *) ‑> FILE *

fopenM(file) -> FILE * Open a file for read/write in binary mode, deny write.

file: (C++: const char *) char const *
return: nullptr if failure

fopenRB(file: char const *) ‑> FILE *

fopenRB(file) -> FILE * Open a file for read in binary mode, deny none.

file: (C++: const char *) char const *
return: nullptr if failure

fopenRT(file: char const *) ‑> FILE *

fopenRT(file) -> FILE * Open a file for read in text mode, deny none.

file: (C++: const char *) char const *
return: nullptr if failure

fopenWB(file: char const *) ‑> FILE *

fopenWB(file) -> FILE * Open a new file for write in binary mode, deny read/write. If a file exists, it will be removed.

file: (C++: const char *) char const *
return: nullptr if failure

fopenWT(file: char const *) ‑> FILE *

fopenWT(file) -> FILE * Open a new file for write in text mode, deny write. If a file exists, it will be removed.

file: (C++: const char *) char const *
return: nullptr if failure

get_ida_subdirs(subdir: char const *, flags: int = 0) ‑> qstrvec_t *

get_ida_subdirs(subdir, flags=0) -> int Get list of directories in which to find a specific IDA resource (see IDA subdirectories). The order of the resulting list is as follows:

  • [$IDAUSR/subdir (0..N entries)]

  • $IDADIR/subdir

subdir: (C++: const char *) name of the resource to list (can be nullptr)
flags: (C++: int) Subdirectory modification flags bits
return: number of directories appended to 'dirs'

get_linput_type(li: linput_t *) ‑> linput_type_t

get_linput_type(li) -> linput_type_t Get linput type.

li: (C++: linput_t *)

get_special_folder(csidl: int) ‑> size_t

get_special_folder(csidl) -> str Get a folder location by CSIDL (see Common CSIDLs). Path should be of at least MAX_PATH size

csidl: (C++: int)

get_user_idadir() ‑> char const *

get_user_idadir() -> char const * Get user ida related directory.

  • if $IDAUSR is defined:

  • the first element in $IDAUSR

  • else

  • default user directory ($HOME/.idapro or %APPDATA%Hex-Rays/IDA Pro)

getsysfile(filename: char const *, subdir: char const *) ‑> char const *

getsysfile(filename, subdir) -> str Search for IDA system file. This function searches for a file in:

  1. each directory specified by IDAUSR%

  2. ida directory [+ subdir] and returns the first match.

filename: (C++: const char *) name of file to search
subdir: (C++: const char *) if specified, the file is looked for in the specified
              subdirectory of the ida directory first (see IDA subdirectories)
return: nullptr if not found, otherwise a pointer to full file name.

idadir(subdir: char const *) ‑> char const *

idadir(subdir) -> char const * Get IDA directory (if subdir==nullptr) or the specified subdirectory (see IDA subdirectories)

subdir: (C++: const char *) char const *

open_linput(file: char const *, remote: bool) ‑> linput_t *

open_linput(file, remote) -> linput_t * Open loader input.

file: (C++: const char *) char const *
remote: (C++: bool)

qlgetz(li: linput_t *, fpos: int64) ‑> size_t

qlgetz(li, fpos) -> str Read a zero-terminated string from the input. If fpos == -1 then no seek will be performed.

li: (C++: linput_t *)
fpos: (C++: int64)

read_ioports2(ports: ioports_t *, device: qstring *, file: char const *, callback: ioports_fallback_t = None) ‑> ssize_t

read_ioports2(ports, device, file, callback=None) -> ssize_t

ports: ioports_t *
device: qstring *
file: char const *
callback: ioports_fallback_t *

Classes

choose_ioport_parser_t()

: Proxy of C++ choose_ioport_parser_t class.

__init__(self) -> choose_ioport_parser_t

 self: PyObject *

Methods

  • parse(self, param: qstring *, line: char const *) ‑> bool parse(self, param, line) -> bool retval true: and fill PARAM with a displayed string retval false: and empty PARAM to skip the current device retval false: and fill PARAM with an error message

    param: (C++: qstring *) line: (C++: const char *) char const *


file_enumerator_t()

: Proxy of C++ file_enumerator_t class.

__init__(self) -> file_enumerator_t

 self: PyObject *

Methods

  • visit_file(self, file: char const *) ‑> int visit_file(self, file) -> int

    file: char const *


generic_linput_t(*args, **kwargs)

: Proxy of C++ generic_linput_t class.

Instance variables

  • blocksize: uint32 blocksize


  • filesize: uint64 filesize


Methods

  • read(self, off: qoff64_t, buffer: void *, nbytes: size_t) ‑> ssize_t read(self, off, buffer, nbytes) -> ssize_t

    off: qoff64_t buffer: void * nbytes: size_t


ioports_fallback_t()

: Proxy of C++ ioports_fallback_t class.

__init__(self) -> ioports_fallback_t

 self: PyObject *

Methods

  • handle(self, ports: ioports_t const &, line: char const *) ‑> bool handle(self, ports, line) -> bool

    ports: ioports_t const & line: char const *


Last updated