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.
Attributes
subdir name for cached deltas and old files |
|
to store file caches |
|
append the processor name as a subdirectory |
|
$IDADIR/subdir will be first, not last |
|
only existing directories will be present |
|
close the inner linput |
|
unmake the inner linput |
|
do nothing |
Classes
Functions
|
Get IDA directory (if subdir==nullptr) or the specified subdirectory (see IDA subdirectories) |
|
Search for IDA system file. This function searches for a file in: |
|
Get user ida related directory. |
|
Get list of directories in which to find a specific IDA resource (see IDA subdirectories). The order of the resulting list is as follows: |
|
Get a folder location by CSIDL (see Common CSIDLs). Path should be of at least MAX_PATH size |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Enumerate files in the specified directory while the callback returns 0. |
|
|
|
Module Contents
- ida_diskio.SWIG_PYTHON_LEGACY_BOOL
- ida_diskio.VAULT_CACHE_SUBDIR
subdir name for cached deltas and old files
- ida_diskio.VAULT_CACHE_FNAME
to store file caches
- ida_diskio.idadir(subdir: str) str
Get IDA directory (if subdir==nullptr) or the specified subdirectory (see IDA subdirectories)
- ida_diskio.getsysfile(filename: str, subdir: str) str
Search for IDA system file. This function searches for a file in: 0. each directory specified by IDAUSR% 1. ida directory [+ subdir]
and returns the first match.
- Parameters:
filename – name of file to search
subdir – if specified, the file is looked for in the specified subdirectory of the ida directory first (see IDA subdirectories)
- Returns:
nullptr if not found, otherwise a pointer to full file name.
- ida_diskio.CFG_SUBDIR
- ida_diskio.IDC_SUBDIR
- ida_diskio.IDS_SUBDIR
- ida_diskio.IDP_SUBDIR
- ida_diskio.LDR_SUBDIR
- ida_diskio.SIG_SUBDIR
- ida_diskio.TIL_SUBDIR
- ida_diskio.PLG_SUBDIR
- ida_diskio.THM_SUBDIR
- ida_diskio.get_user_idadir() str
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)
- ida_diskio.get_ida_subdirs(subdir: str, flags: int = 0) 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
- Parameters:
subdir – name of the resource to list (can be nullptr)
flags – Subdirectory modification flags bits
- Returns:
number of directories appended to ‘dirs’
- ida_diskio.IDA_SUBDIR_IDP
append the processor name as a subdirectory
- ida_diskio.IDA_SUBDIR_IDADIR_FIRST
$IDADIR/subdir will be first, not last
- ida_diskio.IDA_SUBDIR_ONLY_EXISTING
only existing directories will be present
- ida_diskio.get_special_folder(csidl: int) str
Get a folder location by CSIDL (see Common CSIDLs). Path should be of at least MAX_PATH size
- ida_diskio.CSIDL_APPDATA
- ida_diskio.CSIDL_LOCAL_APPDATA
- ida_diskio.CSIDL_PROGRAM_FILES
- ida_diskio.CSIDL_PROGRAM_FILES_COMMON
- ida_diskio.CSIDL_PROGRAM_FILESX86
- ida_diskio.fopenWT(file: str) FILE *
- ida_diskio.fopenWB(file: str) FILE *
- ida_diskio.fopenRT(file: str) FILE *
- ida_diskio.fopenRB(file: str) FILE *
- ida_diskio.fopenM(file: str) FILE *
- ida_diskio.fopenA(file: str) FILE *
- class ida_diskio.ioports_fallback_t
Bases:
object
- thisown
- handle(ports: ioports_t const &, line: str) bool
- Parameters:
ports – i/o port definitions
line – input line to parse
- Returns:
success or fills ERRBUF with an error message
- ida_diskio.read_ioports(ports: ioports_t *, device: str, file: str, callback: ioports_fallback_t = None) ssize_t
- class ida_diskio.choose_ioport_parser_t
Bases:
object
- thisown
- parse(param: str, line: str) bool
- Returns:
true: and fill PARAM with a displayed string
- Returns:
false: and empty PARAM to skip the current device
- Returns:
false: and fill PARAM with an error message
- ida_diskio.choose_ioport_device2(_device: str, file: str, parse_params: choose_ioport_parser_t) bool
- ida_diskio.LINPUT_NONE
- ida_diskio.LINPUT_LOCAL
- ida_diskio.LINPUT_RFILE
- ida_diskio.LINPUT_PROCMEM
- ida_diskio.LINPUT_GENERIC
- ida_diskio.qlgetz(li: linput_t *, fpos: int64) str
- ida_diskio.open_linput(file: str, remote: bool) linput_t *
- class ida_diskio.generic_linput_t(*args, **kwargs)
Bases:
object
- thisown
- filesize: uint64
- blocksize: int
- read(off: qoff64_t, buffer: void *, nbytes: size_t) ssize_t
- ida_diskio.create_generic_linput(gl: generic_linput_t) linput_t *
- ida_diskio.create_memory_linput(start: ida_idaapi.ea_t, size: asize_t) linput_t *
- ida_diskio.get_linput_type(li: linput_t *) linput_type_t
- ida_diskio.LOC_CLOSE
close the inner linput
- ida_diskio.LOC_UNMAKE
unmake the inner linput
- ida_diskio.LOC_KEEP
do nothing
- ida_diskio.enumerate_files(path, fname, callback)
Enumerate files in the specified directory while the callback returns 0.
- Parameters:
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.
- Returns:
tuple(code, fname) : If the callback returns non-zero, or None in case of script errors
- ida_diskio.create_bytearray_linput(s: str) linput_t *
- ida_diskio.close_linput(li: linput_t *) None