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.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.read_ioports(ports: ioports_t *, device: str, file: str, callback: ioports_fallback_t = None) ssize_t
- 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
- class ida_diskio.generic_linput_t(*args, **kwargs)
- Bases: - object- thisown
 - filesize: uint64
 - 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