26#define VAULT_CACHE_SUBDIR ".vault"
27#define VAULT_CACHE_FNAME ".vault_cache"
37idaman THREAD_SAFE
const char *ida_export
idadir(
const char *subdir);
62#define CFG_SUBDIR "cfg"
63#define IDC_SUBDIR "idc"
64#define IDS_SUBDIR "ids"
65#define IDP_SUBDIR "procs"
66#define LDR_SUBDIR "loaders"
67#define SIG_SUBDIR "sig"
68#define TIL_SUBDIR "til"
69#define PLG_SUBDIR "plugins"
70#define THM_SUBDIR "themes"
100#define IDA_SUBDIR_IDP 0x0001
101#define IDA_SUBDIR_IDADIR_FIRST 0x0002
102#define IDA_SUBDIR_ONLY_EXISTING 0x0004
115#define CSIDL_APPDATA 0x001a
117#ifndef CSIDL_LOCAL_APPDATA
118#define CSIDL_LOCAL_APPDATA 0x001c
120#ifndef CSIDL_PROGRAM_FILES
121#define CSIDL_PROGRAM_FILES 0x0026
123#ifndef CSIDL_PROGRAM_FILES_COMMON
124#define CSIDL_PROGRAM_FILES_COMMON 0x002b
126#ifndef CSIDL_PROGRAM_FILESX86
127#define CSIDL_PROGRAM_FILESX86 0x002a
176idaman THREAD_SAFE FILE *ida_export
fopenWT(
const char *file);
183idaman THREAD_SAFE FILE *ida_export
fopenWB(
const char *file);
189idaman THREAD_SAFE FILE *ida_export
fopenRT(
const char *file);
195idaman THREAD_SAFE FILE *ida_export
fopenRB(
const char *file);
201idaman THREAD_SAFE FILE *ida_export
fopenM(
const char *file);
207idaman THREAD_SAFE FILE *ida_export
fopenA(
const char *file);
213idaman THREAD_SAFE FILE *ida_export
openR(
const char *file);
219idaman THREAD_SAFE FILE *ida_export
openRT(
const char *file);
225idaman THREAD_SAFE FILE *ida_export
openM(
const char *file);
345 const char *(idaapi *parse_params)(
347 const char *line)=
nullptr);
364#define IOPORT_SKIP_DEVICE ((const char *)(-1))
387idaman THREAD_SAFE
int ida_export
call_system(
const char *command);
420idaman
void ida_export
lread(linput_t *li,
void *buf,
size_t size);
435idaman
char *ida_export
qlgets(
char *s,
size_t len, linput_t *li);
441idaman
int ida_export
qlgetc(linput_t *li);
455#define DEF_LREADBYTES(read, type, size) \
457inline int idaapi read(linput_t *li, type *res, bool mf) \
458 { return lreadbytes(li, res, size, mf); }
486idaman qoff64_t ida_export
qlseek(linput_t *li, qoff64_t
pos,
int whence=SEEK_SET);
491inline qoff64_t idaapi
qltell(linput_t *li) {
return qlseek(li, 0, SEEK_CUR); }
496idaman linput_t *ida_export
open_linput(
const char *file,
bool remote);
509idaman THREAD_SAFE FILE *ida_export
qlfile(linput_t *li);
Reimplementation of vector class from STL.
Definition pro.h:2250
idaman THREAD_SAFE FILE *ida_export openM(const char *file)
Open a file for read/write in binary mode or die, deny write.
idaman int ida_export lreadbytes(linput_t *li, void *buf, size_t size, bool mf)
Read multiple bytes and swap if necessary.
idaman THREAD_SAFE FILE *ida_export fopenA(const char *file)
Open a file for append in text mode, deny none.
idaman ssize_t ida_export qlread(linput_t *li, void *buf, size_t size)
Read the input source.
uint64
Definition diskio.hpp:464
THREAD_SAFE linput_type_t idaapi get_linput_type(linput_t *li)
Get linput type.
Definition diskio.hpp:567
idaman THREAD_SAFE FILE *ida_export openR(const char *file)
Open a file for read in binary mode or die, deny none.
idaman THREAD_SAFE void ida_export close_linput(linput_t *li)
Close loader input.
idaman THREAD_SAFE FILE *ida_export fopenRB(const char *file)
Open a file for read in binary mode, deny none.
DEF_LREADBYTES(lread2bytes, int16, 2) DEF_LREADBYTES(lread2bytes
idaman char *ida_export qlgetz(linput_t *li, int64 fpos, char *buf, size_t bufsize)
Read a zero-terminated string from the input.
idaman THREAD_SAFE FILE *ida_export openRT(const char *file)
Open a file for read in text mode or die, deny none.
idaman THREAD_SAFE FILE *ida_export fopenWT(const char *file)
Open a new file for write in text mode, deny write.
qvector< ioport_t > ioports_t
Definition diskio.hpp:275
idaman THREAD_SAFE char *ida_export getsysfile(char *buf, size_t bufsize, const char *filename, const char *subdir)
Search for IDA system file.
qvector< ioport_bit_t > ioport_bits_t
Definition diskio.hpp:258
idaman THREAD_SAFE int ida_export enumerate_files(char *answer, size_t answer_size, const char *path, const char *fname, file_enumerator_t &fv)
idaman THREAD_SAFE const char *ida_export get_user_idadir(void)
Get user ida related directory.
idaman int64 ida_export qlsize(linput_t *li)
Get the input source size.
idaman qoff64_t ida_export qlseek(linput_t *li, qoff64_t pos, int whence=SEEK_SET)
Set input source position.
idaman THREAD_SAFE FILE *ida_export qlfile(linput_t *li)
Get FILE* from the input source.
qoff64_t idaapi qltell(linput_t *li)
Get input source position.
Definition diskio.hpp:491
idaman linput_t *ida_export create_memory_linput(ea_t start, asize_t size)
Create a linput for process memory.
idaman THREAD_SAFE FILE *ida_export fopenWB(const char *file)
Open a new file for write in binary mode, deny read/write.
idaman THREAD_SAFE bool ida_export choose_ioport_device(qstring *_device, const char *file, const char *(idaapi *parse_params)(qstring *buf, const char *line)=nullptr)
Allow the user to choose the ioport device.
idaman THREAD_SAFE const ioport_t *ida_export find_ioport(const ioports_t &ports, ea_t address)
Find ioport in the array of ioports.
idaman THREAD_SAFE const ioport_bit_t *ida_export find_ioport_bit(const ioports_t &ports, ea_t address, size_t bit)
Find ioport bit in the array of ioports.
idaman THREAD_SAFE FILE *ida_export fopenM(const char *file)
Open a file for read/write in binary mode, deny write.
uint32
Definition diskio.hpp:462
janitor_t< linput_t * > linput_janitor_t
Object that will free an linput_t at destruction-time.
Definition diskio.hpp:573
idaman void ida_export lread(linput_t *li, void *buf, size_t size)
Read the input source.
idaman THREAD_SAFE linput_t *ida_export create_bytearray_linput(const uchar *start, size_t size)
Trivial memory linput.
linput_close_code_t
Upon closing outer linput, perform one of these actions.
Definition diskio.hpp:608
@ LOC_KEEP
do nothing
Definition diskio.hpp:611
@ LOC_UNMAKE
unmake the inner linput
Definition diskio.hpp:610
@ LOC_CLOSE
close the inner linput
Definition diskio.hpp:609
idaman char *ida_export qlgets(char *s, size_t len, linput_t *li)
Read one line from the input source.
idaman THREAD_SAFE linput_t *ida_export make_linput(FILE *fp)
Convert FILE* to input source.
idaman THREAD_SAFE const char *ida_export idadir(const char *subdir)
Get IDA directory (if subdir==nullptr) or the specified subdirectory (see IDA subdirectories)
idaman THREAD_SAFE FILE *ida_export fopenRT(const char *file)
Open a file for read in text mode, deny none.
idaman THREAD_SAFE bool ida_export get_special_folder(char *buf, size_t bufsize, int csidl)
Get a folder location by CSIDL (see Common CSIDLs).
idaman THREAD_SAFE void ida_export unmake_linput(linput_t *li)
Free an linput_t object (also see make_linput())
idaman THREAD_SAFE void ida_export echsize(FILE *fp, uint64 size)
Change size of file or die.
idaman THREAD_SAFE uint64 ida_export get_free_disk_space(const char *path)
Get free disk space in bytes.
idaman THREAD_SAFE ssize_t ida_export read_ioports(ioports_t *ports, qstring *device, const char *file, ioports_fallback_t *callback=nullptr)
idaman linput_t *ida_export open_linput(const char *file, bool remote)
Open loader input.
idaman THREAD_SAFE int ida_export call_system(const char *command)
Execute a operating system command.
idaman THREAD_SAFE int ida_export get_ida_subdirs(qstrvec_t *dirs, const char *subdir, int flags=0)
Get list of directories in which to find a specific IDA resource (see IDA subdirectories).
linput_type_t
loader input source
Definition diskio.hpp:406
@ LINPUT_LOCAL
local file
Definition diskio.hpp:408
@ LINPUT_GENERIC
generic linput
Definition diskio.hpp:411
@ LINPUT_RFILE
remote file ( debugger_t::open_file, debugger_t::read_file)
Definition diskio.hpp:409
@ LINPUT_PROCMEM
debugged process memory (read_dbg_memory())
Definition diskio.hpp:410
@ LINPUT_NONE
invalid linput
Definition diskio.hpp:407
DECLARE_TYPE_AS_MOVABLE(ioport_bit_t)
idaman THREAD_SAFE bool ida_export choose_ioport_device2(qstring *_device, const char *file, choose_ioport_parser_t *parse_params)
idaman THREAD_SAFE linput_t *ida_export create_generic_linput(generic_linput_t *gl)
Create a generic linput.
idaman int ida_export qlgetc(linput_t *li)
Read one character from the input source.
idaman size_t n
Definition pro.h:997
char * answer
Definition kernwin.hpp:8023
int nbytes
Definition kernwin.hpp:2861
idaman int64 pos
Definition kernwin.hpp:1365
idaman size_t len
Definition kernwin.hpp:1356
asize_t size
Definition kernwin.hpp:6339
unsigned __int64 uint64
Definition llong.hpp:13
__int64 int64
Definition llong.hpp:14
This is the first header included in the IDA project.
unsigned short uint16
unsigned 16 bit value
Definition pro.h:346
unsigned int uint32
unsigned 32 bit value
Definition pro.h:348
uint64 asize_t
Definition pro.h:423
short int16
signed 16 bit value
Definition pro.h:345
uint64 ea_t
Definition pro.h:421
int int32
signed 32 bit value
Definition pro.h:347
unsigned char uchar
unsigned 8 bit value
Definition pro.h:337
idaman size_t bufsize
Definition pro.h:600
ptrdiff_t ssize_t
Signed size_t - used to check for size overflows when the counter becomes negative.
Definition pro.h:381
_qstring< char > qstring
regular string
Definition pro.h:3694
qvector< qstring > qstrvec_t
vector of strings
Definition pro.h:3697
Definition diskio.hpp:350
virtual ~choose_ioport_parser_t()
Definition diskio.hpp:351
virtual bool parse(qstring *param, const char *line)=0
Enumerate files in the specified directory.
Definition diskio.hpp:147
virtual int visit_file(const char *file)=0
virtual ~file_enumerator_t()
Definition diskio.hpp:149
Describes an I/O port bit.
Definition diskio.hpp:253
qstring name
name of the bit
Definition diskio.hpp:254
qstring cmt
comment
Definition diskio.hpp:255
Describes an I/O port.
Definition diskio.hpp:262
qstring cmt
comment
Definition diskio.hpp:265
qstring name
name of the port
Definition diskio.hpp:264
ioport_t()
Definition diskio.hpp:269
ea_t address
address of the port
Definition diskio.hpp:263
ioport_bits_t bits
bit names
Definition diskio.hpp:266
void * userdata
arbitrary data. initialized to nullptr.
Definition diskio.hpp:267
Read i/o port definitions from a config file.
Definition diskio.hpp:309
virtual ~ioports_fallback_t()
Definition diskio.hpp:310
virtual bool handle(qstring *errbuf, const ioports_t &ports, const char *line)=0
Resource janitor to facilitate use of the RAII idiom.
Definition pro.h:4486
linput_t *& resource
Definition pro.h:4491
~janitor_t()
Definition diskio.hpp:575