Module index

Module ida_dirtree

IDA Plugin SDK API wrapper: dirtree

Global variables

var DIRTREE_END
DIRTREE_END = 9
var DIRTREE_ENUMS
DIRTREE_ENUMS = 2
var DIRTREE_ENUMS_BOOKMARKS
DIRTREE_ENUMS_BOOKMARKS = 8
var DIRTREE_FUNCS
DIRTREE_FUNCS = 3
var DIRTREE_IDAPLACE_BOOKMARKS
DIRTREE_IDAPLACE_BOOKMARKS = 6
var DIRTREE_IMPORTS
DIRTREE_IMPORTS = 5
var DIRTREE_LOCAL_TYPES
DIRTREE_LOCAL_TYPES = 0
var DIRTREE_NAMES
DIRTREE_NAMES = 4
var DIRTREE_STRUCTS
DIRTREE_STRUCTS = 1
var DIRTREE_STRUCTS_BOOKMARKS
DIRTREE_STRUCTS_BOOKMARKS = 7
var DTE_ALREADY_EXISTS
DTE_ALREADY_EXISTS = 1
var DTE_BAD_PATH
DTE_BAD_PATH = 5
var DTE_CANT_RENAME
DTE_CANT_RENAME = 6
var DTE_LAST
DTE_LAST = 9
var DTE_MAX_DIR
DTE_MAX_DIR = 8
var DTE_NOT_DIRECTORY
DTE_NOT_DIRECTORY = 3
var DTE_NOT_EMPTY
DTE_NOT_EMPTY = 4
var DTE_NOT_FOUND
DTE_NOT_FOUND = 2
var DTE_OK
DTE_OK = 0
var DTE_OWN_CHILD
DTE_OWN_CHILD = 7

Functions

def dirtree_cursor_t_root_cursor(*args) ‑> dirtree_cursor_t
dirtree_cursor_t_root_cursor() -> dirtree_cursor_t
def dirtree_t_errstr(*args) ‑> char const *
dirtree_t_errstr(err) -> char const *
err: enum dterr_t
def get_std_dirtree(*args) ‑> dirtree_t *
get_std_dirtree(id) -> dirtree_t
id (C++: dirtree_id_t)

Classes

class direntry_t (*args)
Proxy of C++ direntry_t class.
__init__(self, i=BADIDX, d=False) -> direntry_t
i: uval_t d: bool

Class variables

var BADIDX
var ROOTIDX

Instance variables

var idx
direntry_t_idx_get(self) -> uval_t
var isdir
direntry_t_isdir_get(self) -> bool

Methods

def valid(self, *args) ‑> bool
valid(self) -> bool
class direntry_vec_t (*args)
Proxy of C++ qvector< direntry_t > class.
__init__(self) -> direntry_vec_t
x: qvector< direntry_t > const &

Methods

def add_unique(self, *args) ‑> bool
add_unique(self, x) -> bool
x: direntry_t const &
def at(self, *args) ‑> direntry_t const &
at(self, _idx) -> direntry_t
_idx: size_t
def back(self)
def begin(self, *args) ‑> qvector< direntry_t >::const_iterator
begin(self) -> direntry_t
begin(self) -> direntry_t
def capacity(self, *args) ‑> size_t
capacity(self) -> size_t
def clear(self, *args) ‑> void
clear(self)
def empty(self, *args) ‑> bool
empty(self) -> bool
def end(self, *args) ‑> qvector< direntry_t >::const_iterator
end(self) -> direntry_t
end(self) -> direntry_t
def erase(self, *args) ‑> qvector< direntry_t >::iterator
erase(self, it) -> direntry_t
it: qvector< direntry_t >::iterator
erase(self, first, last) -> direntry_t
first: qvector< direntry_t >::iterator last: qvector< direntry_t >::iterator
def extract(self, *args) ‑> direntry_t *
extract(self) -> direntry_t
def find(self, *args) ‑> qvector< direntry_t >::const_iterator
find(self, x) -> direntry_t
x: direntry_t const &
find(self, x) -> direntry_t
x: direntry_t const &
def front(self)
def grow(self, *args) ‑> void
grow(self, x=direntry_t())
x: direntry_t const &
def has(self, *args) ‑> bool
has(self, x) -> bool
x: direntry_t const &
def inject(self, *args) ‑> void
inject(self, s, len)
s: direntry_t * len: size_t
def insert(self, *args) ‑> qvector< direntry_t >::iterator
insert(self, it, x) -> direntry_t
it: qvector< direntry_t >::iterator x: direntry_t const &
def pop_back(self, *args) ‑> void
pop_back(self)
def push_back(self, *args) ‑> direntry_t &
push_back(self, x)
x: direntry_t const &
def qclear(self, *args) ‑> void
qclear(self)
def reserve(self, *args) ‑> void
reserve(self, cnt)
cnt: size_t
def resize(self, *args) ‑> void
resize(self, _newsize, x)
_newsize: size_t x: direntry_t const &
resize(self, _newsize)
_newsize: size_t
def size(self, *args) ‑> size_t
size(self) -> size_t
def swap(self, *args) ‑> void
swap(self, r)
r: qvector< direntry_t > &
def truncate(self, *args) ‑> void
truncate(self)
class dirspec_t (*args)
Proxy of C++ dirspec_t class.
__init__(self, nm=None, f=0) -> dirspec_t
nm: char const * f: uint32

Class variables

var DSF_INODE_EA
var DSF_PRIVRANGE

Instance variables

var flags
dirspec_t_flags_get(self) -> uint32
var nodename
dirspec_t_nodename_get(self) -> qstring *

Methods

def get_attrs(self, *args) ‑> qstring
get_attrs(self, inode) -> qstring
inode (C++: inode_t)
def get_inode(self, *args) ‑> inode_t
get the entry inode in the specified directory
get_inode(self, diridx, name) -> inode_t
diridx (C++: diridx_t)
name (C++: const char *)
return: the entry inode
def get_name(self, *args) ‑> bool
get the entry name. for example, the structure name
get_name(self, inode) -> bool
inode (C++: inode_t)
return: false if the entry does not exist.
def rename_inode(self, *args) ‑> bool
rename the entry
rename_inode(self, inode, newname) -> bool
inode (C++: inode_t)
newname (C++: const char *)
return: success
event: unlinked an inode
unlink_inode(self, inode)
inode (C++: inode_t)
class dirtree_cursor_t (*args)
Proxy of C++ dirtree_cursor_t class.
__init__(self, _parent=BADIDX, _rank=size_t(-1)) -> dirtree_cursor_t
_parent: diridx_t _rank: size_t

Static methods

def root_cursor(*args) ‑> dirtree_cursor_t
root_cursor() -> dirtree_cursor_t

Instance variables

var parent
dirtree_cursor_t_parent_get(self) -> diridx_t
var rank
dirtree_cursor_t_rank_get(self) -> size_t

Methods

def compare(self, *args) ‑> int
compare(self, r) -> int
r: dirtree_cursor_t const &
def is_root_cursor(self, *args) ‑> bool
is_root_cursor(self) -> bool
def set_root_cursor(self, *args) ‑> void
set_root_cursor(self)
def valid(self, *args) ‑> bool
valid(self) -> bool
class dirtree_cursor_vec_t (*args)
Proxy of C++ qvector< dirtree_cursor_t > class.
__init__(self) -> dirtree_cursor_vec_t
x: qvector< dirtree_cursor_t > const &

Subclasses

Methods

def add_unique(self, *args) ‑> bool
add_unique(self, x) -> bool
x: dirtree_cursor_t const &
def at(self, *args) ‑> dirtree_cursor_t const &
at(self, _idx) -> dirtree_cursor_t
_idx: size_t
def back(self)
def begin(self, *args) ‑> qvector< dirtree_cursor_t >::const_iterator
begin(self) -> dirtree_cursor_t
begin(self) -> dirtree_cursor_t
def capacity(self, *args) ‑> size_t
capacity(self) -> size_t
def clear(self, *args) ‑> void
clear(self)
def empty(self, *args) ‑> bool
empty(self) -> bool
def end(self, *args) ‑> qvector< dirtree_cursor_t >::const_iterator
end(self) -> dirtree_cursor_t
end(self) -> dirtree_cursor_t
def erase(self, *args) ‑> qvector< dirtree_cursor_t >::iterator
erase(self, it) -> dirtree_cursor_t
it: qvector< dirtree_cursor_t >::iterator
erase(self, first, last) -> dirtree_cursor_t
first: qvector< dirtree_cursor_t >::iterator last: qvector< dirtree_cursor_t >::iterator
def extract(self, *args) ‑> dirtree_cursor_t *
extract(self) -> dirtree_cursor_t
def find(self, *args) ‑> qvector< dirtree_cursor_t >::const_iterator
find(self, x) -> dirtree_cursor_t
x: dirtree_cursor_t const &
find(self, x) -> dirtree_cursor_t
x: dirtree_cursor_t const &
def front(self)
def grow(self, *args) ‑> void
grow(self, x=dirtree_cursor_t())
x: dirtree_cursor_t const &
def has(self, *args) ‑> bool
has(self, x) -> bool
x: dirtree_cursor_t const &
def inject(self, *args) ‑> void
inject(self, s, len)
s: dirtree_cursor_t * len: size_t
def insert(self, *args) ‑> qvector< dirtree_cursor_t >::iterator
insert(self, it, x) -> dirtree_cursor_t
it: qvector< dirtree_cursor_t >::iterator x: dirtree_cursor_t const &
def pop_back(self, *args) ‑> void
pop_back(self)
def push_back(self, *args) ‑> dirtree_cursor_t &
push_back(self, x)
x: dirtree_cursor_t const &
def qclear(self, *args) ‑> void
qclear(self)
def reserve(self, *args) ‑> void
reserve(self, cnt)
cnt: size_t
def resize(self, *args) ‑> void
resize(self, _newsize, x)
_newsize: size_t x: dirtree_cursor_t const &
resize(self, _newsize)
_newsize: size_t
def size(self, *args) ‑> size_t
size(self) -> size_t
def swap(self, *args) ‑> void
swap(self, r)
r: qvector< dirtree_cursor_t > &
def truncate(self, *args) ‑> void
truncate(self)
class dirtree_iterator_t (*args)
Proxy of C++ dirtree_iterator_t class.
__init__(self) -> dirtree_iterator_t

Instance variables

var cursor
dirtree_iterator_t_cursor_get(self) -> dirtree_cursor_t
var pattern
dirtree_iterator_t_pattern_get(self) -> qstring *
class dirtree_selection_t (*args)
Proxy of C++ dirtree_selection_t class.
__init__(self) -> dirtree_selection_t

Ancestors

Inherited members

class dirtree_t (*args)
Proxy of C++ dirtree_t class.
__init__(self, ds) -> dirtree_t
ds: dirspec_t *

Static methods

def errstr(*args) ‑> char const *
errstr(err) -> char const *
err: enum dterr_t

Methods

def change_rank(self, *args) ‑> dterr_t
Change ordering rank of an item.All subdirectories go before all file entries.
change_rank(self, path, rank_delta) -> dterr_t
path: path to the item (C++: const char *)
rank_delta (C++: ssize_t)
return: dterr_t error code
def chdir(self, *args) ‑> dterr_t
Change current directory
chdir(self, path) -> dterr_t
path: new current directory (C++: const char *)
return: dterr_t error code
def findfirst(self, *args) ‑> bool
Start iterating over files in a directory
findfirst(self, ff, pattern) -> bool
ff: directory iterator. it will be initialized by the function
(C++: dirtree_iterator_t *)
pattern: pattern to search for (C++: const char *)
return: success
def findnext(self, *args) ‑> bool
Continue iterating over files in a directory
findnext(self, ff) -> bool
ff: directory iterator (C++: dirtree_iterator_t *)
return: success
def get_abspath(self, *args) ‑> qstring
Get absolute path pointed by the cursorsee also 'resolve_cursor()'
get_abspath(self, cursor) -> qstring
cursor (C++: const dirtree_cursor_t &)
return: path. empty path means wrong directory part of RELPATH
get_abspath(self, relpath) -> qstring
relpath: char const *
return: path. empty path means wrong directory part of RELPATH
def get_dir_size(self, *args) ‑> ssize_t
Get dir size
get_dir_size(self, diridx) -> ssize_t
diridx: directory index (C++: diridx_t)
return: number of entries under this directory; if error, return -1
def get_entry_attrs(self, *args) ‑> qstring
Get entry attributes
get_entry_attrs(self, de) -> qstring
de: directory entry (C++: const direntry_t &)
return: name
def get_entry_name(self, *args) ‑> qstring
Get entry name
get_entry_name(self, de) -> qstring
de: directory entry (C++: const direntry_t &)
return: name
def get_nodename(self, *args) ‑> char const *
netnode name
def get_parent_cursor(self, *args) ‑> dirtree_cursor_t
Get parent cursor.
get_parent_cursor(self, cursor) -> dirtree_cursor_t
cursor: a valid ditree cursor (C++: const dirtree_cursor_t &)
return: cursor's parent
def get_rank(self, *args) ‑> ssize_t
Get ordering rank of an item.
get_rank(self, diridx, de) -> ssize_t
diridx: index of the parent directory (C++: diridx_t)
de: directory entry (C++: const direntry_t &)
return: number in a range of [0..n) where n is the number of entries
in the parent directory. -1 if error
def getcwd(self, *args) ‑> qstring
Get current directory
def isdir(self, *args) ‑> bool
Is a directory?
isdir(self, de) -> bool
de: direntry_t const &
return: true if the specified path is a directory
isdir(self, path) -> bool
path: char const *
return: true if the specified path is a directory
def isfile(self, *args) ‑> bool
Is a file?
isfile(self, de) -> bool
de: direntry_t const &
return: true if the specified path is a file
isfile(self, path) -> bool
path: char const *
return: true if the specified path is a file
Add a file item into a directory.
link(self, path) -> dterr_t
path: path to item to add to a directory (C++: const char *)
return: dterr_t error code
link(self, inode) -> dterr_t
inode: inode_t
return: dterr_t error code
def load(self, *args) ‑> bool
Load the tree structure from the netnode. If dirspec_t::nodename is empty, the operation will be considered a success. In addition, calling 'load()' more than once will not do anything, and will be considered a success.dirspec_t::nodename.
def mkdir(self, *args) ‑> dterr_t
Create a directory.
mkdir(self, path) -> dterr_t
path: directory to create (C++: const char *)
return: dterr_t error code
def notify_dirtree(self, *args) ‑> void
Notify dirtree about a change of an inode.
notify_dirtree(self, added, inode)
added (C++: bool)
inode: inode in question (C++: inode_t)
def rename(self, *args) ‑> dterr_t
Rename a directory entry.This function can also rename the item
rename(self, _from, to) -> dterr_t
_from: source path (C++: const char *)
to: destination path (C++: const char *)
return: dterr_t error code
def resolve_cursor(self, *args) ‑> direntry_t
Resolve cursorsee also 'get_abspath()'
resolve_cursor(self, cursor) -> direntry_t
cursor: to analyze (C++: const dirtree_cursor_t &)
return: directory entry; if the cursor is bad, the resolved entry
will be invalid.
def resolve_path(self, *args) ‑> direntry_t
Resolve path
resolve_path(self, path) -> direntry_t
path: to analyze (C++: const char *)
return: directory entry
def rmdir(self, *args) ‑> dterr_t
Remove a directory.
rmdir(self, path) -> dterr_t
path: directory to delete (C++: const char *)
return: dterr_t error code
def save(self, *args) ‑> bool
Save the tree structure to the netnode.dirspec_t::nodename.
def set_nodename(self, *args) ‑> void
set_nodename(self, nm)
nm (C++: const char *)
Remove a file item from a directory.
unlink(self, path) -> dterr_t
path: path to item remove from a directory (C++: const char *)
return: dterr_t error code
unlink(self, inode) -> dterr_t
inode: inode_t
return: dterr_t error code