IDA C++ SDK 9.2
Loading...
Searching...
No Matches
extlang_t Struct Reference

External language (to support third party language interpreters) More...

#include <expr.hpp>

Public Member Functions

 bool (idaapi *compile_expr)(const char *name
 Compile an expression.
 bool (idaapi *compile_file)(const char *file
 Compile (load) a file.
 bool (idaapi *call_func)(idc_value_t *result
 Evaluate a previously compiled expression.
 bool (idaapi *eval_expr)(idc_value_t *rv
 Compile and evaluate an expression.
 bool (idaapi *eval_snippet)(const char *str
 Compile and execute a string with statements.
 bool (idaapi *create_object)(idc_value_t *result
 Create an object instance.
 bool (idaapi *get_attr)(idc_value_t *result
 Returns the attribute value of a given object from the global scope.
 bool (idaapi *set_attr)(idc_value_t *obj
 Sets the attribute value of a given object in the global scope.
 bool (idaapi *call_method)(idc_value_t *result
 Calls a member function.
 bool (idaapi *load_procmod)(idc_value_t *procobj
 Compile (load) a file with processor module.
 bool (idaapi *unload_procmod)(const char *path
 Unload previously loaded processor module.
bool is_idc (void) const
bool is_namespace_aware (void) const
void release (void)

Public Attributes

size_t size
 Size of this structure.
uint32 flags
 Language features.
int32 refcnt
 Reference count.
const char * name
 Language name.
const char * fileext
 File name extension for the language.
syntax_highlighter_thighlighter
ea_t current_ea
ea_t const char * expr
ea_t const char qstringerrbuf
const char * requested_namespace
const char qstringerrbuf
const char const idc_value_t args []
const char const idc_value_t size_t nargs
const char const idc_value_t size_t qstringerrbuf
qstringerrbuf
const idc_value_tobj
const idc_value_t const char * attr
const char * attr
const char const idc_value_tvalue
const idc_value_t const char * name
const idc_value_t const char const idc_value_t args []
const idc_value_t const char const idc_value_t size_t nargs
const idc_value_t const char const idc_value_t size_t qstringerrbuf
const char * path

Detailed Description

External language (to support third party language interpreters)

Member Function Documentation

◆ bool() [1/11]

extlang_t::bool ( idaapi * compile_expr) const

Compile an expression.

Parameters
namename of the function which will hold the compiled expression
current_eacurrent address. if unknown then #BADADDR
exprexpression to compile
[out]errbuferror message if compilation fails
Returns
success

◆ bool() [2/11]

extlang_t::bool ( idaapi * compile_file) const

Compile (load) a file.

If an extlang_t object claims to be namespace-aware, it means its 'compile_file()' will receive a requested namespace to compile a file under.

For example, compile_file() might receive a file '.../loaders/myloader.py', with the corresponding namespace: '__loaders__myloader'

Accordingly, call_func() has to be prepared to receive a function name that is namespace-qualified: "__loaders__myloader.accept_file()".

Parameters
filefile name
requested_namespacerequested namespace, may be ignored if not namespace-aware
[out]errbuferror message if compilation fails

◆ bool() [3/11]

extlang_t::bool ( idaapi * call_func)

Evaluate a previously compiled expression.

Parameters
[out]resultfunction result or exception
namefunction to call
nargsnumber of input arguments
argsinput arguments
[out]errbuferror message if evaluation fails
Returns
success

◆ bool() [4/11]

extlang_t::bool ( idaapi * eval_expr)

Compile and evaluate an expression.

Parameters
[out]rvexpression value or exception
current_eacurrent address. if unknown then BADADDR
exprexpression to evaluate
[out]errbuferror message if evaluation fails
Returns
success

◆ bool() [5/11]

extlang_t::bool ( idaapi * eval_snippet) const

Compile and execute a string with statements.

(see also: eval_expr() which works with expressions)

Parameters
strinput string to execute
[out]errbuferror message
Returns
success

◆ bool() [6/11]

extlang_t::bool ( idaapi * create_object)

Create an object instance.

Parameters
resultcreated object or exception
nameobject class name
argsinput arguments
nargsnumber of input arguments
errbuferror message if evaluation fails
Returns
success

◆ bool() [7/11]

extlang_t::bool ( idaapi * get_attr)

Returns the attribute value of a given object from the global scope.

Parameters
[out]resultattribute value
objobject (may be nullptr)
attrattribute name. if nullptr or empty string then the object instance name (i.e. class name) should be returned.
Returns
success

◆ bool() [8/11]

extlang_t::bool ( idaapi * set_attr)

Sets the attribute value of a given object in the global scope.

Parameters
objobject (may be nullptr)
attrattribute name
valueattribute value
Returns
success

◆ bool() [9/11]

extlang_t::bool ( idaapi * call_method)

Calls a member function.

Parameters
[out]resultfunction result or exception
objobject instance
namemethod name to call
argsinput arguments
nargsnumber of input arguments
[out]errbuferror message if evaluation fails
Returns
success

◆ bool() [10/11]

extlang_t::bool ( idaapi * load_procmod)

Compile (load) a file with processor module.

See the note about namespace-awareness in compile_file()

Parameters
[out]procobjcreated object or exception
pathprocessor module file name
[out]errbuferror message if compilation fails
Return values
truesuccess
falseif errbuf is empty then file has been loaded (compiled) successfully but it doesn't contain processor module

◆ bool() [11/11]

extlang_t::bool ( idaapi * unload_procmod) const

Unload previously loaded processor module.

Parameters
pathprocessor module file name
[out]errbufferror message if compilation fails
Returns
success

◆ is_idc()

bool extlang_t::is_idc ( void ) const
inline

◆ is_namespace_aware()

bool extlang_t::is_namespace_aware ( void ) const
inline

◆ release()

void extlang_t::release ( void )
inline

Member Data Documentation

◆ size

size_t extlang_t::size

Size of this structure.

◆ flags

uint32 extlang_t::flags

Language features.

◆ refcnt

int32 extlang_t::refcnt

Reference count.

◆ name [1/2]

const char * extlang_t::name

Language name.

◆ fileext

const char* extlang_t::fileext

File name extension for the language.

◆ highlighter

syntax_highlighter_t* extlang_t::highlighter

◆ current_ea

ea_t extlang_t::current_ea

◆ expr

ea_t const char * extlang_t::expr

◆ errbuf [1/5]

qstring * extlang_t::errbuf

◆ requested_namespace

const char* extlang_t::requested_namespace

◆ errbuf [2/5]

const char qstring* extlang_t::errbuf

◆ args [1/2]

const char const idc_value_t extlang_t::args

◆ nargs [1/2]

const char const idc_value_t size_t extlang_t::nargs

◆ errbuf [3/5]

const char const idc_value_t size_t qstring* extlang_t::errbuf

◆ errbuf [4/5]

qstring* extlang_t::errbuf

◆ obj

const idc_value_t * extlang_t::obj

◆ attr [1/2]

const idc_value_t const char* extlang_t::attr

◆ attr [2/2]

const char* extlang_t::attr

◆ value

const char const idc_value_t& extlang_t::value

◆ name [2/2]

const idc_value_t const char* extlang_t::name

◆ args [2/2]

const idc_value_t const char const idc_value_t extlang_t::args[]

◆ nargs [2/2]

const idc_value_t const char const idc_value_t size_t extlang_t::nargs

◆ errbuf [5/5]

const idc_value_t const char const idc_value_t size_t qstring* extlang_t::errbuf

◆ path

const char* extlang_t::path

The documentation for this struct was generated from the following file: