Module ida_diskio
File I/O functions for IDA.
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
var CFG_SUBDIR
-
CFG_SUBDIR = 'cfg'
var CSIDL_APPDATA
-
CSIDL_APPDATA = 26
var CSIDL_LOCAL_APPDATA
-
CSIDL_LOCAL_APPDATA = 28
var CSIDL_PROGRAM_FILES
-
CSIDL_PROGRAM_FILES = 38
var CSIDL_PROGRAM_FILESX86
-
CSIDL_PROGRAM_FILESX86 = 42
var CSIDL_PROGRAM_FILES_COMMON
-
CSIDL_PROGRAM_FILES_COMMON = 43
var IDA_SUBDIR_IDADIR_FIRST
-
$IDADIR/subdir will be first, not last
var IDA_SUBDIR_IDP
-
append the processor name as a subdirectory
var IDA_SUBDIR_ONLY_EXISTING
-
only existing directories will be present
var IDC_SUBDIR
-
IDC_SUBDIR = 'idc'
var IDP_SUBDIR
-
IDP_SUBDIR = 'procs'
var IDS_SUBDIR
-
IDS_SUBDIR = 'ids'
var LDR_SUBDIR
-
LDR_SUBDIR = 'loaders'
var LINPUT_GENERIC
-
generic linput
var LINPUT_LOCAL
-
local file
var LINPUT_NONE
-
invalid linput
var LINPUT_PROCMEM
-
debugged process memory (read_dbg_memory())
var LINPUT_RFILE
-
remote file ( debugger_t::open_file, debugger_t::read_file)
var PLG_SUBDIR
-
PLG_SUBDIR = 'plugins'
var SIG_SUBDIR
-
SIG_SUBDIR = 'sig'
var THM_SUBDIR
-
THM_SUBDIR = 'themes'
var TIL_SUBDIR
-
TIL_SUBDIR = 'til'
Functions
def choose_ioport_device2(*args) ‑> bool
-
choose_ioport_device2(_device, file, parse_params) -> bool_device: qstring *file: char const *parse_params: choose_ioport_parser_t *
def close_linput(*args) ‑> void
-
close_linput(li)Close loader input.li: (C++: linput_t *)
def create_bytearray_linput(*args) ‑> linput_t *
-
create_bytearray_linput(s) -> linput_t *Trivial memory linput.s: qstring const &
def create_generic_linput(*args) ‑> linput_t *
-
create_generic_linput(gl) -> linput_t *Create a generic linputgl: (C++: generic_linput_t *) linput description. this object will be destroyed by close_linput()using "delete gl;"
def create_memory_linput(*args) ‑> 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 inputsize: (C++: asize_t) size of the memory area to represent as linput if unknown, may bepassed as 0
def eclose(*args) ‑> void
-
eclose(fp)fp: FILE *
def enumerate_files(*args) ‑> PyObject *
-
enumerate_files(path, fname, callback) -> PyObject *Enumerate files in the specified directory while the callback returns 0.path: directory to enumerate files infname: mask of file names to enumeratecallback: a callable object that takes the filename asits first argument and it returns 0 to continue enumeration or non-zero to stop enumeration.return: None in case of script errorstuple(code, fname) : If the callback returns non-zero
def enumerate_files2(*args) ‑> int
-
enumerate_files2(answer, answer_size, path, fname, fv) -> intanswer: char *answer_size: size_tpath: char const *fname: char const *fv: file_enumerator_t &
def fopenA(*args) ‑> FILE *
-
fopenA(file) -> FILE *Open a file for append in text mode, deny none.file: (C++: const char *) char const *return: nullptr if failure
def fopenM(*args) ‑> 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
def fopenRB(*args) ‑> FILE *
-
fopenRB(file) -> FILE *Open a file for read in binary mode, deny none.file: (C++: const char *) char const *return: nullptr if failure
def fopenRT(*args) ‑> FILE *
-
fopenRT(file) -> FILE *Open a file for read in text mode, deny none.file: (C++: const char *) char const *return: nullptr if failure
def fopenWB(*args) ‑> 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
def fopenWT(*args) ‑> 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
def get_ida_subdirs(*args) ‑> qstrvec_t *
-
get_ida_subdirs(subdir, flags=0) -> intGet 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 listflags: (C++: int) Subdirectory modification flags bitsreturn: number of directories appended to 'dirs' def get_linput_type(*args) ‑> linput_type_t
-
get_linput_type(li) -> linput_type_tGet linput type.li: (C++: linput_t *)
def get_special_folder(*args) ‑> size_t
-
get_special_folder(csidl) -> strGet a folder location by CSIDL (see Common CSIDLs). Path should be of at least MAX_PATH sizecsidl: (C++: int)
def get_user_idadir(*args) ‑> 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)
def getsysfile(*args) ‑> char const *
-
getsysfile(filename, subdir) -> strSearch 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 searchsubdir: (C++: const char *) if specified, the file is looked for in the specifiedsubdirectory of the ida directory first (see IDA subdirectories)return: nullptr if not found, otherwise a pointer to full file name.
def idadir(*args) ‑> 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 *
def open_linput(*args) ‑> linput_t *
-
open_linput(file, remote) -> linput_t *Open loader input.file: (C++: const char *) char const *remote: (C++: bool)
def qlgetz(*args) ‑> size_t
-
qlgetz(li, fpos) -> strRead a zero-terminated string from the input. If fpos == -1 then no seek will be performed.li: (C++: linput_t *)fpos: (C++: int64)
def read_ioports2(*args) ‑> ssize_t
-
read_ioports2(ports, device, file, callback=None) -> ssize_tports: ioports_t *device: qstring *file: char const *callback: ioports_fallback_t *
Classes
class choose_ioport_parser_t (*args)
-
Proxy of C++ choose_ioport_parser_t class.__init__(self) -> choose_ioport_parser_tself: PyObject *
Methods
def parse(self, *args) ‑> bool
-
parse(self, param, line) -> boolretval true: and fill PARAM with a displayed stringretval false: and empty PARAM to skip the current deviceretval false: and fill PARAM with an error messageparam: (C++: qstring *)line: (C++: const char *) char const *
class file_enumerator_t (*args)
-
Proxy of C++ file_enumerator_t class.__init__(self) -> file_enumerator_tself: PyObject *
Methods
def visit_file(self, *args) ‑> int
-
visit_file(self, file) -> intfile: char const *
class generic_linput_t (*args, **kwargs)
-
Proxy of C++ generic_linput_t class.
Instance variables
var blocksize
-
preferred block size to work with read/write sizes will be in multiples of this number. for example, 4096 is a nice value blocksize 0 means that the filesize is unknown. the internal cache will be disabled in this case. also, seeks from the file end will fail. blocksize=-1 means error.
var filesize
-
input file size
Methods
def read(self, *args) ‑> ssize_t
-
read(self, off, buffer, nbytes) -> ssize_toff: qoff64_tbuffer: void *nbytes: size_t
class ioports_fallback_t (*args)
-
Proxy of C++ ioports_fallback_t class.__init__(self) -> ioports_fallback_tself: PyObject *
Methods
def handle(self, *args) ‑> bool
-
handle(self, ports, line) -> boolports: ioports_t const &line: char const *