Module index

Module ida_diskio

IDA Plugin SDK API wrapper: diskio

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
LINPUT_GENERIC = 4
var LINPUT_LOCAL
LINPUT_LOCAL = 1
var LINPUT_NONE
LINPUT_NONE = 0
var LINPUT_PROCMEM
LINPUT_PROCMEM = 3
var LINPUT_RFILE
LINPUT_RFILE = 2
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 (C++: qstring *)
file (C++: const char *)
parse_params (C++: choose_ioport_parser_t *)
def close_linput(*args) ‑> void
Close loader input.
close_linput(li)
li (C++: linput_t *)
def create_bytearray_linput(*args) ‑> linput_t *
Trivial memory linput.
create_bytearray_linput(s) -> linput_t *
s: qstring const &
def create_generic_linput(*args) ‑> linput_t *
Create a generic linput
create_generic_linput(gl) -> linput_t *
gl: linput description. this object will be destroyed by
close_linput() using "delete gl;" (C++: generic_linput_t *)
def create_memory_linput(*args) ‑> linput_t *
Create a linput for process memory. This linput will use read_dbg_memory() to read data.
create_memory_linput(start, size) -> linput_t *
start: starting address of the input (C++: ea_t)
size: size of the memory area to represent as linput if
unknown, may be passed as 0 (C++: asize_t)
def eclose(*args) ‑> void
eclose(fp)
fp (C++: 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 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
def enumerate_files2(*args) ‑> int
enumerate_files2(answer, answer_size, path, fname, fv) -> int
answer (C++: char *)
answer_size (C++: size_t)
path (C++: const char *)
fname (C++: const char *)
fv (C++: file_enumerator_t &)
def fopenA(*args) ‑> FILE *
Open a file for append in text mode, deny none.
fopenA(file) -> FILE *
file (C++: const char *)
return: NULL if failure
def fopenM(*args) ‑> FILE *
Open a file for read/write in binary mode, deny write.
fopenM(file) -> FILE *
file (C++: const char *)
return: NULL if failure
def fopenRB(*args) ‑> FILE *
Open a file for read in binary mode, deny none.
fopenRB(file) -> FILE *
file (C++: const char *)
return: NULL if failure
def fopenRT(*args) ‑> FILE *
Open a file for read in text mode, deny none.
fopenRT(file) -> FILE *
file (C++: const char *)
return: NULL if failure
def fopenWB(*args) ‑> FILE *
Open a new file for write in binary mode, deny read/write. If a file exists, it will be removed.
fopenWB(file) -> FILE *
file (C++: const char *)
return: NULL if failure
def fopenWT(*args) ‑> FILE *
Open a new file for write in text mode, deny write. If a file exists, it will be removed.
fopenWT(file) -> FILE *
file (C++: const char *)
return: NULL if failure
def get_ida_subdirs(*args) ‑> qstrvec_t *
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
get_ida_subdirs(subdir, flags=0) -> int
subdir: name of the resource to list (C++: const char *)
flags: Subdirectory modification flags bits (C++: int)
return: number of directories appended to 'dirs'
def get_linput_type(*args) ‑> linput_type_t
Get linput type.
get_linput_type(li) -> linput_type_t
li (C++: linput_t *)
def get_special_folder(*args) ‑> size_t
Get a folder location by CSIDL (see 'Common CSIDLs' ). Path should be of at least MAX_PATH size
get_special_folder(csidl) -> str
csidl (C++: int)
def get_user_idadir(*args) ‑> 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 *
Search for IDA system file. This function searches for a file in:each directory specified by IDAUSR%ida directory [+ subdir] and returns the first match.
getsysfile(filename, subdir) -> str
filename (C++: const char *)
subdir (C++: const char *)
return: NULL if not found, otherwise a pointer to full file name.
def idadir(*args) ‑> char const *
Get IDA directory (if subdir==NULL) or the specified subdirectory (see 'IDA subdirectories' )
idadir(subdir) -> char const *
subdir (C++: const char *)
def open_linput(*args) ‑> linput_t *
Open loader input.
open_linput(file, remote) -> linput_t *
file (C++: const char *)
remote (C++: bool)
def qlgetz(*args) ‑> size_t
Read a zero-terminated string from the input. If fpos == -1 then no seek will be performed.
qlgetz(li, fpos) -> str
li (C++: linput_t *)
fpos (C++: int64)
def read_ioports2(*args) ‑> ssize_t
read_ioports2(ports, device, file, callback=None) -> ssize_t
ports (C++: ioports_t *)
device (C++: qstring *)
file (C++: const char *)
callback (C++: ioports_fallback_t *)

Classes

class choose_ioport_parser_t (*args)
Proxy of C++ choose_ioport_parser_t class.
__init__(self) -> choose_ioport_parser_t
self: PyObject *

Methods

def parse(self, *args) ‑> bool
parse(self, param, line) -> bool
param (C++: qstring *)
line (C++: const char *)
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
class file_enumerator_t (*args)
Proxy of C++ file_enumerator_t class.
__init__(self) -> file_enumerator_t
self: PyObject *

Methods

def visit_file(self, *args) ‑> int
visit_file(self, file) -> int
file (C++: const char *)
class generic_linput_t (*args, **kwargs)
Proxy of C++ generic_linput_t class.

Instance variables

var blocksize
generic_linput_t_blocksize_get(self) -> uint32
var filesize
generic_linput_t_filesize_get(self) -> uint64

Methods

def read(self, *args) ‑> ssize_t
read(self, off, buffer, nbytes) -> ssize_t
off (C++: qoff64_t)
buffer (C++: void *)
nbytes (C++: size_t)
class ioports_fallback_t (*args)
Proxy of C++ ioports_fallback_t class.
__init__(self) -> ioports_fallback_t
self: PyObject *

Methods

def handle(self, *args) ‑> bool
handle(self, ports, line) -> bool
ports (C++: const ioports_t &)
line (C++: const char *)