IDA C++ SDK 9.2
Loading...
Searching...
No Matches
hexrays.hpp
Go to the documentation of this file.
1
6
7#ifndef __HEXRAYS_HPP
8#define __HEXRAYS_HPP
9
91
92#include <pro.h>
93#include <fpro.h>
94#include <ida.hpp>
95#include <idp.hpp>
96#include <gdl.hpp>
97#include <ieee.h>
98#include <loader.hpp>
99#include <kernwin.hpp>
100#include <typeinf.hpp>
101#include <deque>
102#include <queue>
103
231
232#ifdef __NT__
233#pragma warning(push)
234#pragma warning(disable:4062) // enumerator 'x' in switch of enum 'y' is not handled
235#pragma warning(disable:4265) // virtual functions without virtual destructor
236#endif
237
238#define hexapi
239
240// Lint suppressions:
241//lint -sem(mop_t::_make_cases, custodial(1))
242//lint -sem(mop_t::_make_pair, custodial(1))
243//lint -sem(mop_t::_make_callinfo, custodial(1))
244//lint -sem(mop_t::_make_insn, custodial(1))
245//lint -sem(mop_t::make_insn, custodial(1))
246
247// Microcode level forward definitions:
248class mop_t; // microinstruction operand
249class mop_pair_t; // pair of operands. example, :(edx.4,eax.4).8
250class mop_addr_t; // address of an operand. example: &global_var
251class mcallinfo_t; // function call info. example: <cdecl:"int x" #10.4>.8
252class mcases_t; // jump table cases. example: {0 => 12, 1 => 13}
253class minsn_t; // microinstruction
254class mblock_t; // basic block
255class mba_t; // array of blocks, represents microcode for a function
256class codegen_t; // helper class to generate the initial microcode
257class mbl_graph_t; // control flow graph of microcode
258class control_graph_t; // the result of structural analysis
259class edge_mapper_t;
260struct vdui_t; // widget representing the pseudocode window
261struct hexrays_failure_t; // decompilation failure object, is thrown by exceptions
262struct mba_stats_t; // statistics about decompilation of a function
263struct mlist_t; // list of memory and register locations
264struct voff_t; // value offset (microregister number or stack offset)
265typedef std::set<voff_t> voff_set_t;
266struct vivl_t; // value interval (register or stack range)
267typedef int mreg_t;
268
269// Ctree level forward definitions:
270struct cfunc_t; // result of decompilation, the highest level object
271struct citem_t; // base class for cexpr_t and cinsn_t
272struct cexpr_t; // C expression
273struct cinsn_t; // C statement
274struct cblock_t; // C statement block (sequence of statements)
275struct cswitch_t; // C switch statement
276struct carg_t; // call argument
277struct carglist_t; // vector of call arguments
278struct ctry_t; // C++ try-statement
279struct cthrow_t; // C++ throw-statement
280
281typedef std::set<ea_t> easet_t;
282typedef std::set<minsn_t *> minsn_ptr_set_t;
283typedef std::set<qstring> strings_t;
290
291// Function frames must be smaller than this value, otherwise
292// the decompiler will bail out with MERR_HUGESTACK
293#define MAX_SUPPORTED_STACK_SIZE 0x100000 // 1MB
294
295//-------------------------------------------------------------------------
296// Original version of macro DEFINE_MEMORY_ALLOCATION_FUNCS
297// (uses decompiler-specific memory allocation functions)
298#define HEXRAYS_PLACEMENT_DELETE void operator delete(void *, void *) {}
299#define HEXRAYS_MEMORY_ALLOCATION_FUNCS() \
300 void *operator new (size_t _s) { return hexrays_alloc(_s); } \
301 void *operator new[](size_t _s) { return hexrays_alloc(_s); } \
302 void *operator new(size_t /*size*/, void *_v) { return _v; } \
303 void operator delete (void *_blk) { hexrays_free(_blk); } \
304 void operator delete[](void *_blk) { hexrays_free(_blk); } \
305 HEXRAYS_PLACEMENT_DELETE
306
307void *hexapi hexrays_alloc(size_t size);
308void hexapi hexrays_free(void *ptr);
309
311typedef int64 svlr_t;
312enum { MAX_VLR_SIZE = sizeof(uvlr_t) };
316
317//-------------------------------------------------------------------------
319{
320 return size == MAX_VLR_SIZE
322 : (uvlr_t(1) << (size * 8)) - 1;
323}
325{
326 return size == MAX_VLR_SIZE
328 : (uvlr_t(1) << (size * 8 - 1));
329}
331{
332 return size == MAX_VLR_SIZE
334 : (uvlr_t(1) << (size * 8 - 1)) - 1;
335}
336
338{ // the order of comparisons is the same as in microcode opcodes
349};
350inline bool is_unsigned_cmpop(cmpop_t cmpop)
351{
352 return cmpop >= CMP_AE && cmpop <= CMP_BE;
353}
354inline bool is_signed_cmpop(cmpop_t cmpop)
355{
356 return cmpop >= CMP_GT && cmpop <= CMP_LE;
357}
358inline bool is_cmpop_with_eq(cmpop_t cmpop)
359{
360 return cmpop == CMP_AE
361 || cmpop == CMP_BE
362 || cmpop == CMP_GE
363 || cmpop == CMP_LE;
364}
365inline bool is_cmpop_without_eq(cmpop_t cmpop)
366{
367 return cmpop == CMP_A
368 || cmpop == CMP_B
369 || cmpop == CMP_GT
370 || cmpop == CMP_LT;
371}
372
373//-------------------------------------------------------------------------
374// value-range class to keep possible operand value(s).
376{
377protected:
378 int flags;
379#define VLR_TYPE 0x0F // valrng_t type
380#define VLR_NONE 0x00 // no values
381#define VLR_ALL 0x01 // all values
382#define VLR_IVLS 0x02 // union of disjoint intervals
383#define VLR_RANGE 0x03 // strided range
384#define VLR_SRANGE 0x04 // strided range with signed bound
385#define VLR_BITS 0x05 // known bits
386#define VLR_SECT 0x06 // intersection of sub-ranges
387 // each sub-range should be simple or union
388#define VLR_UNION 0x07 // union of sub-ranges
389 // each sub-range should be simple or
390 // intersection
391#define VLR_UNK 0x08 // unknown value (like 'null' in SQL)
392 int size; // operand size: 1..8 bytes
393 // all values must fall within the size
394 union
395 {
396 struct // VLR_RANGE/VLR_SRANGE
397 { // values that are between VALUE and LIMIT
398 // and conform to: value+stride*N
399 uvlr_t value; // initial value
400 uvlr_t limit; // final value
401 // we adjust LIMIT to be on the STRIDE lattice
402 svlr_t stride; // stride between values
403 };
404 struct // VLR_BITS
405 {
406 uvlr_t zeroes; // bits known to be clear
407 uvlr_t ones; // bits known to be set
408 };
409 char reserved[sizeof(qvector<int>)];
410 // VLR_IVLS/VLR_SECT/VLR_UNION
411 };
412 void hexapi clear();
413 void hexapi copy(const valrng_t &r);
414 valrng_t &hexapi assign(const valrng_t &r);
415
416public:
417 explicit valrng_t(int size_ = MAX_VLR_SIZE)
418 : flags(VLR_NONE), size(size_), value(0), limit(0), stride(0) {}
419 valrng_t(const valrng_t &r) { copy(r); }
421 valrng_t &operator=(const valrng_t &r) { return assign(r); }
422 void swap(valrng_t &r) { qswap(*this, r); }
425
426 void set_none() { clear(); }
427 void set_all() { clear(); flags = VLR_ALL; }
428 void set_unk() { clear(); flags = VLR_UNK; }
429 void hexapi set_eq(uvlr_t v);
430 void hexapi set_cmp(cmpop_t cmp, uvlr_t _value);
431
432 // reduce size
433 // it takes the low part of size NEW_SIZE
434 // it returns "true" if size is changed successfully.
435 // e.g.: valrng_t vr(2); vr.set_eq(0x1234);
436 // vr.reduce_size(1);
437 // uvlr_t v; vr.cvt_to_single_value(&v);
438 // assert(v == 0x34);
439 bool hexapi reduce_size(int new_size);
440
441 // Perform intersection or union or inversion.
442 // \return did we change something in THIS?
443 bool hexapi intersect_with(const valrng_t &r);
444 bool hexapi unite_with(const valrng_t &r);
445 void hexapi inverse(); // works for VLR_IVLS only
446
447 bool empty() const { return flags == VLR_NONE; }
448 bool all_values() const { return flags == VLR_ALL; }
449 bool is_unknown() const { return flags == VLR_UNK; }
450 bool hexapi has(uvlr_t v) const;
451
452 void hexapi print(qstring *vout) const;
453 const char *hexapi dstr() const;
454
455 bool hexapi cvt_to_single_value(uvlr_t *v) const;
456 bool hexapi cvt_to_cmp(cmpop_t *cmp, uvlr_t *val) const;
457
458 int get_size() const { return size; }
459 uvlr_t max_value() const { return max_vlr_value(size); }
462};
464
465//-------------------------------------------------------------------------
466// Are we looking for 'must access' or 'may access' information?
467// 'must access' means that the code will always access the specified location(s)
468// 'may access' means that the code may in some cases access the specified location(s)
469// Example: ldx cs.2, r0.4, r1.4
470// MUST_ACCESS: r0.4 and r1.4, usually displayed as r0.8 because r0 and r1 are adjacent
471// MAY_ACCESS: r0.4 and r1.4, and all aliasable memory, because
472// ldx may access any part of the aliasable memory
473typedef int maymust_t;
474const maymust_t
475 // One of the following two bits should be specified:
476 MUST_ACCESS = 0x00, // access information we can count on
477 MAY_ACCESS = 0x01, // access information we should take into account
478 // Optionally combined with the following bits:
480
481 ONE_ACCESS_TYPE = 0x20, // for find_first_use():
482 // use only the specified maymust access type
483 // (by default it inverts the access type for def-lists)
484 INCLUDE_SPOILED_REGS = 0x40, // for build_def_list() with MUST_ACCESS:
485 // include spoiled registers in the list
486 EXCLUDE_PASS_REGS = 0x80, // for build_def_list() with MAY_ACCESS:
487 // exclude pass_regs from the list
488 FULL_XDSU = 0x100, // for build_def_list():
489 // if xds/xdu source and targets are the same
490 // treat it as if xdsu redefines the entire destination
491 WITH_ASSERTS = 0x200, // for find_first_use():
492 // do not ignore assertions
493 EXCLUDE_VOLATILE = 0x400, // for build_def_list():
494 // exclude volatile memory from the list
495 INCLUDE_UNUSED_SRC = 0x800, // for build_use_list():
496 // do not exclude unused source bytes for m_and/m_or insns
497 INCLUDE_DEAD_RETREGS = 0x1000, // for build_def_list():
498 // include dead returned registers in the list
499 INCLUDE_RESTRICTED = 0x2000,// for MAY_ACCESS: include restricted memory
500 CALL_SPOILS_ONLY_ARGS = 0x4000;// for build_def_list() & MAY_ACCESS:
501 // do not include global memory into the
502 // spoiled list of a call
503
504inline THREAD_SAFE bool is_may_access(maymust_t maymust)
505{
506 return (maymust & MAYMUST_ACCESS_MASK) != MUST_ACCESS;
507}
508
509//-------------------------------------------------------------------------
554
555
561
562ea_t hexapi get_merror_desc(qstring *out, merror_t code, mba_t *mba);
563
564//-------------------------------------------------------------------------
565// List of microinstruction opcodes.
566// The order of setX and jX insns is important, it is used in the code.
567
568// Instructions marked with *F may have the FPINSN bit set and operate on fp values
569// Instructions marked with +F must have the FPINSN bit set. They always operate on fp values
570// Other instructions do not operate on fp values.
571
573{
574 m_nop = 0x00, // nop // no operation
575 m_stx = 0x01, // stx l, {r=sel, d=off} // store register to memory *F
576 m_ldx = 0x02, // ldx {l=sel,r=off}, d // load register from memory *F
577 m_ldc = 0x03, // ldc l=const, d // load constant
578 m_mov = 0x04, // mov l, d // move *F
579 m_neg = 0x05, // neg l, d // negate
580 m_lnot = 0x06, // lnot l, d // logical not
581 m_bnot = 0x07, // bnot l, d // bitwise not
582 m_xds = 0x08, // xds l, d // extend (signed)
583 m_xdu = 0x09, // xdu l, d // extend (unsigned)
584 m_low = 0x0A, // low l, d // take low part
585 m_high = 0x0B, // high l, d // take high part
586 m_add = 0x0C, // add l, r, d // l + r -> dst
587 m_sub = 0x0D, // sub l, r, d // l - r -> dst
588 m_mul = 0x0E, // mul l, r, d // l * r -> dst
589 m_udiv = 0x0F, // udiv l, r, d // l / r -> dst
590 m_sdiv = 0x10, // sdiv l, r, d // l / r -> dst
591 m_umod = 0x11, // umod l, r, d // l % r -> dst
592 m_smod = 0x12, // smod l, r, d // l % r -> dst
593 m_or = 0x13, // or l, r, d // bitwise or
594 m_and = 0x14, // and l, r, d // bitwise and
595 m_xor = 0x15, // xor l, r, d // bitwise xor
596 m_shl = 0x16, // shl l, r, d // shift logical left
597 m_shr = 0x17, // shr l, r, d // shift logical right
598 m_sar = 0x18, // sar l, r, d // shift arithmetic right
599 m_cfadd = 0x19, // cfadd l, r, d=carry // calculate carry bit of (l+r)
600 m_ofadd = 0x1A, // ofadd l, r, d=overf // calculate overflow bit of (l+r)
601 m_cfshl = 0x1B, // cfshl l, r, d=carry // calculate carry bit of (l<<r)
602 m_cfshr = 0x1C, // cfshr l, r, d=carry // calculate carry bit of (l>>r)
603 m_sets = 0x1D, // sets l, d=byte SF=1 Sign
604 m_seto = 0x1E, // seto l, r, d=byte OF=1 Overflow of (l-r)
605 m_setp = 0x1F, // setp l, r, d=byte PF=1 Unordered/Parity *F
606 m_setnz = 0x20, // setnz l, r, d=byte ZF=0 Not Equal *F
607 m_setz = 0x21, // setz l, r, d=byte ZF=1 Equal *F
608 m_setae = 0x22, // setae l, r, d=byte CF=0 Unsigned Above or Equal *F
609 m_setb = 0x23, // setb l, r, d=byte CF=1 Unsigned Below *F
610 m_seta = 0x24, // seta l, r, d=byte CF=0 & ZF=0 Unsigned Above *F
611 m_setbe = 0x25, // setbe l, r, d=byte CF=1 | ZF=1 Unsigned Below or Equal *F
612 m_setg = 0x26, // setg l, r, d=byte SF=OF & ZF=0 Signed Greater
613 m_setge = 0x27, // setge l, r, d=byte SF=OF Signed Greater or Equal
614 m_setl = 0x28, // setl l, r, d=byte SF!=OF Signed Less
615 m_setle = 0x29, // setle l, r, d=byte SF!=OF | ZF=1 Signed Less or Equal
616 m_jcnd = 0x2A, // jcnd l, d // d is mop_v or mop_b
617 m_jnz = 0x2B, // jnz l, r, d // ZF=0 Not Equal *F
618 m_jz = 0x2C, // jz l, r, d // ZF=1 Equal *F
619 m_jae = 0x2D, // jae l, r, d // CF=0 Unsigned Above or Equal *F
620 m_jb = 0x2E, // jb l, r, d // CF=1 Unsigned Below *F
621 m_ja = 0x2F, // ja l, r, d // CF=0 & ZF=0 Unsigned Above *F
622 m_jbe = 0x30, // jbe l, r, d // CF=1 | ZF=1 Unsigned Below or Equal *F
623 m_jg = 0x31, // jg l, r, d // SF=OF & ZF=0 Signed Greater
624 m_jge = 0x32, // jge l, r, d // SF=OF Signed Greater or Equal
625 m_jl = 0x33, // jl l, r, d // SF!=OF Signed Less
626 m_jle = 0x34, // jle l, r, d // SF!=OF | ZF=1 Signed Less or Equal
627 m_jtbl = 0x35, // jtbl l, r=mcases // Table jump
628 m_ijmp = 0x36, // ijmp {r=sel, d=off} // indirect unconditional jump
629 m_goto = 0x37, // goto l // l is mop_v or mop_b
630 m_call = 0x38, // call l d // l is mop_v or mop_b or mop_h
631 m_icall = 0x39, // icall {l=sel, r=off} d // indirect call
632 m_ret = 0x3A, // ret
633 m_push = 0x3B, // push l
634 m_pop = 0x3C, // pop d
635 m_und = 0x3D, // und d // undefine
636 m_ext = 0x3E, // ext in1, in2, out1 // external insn, not microcode *F
637 m_f2i = 0x3F, // f2i l, d int(l) => d; convert fp -> integer +F
638 m_f2u = 0x40, // f2u l, d uint(l)=> d; convert fp -> uinteger +F
639 m_i2f = 0x41, // i2f l, d fp(l) => d; convert integer -> fp +F
640 m_u2f = 0x42, // i2f l, d fp(l) => d; convert uinteger -> fp +F
641 m_f2f = 0x43, // f2f l, d l => d; change fp precision +F
642 m_fneg = 0x44, // fneg l, d -l => d; change sign +F
643 m_fadd = 0x45, // fadd l, r, d l + r => d; add +F
644 m_fsub = 0x46, // fsub l, r, d l - r => d; subtract +F
645 m_fmul = 0x47, // fmul l, r, d l * r => d; multiply +F
646 m_fdiv = 0x48, // fdiv l, r, d l / r => d; divide +F
647#define m_max 0x49 // first unused opcode
648};
649
657
658THREAD_SAFE bool hexapi must_mcode_close_block(mcode_t mcode, bool including_calls);
659
660
666
667THREAD_SAFE bool hexapi is_mcode_propagatable(mcode_t mcode);
668
669
670// Is add or sub instruction?
671inline THREAD_SAFE bool is_mcode_addsub(mcode_t mcode) { return mcode == m_add || mcode == m_sub; }
672// Is xds or xdu instruction? We use 'xdsu' as a shortcut for 'xds or xdu'
673inline THREAD_SAFE bool is_mcode_xdsu(mcode_t mcode) { return mcode == m_xds || mcode == m_xdu; }
674// Is a 'set' instruction? (an instruction that sets a condition code)
675inline THREAD_SAFE bool is_mcode_set(mcode_t mcode) { return mcode >= m_sets && mcode <= m_setle; }
676// Is a 1-operand 'set' instruction? Only 'sets' is in this group
677inline THREAD_SAFE bool is_mcode_set1(mcode_t mcode) { return mcode == m_sets; }
678// Is a 1-operand conditional jump instruction? Only 'jcnd' is in this group
679inline THREAD_SAFE bool is_mcode_j1(mcode_t mcode) { return mcode == m_jcnd; }
680// Is a conditional jump?
681inline THREAD_SAFE bool is_mcode_jcond(mcode_t mcode) { return mcode >= m_jcnd && mcode <= m_jle; }
682// Is a 'set' instruction that can be converted into a conditional jump?
683inline THREAD_SAFE bool is_mcode_convertible_to_jmp(mcode_t mcode) { return mcode >= m_setnz && mcode <= m_setle; }
684// Is a conditional jump instruction that can be converted into a 'set'?
685inline THREAD_SAFE bool is_mcode_convertible_to_set(mcode_t mcode) { return mcode >= m_jnz && mcode <= m_jle; }
686// Is a call instruction? (direct or indirect)
687inline THREAD_SAFE bool is_mcode_call(mcode_t mcode) { return mcode == m_call || mcode == m_icall; }
688// Must be an FPU instruction?
689inline THREAD_SAFE bool is_mcode_fpu(mcode_t mcode) { return mcode >= m_f2i; }
690// Is a commutative instruction?
691inline THREAD_SAFE bool is_mcode_commutative(mcode_t mcode)
692{
693 return mcode == m_add
694 || mcode == m_mul
695 || mcode == m_or
696 || mcode == m_and
697 || mcode == m_xor
698 || mcode == m_setz
699 || mcode == m_setnz
700 || mcode == m_cfadd
701 || mcode == m_ofadd;
702}
703// Is a shift instruction?
704inline THREAD_SAFE bool is_mcode_shift(mcode_t mcode)
705{
706 return mcode == m_shl
707 || mcode == m_shr
708 || mcode == m_sar;
709}
710// Is a kind of div or mod instruction?
711inline THREAD_SAFE bool is_mcode_divmod(mcode_t op)
712{
713 return op == m_udiv || op == m_sdiv || op == m_umod || op == m_smod;
714}
715// Is an instruction with the selector/offset pair?
716inline THREAD_SAFE bool has_mcode_seloff(mcode_t op)
717{
718 return op == m_ldx || op == m_stx || op == m_icall || op == m_ijmp;
719}
720
721// Convert setX opcode into corresponding jX opcode
722// This function relies on the order of setX and jX opcodes!
723inline THREAD_SAFE mcode_t set2jcnd(mcode_t code)
724{
725 return mcode_t(code - m_setnz + m_jnz);
726}
727
728// Convert setX opcode into corresponding jX opcode
729// This function relies on the order of setX and jX opcodes!
730inline THREAD_SAFE mcode_t jcnd2set(mcode_t code)
731{
732 return mcode_t(code + m_setnz - m_jnz);
733}
734
735// Negate a conditional opcode.
736// Conditional jumps can be negated, example: jle -> jg
737// 'Set' instruction can be negated, example: seta -> setbe
738// If the opcode cannot be negated, return m_nop
739THREAD_SAFE mcode_t hexapi negate_mcode_relation(mcode_t code);
740
741
742// Swap a conditional opcode.
743// Only conditional jumps and set instructions can be swapped.
744// The returned opcode the one required for swapped operands.
745// Example "x > y" is the same as "y < x", therefore swap(m_jg) is m_jl.
746// If the opcode cannot be swapped, return m_nop
747
748THREAD_SAFE mcode_t hexapi swap_mcode_relation(mcode_t code);
749
750// Return the opcode that performs signed operation.
751// Examples: jae -> jge; udiv -> sdiv
752// If the opcode cannot be transformed into signed form, simply return it.
753
754THREAD_SAFE mcode_t hexapi get_signed_mcode(mcode_t code);
755
756
757// Return the opcode that performs unsigned operation.
758// Examples: jl -> jb; xds -> xdu
759// If the opcode cannot be transformed into unsigned form, simply return it.
760
761THREAD_SAFE mcode_t hexapi get_unsigned_mcode(mcode_t code);
762
763// Does the opcode perform a signed operation?
764inline THREAD_SAFE bool is_signed_mcode(mcode_t code) { return get_unsigned_mcode(code) != code; }
765// Does the opcode perform a unsigned operation?
766inline THREAD_SAFE bool is_unsigned_mcode(mcode_t code) { return get_signed_mcode(code) != code; }
767
768
769// Does the 'd' operand gets modified by the instruction?
770// Example: "add l,r,d" modifies d, while instructions
771// like jcnd, ijmp, stx does not modify it.
772// Note: this function returns 'true' for m_ext but it may be wrong.
773// Use minsn_t::modifies_d() if you have minsn_t.
774
775THREAD_SAFE bool hexapi mcode_modifies_d(mcode_t mcode);
776
777
778// Processor condition codes are mapped to the first microregisters
779// The order is important, see mop_t::is_cc()
781const mreg_t mr_cf = mreg_t(0); // carry bit
782const mreg_t mr_zf = mreg_t(1); // zero bit
783const mreg_t mr_sf = mreg_t(2); // sign bit
784const mreg_t mr_of = mreg_t(3); // overflow bit
785const mreg_t mr_pf = mreg_t(4); // parity bit
786const int cc_count = mr_pf - mr_cf + 1; // number of condition code registers
787const mreg_t mr_cc = mreg_t(5); // synthetic condition code, used internally
788const mreg_t mr_first = mreg_t(8); // the first processor specific register
789
790//-------------------------------------------------------------------------
795struct operand_locator_t
796{
797private:
798 // forbid the default constructor, force the user to initialize objects of this class.
799 operand_locator_t() {}
800public:
802 int opnum;
803 operand_locator_t(ea_t _ea, int _opnum) : ea(_ea), opnum(_opnum) {}
804 DECLARE_COMPARISONS(operand_locator_t);
805 HEXRAYS_MEMORY_ALLOCATION_FUNCS()
806};
807
808//-------------------------------------------------------------------------
812{
814 char opnum;
815 char props = 0;
819#define NF_FIXED 0x01
820#define NF_NEGDONE 0x02
821#define NF_BINVDONE 0x04
822#define NF_NEGATE 0x08
823#define NF_BITNOT 0x10
824#define NF_VALID 0x20
829 char org_nbytes = 0;
834 number_format_t(int _opnum=0) : opnum(char(_opnum)) {}
837 int get_radix() const { return ::get_radix(flags, opnum); }
840 bool is_fixed() const { return props != 0; }
842 bool is_hex() const { return ::is_numop(flags, opnum) && get_radix() == 16; }
844 bool is_dec() const { return ::is_numop(flags, opnum) && get_radix() == 10; }
846 bool is_oct() const { return ::is_numop(flags, opnum) && get_radix() == 8; }
848 bool is_enum() const { return ::is_enum(flags, opnum); }
850 bool is_char() const { return ::is_char(flags, opnum); }
852 bool is_stroff() const { return ::is_stroff(flags, opnum); }
854 bool is_numop() const { return !is_enum() && !is_char() && !is_stroff(); }
858 {
859 return (props & (NF_NEGATE|NF_BITNOT)) != 0 // the user requested it
860 && (props & (NF_NEGDONE|NF_BINVDONE)) == 0; // not done yet
861 }
862 // symbolic constants and struct offsets cannot easily change
863 // their sign or size without a cast. only simple numbers can do that.
864 // for example, by modifying the expression type we can convert:
865 // 10u -> 10
866 // but replacing the type of a symbol constant would lead to an inconsistency.
868 {
869 return (props & NF_VALID) != 0 && (is_stroff() || is_enum());
870 }
871 HEXRAYS_MEMORY_ALLOCATION_FUNCS()
872};
873
874// Number formats are attached to (ea,opnum) pairs
875typedef std::map<operand_locator_t, number_format_t> user_numforms_t;
876
877//-------------------------------------------------------------------------
881{
883 int hdrlines = 0;
891 AS_PRINTF(3, 4) virtual int hexapi print(int indent, const char *format, ...);
892 HEXRAYS_MEMORY_ALLOCATION_FUNCS()
893};
894
897{
898 const cfunc_t *func;
899 char lastchar = 0;
901 vc_printer_t(const cfunc_t *f) : func(f) {}
904 virtual bool idaapi oneliner() const newapi { return false; }
905};
906
909{
910 FILE *fp;
917 AS_PRINTF(3, 4) int hexapi print(int indent, const char *format, ...) override;
919 file_printer_t(FILE *_fp) : fp(_fp) {}
920};
921
924{
928 qstring_printer_t(const cfunc_t *f, qstring &_s, bool tags)
929 : vc_printer_t(f), with_tags(tags), s(_s) {}
930
936 AS_PRINTF(3, 4) int hexapi print(int indent, const char *format, ...) override;
937};
938
939//-------------------------------------------------------------------------
943
946
947const char *hexapi dstr(const tinfo_t *tif);
948
949
952
953bool hexapi is_type_correct(const type_t *ptr);
954
955
959
960bool hexapi is_small_udt(const tinfo_t &tif);
961
962
965
966bool hexapi is_nonbool_type(const tinfo_t &type);
967
968
971
972bool hexapi is_bool_type(const tinfo_t &type);
973
974
976inline THREAD_SAFE bool is_ptr_or_array(type_t t)
977{
978 return is_type_ptr(t) || is_type_array(t);
979}
980
982inline THREAD_SAFE bool is_paf(type_t t)
983{
984 return is_ptr_or_array(t) || is_type_func(t);
985}
986
988inline THREAD_SAFE bool is_inplace_def(const tinfo_t &type)
989{
990 return type.is_decl_complex() && !type.is_typeref();
991}
992
995
996int hexapi partial_type_num(const tinfo_t &type);
997
998
1002
1003tinfo_t hexapi get_float_type(int width);
1004
1005
1010
1011tinfo_t hexapi get_int_type_by_width_and_sign(int srcwidth, type_sign_t sign);
1012
1013
1017
1018tinfo_t hexapi get_unk_type(int size);
1019
1020
1024
1025tinfo_t hexapi dummy_ptrtype(int ptrsize, bool isfp);
1026
1027
1032// the function will return 'char *'
1033
1034tinfo_t hexapi make_pointer(const tinfo_t &type);
1035
1036
1041
1042tinfo_t hexapi create_typedef(const char *name);
1043
1044
1049
1051{
1052 tinfo_t tif;
1053 tif.create_typedef(nullptr, n);
1054 return tif;
1055}
1056
1059{
1060 GUESSED_NONE, // not guessed, specified by the user
1061 GUESSED_WEAK, // not guessed, comes from idb
1062 GUESSED_FUNC, // guessed as a function
1063 GUESSED_DATA, // guessed as a data item
1064 TS_NOELL = 0x8000000, // can be used in set_type() to avoid merging into ellipsis
1065 TS_SHRINK = 0x4000000, // can be used in set_type() to prefer smaller arguments
1066 TS_DONTREF = 0x2000000, // do not mark type as referenced (referenced_types)
1067 TS_MASK = 0xE000000, // all high bits
1068};
1069
1070
1077
1078bool hexapi get_type(uval_t id, tinfo_t *tif, type_source_t guess);
1079
1080
1088
1089bool hexapi set_type(uval_t id, const tinfo_t &tif, type_source_t source, bool force=false);
1090
1092
1093//-------------------------------------------------------------------------
1094// We use our own class to store argument and variable locations.
1095// It is called vdloc_t that stands for 'vd location'.
1096// 'vd' is the internal name of the decompiler, it stands for 'visual decompiler'.
1097// The main differences between vdloc and argloc_t:
1098// ALOC_REG1: the offset is always 0, so it is not used. the register number
1099// uses the whole ~VLOC_MASK field.
1100// ALOC_STACK: stack offsets are always positive because they are based on
1101// the lowest value of sp in the function.
1102class vdloc_t : public argloc_t
1103{
1104 int regoff(); // inaccessible & undefined: regoff() should not be used
1105public:
1106 // Get the register number.
1107 // This function works only for ALOC_REG1 and ALOC_REG2 location types.
1108 // It uses all available bits for register number for ALOC_REG1
1109 int reg1() const { return atype() == ALOC_REG2 ? argloc_t::reg1() : get_reginfo(); }
1110
1111 // Set vdloc to point to the specified register without cleaning it up.
1112 // This is a dangerous function, use set_reg1() instead unless you understand
1113 // what it means to cleanup an argloc.
1114 void _set_reg1(int r1) { argloc_t::_set_reg1(r1, r1>>16); }
1115
1116 // Set vdloc to point to the specified register.
1117 void set_reg1(int r1) { cleanup_argloc(this); _set_reg1(r1); }
1118
1119 // Use member functions of argloc_t for other location types.
1120
1121 // Return textual representation.
1122 // Note: this and all other dstr() functions can be used from a debugger.
1123 // It is much easier than to inspect the memory contents byte by byte.
1124 const char *hexapi dstr(int width=0) const;
1126 bool hexapi is_aliasable(const mba_t *mb, int size) const;
1127};
1128
1131void hexapi print_vdloc(qstring *vout, const vdloc_t &loc, int nbytes);
1132
1133//-------------------------------------------------------------------------
1135bool hexapi arglocs_overlap(const vdloc_t &loc1, size_t w1, const vdloc_t &loc2, size_t w2);
1136
1141{
1143 ea_t defea = BADADDR;
1146
1148 lvar_locator_t(const vdloc_t &loc, ea_t ea) : location(loc), defea(ea) {}
1155 {
1156 return location.is_stkoff() ? location.stkoff() : -1;
1157 }
1158
1159 bool is_reg1() const { return location.is_reg1(); }
1161 bool is_reg2() const { return location.is_reg2(); }
1163 bool is_reg_var() const { return location.is_reg(); }
1165 bool is_stk_var() const { return location.is_stkoff(); }
1167 bool is_scattered() const { return location.is_scattered(); }
1169 mreg_t get_reg1() const { return location.reg1(); }
1171 mreg_t get_reg2() const { return location.reg2(); }
1173 const scattered_aloc_t &get_scattered() const { return location.scattered(); }
1174 scattered_aloc_t &get_scattered() { return location.scattered(); }
1177 // Debugging: get textual representation of a lvar locator.
1178 const char *hexapi dstr() const;
1179};
1180
1183{
1184 friend class mba_t;
1185 int flags;
1189#define CVAR_USED 0x00000001
1190#define CVAR_TYPE 0x00000002
1191#define CVAR_NAME 0x00000004
1192#define CVAR_MREG 0x00000008
1193#define CVAR_NOWD 0x00000010
1194#define CVAR_UNAME 0x00000020
1195#define CVAR_UTYPE 0x00000040
1196#define CVAR_RESULT 0x00000080
1197#define CVAR_ARG 0x00000100
1198#define CVAR_FAKE 0x00000200
1199#define CVAR_OVER 0x00000400
1200#define CVAR_FLOAT 0x00000800
1201#define CVAR_SPOILED 0x00001000
1202#define CVAR_MAPDST 0x00002000
1203#define CVAR_PARTIAL 0x00004000
1204#define CVAR_THISARG 0x00008000
1205#define CVAR_SPLIT 0x00010000
1207#define CVAR_REGNAME 0x00020000
1209#define CVAR_NOPTR 0x00040000
1210#define CVAR_DUMMY 0x00080000
1212#define CVAR_NOTARG 0x00100000
1213#define CVAR_AUTOMAP 0x00200000
1214#define CVAR_BYREF 0x00400000
1215#define CVAR_INASM 0x00800000
1217#define CVAR_UNUSED 0x01000000
1219#define CVAR_SHARED 0x02000000
1220#define CVAR_SCARG 0x04000000
1223
1224public:
1230 int width = 0;
1231 int defblk = -1;
1234
1235 lvar_t() : flags(CVAR_USED) {}
1236 lvar_t(const qstring &n, const vdloc_t &l, ea_t e, const tinfo_t &t, int w, int db)
1237 : lvar_locator_t(l, e), flags(CVAR_USED), name(n), tif(t), width(w), defblk(db)
1238 {
1239 }
1240 // Debugging: get textual representation of a local variable.
1241 const char *hexapi dstr() const;
1242
1244 bool used() const { return (flags & CVAR_USED) != 0; }
1246 bool typed() const { return (flags & CVAR_TYPE) != 0; }
1248 bool mreg_done() const { return (flags & CVAR_MREG) != 0; }
1250 bool has_nice_name() const { return (flags & CVAR_NAME) != 0; }
1252 bool is_unknown_width() const { return (flags & CVAR_NOWD) != 0; }
1254 bool has_user_info() const
1255 {
1256 return (flags & (CVAR_UNAME|CVAR_UTYPE|CVAR_NOPTR|CVAR_UNUSED)) != 0
1257 || !cmt.empty();
1258 }
1259
1260 bool has_user_name() const { return (flags & CVAR_UNAME) != 0; }
1262 bool has_user_type() const { return (flags & CVAR_UTYPE) != 0; }
1264 bool is_result_var() const { return (flags & CVAR_RESULT) != 0; }
1266 bool is_arg_var() const { return (flags & CVAR_ARG) != 0; }
1268 bool hexapi is_promoted_arg() const;
1270 bool is_fake_var() const { return (flags & CVAR_FAKE) != 0; }
1272 bool is_overlapped_var() const { return (flags & CVAR_OVER) != 0; }
1274 bool is_floating_var() const { return (flags & CVAR_FLOAT) != 0; }
1276 bool is_spoiled_var() const { return (flags & CVAR_SPOILED) != 0; }
1278 bool is_partialy_typed() const { return (flags & CVAR_PARTIAL) != 0; }
1280 bool is_noptr_var() const { return (flags & CVAR_NOPTR) != 0; }
1282 bool is_mapdst_var() const { return (flags & CVAR_MAPDST) != 0; }
1284 bool is_thisarg() const { return (flags & CVAR_THISARG) != 0; }
1286 bool is_split_var() const { return (flags & CVAR_SPLIT) != 0; }
1288 bool has_regname() const { return (flags & CVAR_REGNAME) != 0; }
1290 bool in_asm() const { return (flags & CVAR_INASM) != 0; }
1292 bool is_dummy_arg() const { return (flags & CVAR_DUMMY) != 0; }
1294 bool is_notarg() const { return (flags & CVAR_NOTARG) != 0; }
1296 bool is_automapped() const { return (flags & CVAR_AUTOMAP) != 0; }
1298 bool is_used_byref() const { return (flags & CVAR_BYREF) != 0; }
1300 bool is_decl_unused() const { return (flags & CVAR_UNUSED) != 0; }
1302 bool is_shared() const { return (flags & CVAR_SHARED) != 0; }
1304 bool was_scattered_arg() const { return (flags & CVAR_SCARG) != 0; }
1305 void set_used() { flags |= CVAR_USED; }
1306 void clear_used() { flags &= ~CVAR_USED; }
1307 void set_typed() { flags |= CVAR_TYPE; clr_noptr_var(); }
1308 void set_non_typed() { flags &= ~CVAR_TYPE; }
1309 void clr_user_info() { flags &= ~(CVAR_UNAME|CVAR_UTYPE|CVAR_NOPTR); }
1310 void set_user_name() { flags |= CVAR_NAME|CVAR_UNAME; }
1311 void set_user_type() { flags |= CVAR_TYPE|CVAR_UTYPE; }
1312 void clr_user_type() { flags &= ~CVAR_UTYPE; }
1313 void clr_user_name() { flags &= ~CVAR_UNAME; }
1314 void set_mreg_done() { flags |= CVAR_MREG; }
1315 void clr_mreg_done() { flags &= ~CVAR_MREG; }
1316 void set_unknown_width() { flags |= CVAR_NOWD; }
1317 void clr_unknown_width() { flags &= ~CVAR_NOWD; }
1318 void set_arg_var() { flags |= CVAR_ARG; }
1319 void clr_arg_var() { flags &= ~(CVAR_ARG|CVAR_THISARG); }
1320 void set_fake_var() { flags |= CVAR_FAKE; }
1321 void clr_fake_var() { flags &= ~CVAR_FAKE; }
1322 void set_overlapped_var() { flags |= CVAR_OVER; }
1323 void clr_overlapped_var() { flags &= ~CVAR_OVER; }
1324 void set_floating_var() { flags |= CVAR_FLOAT; }
1325 void clr_floating_var() { flags &= ~CVAR_FLOAT; }
1326 void set_spoiled_var() { flags |= CVAR_SPOILED; }
1327 void clr_spoiled_var() { flags &= ~CVAR_SPOILED; }
1328 void set_mapdst_var() { flags |= CVAR_MAPDST; }
1329 void clr_mapdst_var() { flags &= ~CVAR_MAPDST; }
1330 void set_partialy_typed() { flags |= CVAR_PARTIAL; }
1331 void clr_partialy_typed() { flags &= ~CVAR_PARTIAL; }
1332 void set_noptr_var() { flags |= CVAR_NOPTR; }
1333 void clr_noptr_var() { flags &= ~CVAR_NOPTR; }
1334 void set_thisarg() { flags |= CVAR_THISARG; }
1335 void clr_thisarg() { flags &= ~CVAR_THISARG; }
1336 void set_split_var() { flags |= CVAR_SPLIT; }
1337 void clr_split_var() { flags &= ~CVAR_SPLIT; }
1338 void set_dummy_arg() { flags |= CVAR_DUMMY; }
1339 void clr_dummy_arg() { flags &= ~CVAR_DUMMY; }
1340 void set_notarg() { clr_arg_var(); flags |= CVAR_NOTARG; }
1341 void clr_notarg() { flags &= ~CVAR_NOTARG; }
1342 void set_automapped() { flags |= CVAR_AUTOMAP; }
1343 void clr_automapped() { flags &= ~CVAR_AUTOMAP; }
1344 void set_used_byref() { flags |= CVAR_BYREF; }
1345 void clr_used_byref() { flags &= ~CVAR_BYREF; }
1346 void set_decl_unused() { flags |= CVAR_UNUSED; }
1347 void clr_decl_unused() { flags &= ~CVAR_UNUSED; }
1348 void set_shared() { flags |= CVAR_SHARED; }
1349 void clr_shared() { flags &= ~CVAR_SHARED; }
1350 void set_scattered_arg() { flags |= CVAR_SCARG; }
1351 void clr_scattered_arg() { flags &= ~CVAR_SCARG; }
1352
1354 bool has_common(const lvar_t &v) const
1355 {
1357 }
1358
1359 bool has_common_bit(const vdloc_t &loc, asize_t width2) const
1360 {
1361 return arglocs_overlap(location, width, loc, width2);
1362 }
1363
1364 const tinfo_t &type() const { return tif; }
1365 tinfo_t &type() { return tif; }
1366
1369 bool hexapi accepts_type(const tinfo_t &t, bool may_change_thisarg=false);
1380 bool hexapi set_lvar_type(const tinfo_t &t, bool may_fail=false);
1381
1384 {
1386 set_typed();
1387 }
1388
1395 bool hexapi set_width(int w, int svw_flags=0);
1396#define SVW_INT 0x00 // integer value
1397#define SVW_FLOAT 0x01 // floating point value
1398#define SVW_SOFT 0x02 // may fail and return false;
1399 // if this bit is not set and the type is bad, interr
1400
1405 void hexapi append_list(const mba_t *mba, mlist_t *lst, bool pad_if_scattered=false) const;
1406
1410 bool is_aliasable(const mba_t *mba) const
1411 {
1412 return location.is_aliasable(mba, width);
1413 }
1414
1415};
1417
1419struct lvars_t : public qvector<lvar_t>
1420{
1425 int find_input_lvar(const vdloc_t &argloc, int _size) { return find_lvar(argloc, _size, 0); }
1426
1427
1432 int find_input_reg(int reg, int _size=1)
1433 {
1434 vdloc_t rloc;
1435 rloc._set_reg1(reg);
1436 return find_input_lvar(rloc, _size);
1437 }
1438
1439
1444 int hexapi find_stkvar(sval_t spoff, int width);
1445
1446
1450 lvar_t *hexapi find(const lvar_locator_t &ll);
1451
1452
1458 int hexapi find_lvar(const vdloc_t &location, int width, int defblk=-1) const;
1459};
1460
1463{
1469 int flags = 0;
1473#define LVINF_KEEP 0x0001
1479#define LVINF_SPLIT 0x0002
1482#define LVINF_NOPTR 0x0004
1483#define LVINF_NOMAP 0x0008
1484#define LVINF_UNUSED 0x0010
1486 bool has_info() const
1487 {
1488 return !name.empty()
1489 || !type.empty()
1490 || !cmt.empty()
1491 || is_split_lvar()
1492 || is_noptr_lvar()
1493 || is_nomap_lvar();
1494 }
1495 bool operator==(const lvar_saved_info_t &r) const
1496 {
1497 return name == r.name
1498 && cmt == r.cmt
1499 && ll == r.ll
1500 && type == r.type;
1501 }
1502 bool operator!=(const lvar_saved_info_t &r) const { return !(*this == r); }
1503 bool is_kept() const { return (flags & LVINF_KEEP) != 0; }
1504 void clear_keep() { flags &= ~LVINF_KEEP; }
1505 void set_keep() { flags |= LVINF_KEEP; }
1506 bool is_split_lvar() const { return (flags & LVINF_SPLIT) != 0; }
1507 void set_split_lvar() { flags |= LVINF_SPLIT; }
1508 void clr_split_lvar() { flags &= ~LVINF_SPLIT; }
1509 bool is_noptr_lvar() const { return (flags & LVINF_NOPTR) != 0; }
1510 void set_noptr_lvar() { flags |= LVINF_NOPTR; }
1511 void clr_noptr_lvar() { flags &= ~LVINF_NOPTR; }
1512 bool is_nomap_lvar() const { return (flags & LVINF_NOMAP) != 0; }
1513 void set_nomap_lvar() { flags |= LVINF_NOMAP; }
1514 void clr_nomap_lvar() { flags &= ~LVINF_NOMAP; }
1515 bool is_unused_lvar() const { return (flags & LVINF_UNUSED) != 0; }
1516 void set_unused_lvar() { flags |= LVINF_UNUSED; }
1517 void clr_unused_lvar() { flags &= ~LVINF_UNUSED; }
1518};
1521
1523typedef std::map<lvar_locator_t, lvar_locator_t> lvar_mapping_t;
1524
1527{
1531
1534
1538
1542#define ULV_PRECISE_DEFEA 0x0001
1545 int ulv_flags = ULV_PRECISE_DEFEA;
1546
1548 {
1549 lvvec.swap(r.lvvec);
1550 lmaps.swap(r.lmaps);
1551 std::swap(stkoff_delta, r.stkoff_delta);
1552 std::swap(ulv_flags, r.ulv_flags);
1553 }
1554 void clear()
1555 {
1556 lvvec.clear();
1557 lmaps.clear();
1558 stkoff_delta = 0;
1559 ulv_flags = ULV_PRECISE_DEFEA;
1560 }
1561 bool empty() const
1562 {
1563 return lvvec.empty()
1564 && lmaps.empty()
1565 && stkoff_delta == 0
1566 && ulv_flags == ULV_PRECISE_DEFEA;
1567 }
1568
1571 {
1572 for ( lvar_saved_infos_t::iterator p=lvvec.begin(); p != lvvec.end(); ++p )
1573 {
1574 if ( p->ll == vloc )
1575 return p;
1576 }
1577 return nullptr;
1578 }
1579
1581 void keep_info(const lvar_t &v)
1582 {
1584 if ( p != nullptr )
1585 p->set_keep();
1586 }
1587};
1588
1593
1594bool hexapi restore_user_lvar_settings(lvar_uservec_t *lvinf, ea_t func_ea);
1595
1596
1600
1601void hexapi save_user_lvar_settings(ea_t func_ea, const lvar_uservec_t &lvinf);
1602
1603
1606{
1610 virtual bool idaapi modify_lvars(lvar_uservec_t *lvinf) = 0;
1611};
1612
1617
1618bool hexapi modify_user_lvars(ea_t entry_ea, user_lvar_modifier_t &mlv);
1619
1620
1626
1627bool hexapi modify_user_lvar_info(
1628 ea_t func_ea,
1629 uint mli_flags,
1630 const lvar_saved_info_t &info);
1631
1634#define MLI_NAME 0x01
1635#define MLI_TYPE 0x02
1636#define MLI_CMT 0x04
1637#define MLI_SET_FLAGS 0x08
1638#define MLI_CLR_FLAGS 0x10
1640
1641
1649
1650bool hexapi locate_lvar(
1651 lvar_locator_t *out,
1652 ea_t func_ea,
1653 const char *varname);
1654
1655
1663
1664inline bool rename_lvar(
1665 ea_t func_ea,
1666 const char *oldname,
1667 const char *newname)
1668{
1669 lvar_saved_info_t info;
1670 if ( !locate_lvar(&info.ll, func_ea, oldname) )
1671 return false;
1672 info.name = newname;
1673 return modify_user_lvar_info(func_ea, MLI_NAME, info);
1674}
1675
1676//-------------------------------------------------------------------------
1679{
1680 qstring name; // name of the function
1681 tinfo_t tif; // function prototype
1683 {
1684 int code = ::compare(name, r.name);
1685 if ( code == 0 )
1686 code = ::compare(tif, r.tif);
1687 return code;
1688 }
1689
1690 bool empty() const { return name.empty() && tif.empty(); }
1691};
1692
1693// All user-defined function calls (map address -> udcall)
1694typedef std::map<ea_t, udcall_t> udcall_map_t;
1695
1700
1701bool hexapi restore_user_defined_calls(udcall_map_t *udcalls, ea_t func_ea);
1702
1703
1707
1708void hexapi save_user_defined_calls(ea_t func_ea, const udcall_map_t &udcalls);
1709
1710
1716
1717bool hexapi parse_user_call(udcall_t *udc, const char *decl, bool silent);
1718
1719
1724
1725merror_t hexapi convert_to_user_call(const udcall_t &udc, codegen_t &cdg);
1726
1727
1728//-------------------------------------------------------------------------
1738{
1742 virtual bool match(codegen_t &cdg) = 0;
1743
1749 virtual merror_t apply(codegen_t &cdg) = 0;
1750};
1751
1756bool hexapi install_microcode_filter(microcode_filter_t *filter, bool install=true);
1757
1758//-------------------------------------------------------------------------
1762{
1763 udcall_t udc;
1764
1765public:
1767
1770 void hexapi cleanup();
1771
1773 virtual bool match(codegen_t &cdg) override = 0;
1774
1775 bool hexapi init(const char *decl);
1776 virtual merror_t hexapi apply(codegen_t &cdg) override;
1777
1778 bool empty() const { return udc.empty(); }
1779};
1780
1781//-------------------------------------------------------------------------
1782typedef size_t mbitmap_t;
1783const size_t bitset_width = sizeof(mbitmap_t) * CHAR_BIT;
1784const size_t bitset_align = bitset_width - 1;
1785const size_t bitset_shift = 6;
1786
1789{
1790 mbitmap_t *bitmap = nullptr;
1791 size_t high = 0;
1792
1793public:
1795 hexapi bitset_t(const bitset_t &m); // copy constructor
1797 {
1798 qfree(bitmap);
1799 bitmap = nullptr;
1800 }
1802 {
1803 std::swap(bitmap, r.bitmap);
1804 std::swap(high, r.high);
1805 }
1806 bitset_t &operator=(const bitset_t &m) { return copy(m); }
1807 bitset_t &hexapi copy(const bitset_t &m); // assignment operator
1808 bool hexapi add(int bit); // add a bit
1809 bool hexapi add(int bit, int width); // add bits
1810 bool hexapi add(const bitset_t &ml); // add another bitset
1811 bool hexapi sub(int bit); // delete a bit
1812 bool hexapi sub(int bit, int width); // delete bits
1813 bool hexapi sub(const bitset_t &ml); // delete another bitset
1814 bool hexapi cut_at(int maxbit); // delete bits >= maxbit
1815 void hexapi shift_down(int shift); // shift bits down
1816 bool hexapi has(int bit) const; // test presence of a bit
1817 bool hexapi has_all(int bit, int width) const; // test presence of bits
1818 bool hexapi has_any(int bit, int width) const; // test presence of bits
1819 void print(
1820 qstring *vout,
1821 int (*get_bit_name)(qstring *out, int bit, int width, void *ud)=nullptr,
1822 void *ud=nullptr) const;
1823 const char *hexapi dstr() const;
1824 bool hexapi empty() const; // is empty?
1825 int hexapi count() const; // number of set bits
1826 int hexapi count(int bit) const; // get number set bits starting from 'bit'
1827 int hexapi last() const; // get the number of the last bit (-1-no bits)
1828 void clear() { high = 0; } // make empty
1829 void hexapi fill_with_ones(int maxbit);
1830 bool hexapi fill_gaps(int total_nbits);
1831 bool hexapi has_common(const bitset_t &ml) const; // has common elements?
1832 bool hexapi intersect(const bitset_t &ml); // intersect sets. returns true if changed
1833 bool hexapi is_subset_of(const bitset_t &ml) const; // is subset of?
1834 bool includes(const bitset_t &ml) const { return ml.is_subset_of(*this); }
1835 void extract(intvec_t &out) const;
1838 class iterator
1839 {
1840 friend class bitset_t;
1841 int i;
1842 public:
1843 iterator(int n=-1) : i(n) {}
1844 bool operator==(const iterator &n) const { return i == n.i; }
1845 bool operator!=(const iterator &n) const { return i != n.i; }
1846 int operator*() const { return i; }
1847 };
1848 typedef iterator const_iterator;
1849 iterator itat(int n) const { return iterator(goup(n)); }
1850 iterator begin() const { return itat(0); }
1851 iterator end() const { return iterator(high); }
1852 int front() const { return *begin(); }
1853 int back() const { return *end(); }
1854 void inc(iterator &p, int n=1) const { p.i = goup(p.i+n); }
1855private:
1856 int hexapi goup(int reg) const;
1857};
1860
1861//-------------------------------------------------------------------------
1862// set of graph nodes as a bitset
1864{
1865public:
1867 node_bitset_t(int node) { add(node); }
1868};
1870
1871class array_of_node_bitset_t : public qvector<node_bitset_t> {};
1872
1873//-------------------------------------------------------------------------
1874template <class T>
1875struct ivl_tpl // an interval
1876{
1877 ivl_tpl() = delete;
1878public:
1881 ivl_tpl(T _off, T _size) : off(_off), size(_size) {}
1882 bool valid() const { return last() >= off; }
1883 T end() const { return off + size; }
1884 T last() const { return off + size - 1; }
1885
1886 DEFINE_MEMORY_ALLOCATION_FUNCS()
1887};
1888
1889//-------------------------------------------------------------------------
1891struct ivl_t : public uval_ivl_t
1892{
1893private:
1894 typedef ivl_tpl<uval_t> inherited;
1895
1896public:
1897 ivl_t(uval_t _off=0, uval_t _size=0) : inherited(_off,_size) {}
1898 bool empty() const { return size == 0; }
1899 void clear() { size = 0; }
1900 void print(qstring *vout) const;
1901 const char *hexapi dstr() const;
1902
1903 bool extend_to_cover(const ivl_t &r) // extend interval to cover 'r'
1904 {
1905 uval_t new_end = end();
1906 bool changed = false;
1907 if ( off > r.off )
1908 {
1909 off = r.off;
1910 changed = true;
1911 }
1912 if ( new_end < r.end() )
1913 {
1914 new_end = r.end();
1915 changed = true;
1916 }
1917 if ( changed )
1918 size = new_end - off;
1919 return changed;
1920 }
1921 void intersect(const ivl_t &r)
1922 {
1923 uval_t new_off = qmax(off, r.off);
1924 uval_t new_end = end();
1925 if ( new_end > r.end() )
1926 new_end = r.end();
1927 if ( new_off < new_end )
1928 {
1929 off = new_off;
1930 size = new_end - off;
1931 }
1932 else
1933 {
1934 size = 0;
1935 }
1936 }
1937
1938 // do *this and ivl overlap?
1939 bool overlap(const ivl_t &ivl) const
1940 {
1941 return interval::overlap(off, size, ivl.off, ivl.size);
1942 }
1943 // does *this include ivl?
1944 bool includes(const ivl_t &ivl) const
1945 {
1946 return interval::includes(off, size, ivl.off, ivl.size);
1947 }
1948 // does *this contain off2?
1949 bool contains(uval_t off2) const
1950 {
1951 return interval::contains(off, size, off2);
1952 }
1953
1955 static const ivl_t allmem;
1956#define ALLMEM ivl_t::allmem
1957};
1959
1960//-------------------------------------------------------------------------
1962{
1964 const char *whole; // name of the whole interval
1965 const char *part; // prefix to use for parts of the interval (e.g. sp+4)
1966 ivl_with_name_t(): ivl(0, BADADDR), whole("<unnamed inteval>"), part(nullptr) {}
1967 DEFINE_MEMORY_ALLOCATION_FUNCS()
1968};
1969
1970//-------------------------------------------------------------------------
1971template <class Ivl, class T>
1972class ivlset_tpl // set of intervals
1973{
1974public:
1976
1977protected:
1979 bool verify() const;
1980 // we do not store the empty intervals in bag so size == 0 denotes
1981 // MAX_VALUE<T>+1, e.g. 0x100000000 for uint32
1982 static bool ivl_all_values(const Ivl &ivl) { return ivl.off == 0 && ivl.size == 0; }
1983
1984public:
1986 ivlset_tpl(const Ivl &ivl) { if ( ivl.valid() ) bag.push_back(ivl); }
1988
1989 void swap(ivlset_tpl &r) { bag.swap(r.bag); }
1990 const Ivl &getivl(int idx) const { return bag[idx]; }
1991 const Ivl &lastivl() const { return bag.back(); }
1992 size_t nivls() const { return bag.size(); }
1993 bool empty() const { return bag.empty(); }
1994 void clear() { bag.clear(); }
1995 void qclear() { bag.qclear(); }
1996 bool all_values() const { return nivls() == 1 && ivl_all_values(bag[0]); }
1997 void set_all_values() { clear(); bag.push_back(Ivl(0, 0)); }
1998 bool single_value() const { return nivls() == 1 && bag[0].size == 1; }
1999 bool single_value(T v) const { return single_value() && bag[0].off == v; }
2000
2001 bool operator==(const Ivl &v) const { return nivls() == 1 && bag[0] == v; }
2002 bool operator!=(const Ivl &v) const { return !(*this == v); }
2003
2004 typedef typename bag_t::iterator iterator;
2006 const_iterator begin() const { return bag.begin(); }
2007 const_iterator end() const { return bag.end(); }
2008 iterator begin() { return bag.begin(); }
2009 iterator end() { return bag.end(); }
2010};
2011
2012//-------------------------------------------------------------------------
2019{
2022 ivlset_t(const ivl_t &ivl) : inherited(ivl) {}
2023 bool hexapi add(const ivl_t &ivl);
2024 bool add(ea_t ea, asize_t size) { return add(ivl_t(ea, size)); }
2025 bool hexapi add(const ivlset_t &ivs);
2026 bool hexapi addmasked(const ivlset_t &ivs, const ivl_t &mask);
2027 bool hexapi sub(const ivl_t &ivl);
2028 bool sub(ea_t ea, asize_t size) { return sub(ivl_t(ea, size)); }
2029 bool hexapi sub(const ivlset_t &ivs);
2030 bool hexapi has_common(const ivl_t &ivl, bool strict=false) const;
2031 void hexapi print(qstring *vout) const;
2032 const char *hexapi dstr() const;
2033 asize_t hexapi count() const;
2034 bool hexapi has_common(const ivlset_t &ivs) const;
2035 bool hexapi contains(uval_t off) const;
2036 bool hexapi includes(const ivlset_t &ivs) const;
2037 bool hexapi intersect(const ivlset_t &ivs);
2038
2040
2041};
2044//-------------------------------------------------------------------------
2045// We use bitset_t to keep list of registers.
2046// This is the most optimal storage for them.
2047class rlist_t : public bitset_t
2048{
2049public:
2051 rlist_t(const rlist_t &m) : bitset_t(m) {}
2052 rlist_t(mreg_t reg, int width) { add(reg, width); }
2054 rlist_t &operator=(const rlist_t &) = default;
2055 void hexapi print(qstring *vout) const;
2056 const char *hexapi dstr() const;
2057};
2059
2060//-------------------------------------------------------------------------
2061// Microlist: list of register and memory locations
2063{
2064 rlist_t reg; // registers
2065 ivlset_t mem; // memory locations
2066
2068 mlist_t(const ivl_t &ivl) : mem(ivl) {}
2069 mlist_t(mreg_t r, int size) : reg(r, size) {}
2070
2071 void swap(mlist_t &r) { reg.swap(r.reg); mem.swap(r.mem); }
2072 bool hexapi addmem(ea_t ea, asize_t size);
2073 bool add(mreg_t r, int size) { return add(mlist_t(r, size)); } // also see append_def_list()
2074 bool add(const rlist_t &r) { return reg.add(r); }
2075 bool add(const ivl_t &ivl) { return add(mlist_t(ivl)); }
2076 bool add(const mlist_t &lst)
2077 {
2078 bool changed = reg.add(lst.reg);
2079 if ( mem.add(lst.mem) )
2080 changed = true;
2081 return changed;
2082 }
2083 bool sub(mreg_t r, int size) { return sub(mlist_t(r, size)); }
2084 bool sub(const ivl_t &ivl) { return sub(mlist_t(ivl)); }
2085 bool sub(const mlist_t &lst)
2086 {
2087 bool changed = reg.sub(lst.reg);
2088 if ( mem.sub(lst.mem) )
2089 changed = true;
2090 return changed;
2091 }
2092 asize_t count() const { return reg.count() + mem.count(); }
2093 void hexapi print(qstring *vout) const;
2094 const char *hexapi dstr() const;
2095 bool empty() const { return reg.empty() && mem.empty(); }
2096 void clear() { reg.clear(); mem.clear(); }
2097 bool has(mreg_t r) const { return reg.has(r); }
2098 bool has_all(mreg_t r, int size) const { return reg.has_all(r, size); }
2099 bool has_any(mreg_t r, int size) const { return reg.has_any(r, size); }
2100 bool has_memory() const { return !mem.empty(); }
2101 bool has_allmem() const { return mem == ALLMEM; }
2102 bool has_common(const mlist_t &lst) const { return reg.has_common(lst.reg) || mem.has_common(lst.mem); }
2103 bool includes(const mlist_t &lst) const { return reg.includes(lst.reg) && mem.includes(lst.mem); }
2104 bool intersect(const mlist_t &lst)
2105 {
2106 bool changed = reg.intersect(lst.reg);
2107 if ( mem.intersect(lst.mem) )
2108 changed = true;
2109 return changed;
2110 }
2111 bool is_subset_of(const mlist_t &lst) const { return lst.includes(*this); }
2112
2114 HEXRAYS_MEMORY_ALLOCATION_FUNCS()
2115};
2119
2120//-------------------------------------------------------------------------
2127const mlist_t &hexapi get_temp_regs();
2128
2134bool hexapi is_kreg(mreg_t r);
2135
2139mreg_t hexapi reg2mreg(int reg);
2140
2145int hexapi mreg2reg(mreg_t reg, int width);
2146
2155
2156int hexapi get_mreg_name(qstring *out, mreg_t reg, int width, void *ud=nullptr);
2157
2158//-------------------------------------------------------------------------
2161{
2162 virtual ~optinsn_t() {}
2180 virtual int idaapi func(mblock_t *blk, minsn_t *ins, int optflags) = 0;
2181};
2182
2186void hexapi install_optinsn_handler(optinsn_t *opt);
2187
2189bool hexapi remove_optinsn_handler(optinsn_t *opt);
2190
2193{
2194 virtual ~optblock_t() {}
2207 virtual int idaapi func(mblock_t *blk) = 0;
2208};
2209
2213void hexapi install_optblock_handler(optblock_t *opt);
2214
2216bool hexapi remove_optblock_handler(optblock_t *opt);
2217
2218
2219//-------------------------------------------------------------------------
2220// abstract graph interface
2222{
2223 // does a path from 'm' to 'n' exist?
2224 bool path_exists(node_bitset_t &visited, int m, int n) const;
2225protected:
2226 void calc_outgoing_edges(const intvec_t &sub, edgevec_t &el) const;
2227 void compute_dominator_info(struct dominator_info_t &di);
2228 bool is_connected_without(const edge_t &forbidden_edge, const intvec_t &dead_nodes) const;
2229public:
2231 bool colored_gdl_edges = false;
2232
2234 // this call is used to exclude edges in worklist_iterate... functions()
2235 virtual bool ignore_edge(int /*src*/, int /*dst*/ ) const newapi { return false; }
2236
2237 void hexapi compute_dominators(array_of_node_bitset_t &domin, bool post=false) const;
2238 void hexapi compute_immediate_dominators(
2239 const array_of_node_bitset_t &domin,
2240 intvec_t &idomin,
2241 bool post=false) const;
2242 int hexapi depth_first_preorder(node_ordering_t *pre) const; // returns number of visited nodes
2243 int hexapi depth_first_postorder(node_ordering_t *post) const; // returns number of visited nodes
2244#ifndef SWIG
2245 void depth_first_postorder(node_ordering_t *post, edge_mapper_t *et) const;
2248
2249 // find nodes reaching 'n'
2250 void find_reaching_nodes(int n, node_bitset_t &reaching) const;
2251
2252 // does a path from 'm' to 'n' exist?
2253 bool path_exists(int m, int n) const;
2254
2255 // is there a path from M to N which terminates with a back edge to N?
2256 bool path_back(const array_of_node_bitset_t &domin, int m, int n) const;
2257 bool path_back(const edge_mapper_t &et, int m, int n) const;
2258#endif
2259
2260 class iterator
2261 {
2262 friend class simple_graph_t;
2263 int i;
2264 iterator(int n) : i(n) {}
2265 public:
2266 bool operator==(const iterator &n) const { return i == n.i; }
2267 bool operator!=(const iterator &n) const { return i != n.i; }
2268 int operator*() const { return i; }
2269 };
2271 iterator begin() const { return iterator(goup(0)); }
2272 iterator end() const { return iterator(size()); }
2273 int front() const { return *begin(); }
2274 void inc(iterator &p, int n=1) const { p.i = goup(p.i+n); }
2275 virtual int hexapi goup(int node) const newapi;
2276};
2277
2278//-------------------------------------------------------------------------
2279// Since our data structures are quite complex, we use the visitor pattern
2280// in many of our algorthims. This functionality is available for plugins too.
2281// https://en.wikipedia.org/wiki/Visitor_pattern
2282
2283// All our visitor callbacks return an integer value.
2284// Visiting is interrupted as soon an the return value is non-zero.
2285// This non-zero value is returned as the result of the for_all_... function.
2286// If for_all_... returns 0, it means that it successfully visited all items.
2287
2290{
2291 mba_t *mba; // current microcode
2292 mblock_t *blk; // current block
2293 minsn_t *topins; // top level instruction (parent of curins or curins itself)
2294 minsn_t *curins; // currently visited instruction
2295
2297 mba_t *_mba=nullptr,
2298 mblock_t *_blk=nullptr,
2299 minsn_t *_topins=nullptr)
2300 : mba(_mba), blk(_blk), topins(_topins), curins(nullptr) {}
2303 bool really_alloc() const;
2304};
2305
2310{
2312 mba_t *_mba=nullptr,
2313 mblock_t *_blk=nullptr,
2314 minsn_t *_topins=nullptr)
2315 : op_parent_info_t(_mba, _blk, _topins) {}
2316 virtual int idaapi visit_minsn() = 0;
2317};
2318
2323{
2326 bool prune = false;
2327
2329 mba_t *_mba=nullptr,
2330 mblock_t *_blk=nullptr,
2331 minsn_t *_topins=nullptr)
2332 : op_parent_info_t(_mba, _blk, _topins) {}
2333 virtual int idaapi visit_mop(mop_t *op, const tinfo_t *type, bool is_target) = 0;
2334};
2335
2339{
2342 virtual int idaapi visit_scif_mop(const mop_t &r, int off) = 0;
2343};
2344
2345// Used operand visitor.
2346// See mblock_t::for_all_uses
2348{
2349 minsn_t *topins = nullptr;
2350 minsn_t *curins = nullptr;
2351 bool changed = false;
2352 mlist_t *list = nullptr;
2355 bool prune = false;
2356
2359 virtual int idaapi visit_mop(mop_t *op) = 0;
2360};
2361
2362//-------------------------------------------------------------------------
2364
2366const mopt_t
2367 mop_z = 0,
2368 mop_r = 1,
2369 mop_n = 2,
2371 mop_d = 4,
2372 mop_S = 5,
2373 mop_v = 6,
2374 mop_b = 7,
2375 mop_f = 8,
2376 mop_l = 9,
2377 mop_a = 10,
2378 mop_h = 11,
2379 mop_c = 12,
2380 mop_fn = 13,
2381 mop_p = 14,
2382 mop_sc = 15;
2383
2384const int NOSIZE = -1;
2385
2386//-------------------------------------------------------------------------
2389{
2397 mba_t *const mba;
2399 int idx;
2400 lvar_ref_t(mba_t *m, int i, sval_t o=0) : mba(m), off(o), idx(i) {}
2401 lvar_ref_t(const lvar_ref_t &r) : mba(r.mba), off(r.off), idx(r.idx) {}
2403 {
2404 off = r.off;
2405 idx = r.idx;
2406 return *this;
2407 }
2410 void swap(lvar_ref_t &r)
2411 {
2412 std::swap(off, r.off);
2413 std::swap(idx, r.idx);
2414 }
2415 lvar_t &hexapi var() const;
2416};
2417
2418//-------------------------------------------------------------------------
2421{
2425 mba_t *const mba;
2426
2431
2432 stkvar_ref_t(mba_t *m, sval_t o) : mba(m), off(o) {}
2435 void swap(stkvar_ref_t &r)
2436 {
2437 std::swap(off, r.off);
2438 }
2439
2443 ssize_t hexapi get_stkvar(udm_t *udm=nullptr, uval_t *p_idaoff=nullptr) const;
2444};
2445
2446//-------------------------------------------------------------------------
2448struct scif_t : public vdloc_t
2449{
2456
2461
2465
2466 scif_t(mba_t *_mba, tinfo_t *tif, qstring *n=nullptr) : mba(_mba)
2467 {
2468 if ( n != nullptr )
2469 n->swap(name);
2470 tif->swap(type);
2471 }
2472 scif_t &operator =(const vdloc_t &loc)
2473 {
2474 *(vdloc_t *)this = loc;
2475 return *this;
2476 }
2477};
2478
2479//-------------------------------------------------------------------------
2482struct mnumber_t : public operand_locator_t
2483{
2485 uint64 org_value; // original value before changing the operand size
2486 mnumber_t(uint64 v, ea_t _ea=BADADDR, int n=0)
2487 : operand_locator_t(_ea, n), value(v), org_value(v) {}
2490 {
2491 if ( value < r.value )
2492 return -1;
2493 if ( value > r.value )
2494 return -1;
2495 return 0;
2496 }
2497 // always use this function instead of manually modifying the 'value' field
2499 {
2500 value = val64;
2501 org_value = val64;
2502 }
2503};
2504
2505//-------------------------------------------------------------------------
2509{
2512 operator uint16 *() { return fnum.w; }
2513 operator const uint16 *() const { return fnum.w; }
2514 void hexapi print(qstring *vout) const;
2515 const char *hexapi dstr() const;
2517 DECLARE_COMPARISONS(fnumber_t)
2518 {
2519 return ecmp(fnum, r.fnum);
2520 }
2521 int calc_max_exp() const
2522 {
2523 return nbytes <= 4 ? MAXEXP_FLOAT
2524 : nbytes <= 8 ? MAXEXP_DOUBLE
2525 : MAXEXP_LNGDBL;
2526 }
2527 bool is_nan() const
2528 {
2530 }
2531};
2532
2533//-------------------------------------------------------------------------
2536#define SHINS_NUMADDR 0x01
2537#define SHINS_VALNUM 0x02
2538#define SHINS_SHORT 0x04
2539#define SHINS_LDXEA 0x08
2541
2542//-------------------------------------------------------------------------
2557
2558//-------------------------------------------------------------------------
2564{
2565 void hexapi copy(const mop_t &rop);
2566public:
2569
2572#define OPROP_IMPDONE 0x01
2573#define OPROP_UDT 0x02
2574#define OPROP_FLOAT 0x04
2575#define OPROP_CCFLAGS 0x08
2578#define OPROP_UDEFVAL 0x10
2579#define OPROP_LOWADDR 0x20
2580#define OPROP_ABI 0x40
2583
2588
2591 int size;
2592
2597 union
2598 {
2599 mreg_t r; // mop_r register number
2600 mnumber_t *nnn; // mop_n immediate value
2601 minsn_t *d; // mop_d result (destination) of another instruction
2602 stkvar_ref_t *s; // mop_S stack variable
2603 ea_t g; // mop_v global variable (its linear address)
2604 int b; // mop_b block number (used in jmp,call instructions)
2605 mcallinfo_t *f; // mop_f function call information
2606 lvar_ref_t *l; // mop_l local variable
2607 mop_addr_t *a; // mop_a variable whose address is taken
2608 char *helper; // mop_h helper function name
2609 char *cstr; // mop_str utf8 string constant, user representation
2610 mcases_t *c; // mop_c cases
2611 fnumber_t *fpc; // mop_fn floating point constant
2612 mop_pair_t *pair; // mop_p operand pair
2613 scif_t *scif; // mop_sc scattered operand info
2614 };
2615 // -- End of data fields, member function declarations follow:
2616
2617 void set_impptr_done() { oprops |= OPROP_IMPDONE; }
2618 void set_udt() { oprops |= OPROP_UDT; }
2619 void set_undef_val() { oprops |= OPROP_UDEFVAL; }
2620 void set_lowaddr() { oprops |= OPROP_LOWADDR; }
2621 void set_for_abi() { oprops |= OPROP_ABI; }
2622 bool is_impptr_done() const { return (oprops & OPROP_IMPDONE) != 0; }
2623 bool is_udt() const { return (oprops & OPROP_UDT) != 0; }
2624 bool probably_floating() const { return (oprops & OPROP_FLOAT) != 0; }
2625 bool is_undef_val() const { return (oprops & OPROP_UDEFVAL) != 0; }
2626 bool is_lowaddr() const { return (oprops & OPROP_LOWADDR) != 0; }
2627 bool is_for_abi() const { return (oprops & OPROP_ABI) != 0; }
2628 bool is_ccflags() const
2629 {
2630 return (oprops & OPROP_CCFLAGS) != 0
2631 && (t == mop_l || t == mop_v || t == mop_S || t == mop_r);
2632 }
2633 bool is_pcval() const
2634 {
2635 return t == mop_n && (oprops & OPROP_CCFLAGS) != 0;
2636 }
2638 {
2639 return is_glbaddr() && (oprops & OPROP_CCFLAGS) != 0;
2640 }
2641
2642 mop_t() { zero(); }
2643 mop_t(const mop_t &rop) { copy(rop); }
2644 mop_t(mreg_t _r, int _s) : t(mop_r), oprops(0), valnum(0), size(_s), r(_r) {}
2645 mop_t &operator=(const mop_t &rop) { return assign(rop); }
2646 mop_t &hexapi assign(const mop_t &rop);
2648 {
2649 erase();
2650 }
2652 void zero() { t = mop_z; oprops = 0; valnum = 0; size = NOSIZE; nnn = nullptr; }
2653 void hexapi swap(mop_t &rop);
2654 void hexapi erase();
2655 void erase_but_keep_size() { int s2 = size; erase(); size = s2; }
2656
2657 void hexapi print(qstring *vout, int shins_flags=SHINS_SHORT|SHINS_VALNUM) const;
2658 const char *hexapi dstr() const; // use this function for debugging
2659
2660 //-----------------------------------------------------------------------
2661 // Operand creation
2662 //-----------------------------------------------------------------------
2670 bool hexapi create_from_mlist(mba_t *mba, const mlist_t &lst, sval_t fullsize);
2671
2679 bool hexapi create_from_ivlset(mba_t *mba, const ivlset_t &ivs, sval_t fullsize);
2680
2689 void hexapi create_from_vdloc(mba_t *mba, const vdloc_t &loc, int _size);
2690
2700 void hexapi create_from_scattered_vdloc(
2701 mba_t *mba,
2702 const char *name,
2703 tinfo_t type,
2704 const vdloc_t &loc);
2705
2711 void hexapi create_from_insn(const minsn_t *m);
2712
2718 void hexapi make_number(uint64 _value, int _size, ea_t _ea=BADADDR, int opnum=0);
2719
2725 bool hexapi make_fpnum(const void *bytes, size_t _size);
2726
2732 {
2733 t = mop_r;
2734 r = reg;
2735 }
2736 void _make_reg(mreg_t reg, int _size)
2737 {
2738 t = mop_r;
2739 r = reg;
2740 size = _size;
2741 }
2742
2743 void make_reg(mreg_t reg) { erase(); _make_reg(reg); }
2744 void make_reg(mreg_t reg, int _size) { erase(); _make_reg(reg, _size); }
2745
2752 void _make_lvar(mba_t *mba, int idx, sval_t off=0)
2753 {
2754 t = mop_l;
2755 l = new lvar_ref_t(mba, idx, off);
2756 }
2757
2762 void hexapi _make_gvar(ea_t ea);
2764 void hexapi make_gvar(ea_t ea);
2765
2771 void _make_stkvar(mba_t *mba, sval_t off)
2772 {
2773 t = mop_S;
2774 s = new stkvar_ref_t(mba, off);
2775 }
2776 void make_stkvar(mba_t *mba, sval_t off) { erase(); _make_stkvar(mba, off); }
2777
2782 void hexapi make_reg_pair(int loreg, int hireg, int halfsize);
2783
2789 void _make_insn(minsn_t *ins);
2791 void make_insn(minsn_t *ins) { erase(); _make_insn(ins); }
2792
2797 void _make_blkref(int blknum)
2798 {
2799 t = mop_b;
2800 b = blknum;
2801 }
2802
2803 void make_blkref(int blknum) { erase(); _make_blkref(blknum); }
2804
2808 void hexapi make_helper(const char *name);
2809
2811 void _make_strlit(const char *str)
2812 {
2813 t = mop_str;
2814 cstr = ::qstrdup(str);
2815 }
2816 void _make_strlit(qstring *str) // str is consumed
2817 {
2818 t = mop_str;
2819 cstr = str->extract();
2820 }
2821
2827 {
2828 t = mop_f;
2829 f = fi;
2830 }
2831
2835 void _make_cases(mcases_t *_cases)
2836 {
2837 t = mop_c;
2838 c = _cases;
2839 }
2840
2845 {
2846 t = mop_p;
2847 pair = _pair;
2848 }
2849
2850 //-----------------------------------------------------------------------
2851 // Various operand tests
2852 //-----------------------------------------------------------------------
2853 bool empty() const { return t == mop_z; }
2855 bool is_glbvar() const { return t == mop_v; }
2857 bool is_stkvar() const { return t == mop_S; }
2860 bool is_reg() const { return t == mop_r; }
2862 bool is_reg(mreg_t _r) const { return t == mop_r && r == _r; }
2864 bool is_reg(mreg_t _r, int _size) const { return t == mop_r && r == _r && size == _size; }
2866 bool is_arglist() const { return t == mop_f; }
2868 bool is_cc() const { return is_reg() && r >= mr_cf && r < mr_first; }
2871 static bool hexapi is_bit_reg(mreg_t reg);
2872 bool is_bit_reg() const { return is_reg() && is_bit_reg(r); }
2874 bool is_kreg() const;
2876 bool is_mblock() const { return t == mop_b; }
2878 bool is_mblock(int serial) const { return is_mblock() && b == serial; }
2880 bool is_scattered() const { return t == mop_sc; }
2882 bool is_glbaddr() const;
2884 bool is_glbaddr(ea_t ea) const;
2886 bool is_stkaddr() const;
2888 bool is_insn() const { return t == mop_d; }
2890 bool is_insn(mcode_t code) const;
2893 bool has_side_effects(bool include_ldx_and_divs=false) const;
2895 bool hexapi may_use_aliased_memory() const;
2896
2900 bool hexapi is01() const;
2901
2907 bool hexapi is_sign_extended_from(int nbytes) const;
2908
2914 bool hexapi is_zero_extended_from(int nbytes) const;
2915
2917 bool is_extended_from(int nbytes, bool is_signed) const
2918 {
2919 if ( is_signed )
2921 else
2923 }
2924
2925 //-----------------------------------------------------------------------
2926 // Comparisons
2927 //-----------------------------------------------------------------------
2932 bool hexapi equal_mops(const mop_t &rop, int eqflags) const;
2933 bool operator==(const mop_t &rop) const { return equal_mops(rop, 0); }
2934 bool operator!=(const mop_t &rop) const { return !equal_mops(rop, 0); }
2935
2938 bool operator <(const mop_t &rop) const { return lexcompare(rop) < 0; }
2939 friend int lexcompare(const mop_t &a, const mop_t &b) { return a.lexcompare(b); }
2940 int hexapi lexcompare(const mop_t &rop) const;
2941
2942 //-----------------------------------------------------------------------
2943 // Visiting operand parts
2944 //-----------------------------------------------------------------------
2950 int hexapi for_all_ops(
2951 mop_visitor_t &mv,
2952 const tinfo_t *type=nullptr,
2953 bool is_target=false);
2954
2960 int hexapi for_all_scattered_submops(scif_visitor_t &sv) const;
2961
2962 //-----------------------------------------------------------------------
2963 // Working with mop_n operands
2964 //-----------------------------------------------------------------------
2968 uint64 value(bool is_signed) const { return extend_sign(nnn->value, size, is_signed); }
2969 int64 signed_value() const { return value(true); }
2970 uint64 unsigned_value() const { return value(false); }
2972 {
2973 nnn->update_value(extend_sign(val, size, false));
2974 }
2975
2980 bool hexapi is_constant(uint64 *out=nullptr, bool is_signed=true) const;
2981
2982 bool is_equal_to(uint64 n, bool is_signed=true) const
2983 {
2984 uint64 v;
2985 return is_constant(&v, is_signed) && v == n;
2986 }
2987 bool is_zero() const { return is_equal_to(0, false); }
2988 bool is_one() const { return is_equal_to(1, false); }
2990 {
2991 uint64 v;
2992 return is_constant(&v, true) && int64(v) > 0;
2993 }
2995 {
2996 uint64 v;
2997 return is_constant(&v, true) && int64(v) < 0;
2998 }
2999
3000 //-----------------------------------------------------------------------
3001 // Working with mop_S operands
3002 //-----------------------------------------------------------------------
3007 ssize_t get_stkvar(udm_t *udm=nullptr, uval_t *p_idaoff=nullptr) const
3008 {
3009 return s->get_stkvar(udm, p_idaoff);
3010 }
3011
3017 bool hexapi get_stkoff(sval_t *p_vdoff) const;
3018
3019 //-----------------------------------------------------------------------
3020 // Working with mop_d operands
3021 //-----------------------------------------------------------------------
3026 const minsn_t *get_insn(mcode_t code) const;
3027 minsn_t *get_insn(mcode_t code);
3028
3029 //-----------------------------------------------------------------------
3030 // Transforming operands
3031 //-----------------------------------------------------------------------
3036 bool hexapi make_low_half(int width);
3037
3042 bool hexapi make_high_half(int width);
3043
3048 bool hexapi make_first_half(int width);
3049
3054 bool hexapi make_second_half(int width);
3055
3065 bool hexapi shift_mop(int offset);
3066
3075 bool hexapi change_size(int nsize, side_effect_t sideff=WITH_SIDEFF);
3076 bool double_size(side_effect_t sideff=WITH_SIDEFF) { return change_size(size*2, sideff); }
3077
3091 bool hexapi preserve_side_effects(
3092 mblock_t *blk,
3093 minsn_t *top,
3094 bool *moved_calls=nullptr);
3095
3102 void hexapi apply_ld_mcode(mcode_t mcode, ea_t ea, int newsize);
3103 void apply_xdu(ea_t ea, int newsize) { apply_ld_mcode(m_xdu, ea, newsize); }
3104 void apply_xds(ea_t ea, int newsize) { apply_ld_mcode(m_xds, ea, newsize); }
3105};
3107
3110{
3111public:
3114 HEXRAYS_MEMORY_ALLOCATION_FUNCS()
3115};
3116
3118class mop_addr_t : public mop_t
3119{
3120public:
3121 int insize = NOSIZE; // how many bytes of the pointed operand can be read
3122 int outsize = NOSIZE; // how many bytes of the pointed operand can be written
3123
3126 : mop_t(ra), insize(ra.insize), outsize(ra.outsize) {}
3127 mop_addr_t(const mop_t &ra, int isz, int osz)
3128 : mop_t(ra), insize(isz), outsize(osz) {}
3129
3131 {
3132 *(mop_t *)this = mop_t(rop);
3133 insize = rop.insize;
3134 outsize = rop.outsize;
3135 return *this;
3136 }
3137 int lexcompare(const mop_addr_t &ra) const
3138 {
3139 int code = mop_t::lexcompare(ra);
3140 return code != 0 ? code
3141 : insize != ra.insize ? (insize-ra.insize)
3142 : outsize != ra.outsize ? (outsize-ra.outsize)
3143 : 0;
3144 }
3145};
3146
3148class mcallarg_t : public mop_t // #callarg
3149{
3150public:
3151 ea_t ea = BADADDR;
3157
3159 mcallarg_t(const mop_t &rarg) : mop_t(rarg) {}
3160 void copy_mop(const mop_t &op) { *(mop_t *)this = op; }
3161 void hexapi print(qstring *vout, int shins_flags=SHINS_SHORT|SHINS_VALNUM) const;
3162 const char *hexapi dstr() const;
3163 void hexapi set_regarg(mreg_t mr, int sz, const tinfo_t &tif);
3164 void set_regarg(mreg_t mr, const tinfo_t &tif)
3165 {
3166 set_regarg(mr, tif.get_size(), tif);
3167 }
3168 void set_regarg(mreg_t mr, char dt, type_sign_t sign = type_unsigned)
3169 {
3170 int sz = get_dtype_size(dt);
3171 set_regarg(mr, sz, get_int_type_by_width_and_sign(sz, sign));
3172 }
3173 void make_int(int val, ea_t val_ea, int opno = 0)
3174 {
3175 type = tinfo_t(BTF_INT);
3176 make_number(val, inf_get_cc_size_i(), val_ea, opno);
3177 }
3178 void make_uint(int val, ea_t val_ea, int opno = 0)
3179 {
3181 make_number(val, inf_get_cc_size_i(), val_ea, opno);
3182 }
3183};
3186
3234
3237#define FUNC_NAME_MEMCPY "memcpy"
3238#define FUNC_NAME_WMEMCPY "wmemcpy"
3239#define FUNC_NAME_MEMSET "memset"
3240#define FUNC_NAME_WMEMSET "wmemset"
3241#define FUNC_NAME_MEMSET32 "memset32"
3242#define FUNC_NAME_MEMSET64 "memset64"
3243#define FUNC_NAME_STRCPY "strcpy"
3244#define FUNC_NAME_WCSCPY "wcscpy"
3245#define FUNC_NAME_STRLEN "strlen"
3246#define FUNC_NAME_WCSLEN "wcslen"
3247#define FUNC_NAME_STRCAT "strcat"
3248#define FUNC_NAME_WCSCAT "wcscat"
3249#define FUNC_NAME_TAIL "tail"
3250#define FUNC_NAME_VA_ARG "va_arg"
3251#define FUNC_NAME_EMPTY "$empty"
3252#define FUNC_NAME_PRESENT "$present"
3253#define FUNC_NAME_CONTAINING_RECORD "CONTAINING_RECORD"
3254#define FUNC_NAME_MORESTACK "runtime_morestack"
3256
3257
3258// the default 256 function arguments is too big, we use a lower value
3259#undef MAX_FUNC_ARGS
3260#define MAX_FUNC_ARGS 64
3261
3263class mcallinfo_t // #callinfo
3264{
3265public:
3269 int call_spd = 0;
3270 int stkargs_top = 0;
3277
3287 int flags = 0;
3290#define FCI_PROP 0x001
3291#define FCI_DEAD 0x002
3292#define FCI_FINAL 0x004
3293#define FCI_NORET 0x008
3294#define FCI_PURE 0x010
3295#define FCI_NOSIDE 0x020
3296#define FCI_SPLOK 0x040
3301#define FCI_HASCALL 0x080
3304#define FCI_HASFMT 0x100
3306#define FCI_EXPLOCS 0x400
3310
3311 mcallinfo_t(ea_t _callee=BADADDR, int _sargs=0)
3312 : callee(_callee), solid_args(_sargs)
3313 {
3314 }
3316 int hexapi lexcompare(const mcallinfo_t &f) const;
3317 bool hexapi set_type(const tinfo_t &type);
3318 tinfo_t hexapi get_type() const;
3319 bool is_vararg() const { return is_vararg_cc(cc); }
3320 void hexapi print(qstring *vout, int size=-1, int shins_flags=SHINS_SHORT|SHINS_VALNUM) const;
3321 const char *hexapi dstr() const;
3322};
3323
3325class mcases_t // #cases
3326{
3327public:
3330
3331 void swap(mcases_t &r) { values.swap(r.values); targets.swap(r.targets); }
3334 bool empty() const { return targets.empty(); }
3335 size_t size() const { return targets.size(); }
3336 void resize(int s) { values.resize(s); targets.resize(s); }
3337 void hexapi print(qstring *vout) const;
3338 const char *hexapi dstr() const;
3339};
3340
3341//-------------------------------------------------------------------------
3344{
3347
3349 voff_t(mopt_t _type, sval_t _off) : off(_off), type(_type) {}
3350 voff_t(const mop_t &op)
3351 {
3352 if ( op.is_reg() || op.is_stkvar() )
3353 set(op.t, op.is_reg() ? op.r : op.s->off);
3354 }
3355
3356 void set(mopt_t _type, sval_t _off) { type = _type; off = _off; }
3357 void set_stkoff(sval_t stkoff) { set(mop_S, stkoff); }
3358 void set_reg(mreg_t mreg) { set(mop_r, mreg); }
3359 void undef() { set(mop_z, -1); }
3360
3361 bool defined() const { return type != mop_z; }
3362 bool is_reg() const { return type == mop_r; }
3363 bool is_stkoff() const { return type == mop_S; }
3364 mreg_t get_reg() const { QASSERT(51892, is_reg()); return off; }
3365 sval_t get_stkoff() const { QASSERT(51893, is_stkoff()); return off; }
3366
3367 void inc(sval_t delta) { off += delta; }
3368 voff_t add(int width) const { return voff_t(type, off+width); }
3369 sval_t diff(const voff_t &r) const { QASSERT(51894, type == r.type); return off - r.off; }
3370
3372 {
3373 int code = ::compare(type, r.type);
3374 return code != 0 ? code : ::compare(off, r.off);
3375 }
3376};
3377
3378//-------------------------------------------------------------------------
3381{
3382 int size;
3383
3384 vivl_t(mopt_t _type = mop_z, sval_t _off = -1, int _size = 0)
3385 : voff_t(_type, _off), size(_size) {}
3386 vivl_t(const class chain_t &ch);
3387 vivl_t(const mop_t &op) : voff_t(op), size(op.size) {}
3388
3389 // Make a value interval
3390 void set(mopt_t _type, sval_t _off, int _size = 0)
3391 { voff_t::set(_type, _off); size = _size; }
3392 void set(const voff_t &voff, int _size)
3393 { set(voff.type, voff.off, _size); }
3394 void set_stkoff(sval_t stkoff, int sz = 0) { set(mop_S, stkoff, sz); }
3395 void set_reg (mreg_t mreg, int sz = 0) { set(mop_r, mreg, sz); }
3396
3399 bool hexapi extend_to_cover(const vivl_t &r);
3400
3403 uval_t hexapi intersect(const vivl_t &r);
3404
3406 bool overlap(const vivl_t &r) const
3407 {
3408 return type == r.type
3409 && interval::overlap(off, size, r.off, r.size);
3410 }
3411
3412 bool includes(const vivl_t &r) const
3413 {
3414 return type == r.type
3415 && interval::includes(off, size, r.off, r.size);
3416 }
3417
3419 bool contains(const voff_t &voff2) const
3420 {
3421 return type == voff2.type
3422 && interval::contains(off, size, voff2.off);
3423 }
3424
3425 // Comparisons
3427 {
3428 int code = voff_t::compare(r);
3429 return code; //return code != 0 ? code : ::compare(size, r.size);
3430 }
3431 bool operator==(const mop_t &mop) const
3432 {
3433 return type == mop.t && off == (mop.is_reg() ? mop.r : mop.s->off);
3434 }
3435 void hexapi print(qstring *vout) const;
3436 const char *hexapi dstr() const;
3437};
3438
3439//-------------------------------------------------------------------------
3443class chain_t : public intvec_t // sequence of block numbers
3444{
3445 voff_t k;
3447
3448public:
3449 int width = 0;
3450 int varnum = -1;
3454#define CHF_INITED 0x01
3455#define CHF_REPLACED 0x02
3456#define CHF_OVER 0x04
3457#define CHF_FAKE 0x08
3458#define CHF_PASSTHRU 0x10
3459#define CHF_TERM 0x20
3461 chain_t() : flags(CHF_INITED) {}
3462 chain_t(mopt_t t, sval_t off, int w=1, int v=-1)
3463 : k(t, off), width(w), varnum(v), flags(CHF_INITED) {}
3464 chain_t(const voff_t &_k, int w=1)
3465 : k(_k), width(w), varnum(-1), flags(CHF_INITED) {}
3466 void set_value(const chain_t &r)
3467 { width = r.width; varnum = r.varnum; flags = r.flags; *(intvec_t *)this = (intvec_t &)r; }
3468 const voff_t &key() const { return k; }
3469 bool is_inited() const { return (flags & CHF_INITED) != 0; }
3470 bool is_reg() const { return k.is_reg(); }
3471 bool is_stkoff() const { return k.is_stkoff(); }
3472 bool is_replaced() const { return (flags & CHF_REPLACED) != 0; }
3473 bool is_overlapped() const { return (flags & CHF_OVER) != 0; }
3474 bool is_fake() const { return (flags & CHF_FAKE) != 0; }
3475 bool is_passreg() const { return (flags & CHF_PASSTHRU) != 0; }
3476 bool is_term() const { return (flags & CHF_TERM) != 0; }
3477 void set_inited(bool b) { setflag(flags, CHF_INITED, b); }
3478 void set_replaced(bool b) { setflag(flags, CHF_REPLACED, b); }
3479 void set_overlapped(bool b) { setflag(flags, CHF_OVER, b); }
3480 void set_term(bool b) { setflag(flags, CHF_TERM, b); }
3481 mreg_t get_reg() const { return k.get_reg(); }
3482 sval_t get_stkoff() const { return k.get_stkoff(); }
3483 bool overlap(const chain_t &r) const
3484 { return k.type == r.k.type && interval::overlap(k.off, width, r.k.off, r.width); }
3485 bool includes(const chain_t &r) const
3486 { return k.type == r.k.type && interval::includes(k.off, width, r.k.off, r.width); }
3487 const voff_t endoff() const { return k.add(width); }
3488
3489 bool operator<(const chain_t &r) const { return key() < r.key(); }
3490
3491 void hexapi print(qstring *vout) const;
3492 const char *hexapi dstr() const;
3494 void hexapi append_list(const mba_t *mba, mlist_t *list) const;
3495 void clear_varnum() { varnum = -1; set_replaced(false); }
3496};
3497
3498//-------------------------------------------------------------------------
3499#if defined(__NT__)
3500# ifdef _DEBUG
3501# define SIZEOF_BLOCK_CHAINS 32
3502#else
3503# define SIZEOF_BLOCK_CHAINS 24
3504# endif
3505#elif defined(__MAC__)
3506# define SIZEOF_BLOCK_CHAINS 32
3507#else
3508# define SIZEOF_BLOCK_CHAINS 56
3509#endif
3510
3518{
3519 size_t body[SIZEOF_BLOCK_CHAINS/sizeof(size_t)]; // opaque std::set, uncopyable
3520public:
3524 const chain_t *get_reg_chain(mreg_t reg, int width=1) const
3525 { return get_chain((chain_t(mop_r, reg, width))); }
3526 chain_t *get_reg_chain(mreg_t reg, int width=1)
3527 { return get_chain((chain_t(mop_r, reg, width))); }
3528
3532 const chain_t *get_stk_chain(sval_t off, int width=1) const
3533 { return get_chain(chain_t(mop_S, off, width)); }
3534 chain_t *get_stk_chain(sval_t off, int width=1)
3535 { return get_chain(chain_t(mop_S, off, width)); }
3536
3540 const chain_t *get_chain(const voff_t &k, int width=1) const
3541 { return get_chain(chain_t(k, width)); }
3542 chain_t *get_chain(const voff_t &k, int width=1)
3543 { return (chain_t*)((const block_chains_t *)this)->get_chain(k, width); }
3544
3547 const chain_t *hexapi get_chain(const chain_t &ch) const;
3549 { return (chain_t*)((const block_chains_t *)this)->get_chain(ch); }
3550
3551 void hexapi print(qstring *vout) const;
3552 const char *hexapi dstr() const;
3553 HEXRAYS_MEMORY_ALLOCATION_FUNCS()
3554};
3555//-------------------------------------------------------------------------
3558{
3560 virtual ~chain_visitor_t() {}
3561 virtual int idaapi visit_chain(int nblock, chain_t &ch) = 0;
3562};
3563
3564//-------------------------------------------------------------------------
3569{
3570 int lock = 0;
3571public:
3572 ~graph_chains_t() { QASSERT(50444, !lock); }
3576 int hexapi for_all_chains(chain_visitor_t &cv, int gca_flags);
3578
3579#define GCA_EMPTY 0x01
3580#define GCA_SPEC 0x02
3581#define GCA_ALLOC 0x04
3582#define GCA_NALLOC 0x08
3583#define GCA_OFIRST 0x10
3584#define GCA_OLAST 0x20
3586
3590 bool is_locked() const { return lock != 0; }
3592 void acquire() { lock++; }
3594 void hexapi release();
3596 {
3598 std::swap(lock, r.lock);
3599 }
3600};
3601//-------------------------------------------------------------------------
3604{
3605 void hexapi init(ea_t _ea);
3606 void hexapi copy(const minsn_t &m);
3607public:
3616
3618
3619 // bits to be used in patterns:
3620#define IPROP_OPTIONAL 0x0001
3621#define IPROP_PERSIST 0x0002
3622#define IPROP_WILDMATCH 0x0004
3623
3624 // instruction attributes:
3625#define IPROP_CLNPOP 0x0008
3627#define IPROP_FPINSN 0x0010
3628#define IPROP_FARCALL 0x0020
3629#define IPROP_TAILCALL 0x0040
3630#define IPROP_ASSERT 0x0080
3633
3634 // instruction history:
3635#define IPROP_SPLIT 0x0700
3636#define IPROP_SPLIT1 0x0100
3637#define IPROP_SPLIT2 0x0200
3638#define IPROP_SPLIT4 0x0300
3639#define IPROP_SPLIT8 0x0400
3640#define IPROP_COMBINED 0x0800
3641#define IPROP_EXTSTX 0x1000
3642#define IPROP_IGNLOWSRC 0x2000
3645#define IPROP_INV_JX 0x4000
3646#define IPROP_WAS_NORET 0x8000
3647#define IPROP_MULTI_MOV 0x10000
3649
3651#define IPROP_DONT_PROP 0x20000
3652#define IPROP_DONT_COMB 0x40000
3653#define IPROP_MBARRIER 0x80000
3655#define IPROP_UNMERGED 0x100000
3656#define IPROP_UNPAIRED 0x200000
3658
3659 bool is_optional() const { return (iprops & IPROP_OPTIONAL) != 0; }
3660 bool is_combined() const { return (iprops & IPROP_COMBINED) != 0; }
3661 bool is_farcall() const { return (iprops & IPROP_FARCALL) != 0; }
3662 bool is_cleaning_pop() const { return (iprops & IPROP_CLNPOP) != 0; }
3663 bool is_extstx() const { return (iprops & IPROP_EXTSTX) != 0; }
3664 bool is_tailcall() const { return (iprops & IPROP_TAILCALL) != 0; }
3665 bool is_fpinsn() const { return (iprops & IPROP_FPINSN) != 0; }
3666 bool is_assert() const { return (iprops & IPROP_ASSERT) != 0; }
3667 bool is_persistent() const { return (iprops & IPROP_PERSIST) != 0; }
3668 bool is_wild_match() const { return (iprops & IPROP_WILDMATCH) != 0; }
3669 bool is_propagatable() const { return (iprops & IPROP_DONT_PROP) == 0; }
3670 bool is_ignlowsrc() const { return (iprops & IPROP_IGNLOWSRC) != 0; }
3671 bool is_inverted_jx() const { return (iprops & IPROP_INV_JX) != 0; }
3672 bool was_noret_icall() const { return (iprops & IPROP_WAS_NORET) != 0; }
3673 bool is_multimov() const { return (iprops & IPROP_MULTI_MOV) != 0; }
3674 bool is_combinable() const { return (iprops & IPROP_DONT_COMB) == 0; }
3675 bool was_split() const { return (iprops & IPROP_SPLIT) != 0; }
3676 bool is_mbarrier() const { return (iprops & IPROP_MBARRIER) != 0; }
3677 bool was_unmerged() const { return (iprops & IPROP_UNMERGED) != 0; }
3678 bool was_unpaired() const { return (iprops & IPROP_UNPAIRED) != 0; }
3679
3680 void set_optional() { iprops |= IPROP_OPTIONAL; }
3681 void hexapi set_combined();
3682 void clr_combined() { iprops &= ~IPROP_COMBINED; }
3683 void set_farcall() { iprops |= IPROP_FARCALL; }
3684 void set_cleaning_pop() { iprops |= IPROP_CLNPOP; }
3685 void set_extstx() { iprops |= IPROP_EXTSTX; }
3686 void set_tailcall() { iprops |= IPROP_TAILCALL; }
3687 void clr_tailcall() { iprops &= ~IPROP_TAILCALL; }
3688 void set_fpinsn() { iprops |= IPROP_FPINSN; }
3689 void clr_fpinsn() { iprops &= ~IPROP_FPINSN; }
3690 void set_assert() { iprops |= IPROP_ASSERT; }
3691 void clr_assert() { iprops &= ~IPROP_ASSERT; }
3692 void set_persistent() { iprops |= IPROP_PERSIST; }
3693 void set_wild_match() { iprops |= IPROP_WILDMATCH; }
3694 void clr_propagatable() { iprops |= IPROP_DONT_PROP; }
3695 void set_ignlowsrc() { iprops |= IPROP_IGNLOWSRC; }
3696 void clr_ignlowsrc() { iprops &= ~IPROP_IGNLOWSRC; }
3697 void set_inverted_jx() { iprops |= IPROP_INV_JX; }
3698 void set_noret_icall() { iprops |= IPROP_WAS_NORET; }
3699 void clr_noret_icall() { iprops &= ~IPROP_WAS_NORET; }
3700 void set_multimov() { iprops |= IPROP_MULTI_MOV; }
3701 void clr_multimov() { iprops &= ~IPROP_MULTI_MOV; }
3702 void set_combinable() { iprops &= ~IPROP_DONT_COMB; }
3703 void clr_combinable() { iprops |= IPROP_DONT_COMB; }
3704 void set_mbarrier() { iprops |= IPROP_MBARRIER; }
3705 void set_unmerged() { iprops |= IPROP_UNMERGED; }
3706 void set_split_size(int s)
3707 { // s may be only 1,2,4,8. other values are ignored
3708 iprops &= ~IPROP_SPLIT;
3709 iprops |= (s == 1 ? IPROP_SPLIT1
3710 : s == 2 ? IPROP_SPLIT2
3711 : s == 4 ? IPROP_SPLIT4
3712 : s == 8 ? IPROP_SPLIT8 : 0);
3713 }
3714 int get_split_size() const
3715 {
3716 int cnt = (iprops & IPROP_SPLIT) >> 8;
3717 return cnt == 0 ? 0 : 1 << (cnt-1);
3718 }
3719
3721 minsn_t(ea_t _ea) { init(_ea); }
3722 minsn_t(const minsn_t &m) { next = prev = nullptr; copy(m); }
3724
3725
3726 minsn_t &operator=(const minsn_t &m) { copy(m); return *this; }
3727
3731 void hexapi swap(minsn_t &m);
3732
3733
3735 void hexapi print(qstring *vout, int shins_flags=SHINS_SHORT|SHINS_VALNUM) const;
3736
3738 const char *hexapi dstr() const;
3739
3742 void hexapi setaddr(ea_t new_ea);
3743
3751 int optimize_solo(int optflags=0) { return optimize_subtree(nullptr, nullptr, nullptr, nullptr, optflags); }
3753
3754#define OPTI_ADDREXPRS 0x0001
3755#define OPTI_MINSTKREF 0x0002
3756#define OPTI_COMBINSNS 0x0004
3757#define OPTI_NO_LDXOPT 0x0008
3760#define OPTI_NO_VALRNG 0x0010
3762
3765 int hexapi optimize_subtree(
3766 mblock_t *blk,
3767 minsn_t *top,
3768 minsn_t *parent,
3769 ea_t *converted_call,
3770 int optflags=OPTI_MINSTKREF);
3771
3776 int hexapi for_all_ops(mop_visitor_t &mv);
3777
3782 int hexapi for_all_insns(minsn_visitor_t &mv);
3783
3788 void hexapi _make_nop();
3789
3794 bool hexapi equal_insns(const minsn_t &m, int eqflags) const; // intelligent comparison
3796
3797#define EQ_IGNSIZE 0x0001
3798#define EQ_IGNCODE 0x0002
3799#define EQ_CMPDEST 0x0004
3800#define EQ_OPTINSN 0x0008
3802
3805 bool operator <(const minsn_t &ri) const { return lexcompare(ri) < 0; }
3806 int hexapi lexcompare(const minsn_t &ri) const;
3807
3808 //-----------------------------------------------------------------------
3809 // Call instructions
3810 //-----------------------------------------------------------------------
3813 bool hexapi is_noret_call(int flags=0);
3814#define NORET_IGNORE_WAS_NORET_ICALL 0x01 // ignore was_noret_icall() bit
3815#define NORET_FORBID_ANALYSIS 0x02 // forbid additional analysis
3816
3822 bool is_unknown_call() const { return is_mcode_call(opcode) && d.empty(); }
3823
3828 bool hexapi is_helper(const char *name) const;
3829
3833 minsn_t *hexapi find_call(bool with_helpers=false) const;
3834
3836 bool contains_call(bool with_helpers=false) const { return find_call(with_helpers) != nullptr; }
3837
3842 bool hexapi has_side_effects(bool include_ldx_and_divs=false) const;
3843
3845 funcrole_t get_role() const { return d.is_arglist() ? d.f->role : ROLE_UNK; }
3846 bool is_memcpy() const { return get_role() == ROLE_MEMCPY; }
3847 bool is_memset() const { return get_role() == ROLE_MEMSET; }
3848 bool is_alloca() const { return get_role() == ROLE_ALLOCA; }
3849 bool is_bswap () const { return get_role() == ROLE_BSWAP; }
3850 bool is_readflags () const { return get_role() == ROLE_READFLAGS; }
3851
3852 //-----------------------------------------------------------------------
3853 // Misc
3854 //-----------------------------------------------------------------------
3858 bool contains_opcode(mcode_t mcode) const { return find_opcode(mcode) != nullptr; }
3859
3862 const minsn_t *find_opcode(mcode_t mcode) const { return (CONST_CAST(minsn_t*)(this))->find_opcode(mcode); }
3863 minsn_t *hexapi find_opcode(mcode_t mcode);
3864
3871 const minsn_t *hexapi find_ins_op(const mop_t **other, mcode_t op=m_nop) const;
3872 minsn_t *find_ins_op(mop_t **other, mcode_t op=m_nop) { return CONST_CAST(minsn_t*)((CONST_CAST(const minsn_t*)(this))->find_ins_op((const mop_t**)other, op)); }
3873
3879 const mop_t *hexapi find_num_op(const mop_t **other) const;
3880 mop_t *find_num_op(mop_t **other) { return CONST_CAST(mop_t*)((CONST_CAST(const minsn_t*)(this))->find_num_op((const mop_t**)other)); }
3881
3882 bool is_mov() const { return opcode == m_mov || (opcode == m_f2f && l.size == d.size); }
3883 bool is_like_move() const { return is_mov() || is_mcode_xdsu(opcode) || opcode == m_low; }
3884
3887 bool hexapi modifies_d() const;
3888 bool modifies_pair_mop() const { return d.t == mop_p && modifies_d(); }
3889
3895 bool hexapi is_between(const minsn_t *m1, const minsn_t *m2) const;
3896
3899 bool is_after(const minsn_t *m) const { return m != nullptr && is_between(m->next, nullptr); }
3900
3902 bool hexapi may_use_aliased_memory() const;
3903
3907 int hexapi serialize(bytevec_t *b) const;
3908
3914 bool hexapi deserialize(const uchar *bytes, size_t nbytes, int format_version);
3915
3916};
3917
3919const minsn_t *hexapi getf_reginsn(const minsn_t *ins);
3921const minsn_t *hexapi getb_reginsn(const minsn_t *ins);
3922inline minsn_t *getf_reginsn(minsn_t *ins) { return CONST_CAST(minsn_t*)(getf_reginsn(CONST_CAST(const minsn_t *)(ins))); }
3923inline minsn_t *getb_reginsn(minsn_t *ins) { return CONST_CAST(minsn_t*)(getb_reginsn(CONST_CAST(const minsn_t *)(ins))); }
3924
3925//-------------------------------------------------------------------------
3927{
3928public:
3930 int size; // in bytes
3931
3932 intval64_t(uint64 v=0, int _s=1) : val(trunc(v, _s)), size(_s) {}
3933 int64 sval() const { return extend_sign(val, size, true); }
3934 uint64 uval() const { return val; }
3935 void print(qstring *vout) const { vout->sprnt("0x%" FMT_64 "X.%d", val, size); }
3936
3937 //------------------------------------------------------------------------
3938 bool operator==(const intval64_t &o) const
3939 {
3940 return size == o.size && val == o.val;
3941 }
3942
3943 //------------------------------------------------------------------------
3944 bool operator!=(const intval64_t &o) const
3945 {
3946 return !(*this == o);
3947 }
3948
3949 //------------------------------------------------------------------------
3950 bool operator<(const intval64_t &o) const
3951 {
3952 QASSERT(52898, size == o.size);
3953 return val < o.val;
3954 }
3955
3956 //------------------------------------------------------------------------
3957 intval64_t sext(int target_sz) const
3958 {
3959 QASSERT(52899, target_sz >= size);
3960 return intval64_t(sval(), target_sz);
3961 }
3962
3963 //------------------------------------------------------------------------
3964 intval64_t zext(int target_sz) const
3965 {
3966 QASSERT(52900, target_sz >= size);
3967 return intval64_t(val, target_sz);
3968 }
3969
3970 //------------------------------------------------------------------------
3971 intval64_t low(int target_sz) const
3972 {
3973 QASSERT(52901, target_sz <= size);
3974 return intval64_t(val, target_sz);
3975 }
3976
3977 //------------------------------------------------------------------------
3978 intval64_t high(int target_sz) const
3979 {
3980 QASSERT(52902, target_sz <= size);
3981 int bytes_to_remove = size - target_sz;
3982 return intval64_t(right_ushift<uint64>(val, 8 * bytes_to_remove), target_sz);
3983 }
3984
3985 //------------------------------------------------------------------------
3987 {
3988 check_size_equal(o);
3989 return intval64_t(val + o.val, size);
3990 }
3991
3992 //------------------------------------------------------------------------
3994 {
3995 check_size_equal(o);
3996 return intval64_t(val - o.val, size);
3997 }
3998
3999 //-------------------------------------------------------------------------
4001 {
4002 check_size_equal(o);
4003 return intval64_t(val * o.val, size);
4004 }
4005
4006 //------------------------------------------------------------------------
4008 {
4009 check_size_equal(o);
4010 if ( o.val == 0 )
4011 throw "division by zero occurred when emulating instruction";
4012 return intval64_t(val / o.val, size);
4013 }
4014
4015 //------------------------------------------------------------------------
4017 {
4018 check_size_equal(o);
4019 if ( o.val == 0 )
4020 throw "division by zero occurred when emulating instruction";
4021 int64 res;
4022 uint64 l = val;
4023 uint64 r = o.val;
4024 switch ( size )
4025 {
4026 case 1: res = int8(l) / int8(r); break;
4027 case 2: res = int16(l) / int16(r); break;
4028 case 4: res = int32(l) / int32(r); break;
4029 case 8: res = int64(l) / int64(r); break;
4030 default: INTERR(30666);
4031 }
4032
4033 return intval64_t(res, size);
4034 }
4035
4036 //------------------------------------------------------------------------
4038 {
4039 check_size_equal(o);
4040 if ( o.val == 0 )
4041 throw "division by zero occurred when emulating instruction";
4042 return intval64_t(val % o.val, size);
4043 }
4044 //------------------------------------------------------------------------
4046 {
4047 check_size_equal(o);
4048 if ( o.val == 0 )
4049 throw "division by zero occurred when emulating instruction";
4050 int64 res = -1;
4051 uint64 l = val;
4052 uint64 r = o.val;
4053 switch ( size )
4054 {
4055 case 1: res = int8(l) % int8(r); break;
4056 case 2: res = int16(l) % int16(r); break;
4057 case 4: res = int32(l) % int32(r); break;
4058 case 8: res = int64(l) % int64(r); break;
4059 default: INTERR(52903);
4060 }
4061
4062 return intval64_t(res, size);
4063 }
4064
4065 //------------------------------------------------------------------------
4067 {
4069 }
4070
4071 //------------------------------------------------------------------------
4073 {
4075 }
4076
4077 //------------------------------------------------------------------------
4078 intval64_t sar(const intval64_t &o) const
4079 {
4081 }
4082
4083 //------------------------------------------------------------------------
4085 {
4086 check_size_equal(o);
4087 return intval64_t(val | o.val, size);
4088 }
4089
4090 //------------------------------------------------------------------------
4092 {
4093 check_size_equal(o);
4094 return intval64_t(val & o.val, size);
4095 }
4096
4097 //------------------------------------------------------------------------
4099 {
4100 check_size_equal(o);
4101 return intval64_t(val ^ o.val, size);
4102 }
4103
4104 //------------------------------------------------------------------------
4106 {
4107 return intval64_t(0-val, size);
4108 }
4109
4110 //------------------------------------------------------------------------
4112 {
4113 return intval64_t(!val, size);
4114 }
4115
4116 //------------------------------------------------------------------------
4118 {
4119 return intval64_t(~val, size);
4120 }
4121
4122private:
4123 //------------------------------------------------------------------------
4124 static uint64 trunc(uint64 v, int w) // truncate v to w bytes
4125 {
4126 QASSERT(52904, w == 1 || w == 2 || w == 4 || w == 8);
4127 return v & make_mask<uint64>(w * 8);
4128 }
4129
4130 void check_size_equal(const intval64_t &o) const
4131 {
4132 QASSERT(52905, size == o.size);
4133 }
4134};
4135
4136//-------------------------------------------------------------------------
4137// A simple 64bit emulator that can handle integer microcode instructions.
4138// This does not include control transfer instructions (except conditional jumps)
4139// and nop/ldx/stx/setp/...
4140// If the value cannot be calculated, an exception will be thrown:
4141// vd_failure_t(MERR_EMULATOR, ea_if_known, error_message);
4143{
4144public:
4146
4147 // Retreive the value assigned to an operand.
4148 // This function is called for mop_r, mop_S, mop_v, mop_l
4149 virtual intval64_t get_mop_value(const mop_t &mop) = 0;
4150
4151 // Calculate the operand value.
4152 // For register/stack/memory/lvar operands get_mop_value() will be called.
4153 intval64_t hexapi mop_value(const mop_t &mop);
4154
4155 // Calculate the result of applying the instruction opcode to its source
4156 // operands. This function does not store the result to the destination operand.
4157 // For example: "add r0, #2, ..." will return 3 if r0 contains 1.
4158 intval64_t hexapi minsn_value(const minsn_t &insn);
4159};
4160
4161//-------------------------------------------------------------------------
4173
4174// Maximal bit range
4175#define MAXRANGE bitrange_t(0, USHRT_MAX)
4176
4177//-------------------------------------------------------------------------
4184{
4185 friend class codegen_t;
4186 DECLARE_UNCOPYABLE(mblock_t)
4187 void hexapi init();
4188public:
4193
4194#define MBL_PRIV 0x0001
4196#define MBL_NONFAKE 0x0000
4197#define MBL_FAKE 0x0002
4198#define MBL_GOTO 0x0004
4199#define MBL_TCAL 0x0008
4200#define MBL_PUSH 0x0010
4201#define MBL_DMT64 0x0020
4202#define MBL_COMB 0x0040
4203#define MBL_PROP 0x0080
4204#define MBL_DEAD 0x0100
4205#define MBL_LIST 0x0200
4206#define MBL_INCONST 0x0400
4207#define MBL_CALL 0x0800
4208#define MBL_BACKPROP 0x1000
4209#define MBL_NORET 0x2000
4210#define MBL_DSLOT 0x4000
4211#define MBL_VALRANGES 0x8000
4212#define MBL_KEEP 0x10000
4213#define MBL_INLINED 0x20000
4214#define MBL_EXTFRAME 0x40000
4216 ea_t start;
4226
4233
4239
4244
4245 // the exact size of this class is not documented, there may be more fields
4246 char reserved[];
4247
4248 void mark_lists_dirty() { flags &= ~MBL_LIST; request_propagation(); }
4249 void request_propagation() { flags |= MBL_PROP; }
4250 bool needs_propagation() const { return (flags & MBL_PROP) != 0; }
4251 void request_demote64() { flags |= MBL_DMT64; }
4252 bool lists_dirty() const { return (flags & MBL_LIST) == 0; }
4253 bool lists_ready() const { return (flags & (MBL_LIST|MBL_INCONST)) == MBL_LIST; }
4254 int make_lists_ready() // returns number of changes
4255 {
4256 if ( lists_ready() )
4257 return 0;
4258 return build_lists(false);
4259 }
4260
4262 int npred() const { return predset.size(); } // number of xrefs to the block
4264 int nsucc() const { return succset.size(); } // number of xrefs from the block
4265 // Get predecessor number N
4266 int pred(int n) const { return predset[n]; }
4267 // Get successor number N
4268 int succ(int n) const { return succset[n]; }
4269
4270 mblock_t() = delete;
4271 virtual ~mblock_t();
4273 bool empty() const { return head == nullptr; }
4274
4275
4279 void hexapi print(vd_printer_t &vp) const;
4280
4283 void hexapi dump() const;
4284 AS_PRINTF(2, 0) void hexapi vdump_block(const char *title, va_list va) const;
4285 AS_PRINTF(2, 3) void dump_block(const char *title, ...) const
4286 {
4287 va_list va;
4288 va_start(va, title);
4291 }
4292
4293 //-----------------------------------------------------------------------
4294 // Functions to insert/remove insns during the microcode optimization phase.
4295 // See codegen_t, microcode_filter_t, udcall_t classes for the initial
4296 // microcode generation.
4297 //-----------------------------------------------------------------------
4306
4311 minsn_t *hexapi remove_from_block(minsn_t *m);
4312
4313 //-----------------------------------------------------------------------
4314 // Iterator over instructions and operands
4315 //-----------------------------------------------------------------------
4321 int hexapi for_all_insns(minsn_visitor_t &mv);
4322
4327 int hexapi for_all_ops(mop_visitor_t &mv);
4328
4337 int hexapi for_all_uses(
4338 mlist_t *list,
4339 minsn_t *i1,
4340 minsn_t *i2,
4341 mlist_mop_visitor_t &mmv);
4342
4343 //-----------------------------------------------------------------------
4344 // Optimization functions
4345 //-----------------------------------------------------------------------
4354 int hexapi optimize_insn(minsn_t *m, int optflags=OPTI_MINSTKREF|OPTI_COMBINSNS);
4355
4361 int hexapi optimize_block();
4362
4367 int hexapi build_lists(bool kill_deads);
4368
4375 int hexapi optimize_useless_jump();
4376
4377 //-----------------------------------------------------------------------
4378 // Functions that build with use/def lists. These lists are used to
4379 // reprsent list of registers and stack locations that are either modified
4380 // or accessed by microinstructions.
4381 //-----------------------------------------------------------------------
4392 void hexapi append_use_list(
4393 mlist_t *list,
4394 const mop_t &op,
4395 maymust_t maymust,
4396 bitrange_t mask=MAXRANGE) const;
4397
4405 void hexapi append_def_list(
4406 mlist_t *list,
4407 const mop_t &op,
4408 maymust_t maymust) const;
4409
4422 mlist_t hexapi build_use_list(const minsn_t &ins, maymust_t maymust) const;
4423
4436 mlist_t hexapi build_def_list(const minsn_t &ins, maymust_t maymust) const;
4437
4438 //-----------------------------------------------------------------------
4439 // The use/def lists can be used to search for interesting instructions
4440 //-----------------------------------------------------------------------
4449 bool is_used(mlist_t *list, const minsn_t *i1, const minsn_t *i2, maymust_t maymust=MAY_ACCESS) const
4450 { return find_first_use(list, i1, i2, maymust) != nullptr; }
4451
4463 const minsn_t *hexapi find_first_use(mlist_t *list, const minsn_t *i1, const minsn_t *i2, maymust_t maymust=MAY_ACCESS) const;
4464 minsn_t *find_first_use(mlist_t *list, minsn_t *i1, const minsn_t *i2, maymust_t maymust=MAY_ACCESS) const
4465 {
4466 return CONST_CAST(minsn_t*)(find_first_use(list,
4467 CONST_CAST(const minsn_t*)(i1),
4468 i2,
4469 maymust));
4470 }
4471
4480 const mlist_t &list,
4481 const minsn_t *i1,
4482 const minsn_t *i2,
4483 maymust_t maymust=MAY_ACCESS) const
4484 {
4485 return find_redefinition(list, i1, i2, maymust) != nullptr;
4486 }
4487
4496 const minsn_t *hexapi find_redefinition(
4497 const mlist_t &list,
4498 const minsn_t *i1,
4499 const minsn_t *i2,
4500 maymust_t maymust=MAY_ACCESS) const;
4502 const mlist_t &list,
4503 minsn_t *i1,
4504 const minsn_t *i2,
4505 maymust_t maymust=MAY_ACCESS) const
4506 {
4507 return CONST_CAST(minsn_t*)(find_redefinition(list,
4508 CONST_CAST(const minsn_t*)(i1),
4509 i2,
4510 maymust));
4511 }
4512
4520 bool hexapi is_rhs_redefined(const minsn_t *ins, const minsn_t *i1, const minsn_t *i2) const;
4521
4536 minsn_t *hexapi find_access(
4537 const mop_t &op,
4538 minsn_t **parent,
4539 const minsn_t *mend,
4540 int fdflags) const;
4542
4543#define FD_BACKWARD 0x0000
4544#define FD_FORWARD 0x0001
4545#define FD_USE 0x0000
4546#define FD_DEF 0x0002
4547#define FD_DIRTY 0x0004
4549
4550
4551 // Convenience functions:
4553 const mop_t &op,
4554 minsn_t **p_i1,
4555 const minsn_t *i2,
4556 int fdflags)
4557 {
4558 return find_access(op, p_i1, i2, fdflags|FD_DEF);
4559 }
4561 const mop_t &op,
4562 minsn_t **p_i1,
4563 const minsn_t *i2,
4564 int fdflags)
4565 {
4566 return find_access(op, p_i1, i2, fdflags|FD_USE);
4567 }
4568
4573 bool hexapi get_valranges(
4574 valrng_t *res,
4575 const vivl_t &vivl,
4576 int vrflags) const;
4577
4583 bool hexapi get_valranges(
4584 valrng_t *res,
4585 const vivl_t &vivl,
4586 const minsn_t *m,
4587 int vrflags) const;
4588
4590
4591#define VR_AT_START 0x0000
4593#define VR_AT_END 0x0001
4596#define VR_EXACT 0x0002
4598
4599
4604
4608 size_t hexapi get_reginsn_qty() const;
4609
4610 bool is_call_block() const { return tail != nullptr && is_mcode_call(tail->opcode); }
4611 bool is_unknown_call() const { return tail != nullptr && tail->is_unknown_call(); }
4612 bool is_nway() const { return type == BLT_NWAY; }
4613 bool is_branch() const { return type == BLT_2WAY && tail->d.is_mblock(); }
4615 {
4616 return get_reginsn_qty() == 1
4617 && tail->opcode == m_goto
4618 && tail->l.is_mblock();
4619 }
4621 {
4622 return is_branch()
4623 && npred() == 1
4624 && get_reginsn_qty() == 1
4626 }
4627};
4628//-------------------------------------------------------------------------
4692
4695{
4700 {
4701 if ( ea < r.ea )
4702 return -1;
4703 if ( ea > r.ea )
4704 return 1;
4705 if ( id < r.id )
4706 return -1;
4707 if ( id > r.id )
4708 return 1;
4709 return strcmp(text.c_str(), r.text.c_str());
4710 }
4711};
4714
4715//-------------------------------------------------------------------------
4730
4731//-------------------------------------------------------------------------
4741
4742//-------------------------------------------------------------------------
4745{
4746 func_t *pfn = nullptr;
4749 mba_ranges_t(func_t *_pfn=nullptr) : pfn(_pfn) {}
4751 ea_t start() const { return (pfn != nullptr ? *pfn : ranges[0]).start_ea; }
4752 bool empty() const { return pfn == nullptr && ranges.empty(); }
4753 void clear() { pfn = nullptr; ranges.clear(); }
4754 bool is_snippet() const { return pfn == nullptr; }
4755 bool hexapi range_contains(ea_t ea) const;
4756 bool is_fragmented() const
4757 {
4758 int n_frags = ranges.size();
4759 if ( pfn != nullptr )
4760 n_frags += pfn->tailqty + 1;
4761 return n_frags > 1;
4762 }
4763};
4764
4767{
4768 const rangevec_t *ranges = nullptr;
4769 const range_t *rptr = nullptr; // pointer into ranges
4770 ea_t cur = BADADDR; // current address
4771 bool set(const rangevec_t &r);
4773 ea_t current() const { return cur; }
4774};
4775
4778{
4781 bool func_items_done = true;
4782 bool set(const mba_ranges_t &mbr)
4783 {
4784 bool ok = false;
4785 if ( mbr.pfn != nullptr )
4786 {
4787 ok = fii.set(mbr.pfn);
4788 if ( ok )
4789 func_items_done = false;
4790 }
4791 if ( rii.set(mbr.ranges) )
4792 ok = true;
4793 return ok;
4794 }
4796 {
4797 bool ok = false;
4798 if ( !func_items_done )
4799 {
4800 ok = fii.next_code();
4801 if ( !ok )
4802 func_items_done = true;
4803 }
4804 if ( !ok )
4805 ok = rii.next_code();
4806 return ok;
4807 }
4809 {
4810 return func_items_done ? rii.current() : fii.current();
4811 }
4812};
4813
4816{
4817 const range_t *rptr = nullptr; // pointer into ranges
4818 const range_t *rend = nullptr;
4819 bool set(const rangevec_t &r) { rptr = r.begin(); rend = r.end(); return rptr != rend; }
4820 bool next() { return ++rptr != rend; }
4821 const range_t &chunk() const { return *rptr; }
4822};
4823
4826{
4828 func_tail_iterator_t fii; // this is used if rii.rptr==nullptr
4829 bool is_snippet() const { return rii.rptr != nullptr; }
4830 bool set(const mba_ranges_t &mbr)
4831 {
4832 if ( mbr.is_snippet() )
4833 return rii.set(mbr.ranges);
4834 else
4835 return fii.set(mbr.pfn);
4836 }
4837 bool next()
4838 {
4839 if ( is_snippet() )
4840 return rii.next();
4841 else
4842 return fii.next();
4843 }
4844 const range_t &chunk() const
4845 {
4846 return is_snippet() ? rii.chunk() : fii.chunk();
4847 }
4848};
4849
4850//-------------------------------------------------------------------------
4856{
4857 DECLARE_UNCOPYABLE(mba_t)
4858 uint32 flags;
4859 uint32 flags2;
4860
4861public:
4862 // bits to describe the microcode, set by the decompiler
4863#define MBA_PRCDEFS 0x00000001
4864#define MBA_NOFUNC 0x00000002
4865#define MBA_PATTERN 0x00000004
4866#define MBA_LOADED 0x00000008
4867#define MBA_RETFP 0x00000010
4868#define MBA_SPLINFO 0x00000020
4869#define MBA_PASSREGS 0x00000040
4870#define MBA_THUNK 0x00000080
4871#define MBA_CMNSTK 0x00000100
4872
4873 // bits to describe analysis stages and requests
4874#define MBA_PREOPT 0x00000200
4875#define MBA_CMBBLK 0x00000400
4876#define MBA_ASRTOK 0x00000800
4877#define MBA_CALLS 0x00001000
4878#define MBA_ASRPROP 0x00002000
4879#define MBA_SAVRST 0x00004000
4880#define MBA_RETREF 0x00008000
4881#define MBA_GLBOPT 0x00010000
4882#define MBA_LVARS0 0x00040000
4883#define MBA_LVARS1 0x00080000
4884#define MBA_DELPAIRS 0x00100000
4885#define MBA_CHVARS 0x00200000
4886
4887 // bits that can be set by the caller:
4888#define MBA_SHORT 0x00400000
4889#define MBA_COLGDL 0x00800000
4890#define MBA_INSGDL 0x01000000
4891#define MBA_NICE 0x02000000
4892#define MBA_REFINE 0x04000000
4893#define MBA_WINGR32 0x10000000
4894#define MBA_NUMADDR 0x20000000
4895#define MBA_VALNUM 0x40000000
4896
4897#define MBA_INITIAL_FLAGS (MBA_INSGDL|MBA_NICE|MBA_CMBBLK|MBA_REFINE\
4898 |MBA_PRCDEFS|MBA_WINGR32|MBA_VALNUM)
4899
4900#define MBA2_LVARNAMES_OK 0x00000001
4901#define MBA2_LVARS_RENAMED 0x00000002
4902#define MBA2_OVER_CHAINS 0x00000004
4903#define MBA2_VALRNG_DONE 0x00000008
4904#define MBA2_IS_CTR 0x00000010
4905#define MBA2_IS_DTR 0x00000020
4906#define MBA2_ARGIDX_OK 0x00000040
4907#define MBA2_NO_DUP_CALLS 0x00000080
4908#define MBA2_NO_DUP_LVARS 0x00000100
4909#define MBA2_UNDEF_RETVAR 0x00000200
4910#define MBA2_ARGIDX_SORTED 0x00000400
4912#define MBA2_CODE16_BIT 0x00000800
4913#define MBA2_STACK_RETVAL 0x00001000
4914#define MBA2_HAS_OUTLINES 0x00002000
4915#define MBA2_NO_FRAME 0x00004000
4916#define MBA2_PROP_COMPLEX 0x00008000
4917
4918#define MBA2_DONT_VERIFY 0x80000000
4921
4922#define MBA2_INITIAL_FLAGS (MBA2_LVARNAMES_OK|MBA2_LVARS_RENAMED)
4923
4924#define MBA2_ALL_FLAGS 0x0001FFFF
4925
4926 bool precise_defeas() const { return (flags & MBA_PRCDEFS) != 0; }
4927 bool optimized() const { return (flags & MBA_GLBOPT) != 0; }
4928 bool short_display() const { return (flags & MBA_SHORT ) != 0; }
4929 bool show_reduction() const { return (flags & MBA_COLGDL) != 0; }
4930 bool graph_insns() const { return (flags & MBA_INSGDL) != 0; }
4931 bool loaded_gdl() const { return (flags & MBA_LOADED) != 0; }
4932 bool should_beautify()const { return (flags & MBA_NICE ) != 0; }
4933 bool rtype_refined() const { return (flags & MBA_RETREF) != 0; }
4934 bool may_refine_rettype() const { return (flags & MBA_REFINE) != 0; }
4935 bool use_wingraph32() const { return (flags & MBA_WINGR32) != 0; }
4936 bool display_numaddrs() const { return (flags & MBA_NUMADDR) != 0; }
4937 bool display_valnums() const { return (flags & MBA_VALNUM) != 0; }
4938 bool is_pattern() const { return (flags & MBA_PATTERN) != 0; }
4939 bool is_thunk() const { return (flags & MBA_THUNK) != 0; }
4940 bool saverest_done() const { return (flags & MBA_SAVRST) != 0; }
4941 bool callinfo_built() const { return (flags & MBA_CALLS) != 0; }
4942 bool really_alloc() const { return (flags & MBA_LVARS0) != 0; }
4943 bool lvars_allocated()const { return (flags & MBA_LVARS1) != 0; }
4944 bool chain_varnums_ok()const { return (flags & MBA_CHVARS) != 0; }
4945 bool returns_fpval() const { return (flags & MBA_RETFP) != 0; }
4946 bool has_passregs() const { return (flags & MBA_PASSREGS) != 0; }
4947 bool generated_asserts() const { return (flags & MBA_ASRTOK) != 0; }
4948 bool propagated_asserts() const { return (flags & MBA_ASRPROP) != 0; }
4949 bool deleted_pairs() const { return (flags & MBA_DELPAIRS) != 0; }
4950 bool common_stkvars_stkargs() const { return (flags & MBA_CMNSTK) != 0; }
4951 bool lvar_names_ok() const { return (flags2 & MBA2_LVARNAMES_OK) != 0; }
4952 bool lvars_renamed() const { return (flags2 & MBA2_LVARS_RENAMED) != 0; }
4953 bool has_over_chains() const { return (flags2 & MBA2_OVER_CHAINS) != 0; }
4954 bool valranges_done() const { return (flags2 & MBA2_VALRNG_DONE) != 0; }
4955 bool argidx_ok() const { return (flags2 & MBA2_ARGIDX_OK) != 0; }
4956 bool argidx_sorted() const { return (flags2 & MBA2_ARGIDX_SORTED) != 0; }
4957 bool code16_bit_removed() const { return (flags2 & MBA2_CODE16_BIT) != 0; }
4958 bool has_stack_retval() const { return (flags2 & MBA2_STACK_RETVAL) != 0; }
4959 bool has_outlines() const { return (flags2 & MBA2_HAS_OUTLINES) != 0; }
4960 bool is_ctr() const { return (flags2 & MBA2_IS_CTR) != 0; }
4961 bool is_dtr() const { return (flags2 & MBA2_IS_DTR) != 0; }
4962 bool is_cdtr() const { return (flags2 & (MBA2_IS_CTR|MBA2_IS_DTR)) != 0; }
4963 bool prop_complex() const { return (flags2 & MBA2_PROP_COMPLEX) != 0; }
4964 int get_mba_flags() const { return flags; }
4965 int get_mba_flags2() const { return flags2; }
4966 void set_mba_flags(int f) { flags |= f; }
4967 void clr_mba_flags(int f) { flags &= ~f; }
4968 void set_mba_flags2(int f) { flags2 |= f; }
4969 void clr_mba_flags2(int f) { flags2 &= ~f; }
4970 void clr_cdtr() { flags2 &= ~(MBA2_IS_CTR|MBA2_IS_DTR); }
4972 {
4973 int shins_flags = 0;
4974 if ( short_display() )
4975 shins_flags |= SHINS_SHORT;
4976 if ( display_valnums() )
4977 shins_flags |= SHINS_VALNUM;
4978 if ( display_numaddrs() )
4979 shins_flags |= SHINS_NUMADDR;
4980 return shins_flags;
4981 }
4982
4983/*
4984 +-----------+ <- inargtop
4985 | prmN |
4986 | ... | <- minargref
4987 | prm0 |
4988 +-----------+ <- inargoff
4989 |shadow_args|
4990 +-----------+
4991 | retaddr |
4992 frsize+frregs +-----------+ <- initial esp |
4993 | frregs | |
4994 +frsize +-----------+ <- typical ebp |
4995 | | | |
4996 | | | fpd |
4997 | | | |
4998 | frsize | <- current ebp |
4999 | | |
5000 | | |
5001 | | | stacksize
5002 | | |
5003 | | |
5004 | | <- minstkref |
5005 stkvar base off 0 +---.. | | | current
5006 | | | | stack
5007 | | | | pointer
5008 | | | | range
5009 |tmpstk_size| | | (what getspd() returns)
5010 | | | |
5011 | | | |
5012 +-----------+ <- minimal sp | | offset 0 for the decompiler (vd)
5013
5014 There is a detail that may add confusion when working with stack variables.
5015 The decompiler does not use the same stack offsets as IDA.
5016 The picture above should explain the difference:
5017 - IDA stkoffs are displayed on the left, decompiler stkoffs - on the right
5018 - Decompiler stkoffs are always >= 0
5019 - IDA stkoff==0 corresponds to stkoff==tmpstk_size in the decompiler
5020 - See stkoff_vd2ida and stkoff_ida2vd below to convert IDA stkoffs to vd stkoff
5021
5022*/
5023
5024 // convert a stack offset used in vd to a stack offset used in ida stack frame
5025 sval_t hexapi stkoff_vd2ida(sval_t off) const;
5026 // convert a ida stack frame offset to a stack offset used in vd
5027 sval_t hexapi stkoff_ida2vd(sval_t off) const;
5029 {
5030 return retsize + stacksize;
5031 }
5032 static vdloc_t hexapi idaloc2vd(const argloc_t &loc, int width, sval_t spd);
5033 vdloc_t hexapi idaloc2vd(const argloc_t &loc, int width) const;
5034
5035 static argloc_t hexapi vd2idaloc(const vdloc_t &loc, int width, sval_t spd);
5036 argloc_t hexapi vd2idaloc(const vdloc_t &loc, int width) const;
5037
5038 bool is_stkarg(const lvar_t &v) const
5039 {
5040 return v.is_stk_var() && v.get_stkoff() >= inargoff;
5041 }
5043 udm_t *udm,
5044 sval_t vd_stkoff,
5045 uval_t *p_idaoff=nullptr,
5046 tinfo_t *p_frame=nullptr) const;
5047 // get lvar location
5049 {
5050 return vd2idaloc(v.location, v.width);
5051 }
5053 ea_t entry_ea = BADADDR;
5056 int qty = 0;
5057 int npurged = -1;
5064 int pfn_flags = 0;
5065 int retsize = 0;
5066 int shadow_args = 0;
5075 ea_t minstkref_ea = BADADDR;
5085
5088
5089 bool final_type = false;
5093 int fti_flags = 0;
5094
5095#define NALT_VD 2
5096
5100 int retvaridx = -1;
5102
5103 ea_t error_ea = BADADDR;
5105
5106 mblock_t *blocks = nullptr;
5107 mblock_t **natural = nullptr;
5108
5111
5113 mutable uchar occurred_warns[32]; // occurred warning messages
5114 // (even disabled warnings are taken into account)
5116 {
5118 }
5120 {
5122 }
5124 {
5126 }
5127 bool has_bad_sp() const
5128 {
5130 }
5131
5132 // the exact size of this class is not documented, there may be more fields
5133 char reserved[];
5134 mba_t(); // use gen_microcode() or create_empty_mba() to create microcode objects
5135 ~mba_t() { term(); }
5137 void hexapi term();
5138 func_t *hexapi get_curfunc() const;
5139 bool use_frame() const { return get_curfunc() != nullptr; }
5140 bool range_contains(ea_t ea) const { return mbr.range_contains(map_fict_ea(ea)); }
5141 bool is_snippet() const { return mbr.is_snippet(); }
5142
5148 merror_t hexapi set_maturity(mba_maturity_t mat);
5149
5155 int hexapi optimize_local(int locopt_bits);
5157
5158#define LOCOPT_ALL 0x0001
5160#define LOCOPT_REFINE 0x0002
5161#define LOCOPT_REFINE2 0x0004
5163
5169 merror_t hexapi build_graph();
5170
5173 mbl_graph_t *hexapi get_graph();
5174
5179 int hexapi analyze_calls(int acflags);
5181
5182#define ACFL_LOCOPT 0x01
5183#define ACFL_BLKOPT 0x02
5184#define ACFL_GLBPROP 0x04
5185#define ACFL_GLBDEL 0x08
5186#define ACFL_GUESS 0x10
5188
5193 merror_t hexapi optimize_global();
5194
5201 void hexapi alloc_lvars();
5202
5206 void hexapi dump() const;
5207 AS_PRINTF(3, 0) void hexapi vdump_mba(bool _verify, const char *title, va_list va) const;
5208 AS_PRINTF(3, 4) void dump_mba(bool _verify, const char *title, ...) const
5209 {
5210 va_list va;
5212 vdump_mba(_verify, title, va);
5214 }
5215
5218 void hexapi print(vd_printer_t &vp) const;
5219
5229 void hexapi verify(bool always) const;
5230
5235 void hexapi mark_chains_dirty();
5236
5238 const mblock_t *get_mblock(uint n) const { QASSERT(52719, n < qty); return natural[n]; }
5239 mblock_t *get_mblock(uint n) { return CONST_CAST(mblock_t*)((CONST_CAST(const mba_t *)(this))->get_mblock(n)); }
5240
5248 mblock_t *hexapi insert_block(int bblk);
5249
5255 mblock_t *hexapi split_block(mblock_t *blk, minsn_t *start_insn);
5256
5260 bool hexapi remove_block(mblock_t *blk);
5261 bool hexapi remove_blocks(int start_blk, int end_blk); // end_blk is excluded
5262
5270 mblock_t *hexapi copy_block(mblock_t *blk, int new_serial, int cpblk_flags=3);
5273#define CPBLK_FAST 0x0000
5274#define CPBLK_MINREF 0x0001
5275#define CPBLK_OPTJMP 0x0002
5278
5281 bool hexapi remove_empty_and_unreachable_blocks();
5282
5287 bool hexapi merge_blocks();
5288
5292 int hexapi for_all_ops(mop_visitor_t &mv);
5293
5298 int hexapi for_all_insns(minsn_visitor_t &mv);
5299
5303 int hexapi for_all_topinsns(minsn_visitor_t &mv);
5304
5314 mop_t *hexapi find_mop(op_parent_info_t *ctx, ea_t ea, bool is_dest, const mlist_t &list);
5315
5327 minsn_t *hexapi create_helper_call(
5328 ea_t ea,
5329 const char *helper,
5330 const tinfo_t *rettype=nullptr,
5331 const mcallargs_t *callargs=nullptr,
5332 const mop_t *out=nullptr);
5333
5341 void hexapi get_func_output_lists(
5342 mlist_t *return_regs,
5343 mlist_t *spoiled,
5344 const tinfo_t &type,
5345 ea_t call_ea=BADADDR,
5346 bool tail_call=false);
5347
5350 lvar_t &hexapi arg(int n);
5351 const lvar_t &arg(int n) const { return CONST_CAST(mba_t*)(this)->arg(n); }
5352
5374 ea_t hexapi alloc_fict_ea(ea_t real_ea);
5375
5380 ea_t hexapi map_fict_ea(ea_t fict_ea) const;
5381
5384 const ivl_t &get_std_region(memreg_index_t idx) const;
5385 const ivl_t &get_lvars_region() const;
5386 const ivl_t &get_shadow_region() const;
5387 const ivl_t &get_args_region() const;
5388 ivl_t get_stack_region() const; // get entire stack region
5389
5391 void hexapi serialize(bytevec_t &vout) const;
5392
5397 WARN_UNUSED_RESULT static mba_t *hexapi deserialize(const uchar *bytes, size_t nbytes);
5398
5400 void hexapi save_snapshot(const char *description);
5401
5407 mreg_t hexapi alloc_kreg(size_t size, bool check_size=true);
5408
5413 void hexapi free_kreg(mreg_t reg, size_t size);
5414
5417#define INLINE_EXTFRAME 0x0001
5418#define INLINE_DONTCOPY 0x0002
5431 merror_t hexapi inline_func(
5432 codegen_t &cdg,
5433 int blknum,
5434 mba_ranges_t &ranges,
5435 int decomp_flags=0,
5436 int inline_flags=0);
5437
5438 // Find a sp change point.
5439 // returns stkpnt p, where p->ea <= ea
5440 const stkpnt_t *hexapi locate_stkpnt(ea_t ea) const;
5441
5442 bool hexapi set_lvar_name(lvar_t &v, const char *name, int flagbits);
5443 bool set_nice_lvar_name(lvar_t &v, const char *name) { return set_lvar_name(v, name, CVAR_NAME); }
5444 bool set_user_lvar_name(lvar_t &v, const char *name) { return set_lvar_name(v, name, CVAR_NAME|CVAR_UNAME); }
5445};
5447//-------------------------------------------------------------------------
5451{
5452 graph_chains_t *gc;
5453 chain_keeper_t &operator=(const chain_keeper_t &); // not defined
5454public:
5455 chain_keeper_t(graph_chains_t *_gc) : gc(_gc) { QASSERT(50446, gc != nullptr); gc->acquire(); }
5457 {
5458 gc->release();
5459 }
5460 block_chains_t &operator[](size_t idx) { return (*gc)[idx]; }
5461 block_chains_t &front() { return gc->front(); }
5462 block_chains_t &back() { return gc->back(); }
5463 operator graph_chains_t &() { return *gc; }
5464 int for_all_chains(chain_visitor_t &cv, int gca) { return gc->for_all_chains(cv, gca); }
5465 HEXRAYS_MEMORY_ALLOCATION_FUNCS()
5466};
5467
5468//-------------------------------------------------------------------------
5478
5479//-------------------------------------------------------------------------
5482{
5483 mba_t *mba;
5484 int dirty = GC_DIRTY_ALL;
5485 int chain_stamp = 0;
5486 graph_chains_t gcs[2*GC_END];
5487 bool exclude_never_jumping_edges = true;
5488
5504 bool hexapi is_accessed_globally(
5505 const mlist_t &list, // list to verify
5506 int b1, // starting block
5507 int b2, // ending block
5508 const minsn_t *m1, // starting instruction (in b1)
5509 const minsn_t *m2, // ending instruction (in b2)
5510 access_type_t access_type,
5511 maymust_t maymust) const;
5512 int get_ud_gc_idx(gctype_t gctype) const { return (gctype << 1); }
5513 int get_du_gc_idx(gctype_t gctype) const { return (gctype << 1)+1; }
5514 int get_ud_dirty_bit(gctype_t gctype) { return 1 << get_ud_gc_idx(gctype); }
5515 int get_du_dirty_bit(gctype_t gctype) { return 1 << get_du_gc_idx(gctype); }
5516
5517public:
5520 {
5521 int bit = get_ud_dirty_bit(gctype);
5522 return (dirty & bit) != 0;
5523 }
5524
5527 {
5528 int bit = get_du_dirty_bit(gctype);
5529 return (dirty & bit) != 0;
5530 }
5531 int get_chain_stamp() const { return chain_stamp; }
5532
5534 graph_chains_t *hexapi get_ud(gctype_t gctype);
5535
5537 graph_chains_t *hexapi get_du(gctype_t gctype);
5538
5540 bool is_redefined_globally(const mlist_t &list, int b1, int b2, const minsn_t *m1, const minsn_t *m2, maymust_t maymust=MAY_ACCESS) const
5541 { return is_accessed_globally(list, b1, b2, m1, m2, WRITE_ACCESS, maymust); }
5542
5544 bool is_used_globally(const mlist_t &list, int b1, int b2, const minsn_t *m1, const minsn_t *m2, maymust_t maymust=MAY_ACCESS) const
5545 { return is_accessed_globally(list, b1, b2, m1, m2, READ_ACCESS, maymust); }
5546
5547 mblock_t *get_mblock(int n) const { return mba->get_mblock(n); }
5548};
5549
5550//-------------------------------------------------------------------------
5551// Helper for codegen_t. It takes into account delay slots
5553{
5554 const mba_t *mba; // to check range
5555 ea_t ea = BADADDR; // next insn to decode
5556 ea_t end = BADADDR; // end of the block
5557 ea_t dslot = BADADDR; // address of the insn in the delay slot
5558 insn_t dslot_insn; // instruction in the delay slot
5559 ea_t severed_branch = BADADDR; // address of the severed branch insn
5560 // (when this branch insn ends the previous block)
5561 bool is_likely_dslot = false; // execute delay slot only when jumping
5562
5563 cdg_insn_iterator_t(const mba_t *mba_) : mba(mba_) {}
5566
5567 bool ok() const { return ea < end; }
5568 bool has_dslot() const { return dslot != BADADDR; }
5569 bool dslot_with_xrefs() const { return dslot >= end; }
5570 // the current insn is the severed delayed insn (when this starts a block)
5571 bool is_severed_dslot() const { return severed_branch != BADADDR; }
5572 void start(const range_t &rng)
5573 {
5574 ea = rng.start_ea;
5575 end = rng.end_ea;
5576 }
5577 merror_t hexapi next(insn_t *ins);
5578};
5579
5580//-------------------------------------------------------------------------
5583{
5584public:
5585 mba_t *mba; // ptr to mbl array
5586 mblock_t *mb = nullptr; // current basic block
5587 insn_t insn; // instruction to generate microcode for
5588 char ignore_micro = IM_NONE; // value of get_ignore_micro() for the insn
5589 cdg_insn_iterator_t ii; // instruction iterator
5590 size_t reserved[4];
5591
5592 codegen_t() = delete;
5593 virtual ~codegen_t()
5594 {
5595 clear();
5596 }
5597 void hexapi clear(); // does not clear everything yet
5598
5604 virtual merror_t idaapi analyze_prolog(
5605 const class qflow_chart_t &fc,
5606 const class bitset_t &reachable) = 0;
5607
5614 virtual merror_t idaapi gen_micro() = 0;
5615
5620 virtual mreg_t idaapi load_operand(int opnum, int flags=0) = 0;
5621
5623 virtual void idaapi microgen_completed() {}
5624
5632 virtual merror_t idaapi prepare_gen_micro() { return MERR_OK; }
5633
5639 virtual mreg_t idaapi load_effective_address(int n, int flags=0) = 0;
5640
5648 // (nullptr if no instruction was generated)
5650 virtual bool idaapi store_operand(int n, const mop_t &mop, int flags=0, minsn_t **outins=nullptr);
5651
5668 minsn_t *hexapi emit(mcode_t code, int width, uval_t l, uval_t r, uval_t d, int offsize);
5669
5673 mcode_t code,
5674 op_dtype_t dtype,
5675 uval_t l,
5676 uval_t r,
5677 uval_t d,
5678 int offsize)
5679 {
5680 return emit(code, get_dtype_size(dtype), l, r, d, offsize);
5681 }
5682
5687 minsn_t *hexapi emit(mcode_t code, const mop_t *l, const mop_t *r, const mop_t *d);
5688
5689};
5690
5691//-------------------------------------------------------------------------
5694bool hexapi change_hexrays_config(const char *directive);
5695
5696//-------------------------------------------------------------------------
5698{
5699 t = mop_d;
5700 d = ins;
5701}
5702
5703inline bool mop_t::has_side_effects(bool include_ldx_and_divs) const
5704{
5705 return is_insn() && d->has_side_effects(include_ldx_and_divs);
5706}
5707
5708inline bool mop_t::is_kreg() const
5709{
5710 return is_reg() && ::is_kreg(r);
5711}
5712
5714{
5715 return is_insn(code) ? d : nullptr;
5716}
5718{
5719 return is_insn(code) ? d : nullptr;
5720}
5721
5722inline bool mop_t::is_insn(mcode_t code) const
5723{
5724 return is_insn() && d->opcode == code;
5725}
5726
5727inline bool mop_t::is_glbaddr() const
5728{
5729 return t == mop_a && a->is_glbvar();
5730}
5731
5732inline bool mop_t::is_glbaddr(ea_t ea) const
5733{
5734 return is_glbaddr() && a->g == ea;
5735}
5736
5737inline bool mop_t::is_stkaddr() const
5738{
5739 return t == mop_a && a->is_stkvar();
5740}
5741
5742inline vivl_t::vivl_t(const chain_t &ch)
5743 : voff_t(ch.key().type, ch.is_reg() ? ch.get_reg() : ch.get_stkoff()),
5744 size(ch.width)
5745{
5746}
5747
5748// The following memory regions exist
5749// start length
5750// ------------------------ ---------
5751// lvars spbase stacksize
5752// retaddr spbase+stacksize retsize
5753// shadow spbase+stacksize+retsize shadow_args
5754// args inargoff MAX_FUNC_ARGS*sp_width-shadow_args
5755// globals data_segment sizeof_data_segment
5756// heap everything else?
5757
5759{
5760 return std_ivls[idx].ivl;
5761}
5762
5763inline const ivl_t &mba_t::get_lvars_region() const
5764{
5766}
5767
5768inline const ivl_t &mba_t::get_shadow_region() const
5769{
5771}
5772
5773inline const ivl_t &mba_t::get_args_region() const
5774{
5775 return get_std_region(MMIDX_ARGS);
5776}
5777
5779{
5780 return ivl_t(std_ivls[MMIDX_LVARS].ivl.off, fullsize);
5781}
5782
5783//-------------------------------------------------------------------------
5787
5788const char *hexapi get_hexrays_version();
5789
5793#define OPF_REUSE 0x00
5794#define OPF_NEW_WINDOW 0x01
5795#define OPF_REUSE_ACTIVE 0x02
5797#define OPF_NO_WAIT 0x08
5799
5800#define OPF_WINDOW_MGMT_MASK 0x07
5801
5802
5808
5809vdui_t *hexapi open_pseudocode(ea_t ea, int flags);
5810
5811
5815
5816bool hexapi close_pseudocode(TWidget *f);
5817
5818
5822
5823vdui_t *hexapi get_widget_vdui(TWidget *f);
5824
5825
5828#define VDRUN_NEWFILE 0x00000000
5829#define VDRUN_APPEND 0x00000001
5830#define VDRUN_ONLYNEW 0x00000002
5831#define VDRUN_SILENT 0x00000004
5832#define VDRUN_SENDIDB 0x00000008
5833#define VDRUN_MAYSTOP 0x00000010
5834#define VDRUN_CMDLINE 0x00000020
5835#define VDRUN_STATS 0x00000040
5836#define VDRUN_LUMINA 0x00000080
5837#define VDRUN_PERF 0x00200000
5839
5847
5848bool hexapi decompile_many(const char *outfile, const eavec_t *funcaddrs, int flags);
5849
5850
5853{
5855 ea_t errea = BADADDR;
5858 hexrays_failure_t(merror_t c, ea_t ea, const char *buf=nullptr) : code(c), errea(ea), str(buf) {}
5859 hexrays_failure_t(merror_t c, ea_t ea, const qstring &buf) : code(c), errea(ea), str(buf) {}
5860 qstring hexapi desc() const;
5861 HEXRAYS_MEMORY_ALLOCATION_FUNCS()
5862};
5863
5865struct vd_failure_t : public std::exception
5866{
5869 vd_failure_t(merror_t code, ea_t ea, const char *buf=nullptr) : hf(code, ea, buf) {}
5870 vd_failure_t(merror_t code, ea_t ea, const qstring &buf) : hf(code, ea, buf) {}
5871 vd_failure_t(const hexrays_failure_t &_hf) : hf(_hf) {}
5872 qstring desc() const { return hf.desc(); }
5873#ifndef SWIG
5874 virtual const char *what() const noexcept override { return "decompilation failure"; }
5875#endif
5876#ifdef __GNUC__
5877 ~vd_failure_t() throw() {}
5878#endif
5879 HEXRAYS_MEMORY_ALLOCATION_FUNCS()
5880};
5881
5884{
5885 vd_interr_t(ea_t ea, const qstring &buf) : vd_failure_t(MERR_INTERR, ea, buf) {}
5886 vd_interr_t(ea_t ea, const char *buf) : vd_failure_t(MERR_INTERR, ea, buf) {}
5887};
5888
5895
5896void hexapi send_database(const hexrays_failure_t &err, bool silent);
5897
5900{
5902 union
5903 {
5906 };
5907 int size;
5909#define GCO_STK 0x0000
5910#define GCO_REG 0x0001
5911#define GCO_USE 0x0002
5912#define GCO_DEF 0x0004
5913 bool is_reg() const { return (flags & GCO_REG) != 0; }
5914 bool is_use() const { return (flags & GCO_USE) != 0; }
5915 bool is_def() const { return (flags & GCO_DEF) != 0; }
5916
5922 bool hexapi append_to_list(mlist_t *list, const mba_t *mba) const;
5923
5928 {
5929 vivl_t ret;
5930 if ( is_reg() )
5931 ret.set_reg(regnum, size);
5932 else
5933 ret.set_stkoff(stkoff, size);
5934 return ret;
5935 }
5936};
5937
5943bool hexapi get_current_operand(gco_info_t *out);
5944
5945void hexapi remitem(const citem_t *e);
5946//-------------------------------------------------------------------------
5950{
5968 cot_lor = 17,
5970 cot_bor = 19,
5971 cot_xor = 20,
5973 cot_eq = 22,
5974 cot_ne = 23,
5975 cot_sge = 24,
5976 cot_uge = 25,
5977 cot_sle = 26,
5978 cot_ule = 27,
5979 cot_sgt = 28,
5980 cot_ugt = 29,
5981 cot_slt = 30,
5982 cot_ult = 31,
5985 cot_shl = 34,
5986 cot_add = 35,
5987 cot_sub = 36,
5988 cot_mul = 37,
5998 cot_neg = 47,
6002 cot_ptr = 51,
6003 cot_ref = 52,
6009 cot_idx = 58,
6012 cot_num = 61,
6014 cot_str = 63,
6015 cot_obj = 64,
6016 cot_var = 65,
6025 cit_if = 73,
6026 cit_for = 74,
6028 cit_do = 76,
6034 cit_asm = 82,
6035 cit_try = 83,
6038};
6039
6047ctype_t hexapi asgop(ctype_t cop);
6050ctype_t hexapi asgop_revert(ctype_t cop);
6052inline bool op_uses_x(ctype_t op) { return (op >= cot_comma && op <= cot_memptr) || op == cot_sizeof; }
6054inline bool op_uses_y(ctype_t op) { return (op >= cot_comma && op <= cot_fdiv) || op == cot_idx; }
6056inline bool op_uses_z(ctype_t op) { return op == cot_tern; }
6058inline bool is_binary(ctype_t op) { return op_uses_y(op) && op != cot_tern; } // x,y
6060inline bool is_unary(ctype_t op) { return op >= cot_fneg && op <= cot_predec; }
6062inline bool is_relational(ctype_t op) { return op >= cot_eq && op <= cot_ult; }
6064inline bool is_assignment(ctype_t op) { return op >= cot_asg && op <= cot_asgumod; }
6065// Can operate on UDTs?
6066inline bool accepts_udts(ctype_t op) { return op == cot_asg || op == cot_comma || op > cot_last; }
6068inline bool is_prepost(ctype_t op) { return op >= cot_postinc && op <= cot_predec; }
6071{
6072 return op == cot_bor
6073 || op == cot_xor
6074 || op == cot_band
6075 || op == cot_add
6076 || op == cot_mul
6077 || op == cot_fadd
6078 || op == cot_fmul
6079 || op == cot_ne
6080 || op == cot_eq;
6081}
6082
6083inline bool is_additive(ctype_t op)
6084{
6085 return op == cot_add
6086 || op == cot_sub
6087 || op == cot_fadd
6088 || op == cot_fsub;
6089}
6090
6092{
6093 return op == cot_mul
6094 || op == cot_sdiv
6095 || op == cot_udiv
6096 || op == cot_fmul
6097 || op == cot_fdiv;
6098}
6099
6101inline bool is_bitop(ctype_t op)
6102{
6103 return op == cot_bor
6104 || op == cot_xor
6105 || op == cot_band
6106 || op == cot_bnot;
6107}
6108
6110inline bool is_logical(ctype_t op)
6111{
6112 return op == cot_lor
6113 || op == cot_land
6114 || op == cot_lnot;
6115}
6116
6118inline bool is_loop(ctype_t op)
6119{
6120 return op == cit_for
6121 || op == cit_while
6122 || op == cit_do;
6123}
6124
6126{
6127 return is_loop(op) || op == cit_switch;
6128}
6129
6131inline bool is_lvalue(ctype_t op)
6132{
6133 return op == cot_ptr // *x
6134 || op == cot_idx // x[y]
6135 || op == cot_memref // x.m
6136 || op == cot_memptr // x->m
6137 || op == cot_obj // v
6138 || op == cot_var; // l
6139}
6140
6143{
6144 return op == cot_asg
6145 || op == cot_eq
6146 || op == cot_ne
6147 || op == cot_comma
6148 || op == cot_tern
6149 || (op > cot_last && op < cit_end); // any insn
6150}
6151
6154{
6157 cnumber_t(int _opnum=0) : nf(_opnum) {}
6158
6164 void hexapi print(
6165 qstring *vout,
6166 const tinfo_t &type,
6167 const citem_t *parent=nullptr,
6168 bool *nice_stroff=nullptr) const;
6169
6173 uint64 hexapi value(const tinfo_t &type) const;
6174
6179 void hexapi assign(uint64 v, int nbytes, type_sign_t sign);
6180
6182 DECLARE_COMPARISONS(cnumber_t);
6183};
6184
6187{
6189 int idx;
6190 lvar_t &getv() const { return mba->vars[idx]; }
6192 DECLARE_COMPARISONS(var_ref_t);
6193};
6194
6198
6213
6214//--------------------------------------------------------------------------
6228{
6229 // inner comments (comments within an expression)
6235 // outer comments
6248 ITP_CASE = 0x40000000,
6249 ITP_SIGN = 0x20000000,
6250 // this is a hack, we better introduce special indexes for case values
6251 // case value >= ITP_CASE will be processed incorrectly
6252};
6253
6255{
6258 bool operator < (const treeloc_t &r) const
6259 {
6260 return ea < r.ea
6261 || (ea == r.ea && itp < r.itp);
6262 }
6263 bool operator == (const treeloc_t &r) const
6264 {
6265 return ea == r.ea && itp == r.itp;
6266 }
6267 HEXRAYS_MEMORY_ALLOCATION_FUNCS()
6268};
6269
6281
6284struct citem_cmt_t : public qstring
6285{
6286 mutable bool used = false;
6288 citem_cmt_t(const char *s) : qstring(s) {}
6289};
6290
6291// Comments are attached to tree locations:
6292typedef std::map<treeloc_t, citem_cmt_t> user_cmts_t;
6293
6297{
6301public:
6302 citem_locator_t(ea_t _ea, ctype_t _op) : ea(_ea), op(_op) {}
6303 citem_locator_t(const citem_t *i);
6305 HEXRAYS_MEMORY_ALLOCATION_FUNCS()
6306};
6307
6308// citem_t::iflags are attached to (ea,op) pairs
6309typedef std::map<citem_locator_t, int32> user_iflags_t;
6310
6311// union field selections
6312// they are represented as a vector of integers. each integer represents the
6313// number of union field (0 means the first union field, etc)
6314// the size of this vector is equal to the number of nested unions in the selection.
6315typedef std::map<ea_t, intvec_t> user_unions_t;
6316
6317//--------------------------------------------------------------------------
6319{
6320 int16 nbits; // total number of non-zero bits. we cannot guarantee that
6321 // they are zero. example: a random "int var" has nbits==32
6322 int16 sbits; // number of sign bits (they can be either 0 or 1, all of them)
6323 // if bits are known to be zeroes, they are not taken into account here
6324 // (in this case nbits should be reduced)
6325 // if bits are unknown and can be anything, they cannot be included
6326 // in sbits.
6327 // sbits==1 is a special case and should not be used
6328 bit_bound_t(int n=0, int s=0) : nbits(n), sbits(s) {}
6329};
6330
6331//--------------------------------------------------------------------------
6337{
6338 ea_t ea = BADADDR;
6340 int label_num = -1;
6345 mutable int index = -1;
6349 void swap(citem_t &r)
6350 {
6351 std::swap(ea, r.ea);
6352 std::swap(op, r.op);
6353 std::swap(label_num, r.label_num);
6354 }
6355
6356 bool is_expr() const { return op <= cot_last; }
6358 bool hexapi contains_expr(const cexpr_t *e) const;
6360 bool hexapi contains_label() const;
6365 const citem_t *hexapi find_parent_of(const citem_t *item) const;
6367 { return CONST_CAST(citem_t*)((CONST_CAST(const citem_t*)(this))->find_parent_of(item)); }
6368 citem_t *hexapi find_closest_addr(ea_t _ea);
6369 void print1(qstring *vout, const cfunc_t *func) const;
6371 {
6372 remitem(this);
6373 }
6374 HEXRAYS_MEMORY_ALLOCATION_FUNCS()
6375};
6377
6380struct cexpr_t : public citem_t
6381{
6382 union
6383 {
6386 struct
6387 {
6388 union
6389 {
6392 };
6394 };
6395 struct
6396 {
6398 union
6399 {
6404 };
6405 union
6406 {
6409 };
6410 };
6413 char *helper;
6414 char *string;
6415 };
6421#define EXFL_CPADONE 0x0001
6422#define EXFL_LVALUE 0x0002
6423#define EXFL_FPOP 0x0004
6424#define EXFL_ALONE 0x0008
6425#define EXFL_CSTR 0x0010
6426#define EXFL_PARTIAL 0x0020
6427#define EXFL_UNDEF 0x0040
6428#define EXFL_JUMPOUT 0x0080
6429#define EXFL_VFTABLE 0x0100
6430#define EXFL_ALL 0x01FF
6433 bool cpadone() const { return (exflags & EXFL_CPADONE) != 0; }
6434 bool is_odd_lvalue() const { return (exflags & EXFL_LVALUE) != 0; }
6435 bool is_fpop() const { return (exflags & EXFL_FPOP) != 0; }
6436 bool is_cstr() const { return (exflags & EXFL_CSTR) != 0; }
6437 bool is_type_partial() const { return (exflags & EXFL_PARTIAL) != 0; }
6438 bool is_undef_val() const { return (exflags & EXFL_UNDEF) != 0; }
6439 bool is_jumpout() const { return (exflags & EXFL_JUMPOUT) != 0; }
6440 bool is_vftable() const { return (exflags & EXFL_VFTABLE) != 0; }
6441
6442
6443 void set_cpadone() { exflags |= EXFL_CPADONE; }
6444 void set_vftable() { exflags |= EXFL_VFTABLE; }
6445 void set_type_partial(bool val = true)
6446 {
6447 if ( val )
6448 exflags |= EXFL_PARTIAL;
6449 else
6450 exflags &= ~EXFL_PARTIAL;
6451 }
6452
6453 cexpr_t() : x(nullptr), y(nullptr), z(nullptr) {}
6454 cexpr_t(ctype_t cexpr_op, cexpr_t *_x, cexpr_t *_y=nullptr, cexpr_t *_z=nullptr)
6455 : citem_t(cexpr_op), x(_x), y(_y), z(_z) {}
6456 cexpr_t(mba_t *mba, const lvar_t &v);
6457 cexpr_t(const cexpr_t &r) : citem_t() { *this = r; }
6458 void swap(cexpr_t &r)
6459 {
6460 citem_t &ci = *this;
6461 ci.swap(r);
6462 std::swap(x, r.x);
6463 std::swap(y, r.y);
6464 std::swap(z, r.z);
6465 type.swap(r.type);
6466 std::swap(exflags, r.exflags);
6467 }
6468 cexpr_t &operator=(const cexpr_t &r) { return assign(r); }
6469 cexpr_t &hexapi assign(const cexpr_t &r);
6472
6477 void hexapi replace_by(cexpr_t *r);
6478
6481 void hexapi cleanup();
6482
6488 void hexapi put_number(cfunc_t *func, uint64 value, int nbytes, type_sign_t sign=no_sign);
6489
6493 void hexapi print1(qstring *vout, const cfunc_t *func) const;
6494
6499 void hexapi calc_type(bool recursive);
6500
6506 bool hexapi equal_effect(const cexpr_t &r) const;
6507
6511 bool hexapi is_child_of(const citem_t *parent) const;
6512
6517 bool hexapi contains_operator(ctype_t needed_op, int times=1) const;
6518
6520 bool contains_comma(int times=1) const { return contains_operator(cot_comma, times); }
6522 bool contains_insn(int times=1) const { return contains_operator(cot_insn, times); }
6526 bool contains_comma_or_insn_or_label(int maxcommas=1) const { return contains_comma(maxcommas) || contains_insn_or_label(); }
6532 bool is_nice_cond() const { return is_nice_expr() && type.is_bool(); }
6535 bool is_call_object_of(const citem_t *parent) const { return parent != nullptr && parent->op == cot_call && ((cexpr_t*)parent)->x == this; }
6538 bool is_call_arg_of(const citem_t *parent) const { return parent != nullptr && parent->op == cot_call && ((cexpr_t*)parent)->x != this; }
6540 type_sign_t get_type_sign() const { return type.get_sign(); }
6542 bool is_type_unsigned() const { return type.is_unsigned(); }
6544 bool is_type_signed() const { return type.is_signed(); }
6547 bit_bound_t hexapi get_high_nbit_bound() const;
6550 int hexapi get_low_nbit_bound() const;
6554 bool hexapi requires_lvalue(const cexpr_t *child) const;
6557 bool hexapi has_side_effects() const;
6560 bool like_boolean() const;
6563 bool is_aliasable() const;
6567 {
6568 QASSERT(50071, op == cot_num);
6569 return n->value(type);
6570 }
6571
6572 bool is_const_value(uint64 _v) const
6573 {
6574 return op == cot_num && numval() == _v;
6575 }
6576
6578 {
6579 return op == cot_num && int64(numval()) < 0;
6580 }
6581
6583 {
6584 return op == cot_num && int64(numval()) >= 0;
6585 }
6586
6588 {
6589 return op == cot_num && numval() != 0;
6590 }
6591
6592 bool is_zero_const() const { return is_const_value(0); }
6594 bool is_value_used(const citem_t *parent) const;
6598 bool get_const_value(uint64 *out) const
6599 {
6600 if ( op == cot_num )
6601 {
6602 if ( out != nullptr )
6603 *out = numval();
6604 return true;
6605 }
6606 return false;
6607 }
6608
6609 bool hexapi maybe_ptr() const;
6610
6613 {
6614 if ( x->type.is_ptr_or_array() )
6615 return x;
6616 if ( y->type.is_ptr_or_array() )
6617 return y;
6618 return nullptr;
6619 }
6620
6621 const cexpr_t *find_op(ctype_t _op) const
6622 {
6623 if ( x->op == _op )
6624 return x;
6625 if ( y->op == _op )
6626 return y;
6627 return nullptr;
6628 }
6630 {
6631 return (cexpr_t *)((const cexpr_t *)this)->find_op(_op);
6632 }
6633
6635 const cexpr_t *find_num_op() const { return find_op(cot_num); }
6639 const cexpr_t *find_ptr_or_array(bool remove_eqsize_casts) const;
6643 const cexpr_t *theother(const cexpr_t *what) const { return what == x ? y : x; }
6644 cexpr_t *theother(const cexpr_t *what) { return what == x ? y : x; }
6645
6646 // these are inline functions, see below
6647 bool get_1num_op(cexpr_t **o1, cexpr_t **o2);
6648 bool get_1num_op(const cexpr_t **o1, const cexpr_t **o2) const;
6649
6650 const char *hexapi dstr() const;
6651};
6653
6657{
6659 HEXRAYS_MEMORY_ALLOCATION_FUNCS()
6660};
6662
6670
6672struct cif_t : public ceinsn_t
6673{
6674 cinsn_t *ithen = nullptr;
6675 cinsn_t *ielse = nullptr;
6677 cif_t(const cif_t &r) : ceinsn_t(), ithen(nullptr), ielse(nullptr) { *this = r; }
6678 cif_t &operator=(const cif_t &r) { return assign(r); }
6679 cif_t &hexapi assign(const cif_t &r);
6682 void cleanup();
6683};
6684
6686struct cloop_t : public ceinsn_t
6687{
6688 cinsn_t *body = nullptr;
6689 cloop_t(cinsn_t *b=nullptr) : body(b) {}
6690 cloop_t(const cloop_t &r) : ceinsn_t() { *this = r; }
6691 cloop_t &operator=(const cloop_t &r) { return assign(r); }
6692 cloop_t &hexapi assign(const cloop_t &r);
6694 void cleanup();
6695};
6696
6704
6706struct cwhile_t : public cloop_t
6707{
6709};
6710
6712struct cdo_t : public cloop_t
6713{
6715};
6716
6722
6725{
6727 void print(const citem_t *parent, int indent, vc_printer_t &vp) const;
6729 HEXRAYS_MEMORY_ALLOCATION_FUNCS()
6730};
6731
6733struct casm_t : public eavec_t
6734{
6735 casm_t(ea_t ea) { push_back(ea); }
6736 casm_t(const casm_t &r) : eavec_t(eavec_t(r)) {}
6738 void print(const citem_t *parent, int indent, vc_printer_t &vp) const;
6739 bool one_insn() const { return size() == 1; }
6740 void genasm(qstring *buf, ea_t ea) const;
6741};
6742
6745
6748struct cinsn_t : public citem_t
6749{
6750 union
6751 {
6764 };
6765
6766 cinsn_t() { zero(); }
6767 cinsn_t(const cinsn_t &r) : citem_t(cit_empty) { *this = r; }
6768 void swap(cinsn_t &r) { citem_t::swap(r); std::swap(cblock, r.cblock); }
6769 cinsn_t &operator=(const cinsn_t &r) { return assign(r); }
6770 cinsn_t &hexapi assign(const cinsn_t &r);
6773
6778 void hexapi replace_by(cinsn_t *r);
6779
6782 void hexapi cleanup();
6783
6785 void zero() { op = cit_empty; cblock = nullptr; }
6786
6790 cinsn_t &hexapi new_insn(ea_t insn_ea);
6791
6795 cif_t &hexapi create_if(cexpr_t *cnd);
6796
6801 void hexapi print(int indent, vc_printer_t &vp, use_curly_t use_curly=CALC_CURLY_BRACES) const;
6802
6807 void hexapi print1(qstring *vout, const cfunc_t *func) const;
6808
6811 bool hexapi is_ordinary_flow() const;
6812
6817 bool hexapi contains_insn(ctype_t type, int times=1) const;
6818
6826 bool hexapi collect_free_breaks(cinsnptrvec_t *breaks);
6827
6835 bool hexapi collect_free_continues(cinsnptrvec_t *continues);
6836
6838 bool contains_free_break() const { return CONST_CAST(cinsn_t*)(this)->collect_free_breaks(nullptr); }
6840 bool contains_free_continue() const { return CONST_CAST(cinsn_t*)(this)->collect_free_continues(nullptr); }
6841
6842 const char *hexapi dstr() const;
6843};
6845
6847
6849struct cblock_t : public cinsn_list_t // we need list to be able to manipulate
6850{ // its elements freely
6852};
6853
6855struct carg_t : public cexpr_t
6856{
6857 bool is_vararg = false;
6860 {
6861 e->swap(*this);
6862 delete e;
6863 }
6865 {
6866 return cexpr_t::compare(r);
6867 }
6868};
6870
6872struct carglist_t : public qvector<carg_t>
6873{
6875 int flags = 0;
6876#define CFL_FINAL 0x0001
6877#define CFL_HELPER 0x0002
6878#define CFL_NORET 0x0004
6880 carglist_t(const tinfo_t &ftype, int fl = 0) : functype(ftype), flags(fl) {}
6882 void print(qstring *vout, const cfunc_t *func) const;
6883 int print(int curpos, vc_printer_t &vp) const;
6884};
6885
6887struct ccase_t : public cinsn_t
6888{
6892 void set_insn(cinsn_t *i); // deletes 'i'
6893 size_t size() const { return values.size(); }
6894 const uint64 &value(int i) const { return values[i]; }
6895};
6897
6899struct ccases_t : public qvector<ccase_t>
6900{
6902 int find_value(uint64 v) const;
6903};
6904
6912
6915{
6923 {
6924 obj.swap(r.obj);
6925 fake_type.swap(r.fake_type);
6926 }
6927 bool is_catch_all() const { return obj.op == cot_empty && fake_type.empty(); }
6928};
6931
6933struct ccatch_t : public cblock_t
6934{
6937 bool is_catch_all() const { return exprs.empty(); }
6939 {
6940 exprs.swap(r.exprs);
6941 cblock_t *cb = this;
6942 cb->swap(r);
6943 }
6944};
6946
6949struct ctry_t : public cblock_t
6950{
6953 size_t old_state = 0;
6954 size_t new_state = 0;
6955
6974 bool is_wind = false; // if false, then try/catch
6975
6977 void print(const citem_t *parent, int indent, vc_printer_t &vp) const;
6978};
6979
6985
6986//---------------------------------------------------------------------------
6989{
6990 cblock_t *blk; // cinsn_t::cblock or cinsn_t::ctry or cinsn_t::ctry->catchs[x]
6991 cblock_t::iterator p; // iterator pointing to the current item
6992 bool is_first_insn() const { return p == blk->begin(); }
6993 cinsn_t *insn() const { return &*p; }
6994 cinsn_t *prev_insn() { --p; return insn(); }
6995};
6998
7005{
7010#define CV_FAST 0x0000
7011#define CV_PRUNE 0x0001
7012#define CV_PARENTS 0x0002
7013#define CV_POST 0x0004
7014#define CV_RESTART 0x0008
7015#define CV_INSNS 0x0010
7022 bool maintain_parents() const { return (cv_flags & CV_PARENTS) != 0; }
7024 bool must_prune() const { return (cv_flags & CV_PRUNE) != 0; }
7026 bool must_restart() const { return (cv_flags & CV_RESTART) != 0; }
7028 bool is_postorder() const { return (cv_flags & CV_POST) != 0; }
7030 bool only_insns() const { return (cv_flags & CV_INSNS) != 0; }
7033 void prune_now() { cv_flags |= CV_PRUNE; }
7035 void clr_prune() { cv_flags &= ~CV_PRUNE; }
7037 void set_restart() { cv_flags |= CV_RESTART; }
7039 void clr_restart() { cv_flags &= ~CV_RESTART; }
7040
7045
7049 ctree_visitor_t(int _flags) : cv_flags(_flags) {}
7050
7051 virtual ~ctree_visitor_t() {}
7058 int hexapi apply_to(citem_t *item, citem_t *parent);
7059
7066 int hexapi apply_to_exprs(citem_t *item, citem_t *parent);
7067
7070 {
7071 return !parents.empty() ? parents.back() : nullptr;
7072 }
7073
7076 {
7077 citem_t *item = parent_item();
7078 return item != nullptr && item->is_expr() ? (cexpr_t *)item : nullptr;
7079 }
7080
7083 {
7084 citem_t *item = parent_item();
7085 return item != nullptr && !item->is_expr() ? (cinsn_t *)item : nullptr;
7086 }
7087
7088 // the following functions are redefined by the derived class
7089 // in order to perform the desired actions during the traversal
7090
7097 virtual int idaapi visit_insn(cinsn_t *) { return 0; }
7098
7105 virtual int idaapi visit_expr(cexpr_t *) { return 0; }
7106
7113 virtual int idaapi leave_insn(cinsn_t *) { return 0; }
7114
7121 virtual int idaapi leave_expr(cexpr_t *) { return 0; }
7122
7123 HEXRAYS_MEMORY_ALLOCATION_FUNCS()
7124};
7125
7128{
7129 ctree_parentee_t(bool post=false)
7130 : ctree_visitor_t((post ? CV_POST : 0)|CV_PARENTS) {}
7131
7139 bool hexapi recalc_parent_types();
7140};
7141
7144{
7146 cfunc_parentee_t(cfunc_t *f, bool post=false)
7147 : ctree_parentee_t(post), func(f) {}
7148
7158 bool hexapi calc_rvalue_type(tinfo_t *target, const cexpr_t *e);
7159};
7160
7161//---------------------------------------------------------------------------
7164{
7165 uval_t value = BADADDR;
7166#define ANCHOR_INDEX 0x1FFFFFFF
7167#define ANCHOR_MASK 0xC0000000
7168#define ANCHOR_CITEM 0x00000000
7169#define ANCHOR_LVAR 0x40000000
7170#define ANCHOR_ITP 0x80000000
7171#define ANCHOR_BLKCMT 0x20000000
7172 int get_index() const { return value & ANCHOR_INDEX; }
7173 item_preciser_t get_itp() const { return item_preciser_t(value & ~ANCHOR_ITP); }
7174 bool is_valid_anchor() const { return value != BADADDR; }
7175 bool is_citem_anchor() const { return (value & ANCHOR_MASK) == ANCHOR_CITEM; }
7176 bool is_lvar_anchor() const { return (value & ANCHOR_MASK) == ANCHOR_LVAR; }
7177 bool is_itp_anchor() const { return (value & ANCHOR_ITP) != 0; }
7178 bool is_blkcmt_anchor() const { return (value & ANCHOR_BLKCMT) != 0; }
7179};
7180
7190
7194{
7196 union
7197 {
7204 };
7205
7206 void verify(const mba_t *mba) const;
7207
7216
7217 int hexapi get_udm(
7218 udm_t *udm=nullptr,
7219 tinfo_t *parent=nullptr,
7220 uint64 *p_offset=nullptr) const;
7221
7227
7228 int hexapi get_edm(tinfo_t *parent) const;
7229
7234
7235 lvar_t *hexapi get_lvar() const;
7236
7237
7241
7242 ea_t hexapi get_ea() const;
7243
7244
7248
7249 int hexapi get_label_num(int gln_flags) const;
7252#define GLN_CURRENT 0x01
7253#define GLN_GOTO_TARGET 0x02
7254#define GLN_ALL 0x03
7256
7258 bool is_citem() const { return citype == VDI_EXPR; }
7259
7260 void hexapi print(qstring *vout) const;
7261 const char *hexapi dstr() const;
7262 HEXRAYS_MEMORY_ALLOCATION_FUNCS()
7263};
7264
7271
7272typedef std::map<int, qstring> user_labels_t;
7273
7281
7282cexpr_t *hexapi lnot(cexpr_t *e);
7283
7284
7286
7287cinsn_t *hexapi new_block();
7288
7289
7300
7301AS_PRINTF(3, 0) cexpr_t *hexapi vcreate_helper(bool standalone, const tinfo_t &type, const char *format, va_list va);
7302
7304AS_PRINTF(3, 4) inline cexpr_t *create_helper(bool standalone, const tinfo_t &type, const char *format, ...)
7305{
7306 va_list va;
7308 cexpr_t *e = vcreate_helper(standalone, type, format, va);
7310 return e;
7311}
7312
7313
7322
7323AS_PRINTF(3, 0) cexpr_t *hexapi vcall_helper(const tinfo_t &rettype, carglist_t *args, const char *format, va_list va);
7324
7326AS_PRINTF(3, 4) inline cexpr_t *call_helper(
7327 const tinfo_t &rettype,
7329 const char *format, ...)
7330{
7331 va_list va;
7332 va_start(va, format);
7333 cexpr_t *e = vcall_helper(rettype, args, format, va);
7334 va_end(va);
7335 return e;
7336}
7337
7338
7349
7350cexpr_t *hexapi make_num(uint64 n, cfunc_t *func=nullptr, ea_t ea=BADADDR, int opnum=0, type_sign_t sign=no_sign, int size=0);
7351
7352
7356
7357cexpr_t *hexapi make_ref(cexpr_t *e);
7358
7359
7368
7369cexpr_t *hexapi dereference(cexpr_t *e, int ptrsize, bool is_flt=false);
7370
7371
7380
7381void hexapi save_user_labels(ea_t func_ea, const user_labels_t *user_labels, const cfunc_t *func=nullptr);
7382
7383
7387
7388void hexapi save_user_cmts(ea_t func_ea, const user_cmts_t *user_cmts);
7389
7393
7394void hexapi save_user_numforms(ea_t func_ea, const user_numforms_t *numforms);
7395
7396
7400
7401void hexapi save_user_iflags(ea_t func_ea, const user_iflags_t *iflags);
7402
7403
7407
7408void hexapi save_user_unions(ea_t func_ea, const user_unions_t *unions);
7409
7410
7417
7418user_labels_t *hexapi restore_user_labels(ea_t func_ea, const cfunc_t *func=nullptr);
7419
7420
7425
7426user_cmts_t *hexapi restore_user_cmts(ea_t func_ea);
7427
7428
7433
7435
7436
7441
7442user_iflags_t *hexapi restore_user_iflags(ea_t func_ea);
7443
7444
7449
7450user_unions_t *hexapi restore_user_unions(ea_t func_ea);
7451
7452
7453typedef std::map<ea_t, cinsnptrvec_t> eamap_t;
7454// map of instruction boundaries. may contain INS_EPILOG for the epilog instructions
7455typedef std::map<cinsn_t *, rangeset_t> boundaries_t;
7456#define INS_EPILOG ((cinsn_t *)1)
7457
7458// Tags to find this location quickly: #cfunc_t #func_t
7459//-------------------------------------------------------------------------
7462{
7468 // The following maps must be accessed using helper functions.
7469 // Example: for user_labels_t, see functions starting with "user_labels_".
7477#define CIT_COLLAPSED 0x0001
7482#define CFS_BOUNDS 0x0001
7483#define CFS_TEXT 0x0002
7484#define CFS_LVARS_HIDDEN 0x0004
7485#define CFS_LOCKED 0x0008
7491
7492 // the exact size of this class is not documented, there may be more fields
7493 char reserved[];
7494
7495public:
7496 cfunc_t(mba_t *mba); // use create_cfunc()
7497 ~cfunc_t() { cleanup(); }
7498 void release() { delete this; }
7500
7501
7503 void hexapi build_c_tree();
7504
7510 void hexapi verify(allow_unused_labels_t aul, bool even_without_debugger) const;
7511
7514 void hexapi print_dcl(qstring *vout) const;
7515
7518 void hexapi print_func(vc_printer_t &vp) const;
7519
7523 bool hexapi get_func_type(tinfo_t *type) const;
7524
7531 lvars_t *hexapi get_lvars();
7532
7538 sval_t hexapi get_stkoff_delta();
7539
7542 citem_t *hexapi find_label(int label);
7543
7547 void hexapi remove_unused_labels();
7548
7553 const char *hexapi get_user_cmt(const treeloc_t &loc, cmt_retrieval_type_t rt) const;
7554
7560 void hexapi set_user_cmt(const treeloc_t &loc, const char *cmt);
7561
7565 int32 hexapi get_user_iflags(const citem_locator_t &loc) const;
7566
7570 void hexapi set_user_iflags(const citem_locator_t &loc, int32 iflags);
7571
7573 bool hexapi has_orphan_cmts() const;
7574
7577 int hexapi del_orphan_cmts();
7578
7583 bool hexapi get_user_union_selection(ea_t ea, intvec_t *path);
7584
7589 void hexapi set_user_union_selection(ea_t ea, const intvec_t &path);
7590
7592 void hexapi save_user_labels() const;
7594 void hexapi save_user_cmts() const;
7596 void hexapi save_user_numforms() const;
7598 void hexapi save_user_iflags() const;
7600 void hexapi save_user_unions() const;
7601
7611 bool hexapi get_line_item(
7612 const char *line,
7613 int x,
7614 bool is_ctree_line,
7615 ctree_item_t *phead,
7616 ctree_item_t *pitem,
7617 ctree_item_t *ptail);
7618
7621 hexwarns_t &hexapi get_warnings();
7622
7625 eamap_t &hexapi get_eamap();
7626
7629 boundaries_t &hexapi get_boundaries();
7630
7633 const strvec_t &hexapi get_pseudocode();
7634
7639 void hexapi refresh_func_ctext();
7640
7645 void hexapi recalc_item_addresses();
7646
7647 bool hexapi gather_derefs(const ctree_item_t &ci, udt_type_data_t *udm=nullptr) const;
7648 bool hexapi find_item_coords(const citem_t *item, int *px, int *py);
7649 bool locked() const { return (statebits & CFS_LOCKED) != 0; }
7650private:
7653 void hexapi cleanup();
7654 DECLARE_UNCOPYABLE(cfunc_t)
7655};
7657
7660#define DECOMP_NO_WAIT 0x0001
7661#define DECOMP_NO_CACHE 0x0002
7662#define DECOMP_NO_FRAME 0x0004
7663#define DECOMP_WARNINGS 0x0008
7664#define DECOMP_ALL_BLKS 0x0010
7665#define DECOMP_NO_HIDE 0x0020
7666#define DECOMP_GXREFS_DEFLT 0x0000
7670#define DECOMP_GXREFS_NOUPD 0x0040
7671#define DECOMP_GXREFS_FORCE 0x0080
7672#define DECOMP_VOID_MBA 0x0100
7673#define DECOMP_OUTLINE 0x80000000
7675
7678
7679void hexapi close_hexrays_waitbox();
7680
7681
7688
7689cfuncptr_t hexapi decompile(
7690 const mba_ranges_t &mbr,
7691 hexrays_failure_t *hf=nullptr,
7692 int decomp_flags=0);
7693
7694
7702
7704 func_t *pfn,
7705 hexrays_failure_t *hf=nullptr,
7706 int decomp_flags=0)
7707{
7708 mba_ranges_t mbr(pfn);
7709 return decompile(mbr, hf, decomp_flags);
7710}
7711
7712
7719
7721 const rangevec_t &ranges,
7722 hexrays_failure_t *hf=nullptr,
7723 int decomp_flags=0)
7724{
7725 mba_ranges_t mbr(ranges);
7726 return decompile(mbr, hf, decomp_flags);
7727}
7728
7729
7737
7738mba_t *hexapi gen_microcode(
7739 const mba_ranges_t &mbr,
7740 hexrays_failure_t *hf=nullptr,
7741 const mlist_t *retlist=nullptr,
7742 int decomp_flags=0,
7744
7747 const mba_ranges_t &mbr,
7748 hexrays_failure_t *hf=nullptr)
7749{
7750 return gen_microcode(mbr, hf, nullptr, DECOMP_VOID_MBA);
7751}
7752
7753
7757
7758cfuncptr_t hexapi create_cfunc(mba_t *mba);
7759
7760
7766
7767bool hexapi mark_cfunc_dirty(ea_t ea, bool close_views=false);
7768
7769
7771
7772void hexapi clear_cached_cfuncs();
7773
7774
7776
7777bool hexapi has_cached_cfunc(ea_t ea);
7778
7779//--------------------------------------------------------------------------
7780// Now cinsn_t class is defined, define the cleanup functions:
7781inline void cif_t::cleanup() { delete ithen; delete ielse; }
7782inline void cloop_t::cleanup() { delete body; }
7783
7788
7789inline void citem_t::print1(qstring *vout, const cfunc_t *func) const
7790{
7791 if ( is_expr() )
7792 ((cexpr_t*)this)->print1(vout, func);
7793 else
7794 ((cinsn_t*)this)->print1(vout, func);
7795}
7796
7799
7800inline bool cexpr_t::get_1num_op(cexpr_t **o1, cexpr_t **o2)
7801{
7802 if ( x->op == cot_num )
7803 {
7804 *o1 = x;
7805 *o2 = y;
7806 }
7807 else
7808 {
7809 if ( y->op != cot_num )
7810 return false;
7811 *o1 = y;
7812 *o2 = x;
7813 }
7814 return true;
7815}
7816
7817inline bool cexpr_t::get_1num_op(const cexpr_t **o1, const cexpr_t **o2) const
7818{
7819 return CONST_CAST(cexpr_t*)(this)->get_1num_op(
7820 CONST_CAST(cexpr_t**)(o1),
7821 CONST_CAST(cexpr_t**)(o2));
7822}
7823
7825 : ea(i != nullptr ? i->ea : BADADDR),
7826 op(i != nullptr ? i->op : cot_empty)
7827{
7828}
7829
7830const char *hexapi get_ctype_name(ctype_t op);
7831qstring hexapi create_field_name(const tinfo_t &type, uval_t offset=BADADDR);
7832typedef void *hexdsp_t(int code, ...);
7833const int64 HEXRAYS_API_MAGIC = 0x00DEC0DE00000004LL;
7834
7839enum hexrays_event_t ENUM_SIZE(int)
7840{
7841 // When a function is decompiled, the following events occur:
7842
7843 hxe_flowchart,
7849
7850 hxe_stkpnts,
7855
7856 hxe_prolog,
7863
7864 hxe_microcode,
7867
7868 hxe_preoptimized,
7871
7872 hxe_locopt,
7875
7876 hxe_prealloc,
7881
7882 hxe_glbopt,
7887
7888 hxe_pre_structural,
7893
7894 hxe_structural,
7896
7897 hxe_maturity,
7900
7901 hxe_interr,
7903
7904 hxe_combine,
7910
7911 hxe_print_func,
7916
7917 hxe_func_printed,
7923
7924 hxe_resolve_stkaddrs,
7926
7927 hxe_build_callinfo,
7933
7934 hxe_callinfo_built,
7936
7937 hxe_calls_done,
7942
7943 hxe_begin_inlining,
7948
7949 hxe_inlining_func,
7953
7954 hxe_inlined_func,
7960
7961 hxe_collect_warnings,
7966
7967 // User interface related events:
7968
7969 hxe_open_pseudocode=100,
7972
7973 hxe_switch_pseudocode,
7977
7978 hxe_refresh_pseudocode,
7982
7983 hxe_close_pseudocode,
7985
7986 hxe_keyboard,
7991
7992 hxe_right_click,
7996
7997 hxe_double_click,
8001
8002 hxe_curpos,
8005
8006 hxe_create_hint,
8014
8015 hxe_text_ready,
8019
8020 hxe_populating_popup,
8024
8025 lxe_lvar_name_changed,
8032
8033 lxe_lvar_type_changed,
8039
8040 lxe_lvar_cmt_changed,
8046
8047 lxe_lvar_mapping_changed,
8053
8054 hxe_cmt_changed,
8058
8059 hxe_mba_maturity,
8063};
8064
8072
8073typedef ssize_t idaapi hexrays_cb_t(void *ud, hexrays_event_t event, va_list va);
8074
8075
8080
8081bool hexapi install_hexrays_callback(hexrays_cb_t *callback, void *ud);
8082
8088
8089int hexapi remove_hexrays_callback(hexrays_cb_t *callback, void *ud);
8090
8091
8092//---------------------------------------------------------------------------
8095
8103
8104
8105//---------------------------------------------------------------------------
8108{
8109 int lnnum;
8110 int x;
8111 int y;
8114 bool in_ctree(int hdrlines) const { return lnnum >= hdrlines; }
8117 {
8118 if ( lnnum < r.lnnum ) return -1;
8119 if ( lnnum > r.lnnum ) return 1;
8120 if ( x < r.x ) return -1;
8121 if ( x > r.x ) return 1;
8122 return 0;
8123 }
8124 ctext_position_t(int _lnnum=-1, int _x=0, int _y=0)
8125 : lnnum(_lnnum), x(_x), y(_y) {}
8126};
8127
8132{
8135 ea_t end = BADADDR;
8136 history_item_t(ea_t fea=BADADDR, ea_t cea=BADADDR, int _lnnum=-1, int _x=0, int _y=0)
8137 : ctext_position_t(_lnnum, _x, _y), func_ea(fea), curr_ea(cea) {}
8139 : ctext_position_t(p), func_ea(fea), curr_ea(cea) {}
8140};
8141
8144
8146typedef int cmt_type_t;
8147const cmt_type_t
8148 CMT_NONE = 0x0000,
8149 CMT_TAIL = 0x0001,
8150 CMT_BLOCK1 = 0x0002,
8151 CMT_BLOCK2 = 0x0004,
8152 CMT_LVAR = 0x0008,
8153 CMT_FUNC = 0x0010,
8154 CMT_ALL = 0x001F;
8155
8156//---------------------------------------------------------------------------
8159{
8160 int flags = 0;
8164#define VDUI_VISIBLE 0x0001
8165#define VDUI_VALID 0x0002
8167
8170 bool visible() const { return (flags & VDUI_VISIBLE) != 0; }
8173 bool valid() const { return (flags & VDUI_VALID) != 0; }
8178 bool locked() const { return cfunc != nullptr && cfunc->locked(); }
8179 void set_visible(bool v) { setflag(flags, VDUI_VISIBLE, v); }
8180 void set_valid(bool v) { setflag(flags, VDUI_VALID, v); }
8181 bool hexapi set_locked(bool v); // returns true-redecompiled
8182
8184 TWidget *ct = nullptr;
8185 TWidget *toplevel = nullptr;
8186
8190
8191 // The following fields are valid after get_current_item():
8196
8197 vdui_t(); // do not create your own vdui_t objects
8198
8207 void hexapi refresh_view(bool redo_mba);
8208
8214 void hexapi refresh_ctext(bool activate=true); // deprecated
8215
8221 void hexapi switch_to(cfuncptr_t f, bool activate);
8222
8226 bool in_ctree() const { return cpos.in_ctree(cfunc->hdrlines); }
8227
8233 cnumber_t *hexapi get_number();
8234
8239 int hexapi get_current_label();
8240
8243 void hexapi clear();
8244
8249 bool hexapi refresh_cpos(input_device_t idv);
8250
8256 bool hexapi get_current_item(input_device_t idv);
8257
8262 bool hexapi ui_rename_lvar(lvar_t *v);
8263
8272 bool hexapi rename_lvar(lvar_t *v, const char *name, bool is_user_name);
8273
8279 bool hexapi ui_set_call_type(const cexpr_t *e);
8280
8286 bool hexapi ui_set_lvar_type(lvar_t *v);
8287
8294 bool hexapi set_lvar_type(lvar_t *v, const tinfo_t &type);
8295
8301 bool hexapi set_noptr_lvar(lvar_t *v);
8302
8308 bool hexapi ui_edit_lvar_cmt(lvar_t *v);
8309
8315 bool hexapi set_lvar_cmt(lvar_t *v, const char *cmt);
8316
8321 bool hexapi ui_map_lvar(lvar_t *v);
8322
8328 bool hexapi ui_unmap_lvar(lvar_t *v);
8329
8336 bool hexapi map_lvar(lvar_t *from, lvar_t *to);
8337
8344 bool hexapi set_udm_type(tinfo_t &udt_type, int udm_idx);
8345
8352 bool hexapi rename_udm(tinfo_t &udt_type, int udm_idx);
8353
8359 bool hexapi set_global_type(ea_t ea);
8360
8366 bool hexapi rename_global(ea_t ea);
8367
8373 bool hexapi rename_label(int label);
8374
8382 bool hexapi jump_enter(input_device_t idv, int omflags);
8383
8389 bool hexapi ctree_to_disasm();
8390
8399 cmt_type_t hexapi calc_cmt_type(size_t lnnum, cmt_type_t cmttype) const;
8400
8406 bool hexapi edit_cmt(const treeloc_t &loc);
8407
8412 bool hexapi edit_func_cmt();
8413
8417 bool hexapi del_orphan_cmts();
8418
8424 bool hexapi set_num_radix(int base);
8425
8430 bool hexapi set_num_enum();
8431
8435 bool hexapi set_num_stroff();
8436
8440 bool hexapi invert_sign();
8441
8445 bool hexapi invert_bits();
8446
8450 bool hexapi collapse_item(bool hide);
8451
8454 bool hexapi collapse_lvars(bool hide);
8455
8459 bool hexapi split_item(bool split);
8460
8461};
8462
8463//---------------------------------------------------------------------------
8465
8468{
8471 bool operator==(const ui_stroff_op_t &r) const
8472 {
8473 return text == r.text && offset == r.offset;
8474 }
8475 bool operator!=(const ui_stroff_op_t &r) const { return !(*this == r); }
8476};
8479
8483{
8489 virtual bool idaapi apply(size_t opnum, const intvec_t &path, const tinfo_t &top_tif, const char *spath) = 0;
8490};
8491
8497int hexapi select_udt_by_offset(
8498 const qvector<tinfo_t> *udts,
8499 const ui_stroff_ops_t &ops,
8500 ui_stroff_applicator_t &applicator);
8501
8502
8503
8504
8505//--------------------------------------------------------------------------
8506// PUBLIC HEX-RAYS API
8507//--------------------------------------------------------------------------
8508
8511typedef void *hexdsp_t(int code, ...);
8512
8515{
9138};
9139
9140typedef size_t iterator_word;
9141
9142//--------------------------------------------------------------------------
9147inline bool init_hexrays_plugin(int flags=0)
9148{
9149 hexdsp_t *dummy;
9150 return callui(ui_broadcast, HEXRAYS_API_MAGIC, &dummy, flags).i == (HEXRAYS_API_MAGIC >> 32);
9151}
9152
9153//--------------------------------------------------------------------------
9156{
9157}
9158
9159
9160//-------------------------------------------------------------------------
9162{
9164 bool operator==(const user_numforms_iterator_t &p) const { return x == p.x; }
9165 bool operator!=(const user_numforms_iterator_t &p) const { return x != p.x; }
9166};
9167
9168//-------------------------------------------------------------------------
9174
9175//-------------------------------------------------------------------------
9181
9182//-------------------------------------------------------------------------
9185{
9187 HEXDSP(hx_user_numforms_find, &p, map, &key);
9188 return p;
9189}
9190
9191//-------------------------------------------------------------------------
9194{
9196 HEXDSP(hx_user_numforms_insert, &p, map, &key, &val);
9197 return p;
9198}
9199
9200//-------------------------------------------------------------------------
9203{
9205 HEXDSP(hx_user_numforms_begin, &p, map);
9206 return p;
9207}
9208
9209//-------------------------------------------------------------------------
9212{
9214 HEXDSP(hx_user_numforms_end, &p, map);
9215 return p;
9216}
9217
9218//-------------------------------------------------------------------------
9225
9226//-------------------------------------------------------------------------
9233
9234//-------------------------------------------------------------------------
9237{
9238 HEXDSP(hx_user_numforms_erase, map, &p);
9239}
9240
9241//-------------------------------------------------------------------------
9244{
9245 HEXDSP(hx_user_numforms_clear, map);
9246}
9247
9248//-------------------------------------------------------------------------
9251{
9252 return (size_t)HEXDSP(hx_user_numforms_size, map);
9253}
9254
9255//-------------------------------------------------------------------------
9258{
9259 HEXDSP(hx_user_numforms_free, map);
9260}
9261
9262//-------------------------------------------------------------------------
9265{
9266 return (user_numforms_t *)HEXDSP(hx_user_numforms_new);
9267}
9268
9269//-------------------------------------------------------------------------
9271{
9273 bool operator==(const lvar_mapping_iterator_t &p) const { return x == p.x; }
9274 bool operator!=(const lvar_mapping_iterator_t &p) const { return x != p.x; }
9275};
9276
9277//-------------------------------------------------------------------------
9283
9284//-------------------------------------------------------------------------
9290
9291//-------------------------------------------------------------------------
9294{
9296 HEXDSP(hx_lvar_mapping_find, &p, map, &key);
9297 return p;
9298}
9299
9300//-------------------------------------------------------------------------
9303{
9305 HEXDSP(hx_lvar_mapping_insert, &p, map, &key, &val);
9306 return p;
9307}
9308
9309//-------------------------------------------------------------------------
9312{
9314 HEXDSP(hx_lvar_mapping_begin, &p, map);
9315 return p;
9316}
9317
9318//-------------------------------------------------------------------------
9321{
9323 HEXDSP(hx_lvar_mapping_end, &p, map);
9324 return p;
9325}
9326
9327//-------------------------------------------------------------------------
9330{
9331 HEXDSP(hx_lvar_mapping_next, &p);
9332 return p;
9333}
9334
9335//-------------------------------------------------------------------------
9338{
9339 HEXDSP(hx_lvar_mapping_prev, &p);
9340 return p;
9341}
9342
9343//-------------------------------------------------------------------------
9346{
9347 HEXDSP(hx_lvar_mapping_erase, map, &p);
9348}
9349
9350//-------------------------------------------------------------------------
9353{
9354 HEXDSP(hx_lvar_mapping_clear, map);
9355}
9356
9357//-------------------------------------------------------------------------
9360{
9361 return (size_t)HEXDSP(hx_lvar_mapping_size, map);
9362}
9363
9364//-------------------------------------------------------------------------
9367{
9368 HEXDSP(hx_lvar_mapping_free, map);
9369}
9370
9371//-------------------------------------------------------------------------
9374{
9375 return (lvar_mapping_t *)HEXDSP(hx_lvar_mapping_new);
9376}
9377
9378//-------------------------------------------------------------------------
9380{
9382 bool operator==(const udcall_map_iterator_t &p) const { return x == p.x; }
9383 bool operator!=(const udcall_map_iterator_t &p) const { return x != p.x; }
9384};
9385
9386//-------------------------------------------------------------------------
9389{
9390 return *(ea_t *)HEXDSP(hx_udcall_map_first, &p);
9391}
9392
9393//-------------------------------------------------------------------------
9396{
9397 return *(udcall_t *)HEXDSP(hx_udcall_map_second, &p);
9398}
9399
9400//-------------------------------------------------------------------------
9403{
9405 HEXDSP(hx_udcall_map_find, &p, map, &key);
9406 return p;
9407}
9408
9409//-------------------------------------------------------------------------
9412{
9414 HEXDSP(hx_udcall_map_insert, &p, map, &key, &val);
9415 return p;
9416}
9417
9418//-------------------------------------------------------------------------
9421{
9423 HEXDSP(hx_udcall_map_begin, &p, map);
9424 return p;
9425}
9426
9427//-------------------------------------------------------------------------
9430{
9432 HEXDSP(hx_udcall_map_end, &p, map);
9433 return p;
9434}
9435
9436//-------------------------------------------------------------------------
9439{
9440 HEXDSP(hx_udcall_map_next, &p);
9441 return p;
9442}
9443
9444//-------------------------------------------------------------------------
9447{
9448 HEXDSP(hx_udcall_map_prev, &p);
9449 return p;
9450}
9451
9452//-------------------------------------------------------------------------
9455{
9456 HEXDSP(hx_udcall_map_erase, map, &p);
9457}
9458
9459//-------------------------------------------------------------------------
9462{
9463 HEXDSP(hx_udcall_map_clear, map);
9464}
9465
9466//-------------------------------------------------------------------------
9469{
9470 return (size_t)HEXDSP(hx_udcall_map_size, map);
9471}
9472
9473//-------------------------------------------------------------------------
9476{
9477 HEXDSP(hx_udcall_map_free, map);
9478}
9479
9480//-------------------------------------------------------------------------
9483{
9484 return (udcall_map_t *)HEXDSP(hx_udcall_map_new);
9485}
9486
9487//-------------------------------------------------------------------------
9489{
9491 bool operator==(const user_cmts_iterator_t &p) const { return x == p.x; }
9492 bool operator!=(const user_cmts_iterator_t &p) const { return x != p.x; }
9493};
9494
9495//-------------------------------------------------------------------------
9498{
9499 return *(treeloc_t *)HEXDSP(hx_user_cmts_first, &p);
9500}
9501
9502//-------------------------------------------------------------------------
9505{
9506 return *(citem_cmt_t *)HEXDSP(hx_user_cmts_second, &p);
9507}
9508
9509//-------------------------------------------------------------------------
9512{
9514 HEXDSP(hx_user_cmts_find, &p, map, &key);
9515 return p;
9516}
9517
9518//-------------------------------------------------------------------------
9521{
9523 HEXDSP(hx_user_cmts_insert, &p, map, &key, &val);
9524 return p;
9525}
9526
9527//-------------------------------------------------------------------------
9530{
9532 HEXDSP(hx_user_cmts_begin, &p, map);
9533 return p;
9534}
9535
9536//-------------------------------------------------------------------------
9539{
9541 HEXDSP(hx_user_cmts_end, &p, map);
9542 return p;
9543}
9544
9545//-------------------------------------------------------------------------
9548{
9549 HEXDSP(hx_user_cmts_next, &p);
9550 return p;
9551}
9552
9553//-------------------------------------------------------------------------
9556{
9557 HEXDSP(hx_user_cmts_prev, &p);
9558 return p;
9559}
9560
9561//-------------------------------------------------------------------------
9564{
9565 HEXDSP(hx_user_cmts_erase, map, &p);
9566}
9567
9568//-------------------------------------------------------------------------
9571{
9572 HEXDSP(hx_user_cmts_clear, map);
9573}
9574
9575//-------------------------------------------------------------------------
9577inline size_t user_cmts_size(user_cmts_t *map)
9578{
9579 return (size_t)HEXDSP(hx_user_cmts_size, map);
9580}
9581
9582//-------------------------------------------------------------------------
9585{
9586 HEXDSP(hx_user_cmts_free, map);
9587}
9588
9589//-------------------------------------------------------------------------
9592{
9593 return (user_cmts_t *)HEXDSP(hx_user_cmts_new);
9594}
9595
9596//-------------------------------------------------------------------------
9598{
9600 bool operator==(const user_iflags_iterator_t &p) const { return x == p.x; }
9601 bool operator!=(const user_iflags_iterator_t &p) const { return x != p.x; }
9602};
9603
9604//-------------------------------------------------------------------------
9607{
9608 return *(citem_locator_t *)HEXDSP(hx_user_iflags_first, &p);
9609}
9610
9611//-------------------------------------------------------------------------
9614{
9615 return *(int32 *)HEXDSP(hx_user_iflags_second, &p);
9616}
9617
9618//-------------------------------------------------------------------------
9621{
9623 HEXDSP(hx_user_iflags_find, &p, map, &key);
9624 return p;
9625}
9626
9627//-------------------------------------------------------------------------
9630{
9632 HEXDSP(hx_user_iflags_insert, &p, map, &key, &val);
9633 return p;
9634}
9635
9636//-------------------------------------------------------------------------
9639{
9641 HEXDSP(hx_user_iflags_begin, &p, map);
9642 return p;
9643}
9644
9645//-------------------------------------------------------------------------
9648{
9650 HEXDSP(hx_user_iflags_end, &p, map);
9651 return p;
9652}
9653
9654//-------------------------------------------------------------------------
9657{
9658 HEXDSP(hx_user_iflags_next, &p);
9659 return p;
9660}
9661
9662//-------------------------------------------------------------------------
9665{
9666 HEXDSP(hx_user_iflags_prev, &p);
9667 return p;
9668}
9669
9670//-------------------------------------------------------------------------
9673{
9674 HEXDSP(hx_user_iflags_erase, map, &p);
9675}
9676
9677//-------------------------------------------------------------------------
9680{
9681 HEXDSP(hx_user_iflags_clear, map);
9682}
9683
9684//-------------------------------------------------------------------------
9687{
9688 return (size_t)HEXDSP(hx_user_iflags_size, map);
9689}
9690
9691//-------------------------------------------------------------------------
9694{
9695 HEXDSP(hx_user_iflags_free, map);
9696}
9697
9698//-------------------------------------------------------------------------
9701{
9702 return (user_iflags_t *)HEXDSP(hx_user_iflags_new);
9703}
9704
9705//-------------------------------------------------------------------------
9707{
9709 bool operator==(const user_unions_iterator_t &p) const { return x == p.x; }
9710 bool operator!=(const user_unions_iterator_t &p) const { return x != p.x; }
9711};
9712
9713//-------------------------------------------------------------------------
9716{
9717 return *(ea_t *)HEXDSP(hx_user_unions_first, &p);
9718}
9719
9720//-------------------------------------------------------------------------
9723{
9724 return *(intvec_t *)HEXDSP(hx_user_unions_second, &p);
9725}
9726
9727//-------------------------------------------------------------------------
9730{
9732 HEXDSP(hx_user_unions_find, &p, map, &key);
9733 return p;
9734}
9735
9736//-------------------------------------------------------------------------
9739{
9741 HEXDSP(hx_user_unions_insert, &p, map, &key, &val);
9742 return p;
9743}
9744
9745//-------------------------------------------------------------------------
9748{
9750 HEXDSP(hx_user_unions_begin, &p, map);
9751 return p;
9752}
9753
9754//-------------------------------------------------------------------------
9757{
9759 HEXDSP(hx_user_unions_end, &p, map);
9760 return p;
9761}
9762
9763//-------------------------------------------------------------------------
9766{
9767 HEXDSP(hx_user_unions_next, &p);
9768 return p;
9769}
9770
9771//-------------------------------------------------------------------------
9774{
9775 HEXDSP(hx_user_unions_prev, &p);
9776 return p;
9777}
9778
9779//-------------------------------------------------------------------------
9782{
9783 HEXDSP(hx_user_unions_erase, map, &p);
9784}
9785
9786//-------------------------------------------------------------------------
9789{
9790 HEXDSP(hx_user_unions_clear, map);
9791}
9792
9793//-------------------------------------------------------------------------
9796{
9797 return (size_t)HEXDSP(hx_user_unions_size, map);
9798}
9799
9800//-------------------------------------------------------------------------
9803{
9804 HEXDSP(hx_user_unions_free, map);
9805}
9806
9807//-------------------------------------------------------------------------
9810{
9811 return (user_unions_t *)HEXDSP(hx_user_unions_new);
9812}
9813
9814//-------------------------------------------------------------------------
9816{
9818 bool operator==(const user_labels_iterator_t &p) const { return x == p.x; }
9819 bool operator!=(const user_labels_iterator_t &p) const { return x != p.x; }
9820};
9821
9822//-------------------------------------------------------------------------
9825{
9826 return *(int *)HEXDSP(hx_user_labels_first, &p);
9827}
9828
9829//-------------------------------------------------------------------------
9832{
9833 return *(qstring *)HEXDSP(hx_user_labels_second, &p);
9834}
9835
9836//-------------------------------------------------------------------------
9839{
9841 HEXDSP(hx_user_labels_find, &p, map, &key);
9842 return p;
9843}
9844
9845//-------------------------------------------------------------------------
9847inline user_labels_iterator_t user_labels_insert(user_labels_t *map, const int &key, const qstring &val)
9848{
9850 HEXDSP(hx_user_labels_insert, &p, map, &key, &val);
9851 return p;
9852}
9853
9854//-------------------------------------------------------------------------
9857{
9859 HEXDSP(hx_user_labels_begin, &p, map);
9860 return p;
9861}
9862
9863//-------------------------------------------------------------------------
9866{
9868 HEXDSP(hx_user_labels_end, &p, map);
9869 return p;
9870}
9871
9872//-------------------------------------------------------------------------
9875{
9876 HEXDSP(hx_user_labels_next, &p);
9877 return p;
9878}
9879
9880//-------------------------------------------------------------------------
9883{
9884 HEXDSP(hx_user_labels_prev, &p);
9885 return p;
9886}
9887
9888//-------------------------------------------------------------------------
9891{
9892 HEXDSP(hx_user_labels_erase, map, &p);
9893}
9894
9895//-------------------------------------------------------------------------
9898{
9899 HEXDSP(hx_user_labels_clear, map);
9900}
9901
9902//-------------------------------------------------------------------------
9905{
9906 return (size_t)HEXDSP(hx_user_labels_size, map);
9907}
9908
9909//-------------------------------------------------------------------------
9912{
9913 HEXDSP(hx_user_labels_free, map);
9914}
9915
9916//-------------------------------------------------------------------------
9919{
9920 return (user_labels_t *)HEXDSP(hx_user_labels_new);
9921}
9922
9923//-------------------------------------------------------------------------
9925{
9927 bool operator==(const eamap_iterator_t &p) const { return x == p.x; }
9928 bool operator!=(const eamap_iterator_t &p) const { return x != p.x; }
9929};
9930
9931//-------------------------------------------------------------------------
9934{
9935 return *(ea_t *)HEXDSP(hx_eamap_first, &p);
9936}
9937
9938//-------------------------------------------------------------------------
9941{
9942 return *(cinsnptrvec_t *)HEXDSP(hx_eamap_second, &p);
9943}
9944
9945//-------------------------------------------------------------------------
9947inline eamap_iterator_t eamap_find(const eamap_t *map, const ea_t &key)
9948{
9950 HEXDSP(hx_eamap_find, &p, map, &key);
9951 return p;
9952}
9953
9954//-------------------------------------------------------------------------
9956inline eamap_iterator_t eamap_insert(eamap_t *map, const ea_t &key, const cinsnptrvec_t &val)
9957{
9959 HEXDSP(hx_eamap_insert, &p, map, &key, &val);
9960 return p;
9961}
9962
9963//-------------------------------------------------------------------------
9966{
9968 HEXDSP(hx_eamap_begin, &p, map);
9969 return p;
9970}
9971
9972//-------------------------------------------------------------------------
9975{
9977 HEXDSP(hx_eamap_end, &p, map);
9978 return p;
9979}
9980
9981//-------------------------------------------------------------------------
9984{
9985 HEXDSP(hx_eamap_next, &p);
9986 return p;
9987}
9988
9989//-------------------------------------------------------------------------
9992{
9993 HEXDSP(hx_eamap_prev, &p);
9994 return p;
9995}
9996
9997//-------------------------------------------------------------------------
10000{
10001 HEXDSP(hx_eamap_erase, map, &p);
10002}
10003
10004//-------------------------------------------------------------------------
10006inline void eamap_clear(eamap_t *map)
10007{
10008 HEXDSP(hx_eamap_clear, map);
10009}
10010
10011//-------------------------------------------------------------------------
10013inline size_t eamap_size(eamap_t *map)
10014{
10015 return (size_t)HEXDSP(hx_eamap_size, map);
10016}
10017
10018//-------------------------------------------------------------------------
10020inline void eamap_free(eamap_t *map)
10021{
10022 HEXDSP(hx_eamap_free, map);
10023}
10024
10025//-------------------------------------------------------------------------
10028{
10029 return (eamap_t *)HEXDSP(hx_eamap_new);
10030}
10031
10032//-------------------------------------------------------------------------
10034{
10036 bool operator==(const boundaries_iterator_t &p) const { return x == p.x; }
10037 bool operator!=(const boundaries_iterator_t &p) const { return x != p.x; }
10038};
10039
10040//-------------------------------------------------------------------------
10043{
10044 return *(cinsn_t * *)HEXDSP(hx_boundaries_first, &p);
10045}
10046
10047//-------------------------------------------------------------------------
10050{
10051 return *(rangeset_t *)HEXDSP(hx_boundaries_second, &p);
10052}
10053
10054//-------------------------------------------------------------------------
10057{
10059 HEXDSP(hx_boundaries_find, &p, map, &key);
10060 return p;
10061}
10062
10063//-------------------------------------------------------------------------
10065inline boundaries_iterator_t boundaries_insert(boundaries_t *map, const cinsn_t * &key, const rangeset_t &val)
10066{
10068 HEXDSP(hx_boundaries_insert, &p, map, &key, &val);
10069 return p;
10070}
10071
10072//-------------------------------------------------------------------------
10075{
10077 HEXDSP(hx_boundaries_begin, &p, map);
10078 return p;
10079}
10080
10081//-------------------------------------------------------------------------
10084{
10086 HEXDSP(hx_boundaries_end, &p, map);
10087 return p;
10088}
10089
10090//-------------------------------------------------------------------------
10093{
10094 HEXDSP(hx_boundaries_next, &p);
10095 return p;
10096}
10097
10098//-------------------------------------------------------------------------
10101{
10102 HEXDSP(hx_boundaries_prev, &p);
10103 return p;
10104}
10105
10106//-------------------------------------------------------------------------
10109{
10110 HEXDSP(hx_boundaries_erase, map, &p);
10111}
10112
10113//-------------------------------------------------------------------------
10116{
10117 HEXDSP(hx_boundaries_clear, map);
10118}
10119
10120//-------------------------------------------------------------------------
10123{
10124 return (size_t)HEXDSP(hx_boundaries_size, map);
10125}
10126
10127//-------------------------------------------------------------------------
10130{
10131 HEXDSP(hx_boundaries_free, map);
10132}
10133
10134//-------------------------------------------------------------------------
10137{
10138 return (boundaries_t *)HEXDSP(hx_boundaries_new);
10139}
10140
10141//-------------------------------------------------------------------------
10143{
10145 bool operator==(const block_chains_iterator_t &p) const { return x == p.x; }
10146 bool operator!=(const block_chains_iterator_t &p) const { return x != p.x; }
10147};
10148
10149//-------------------------------------------------------------------------
10152{
10153 return *(chain_t *)HEXDSP(hx_block_chains_get, &p);
10154}
10155
10156//-------------------------------------------------------------------------
10159{
10161 HEXDSP(hx_block_chains_find, &p, set, &val);
10162 return p;
10163}
10164
10165//-------------------------------------------------------------------------
10168{
10170 HEXDSP(hx_block_chains_insert, &p, set, &val);
10171 return p;
10172}
10173
10174//-------------------------------------------------------------------------
10177{
10179 HEXDSP(hx_block_chains_begin, &p, set);
10180 return p;
10181}
10182
10183//-------------------------------------------------------------------------
10186{
10188 HEXDSP(hx_block_chains_end, &p, set);
10189 return p;
10190}
10191
10192//-------------------------------------------------------------------------
10195{
10196 HEXDSP(hx_block_chains_next, &p);
10197 return p;
10198}
10199
10200//-------------------------------------------------------------------------
10203{
10204 HEXDSP(hx_block_chains_prev, &p);
10205 return p;
10206}
10207
10208//-------------------------------------------------------------------------
10211{
10212 HEXDSP(hx_block_chains_erase, set, &p);
10213}
10214
10215//-------------------------------------------------------------------------
10218{
10219 HEXDSP(hx_block_chains_clear, set);
10220}
10221
10222//-------------------------------------------------------------------------
10225{
10226 return (size_t)HEXDSP(hx_block_chains_size, set);
10227}
10228
10229//-------------------------------------------------------------------------
10232{
10233 HEXDSP(hx_block_chains_free, set);
10234}
10235
10236//-------------------------------------------------------------------------
10239{
10240 return (block_chains_t *)HEXDSP(hx_block_chains_new);
10241}
10242
10243//--------------------------------------------------------------------------
10244inline void *hexrays_alloc(size_t size)
10245{
10246 return HEXDSP(hx_hexrays_alloc, size);
10247}
10248
10249//--------------------------------------------------------------------------
10250inline void hexrays_free(void *ptr)
10251{
10252 HEXDSP(hx_hexrays_free, ptr);
10253}
10254
10255//--------------------------------------------------------------------------
10256inline void valrng_t::clear()
10257{
10258 HEXDSP(hx_valrng_t_clear, this);
10259}
10260
10261//--------------------------------------------------------------------------
10262inline void valrng_t::copy(const valrng_t &r)
10263{
10264 HEXDSP(hx_valrng_t_copy, this, &r);
10265}
10266
10267//--------------------------------------------------------------------------
10269{
10270 return *(valrng_t *)HEXDSP(hx_valrng_t_assign, this, &r);
10271}
10272
10273//--------------------------------------------------------------------------
10274inline int valrng_t::compare(const valrng_t &r) const
10275{
10276 return (int)(size_t)HEXDSP(hx_valrng_t_compare, this, &r);
10277}
10278
10279//--------------------------------------------------------------------------
10281{
10282 HEXDSP(hx_valrng_t_set_eq, this, v);
10283}
10284
10285//--------------------------------------------------------------------------
10286inline void valrng_t::set_cmp(cmpop_t cmp, uvlr_t _value)
10287{
10288 HEXDSP(hx_valrng_t_set_cmp, this, cmp, _value);
10289}
10290
10291//--------------------------------------------------------------------------
10292inline bool valrng_t::reduce_size(int new_size)
10293{
10294 return (uchar)(size_t)HEXDSP(hx_valrng_t_reduce_size, this, new_size) != 0;
10295}
10296
10297//--------------------------------------------------------------------------
10299{
10300 return (uchar)(size_t)HEXDSP(hx_valrng_t_intersect_with, this, &r) != 0;
10301}
10302
10303//--------------------------------------------------------------------------
10304inline bool valrng_t::unite_with(const valrng_t &r)
10305{
10306 return (uchar)(size_t)HEXDSP(hx_valrng_t_unite_with, this, &r) != 0;
10307}
10308
10309//--------------------------------------------------------------------------
10311{
10312 HEXDSP(hx_valrng_t_inverse, this);
10313}
10314
10315//--------------------------------------------------------------------------
10316inline bool valrng_t::has(uvlr_t v) const
10317{
10318 return (uchar)(size_t)HEXDSP(hx_valrng_t_has, this, v) != 0;
10319}
10320
10321//--------------------------------------------------------------------------
10322inline void valrng_t::print(qstring *vout) const
10323{
10324 HEXDSP(hx_valrng_t_print, this, vout);
10325}
10326
10327//--------------------------------------------------------------------------
10328inline const char *valrng_t::dstr() const
10329{
10330 return (const char *)HEXDSP(hx_valrng_t_dstr, this);
10331}
10332
10333//--------------------------------------------------------------------------
10335{
10336 return (uchar)(size_t)HEXDSP(hx_valrng_t_cvt_to_single_value, this, v) != 0;
10337}
10338
10339//--------------------------------------------------------------------------
10340inline bool valrng_t::cvt_to_cmp(cmpop_t *cmp, uvlr_t *val) const
10341{
10342 return (uchar)(size_t)HEXDSP(hx_valrng_t_cvt_to_cmp, this, cmp, val) != 0;
10343}
10344
10345//--------------------------------------------------------------------------
10347{
10348 ea_t retval;
10349 HEXDSP(hx_get_merror_desc, &retval, out, code, mba);
10350 return retval;
10351}
10352
10353//--------------------------------------------------------------------------
10354inline THREAD_SAFE bool must_mcode_close_block(mcode_t mcode, bool including_calls)
10355{
10356 return (uchar)(size_t)HEXDSP(hx_must_mcode_close_block, mcode, including_calls) != 0;
10357}
10358
10359//--------------------------------------------------------------------------
10360inline THREAD_SAFE bool is_mcode_propagatable(mcode_t mcode)
10361{
10362 return (uchar)(size_t)HEXDSP(hx_is_mcode_propagatable, mcode) != 0;
10363}
10364
10365//--------------------------------------------------------------------------
10367{
10368 return (mcode_t)(size_t)HEXDSP(hx_negate_mcode_relation, code);
10369}
10370
10371//--------------------------------------------------------------------------
10373{
10374 return (mcode_t)(size_t)HEXDSP(hx_swap_mcode_relation, code);
10375}
10376
10377//--------------------------------------------------------------------------
10379{
10380 return (mcode_t)(size_t)HEXDSP(hx_get_signed_mcode, code);
10381}
10382
10383//--------------------------------------------------------------------------
10385{
10386 return (mcode_t)(size_t)HEXDSP(hx_get_unsigned_mcode, code);
10387}
10388
10389//--------------------------------------------------------------------------
10390inline THREAD_SAFE bool mcode_modifies_d(mcode_t mcode)
10391{
10392 return (uchar)(size_t)HEXDSP(hx_mcode_modifies_d, mcode) != 0;
10393}
10394
10395//--------------------------------------------------------------------------
10396inline int operand_locator_t::compare(const operand_locator_t &r) const
10397{
10398 return (int)(size_t)HEXDSP(hx_operand_locator_t_compare, this, &r);
10399}
10400
10401//--------------------------------------------------------------------------
10402inline AS_PRINTF(3, 4) int vd_printer_t::print(int indent, const char *format, ...)
10403{
10404 va_list va;
10405 va_start(va, format);
10406 int retval = (int)(size_t)HEXDSP(hx_vd_printer_t_print, this, indent, format, va);
10407 va_end(va);
10408 return retval;
10409}
10410
10411//--------------------------------------------------------------------------
10412inline AS_PRINTF(3, 4) int file_printer_t::print(int indent, const char *format, ...)
10413{
10414 va_list va;
10415 va_start(va, format);
10416 int retval = (int)(size_t)HEXDSP(hx_file_printer_t_print, this, indent, format, va);
10417 va_end(va);
10418 return retval;
10419}
10420
10421//--------------------------------------------------------------------------
10422inline AS_PRINTF(3, 4) int qstring_printer_t::print(int indent, const char *format, ...)
10423{
10424 va_list va;
10425 va_start(va, format);
10426 int retval = (int)(size_t)HEXDSP(hx_qstring_printer_t_print, this, indent, format, va);
10427 va_end(va);
10428 return retval;
10429}
10430
10431//--------------------------------------------------------------------------
10432inline const char *dstr(const tinfo_t *tif)
10433{
10434 return (const char *)HEXDSP(hx_dstr, tif);
10435}
10436
10437//--------------------------------------------------------------------------
10438inline bool is_type_correct(const type_t *ptr)
10439{
10440 return (uchar)(size_t)HEXDSP(hx_is_type_correct, ptr) != 0;
10441}
10442
10443//--------------------------------------------------------------------------
10444inline bool is_small_udt(const tinfo_t &tif)
10445{
10446 return (uchar)(size_t)HEXDSP(hx_is_small_udt, &tif) != 0;
10447}
10448
10449//--------------------------------------------------------------------------
10450inline bool is_nonbool_type(const tinfo_t &type)
10451{
10452 return (uchar)(size_t)HEXDSP(hx_is_nonbool_type, &type) != 0;
10453}
10454
10455//--------------------------------------------------------------------------
10456inline bool is_bool_type(const tinfo_t &type)
10457{
10458 return (uchar)(size_t)HEXDSP(hx_is_bool_type, &type) != 0;
10459}
10460
10461//--------------------------------------------------------------------------
10463{
10464 return (int)(size_t)HEXDSP(hx_partial_type_num, &type);
10465}
10466
10467//--------------------------------------------------------------------------
10468inline tinfo_t get_float_type(int width)
10469{
10470 tinfo_t retval;
10471 HEXDSP(hx_get_float_type, &retval, width);
10472 return retval;
10473}
10474
10475//--------------------------------------------------------------------------
10477{
10478 tinfo_t retval;
10479 HEXDSP(hx_get_int_type_by_width_and_sign, &retval, srcwidth, sign);
10480 return retval;
10481}
10482
10483//--------------------------------------------------------------------------
10485{
10486 tinfo_t retval;
10487 HEXDSP(hx_get_unk_type, &retval, size);
10488 return retval;
10489}
10490
10491//--------------------------------------------------------------------------
10492inline tinfo_t dummy_ptrtype(int ptrsize, bool isfp)
10493{
10494 tinfo_t retval;
10495 HEXDSP(hx_dummy_ptrtype, &retval, ptrsize, isfp);
10496 return retval;
10497}
10498
10499//--------------------------------------------------------------------------
10501{
10502 tinfo_t retval;
10503 HEXDSP(hx_make_pointer, &retval, &type);
10504 return retval;
10505}
10506
10507//--------------------------------------------------------------------------
10508inline tinfo_t create_typedef(const char *name)
10509{
10510 tinfo_t retval;
10511 HEXDSP(hx_create_typedef, &retval, name);
10512 return retval;
10513}
10514
10515//--------------------------------------------------------------------------
10516inline bool get_type(uval_t id, tinfo_t *tif, type_source_t guess)
10517{
10518 return (uchar)(size_t)HEXDSP(hx_get_type, id, tif, guess) != 0;
10519}
10520
10521//--------------------------------------------------------------------------
10522inline bool set_type(uval_t id, const tinfo_t &tif, type_source_t source, bool force)
10523{
10524 return (uchar)(size_t)HEXDSP(hx_set_type, id, &tif, source, force) != 0;
10525}
10526
10527//--------------------------------------------------------------------------
10528inline const char *vdloc_t::dstr(int width) const
10529{
10530 return (const char *)HEXDSP(hx_vdloc_t_dstr, this, width);
10531}
10532
10533//--------------------------------------------------------------------------
10534inline int vdloc_t::compare(const vdloc_t &r) const
10535{
10536 return (int)(size_t)HEXDSP(hx_vdloc_t_compare, this, &r);
10537}
10538
10539//--------------------------------------------------------------------------
10540inline bool vdloc_t::is_aliasable(const mba_t *mb, int size) const
10541{
10542 return (uchar)(size_t)HEXDSP(hx_vdloc_t_is_aliasable, this, mb, size) != 0;
10543}
10544
10545//--------------------------------------------------------------------------
10546inline void print_vdloc(qstring *vout, const vdloc_t &loc, int nbytes)
10547{
10548 HEXDSP(hx_print_vdloc, vout, &loc, nbytes);
10549}
10550
10551//--------------------------------------------------------------------------
10552inline bool arglocs_overlap(const vdloc_t &loc1, size_t w1, const vdloc_t &loc2, size_t w2)
10553{
10554 return (uchar)(size_t)HEXDSP(hx_arglocs_overlap, &loc1, w1, &loc2, w2) != 0;
10555}
10556
10557//--------------------------------------------------------------------------
10558inline int lvar_locator_t::compare(const lvar_locator_t &r) const
10559{
10560 return (int)(size_t)HEXDSP(hx_lvar_locator_t_compare, this, &r);
10561}
10562
10563//--------------------------------------------------------------------------
10564inline const char *lvar_locator_t::dstr() const
10565{
10566 return (const char *)HEXDSP(hx_lvar_locator_t_dstr, this);
10567}
10568
10569//--------------------------------------------------------------------------
10570inline const char *lvar_t::dstr() const
10571{
10572 return (const char *)HEXDSP(hx_lvar_t_dstr, this);
10573}
10574
10575//--------------------------------------------------------------------------
10576inline bool lvar_t::is_promoted_arg() const
10577{
10578 return (uchar)(size_t)HEXDSP(hx_lvar_t_is_promoted_arg, this) != 0;
10579}
10580
10581//--------------------------------------------------------------------------
10582inline bool lvar_t::accepts_type(const tinfo_t &t, bool may_change_thisarg)
10583{
10584 return (uchar)(size_t)HEXDSP(hx_lvar_t_accepts_type, this, &t, may_change_thisarg) != 0;
10585}
10586
10587//--------------------------------------------------------------------------
10588inline bool lvar_t::set_lvar_type(const tinfo_t &t, bool may_fail)
10589{
10590 return (uchar)(size_t)HEXDSP(hx_lvar_t_set_lvar_type, this, &t, may_fail) != 0;
10591}
10592
10593//--------------------------------------------------------------------------
10594inline bool lvar_t::set_width(int w, int svw_flags)
10595{
10596 return (uchar)(size_t)HEXDSP(hx_lvar_t_set_width, this, w, svw_flags) != 0;
10597}
10598
10599//--------------------------------------------------------------------------
10600inline void lvar_t::append_list(const mba_t *mba, mlist_t *lst, bool pad_if_scattered) const
10601{
10602 HEXDSP(hx_lvar_t_append_list, this, mba, lst, pad_if_scattered);
10603}
10604
10605//--------------------------------------------------------------------------
10606inline int lvars_t::find_stkvar(sval_t spoff, int width)
10607{
10608 return (int)(size_t)HEXDSP(hx_lvars_t_find_stkvar, this, spoff, width);
10609}
10610
10611//--------------------------------------------------------------------------
10613{
10614 return (lvar_t *)HEXDSP(hx_lvars_t_find, this, &ll);
10615}
10616
10617//--------------------------------------------------------------------------
10618inline int lvars_t::find_lvar(const vdloc_t &location, int width, int defblk) const
10619{
10620 return (int)(size_t)HEXDSP(hx_lvars_t_find_lvar, this, &location, width, defblk);
10621}
10622
10623//--------------------------------------------------------------------------
10625{
10626 return (uchar)(size_t)HEXDSP(hx_restore_user_lvar_settings, lvinf, func_ea) != 0;
10627}
10628
10629//--------------------------------------------------------------------------
10630inline void save_user_lvar_settings(ea_t func_ea, const lvar_uservec_t &lvinf)
10631{
10632 HEXDSP(hx_save_user_lvar_settings, func_ea, &lvinf);
10633}
10634
10635//--------------------------------------------------------------------------
10637{
10638 return (uchar)(size_t)HEXDSP(hx_modify_user_lvars, entry_ea, &mlv) != 0;
10639}
10640
10641//--------------------------------------------------------------------------
10642inline bool modify_user_lvar_info(ea_t func_ea, uint mli_flags, const lvar_saved_info_t &info)
10643{
10644 return (uchar)(size_t)HEXDSP(hx_modify_user_lvar_info, func_ea, mli_flags, &info) != 0;
10645}
10646
10647//--------------------------------------------------------------------------
10648inline bool locate_lvar(lvar_locator_t *out, ea_t func_ea, const char *varname)
10649{
10650 return (uchar)(size_t)HEXDSP(hx_locate_lvar, out, func_ea, varname) != 0;
10651}
10652
10653//--------------------------------------------------------------------------
10654inline bool restore_user_defined_calls(udcall_map_t *udcalls, ea_t func_ea)
10655{
10656 return (uchar)(size_t)HEXDSP(hx_restore_user_defined_calls, udcalls, func_ea) != 0;
10657}
10658
10659//--------------------------------------------------------------------------
10660inline void save_user_defined_calls(ea_t func_ea, const udcall_map_t &udcalls)
10661{
10662 HEXDSP(hx_save_user_defined_calls, func_ea, &udcalls);
10663}
10664
10665//--------------------------------------------------------------------------
10666inline bool parse_user_call(udcall_t *udc, const char *decl, bool silent)
10667{
10668 return (uchar)(size_t)HEXDSP(hx_parse_user_call, udc, decl, silent) != 0;
10669}
10670
10671//--------------------------------------------------------------------------
10673{
10674 return (merror_t)(size_t)HEXDSP(hx_convert_to_user_call, &udc, &cdg);
10675}
10676
10677//--------------------------------------------------------------------------
10678inline bool install_microcode_filter(microcode_filter_t *filter, bool install)
10679{
10680 auto hrdsp = HEXDSP;
10681 return hrdsp != nullptr && (uchar)(size_t)hrdsp(hx_install_microcode_filter, filter, install) != 0;
10682}
10683
10684//--------------------------------------------------------------------------
10686{
10687 HEXDSP(hx_udc_filter_t_cleanup, this);
10688}
10689
10690//--------------------------------------------------------------------------
10691inline bool udc_filter_t::init(const char *decl)
10692{
10693 return (uchar)(size_t)HEXDSP(hx_udc_filter_t_init, this, decl) != 0;
10694}
10695
10696//--------------------------------------------------------------------------
10698{
10699 return (merror_t)(size_t)HEXDSP(hx_udc_filter_t_apply, this, &cdg);
10700}
10701
10702//--------------------------------------------------------------------------
10704{
10705 HEXDSP(hx_bitset_t_bitset_t, this, &m);
10706}
10707
10708//--------------------------------------------------------------------------
10710{
10711 return *(bitset_t *)HEXDSP(hx_bitset_t_copy, this, &m);
10712}
10713
10714//--------------------------------------------------------------------------
10715inline bool bitset_t::add(int bit)
10716{
10717 return (uchar)(size_t)HEXDSP(hx_bitset_t_add, this, bit) != 0;
10718}
10719
10720//--------------------------------------------------------------------------
10721inline bool bitset_t::add(int bit, int width)
10722{
10723 return (uchar)(size_t)HEXDSP(hx_bitset_t_add_, this, bit, width) != 0;
10724}
10725
10726//--------------------------------------------------------------------------
10727inline bool bitset_t::add(const bitset_t &ml)
10728{
10729 return (uchar)(size_t)HEXDSP(hx_bitset_t_add__, this, &ml) != 0;
10730}
10731
10732//--------------------------------------------------------------------------
10733inline bool bitset_t::sub(int bit)
10734{
10735 return (uchar)(size_t)HEXDSP(hx_bitset_t_sub, this, bit) != 0;
10736}
10737
10738//--------------------------------------------------------------------------
10739inline bool bitset_t::sub(int bit, int width)
10740{
10741 return (uchar)(size_t)HEXDSP(hx_bitset_t_sub_, this, bit, width) != 0;
10742}
10743
10744//--------------------------------------------------------------------------
10745inline bool bitset_t::sub(const bitset_t &ml)
10746{
10747 return (uchar)(size_t)HEXDSP(hx_bitset_t_sub__, this, &ml) != 0;
10748}
10749
10750//--------------------------------------------------------------------------
10751inline bool bitset_t::cut_at(int maxbit)
10752{
10753 return (uchar)(size_t)HEXDSP(hx_bitset_t_cut_at, this, maxbit) != 0;
10754}
10755
10756//--------------------------------------------------------------------------
10757inline void bitset_t::shift_down(int shift)
10758{
10759 HEXDSP(hx_bitset_t_shift_down, this, shift);
10760}
10761
10762//--------------------------------------------------------------------------
10763inline bool bitset_t::has(int bit) const
10764{
10765 return (uchar)(size_t)HEXDSP(hx_bitset_t_has, this, bit) != 0;
10766}
10767
10768//--------------------------------------------------------------------------
10769inline bool bitset_t::has_all(int bit, int width) const
10770{
10771 return (uchar)(size_t)HEXDSP(hx_bitset_t_has_all, this, bit, width) != 0;
10772}
10773
10774//--------------------------------------------------------------------------
10775inline bool bitset_t::has_any(int bit, int width) const
10776{
10777 return (uchar)(size_t)HEXDSP(hx_bitset_t_has_any, this, bit, width) != 0;
10778}
10779
10780//--------------------------------------------------------------------------
10781inline const char *bitset_t::dstr() const
10782{
10783 return (const char *)HEXDSP(hx_bitset_t_dstr, this);
10784}
10785
10786//--------------------------------------------------------------------------
10787inline bool bitset_t::empty() const
10788{
10789 return (uchar)(size_t)HEXDSP(hx_bitset_t_empty, this) != 0;
10790}
10791
10792//--------------------------------------------------------------------------
10793inline int bitset_t::count() const
10794{
10795 return (int)(size_t)HEXDSP(hx_bitset_t_count, this);
10796}
10797
10798//--------------------------------------------------------------------------
10799inline int bitset_t::count(int bit) const
10800{
10801 return (int)(size_t)HEXDSP(hx_bitset_t_count_, this, bit);
10802}
10803
10804//--------------------------------------------------------------------------
10805inline int bitset_t::last() const
10806{
10807 return (int)(size_t)HEXDSP(hx_bitset_t_last, this);
10808}
10809
10810//--------------------------------------------------------------------------
10811inline void bitset_t::fill_with_ones(int maxbit)
10812{
10813 HEXDSP(hx_bitset_t_fill_with_ones, this, maxbit);
10814}
10815
10816//--------------------------------------------------------------------------
10817inline bool bitset_t::fill_gaps(int total_nbits)
10818{
10819 return (uchar)(size_t)HEXDSP(hx_bitset_t_fill_gaps, this, total_nbits) != 0;
10820}
10821
10822//--------------------------------------------------------------------------
10823inline bool bitset_t::has_common(const bitset_t &ml) const
10824{
10825 return (uchar)(size_t)HEXDSP(hx_bitset_t_has_common, this, &ml) != 0;
10826}
10827
10828//--------------------------------------------------------------------------
10829inline bool bitset_t::intersect(const bitset_t &ml)
10830{
10831 return (uchar)(size_t)HEXDSP(hx_bitset_t_intersect, this, &ml) != 0;
10832}
10833
10834//--------------------------------------------------------------------------
10835inline bool bitset_t::is_subset_of(const bitset_t &ml) const
10836{
10837 return (uchar)(size_t)HEXDSP(hx_bitset_t_is_subset_of, this, &ml) != 0;
10838}
10839
10840//--------------------------------------------------------------------------
10841inline int bitset_t::compare(const bitset_t &r) const
10842{
10843 return (int)(size_t)HEXDSP(hx_bitset_t_compare, this, &r);
10844}
10845
10846//--------------------------------------------------------------------------
10847inline int bitset_t::goup(int reg) const
10848{
10849 return (int)(size_t)HEXDSP(hx_bitset_t_goup, this, reg);
10850}
10851
10852//--------------------------------------------------------------------------
10853inline const char *ivl_t::dstr() const
10854{
10855 return (const char *)HEXDSP(hx_ivl_t_dstr, this);
10856}
10857
10858//--------------------------------------------------------------------------
10859inline int ivl_t::compare(const ivl_t &r) const
10860{
10861 return (int)(size_t)HEXDSP(hx_ivl_t_compare, this, &r);
10862}
10863
10864//--------------------------------------------------------------------------
10865inline bool ivlset_t::add(const ivl_t &ivl)
10866{
10867 return (uchar)(size_t)HEXDSP(hx_ivlset_t_add, this, &ivl) != 0;
10868}
10869
10870//--------------------------------------------------------------------------
10871inline bool ivlset_t::add(const ivlset_t &ivs)
10872{
10873 return (uchar)(size_t)HEXDSP(hx_ivlset_t_add_, this, &ivs) != 0;
10874}
10875
10876//--------------------------------------------------------------------------
10877inline bool ivlset_t::addmasked(const ivlset_t &ivs, const ivl_t &mask)
10878{
10879 return (uchar)(size_t)HEXDSP(hx_ivlset_t_addmasked, this, &ivs, &mask) != 0;
10880}
10881
10882//--------------------------------------------------------------------------
10883inline bool ivlset_t::sub(const ivl_t &ivl)
10884{
10885 return (uchar)(size_t)HEXDSP(hx_ivlset_t_sub, this, &ivl) != 0;
10886}
10887
10888//--------------------------------------------------------------------------
10889inline bool ivlset_t::sub(const ivlset_t &ivs)
10890{
10891 return (uchar)(size_t)HEXDSP(hx_ivlset_t_sub_, this, &ivs) != 0;
10892}
10893
10894//--------------------------------------------------------------------------
10895inline bool ivlset_t::has_common(const ivl_t &ivl, bool strict) const
10896{
10897 return (uchar)(size_t)HEXDSP(hx_ivlset_t_has_common, this, &ivl, strict) != 0;
10898}
10899
10900//--------------------------------------------------------------------------
10901inline void ivlset_t::print(qstring *vout) const
10902{
10903 HEXDSP(hx_ivlset_t_print, this, vout);
10904}
10905
10906//--------------------------------------------------------------------------
10907inline const char *ivlset_t::dstr() const
10908{
10909 return (const char *)HEXDSP(hx_ivlset_t_dstr, this);
10910}
10911
10912//--------------------------------------------------------------------------
10914{
10915 asize_t retval;
10916 HEXDSP(hx_ivlset_t_count, &retval, this);
10917 return retval;
10918}
10919
10920//--------------------------------------------------------------------------
10921inline bool ivlset_t::has_common(const ivlset_t &ivs) const
10922{
10923 return (uchar)(size_t)HEXDSP(hx_ivlset_t_has_common_, this, &ivs) != 0;
10924}
10925
10926//--------------------------------------------------------------------------
10927inline bool ivlset_t::contains(uval_t off) const
10928{
10929 return (uchar)(size_t)HEXDSP(hx_ivlset_t_contains, this, off) != 0;
10930}
10931
10932//--------------------------------------------------------------------------
10933inline bool ivlset_t::includes(const ivlset_t &ivs) const
10934{
10935 return (uchar)(size_t)HEXDSP(hx_ivlset_t_includes, this, &ivs) != 0;
10936}
10937
10938//--------------------------------------------------------------------------
10939inline bool ivlset_t::intersect(const ivlset_t &ivs)
10940{
10941 return (uchar)(size_t)HEXDSP(hx_ivlset_t_intersect, this, &ivs) != 0;
10942}
10943
10944//--------------------------------------------------------------------------
10945inline int ivlset_t::compare(const ivlset_t &r) const
10946{
10947 return (int)(size_t)HEXDSP(hx_ivlset_t_compare, this, &r);
10948}
10949
10950//--------------------------------------------------------------------------
10951inline void rlist_t::print(qstring *vout) const
10952{
10953 HEXDSP(hx_rlist_t_print, this, vout);
10954}
10955
10956//--------------------------------------------------------------------------
10957inline const char *rlist_t::dstr() const
10958{
10959 return (const char *)HEXDSP(hx_rlist_t_dstr, this);
10960}
10961
10962//--------------------------------------------------------------------------
10964{
10965 return (uchar)(size_t)HEXDSP(hx_mlist_t_addmem, this, ea, size) != 0;
10966}
10967
10968//--------------------------------------------------------------------------
10969inline void mlist_t::print(qstring *vout) const
10970{
10971 HEXDSP(hx_mlist_t_print, this, vout);
10972}
10973
10974//--------------------------------------------------------------------------
10975inline const char *mlist_t::dstr() const
10976{
10977 return (const char *)HEXDSP(hx_mlist_t_dstr, this);
10978}
10979
10980//--------------------------------------------------------------------------
10981inline int mlist_t::compare(const mlist_t &r) const
10982{
10983 return (int)(size_t)HEXDSP(hx_mlist_t_compare, this, &r);
10984}
10985
10986//--------------------------------------------------------------------------
10987inline const mlist_t &get_temp_regs()
10988{
10989 return *(const mlist_t *)HEXDSP(hx_get_temp_regs);
10990}
10991
10992//--------------------------------------------------------------------------
10993inline bool is_kreg(mreg_t r)
10994{
10995 return (uchar)(size_t)HEXDSP(hx_is_kreg, r) != 0;
10996}
10997
10998//--------------------------------------------------------------------------
10999inline mreg_t reg2mreg(int reg)
11000{
11001 return (mreg_t)(size_t)HEXDSP(hx_reg2mreg, reg);
11002}
11003
11004//--------------------------------------------------------------------------
11005inline int mreg2reg(mreg_t reg, int width)
11006{
11007 return (int)(size_t)HEXDSP(hx_mreg2reg, reg, width);
11008}
11009
11010//--------------------------------------------------------------------------
11011inline int get_mreg_name(qstring *out, mreg_t reg, int width, void *ud)
11012{
11013 return (int)(size_t)HEXDSP(hx_get_mreg_name, out, reg, width, ud);
11014}
11015
11016//--------------------------------------------------------------------------
11018{
11019 HEXDSP(hx_install_optinsn_handler, opt);
11020}
11021
11022//--------------------------------------------------------------------------
11024{
11025 auto hrdsp = HEXDSP;
11026 return hrdsp != nullptr && (uchar)(size_t)hrdsp(hx_remove_optinsn_handler, opt) != 0;
11027}
11028
11029//--------------------------------------------------------------------------
11031{
11032 HEXDSP(hx_install_optblock_handler, opt);
11033}
11034
11035//--------------------------------------------------------------------------
11037{
11038 auto hrdsp = HEXDSP;
11039 return hrdsp != nullptr && (uchar)(size_t)hrdsp(hx_remove_optblock_handler, opt) != 0;
11040}
11041
11042//--------------------------------------------------------------------------
11044{
11045 HEXDSP(hx_simple_graph_t_compute_dominators, this, &domin, post);
11046}
11047
11048//--------------------------------------------------------------------------
11049inline void simple_graph_t::compute_immediate_dominators(const array_of_node_bitset_t &domin, intvec_t &idomin, bool post) const
11050{
11051 HEXDSP(hx_simple_graph_t_compute_immediate_dominators, this, &domin, &idomin, post);
11052}
11053
11054//--------------------------------------------------------------------------
11056{
11057 return (int)(size_t)HEXDSP(hx_simple_graph_t_depth_first_preorder, this, pre);
11058}
11059
11060//--------------------------------------------------------------------------
11062{
11063 return (int)(size_t)HEXDSP(hx_simple_graph_t_depth_first_postorder, this, post);
11064}
11065
11066//--------------------------------------------------------------------------
11067inline int simple_graph_t::goup(int node) const
11068{
11069 return (int)(size_t)HEXDSP(hx_simple_graph_t_goup, this, node);
11070}
11071
11072//--------------------------------------------------------------------------
11073inline int lvar_ref_t::compare(const lvar_ref_t &r) const
11074{
11075 return (int)(size_t)HEXDSP(hx_lvar_ref_t_compare, this, &r);
11076}
11077
11078//--------------------------------------------------------------------------
11080{
11081 return *(lvar_t *)HEXDSP(hx_lvar_ref_t_var, this);
11082}
11083
11084//--------------------------------------------------------------------------
11085inline int stkvar_ref_t::compare(const stkvar_ref_t &r) const
11086{
11087 return (int)(size_t)HEXDSP(hx_stkvar_ref_t_compare, this, &r);
11088}
11089
11090//--------------------------------------------------------------------------
11091inline ssize_t stkvar_ref_t::get_stkvar(udm_t *udm, uval_t *p_idaoff) const
11092{
11093 return (ssize_t)HEXDSP(hx_stkvar_ref_t_get_stkvar, this, udm, p_idaoff);
11094}
11095
11096//--------------------------------------------------------------------------
11097inline void fnumber_t::print(qstring *vout) const
11098{
11099 HEXDSP(hx_fnumber_t_print, this, vout);
11100}
11101
11102//--------------------------------------------------------------------------
11103inline const char *fnumber_t::dstr() const
11104{
11105 return (const char *)HEXDSP(hx_fnumber_t_dstr, this);
11106}
11107
11108//--------------------------------------------------------------------------
11109inline void mop_t::copy(const mop_t &rop)
11110{
11111 HEXDSP(hx_mop_t_copy, this, &rop);
11112}
11113
11114//--------------------------------------------------------------------------
11115inline mop_t &mop_t::assign(const mop_t &rop)
11116{
11117 return *(mop_t *)HEXDSP(hx_mop_t_assign, this, &rop);
11118}
11119
11120//--------------------------------------------------------------------------
11121inline void mop_t::swap(mop_t &rop)
11122{
11123 HEXDSP(hx_mop_t_swap, this, &rop);
11124}
11125
11126//--------------------------------------------------------------------------
11127inline void mop_t::erase()
11128{
11129 HEXDSP(hx_mop_t_erase, this);
11130}
11131
11132//--------------------------------------------------------------------------
11133inline void mop_t::print(qstring *vout, int shins_flags) const
11134{
11135 HEXDSP(hx_mop_t_print, this, vout, shins_flags);
11136}
11137
11138//--------------------------------------------------------------------------
11139inline const char *mop_t::dstr() const
11140{
11141 return (const char *)HEXDSP(hx_mop_t_dstr, this);
11142}
11143
11144//--------------------------------------------------------------------------
11145inline bool mop_t::create_from_mlist(mba_t *mba, const mlist_t &lst, sval_t fullsize)
11146{
11147 return (uchar)(size_t)HEXDSP(hx_mop_t_create_from_mlist, this, mba, &lst, fullsize) != 0;
11148}
11149
11150//--------------------------------------------------------------------------
11151inline bool mop_t::create_from_ivlset(mba_t *mba, const ivlset_t &ivs, sval_t fullsize)
11152{
11153 return (uchar)(size_t)HEXDSP(hx_mop_t_create_from_ivlset, this, mba, &ivs, fullsize) != 0;
11154}
11155
11156//--------------------------------------------------------------------------
11157inline void mop_t::create_from_vdloc(mba_t *mba, const vdloc_t &loc, int _size)
11158{
11159 HEXDSP(hx_mop_t_create_from_vdloc, this, mba, &loc, _size);
11160}
11161
11162//--------------------------------------------------------------------------
11163inline void mop_t::create_from_scattered_vdloc(mba_t *mba, const char *name, tinfo_t type, const vdloc_t &loc)
11164{
11165 HEXDSP(hx_mop_t_create_from_scattered_vdloc, this, mba, name, &type, &loc);
11166}
11167
11168//--------------------------------------------------------------------------
11170{
11171 HEXDSP(hx_mop_t_create_from_insn, this, m);
11172}
11173
11174//--------------------------------------------------------------------------
11175inline void mop_t::make_number(uint64 _value, int _size, ea_t _ea, int opnum)
11176{
11177 HEXDSP(hx_mop_t_make_number, this, _value, _size, _ea, opnum);
11178}
11179
11180//--------------------------------------------------------------------------
11181inline bool mop_t::make_fpnum(const void *bytes, size_t _size)
11182{
11183 return (uchar)(size_t)HEXDSP(hx_mop_t_make_fpnum, this, bytes, _size) != 0;
11184}
11185
11186//--------------------------------------------------------------------------
11188{
11189 HEXDSP(hx_mop_t__make_gvar, this, ea);
11190}
11191
11192//--------------------------------------------------------------------------
11193inline void mop_t::make_gvar(ea_t ea)
11194{
11195 HEXDSP(hx_mop_t_make_gvar, this, ea);
11196}
11197
11198//--------------------------------------------------------------------------
11199inline void mop_t::make_reg_pair(int loreg, int hireg, int halfsize)
11200{
11201 HEXDSP(hx_mop_t_make_reg_pair, this, loreg, hireg, halfsize);
11202}
11203
11204//--------------------------------------------------------------------------
11205inline void mop_t::make_helper(const char *name)
11206{
11207 HEXDSP(hx_mop_t_make_helper, this, name);
11208}
11209
11210//--------------------------------------------------------------------------
11212{
11213 return (uchar)(size_t)HEXDSP(hx_mop_t_is_bit_reg, reg) != 0;
11214}
11215
11216//--------------------------------------------------------------------------
11218{
11219 return (uchar)(size_t)HEXDSP(hx_mop_t_may_use_aliased_memory, this) != 0;
11220}
11221
11222//--------------------------------------------------------------------------
11223inline bool mop_t::is01() const
11224{
11225 return (uchar)(size_t)HEXDSP(hx_mop_t_is01, this) != 0;
11226}
11227
11228//--------------------------------------------------------------------------
11230{
11231 return (uchar)(size_t)HEXDSP(hx_mop_t_is_sign_extended_from, this, nbytes) != 0;
11232}
11233
11234//--------------------------------------------------------------------------
11236{
11237 return (uchar)(size_t)HEXDSP(hx_mop_t_is_zero_extended_from, this, nbytes) != 0;
11238}
11239
11240//--------------------------------------------------------------------------
11241inline bool mop_t::equal_mops(const mop_t &rop, int eqflags) const
11242{
11243 return (uchar)(size_t)HEXDSP(hx_mop_t_equal_mops, this, &rop, eqflags) != 0;
11244}
11245
11246//--------------------------------------------------------------------------
11247inline int mop_t::lexcompare(const mop_t &rop) const
11248{
11249 return (int)(size_t)HEXDSP(hx_mop_t_lexcompare, this, &rop);
11250}
11251
11252//--------------------------------------------------------------------------
11253inline int mop_t::for_all_ops(mop_visitor_t &mv, const tinfo_t *type, bool is_target)
11254{
11255 return (int)(size_t)HEXDSP(hx_mop_t_for_all_ops, this, &mv, type, is_target);
11256}
11257
11258//--------------------------------------------------------------------------
11260{
11261 return (int)(size_t)HEXDSP(hx_mop_t_for_all_scattered_submops, this, &sv);
11262}
11263
11264//--------------------------------------------------------------------------
11265inline bool mop_t::is_constant(uint64 *out, bool is_signed) const
11266{
11267 return (uchar)(size_t)HEXDSP(hx_mop_t_is_constant, this, out, is_signed) != 0;
11268}
11269
11270//--------------------------------------------------------------------------
11271inline bool mop_t::get_stkoff(sval_t *p_vdoff) const
11272{
11273 return (uchar)(size_t)HEXDSP(hx_mop_t_get_stkoff, this, p_vdoff) != 0;
11274}
11275
11276//--------------------------------------------------------------------------
11277inline bool mop_t::make_low_half(int width)
11278{
11279 return (uchar)(size_t)HEXDSP(hx_mop_t_make_low_half, this, width) != 0;
11280}
11281
11282//--------------------------------------------------------------------------
11283inline bool mop_t::make_high_half(int width)
11284{
11285 return (uchar)(size_t)HEXDSP(hx_mop_t_make_high_half, this, width) != 0;
11286}
11287
11288//--------------------------------------------------------------------------
11289inline bool mop_t::make_first_half(int width)
11290{
11291 return (uchar)(size_t)HEXDSP(hx_mop_t_make_first_half, this, width) != 0;
11292}
11293
11294//--------------------------------------------------------------------------
11295inline bool mop_t::make_second_half(int width)
11296{
11297 return (uchar)(size_t)HEXDSP(hx_mop_t_make_second_half, this, width) != 0;
11298}
11299
11300//--------------------------------------------------------------------------
11301inline bool mop_t::shift_mop(int offset)
11302{
11303 return (uchar)(size_t)HEXDSP(hx_mop_t_shift_mop, this, offset) != 0;
11304}
11305
11306//--------------------------------------------------------------------------
11307inline bool mop_t::change_size(int nsize, side_effect_t sideff)
11308{
11309 return (uchar)(size_t)HEXDSP(hx_mop_t_change_size, this, nsize, sideff) != 0;
11310}
11311
11312//--------------------------------------------------------------------------
11313inline bool mop_t::preserve_side_effects(mblock_t *blk, minsn_t *top, bool *moved_calls)
11314{
11315 return (uchar)(size_t)HEXDSP(hx_mop_t_preserve_side_effects, this, blk, top, moved_calls) != 0;
11316}
11317
11318//--------------------------------------------------------------------------
11319inline void mop_t::apply_ld_mcode(mcode_t mcode, ea_t ea, int newsize)
11320{
11321 HEXDSP(hx_mop_t_apply_ld_mcode, this, mcode, ea, newsize);
11322}
11323
11324//--------------------------------------------------------------------------
11325inline void mcallarg_t::print(qstring *vout, int shins_flags) const
11326{
11327 HEXDSP(hx_mcallarg_t_print, this, vout, shins_flags);
11328}
11329
11330//--------------------------------------------------------------------------
11331inline const char *mcallarg_t::dstr() const
11332{
11333 return (const char *)HEXDSP(hx_mcallarg_t_dstr, this);
11334}
11335
11336//--------------------------------------------------------------------------
11337inline void mcallarg_t::set_regarg(mreg_t mr, int sz, const tinfo_t &tif)
11338{
11339 HEXDSP(hx_mcallarg_t_set_regarg, this, mr, sz, &tif);
11340}
11341
11342//--------------------------------------------------------------------------
11343inline int mcallinfo_t::lexcompare(const mcallinfo_t &f) const
11344{
11345 return (int)(size_t)HEXDSP(hx_mcallinfo_t_lexcompare, this, &f);
11346}
11347
11348//--------------------------------------------------------------------------
11350{
11351 return (uchar)(size_t)HEXDSP(hx_mcallinfo_t_set_type, this, &type) != 0;
11352}
11353
11354//--------------------------------------------------------------------------
11356{
11357 tinfo_t retval;
11358 HEXDSP(hx_mcallinfo_t_get_type, &retval, this);
11359 return retval;
11360}
11361
11362//--------------------------------------------------------------------------
11363inline void mcallinfo_t::print(qstring *vout, int size, int shins_flags) const
11364{
11365 HEXDSP(hx_mcallinfo_t_print, this, vout, size, shins_flags);
11366}
11367
11368//--------------------------------------------------------------------------
11369inline const char *mcallinfo_t::dstr() const
11370{
11371 return (const char *)HEXDSP(hx_mcallinfo_t_dstr, this);
11372}
11373
11374//--------------------------------------------------------------------------
11375inline int mcases_t::compare(const mcases_t &r) const
11376{
11377 return (int)(size_t)HEXDSP(hx_mcases_t_compare, this, &r);
11378}
11379
11380//--------------------------------------------------------------------------
11381inline void mcases_t::print(qstring *vout) const
11382{
11383 HEXDSP(hx_mcases_t_print, this, vout);
11384}
11385
11386//--------------------------------------------------------------------------
11387inline const char *mcases_t::dstr() const
11388{
11389 return (const char *)HEXDSP(hx_mcases_t_dstr, this);
11390}
11391
11392//--------------------------------------------------------------------------
11393inline bool vivl_t::extend_to_cover(const vivl_t &r)
11394{
11395 return (uchar)(size_t)HEXDSP(hx_vivl_t_extend_to_cover, this, &r) != 0;
11396}
11397
11398//--------------------------------------------------------------------------
11400{
11401 uval_t retval;
11402 HEXDSP(hx_vivl_t_intersect, &retval, this, &r);
11403 return retval;
11404}
11405
11406//--------------------------------------------------------------------------
11407inline void vivl_t::print(qstring *vout) const
11408{
11409 HEXDSP(hx_vivl_t_print, this, vout);
11410}
11411
11412//--------------------------------------------------------------------------
11413inline const char *vivl_t::dstr() const
11414{
11415 return (const char *)HEXDSP(hx_vivl_t_dstr, this);
11416}
11417
11418//--------------------------------------------------------------------------
11419inline void chain_t::print(qstring *vout) const
11420{
11421 HEXDSP(hx_chain_t_print, this, vout);
11422}
11423
11424//--------------------------------------------------------------------------
11425inline const char *chain_t::dstr() const
11426{
11427 return (const char *)HEXDSP(hx_chain_t_dstr, this);
11428}
11429
11430//--------------------------------------------------------------------------
11431inline void chain_t::append_list(const mba_t *mba, mlist_t *list) const
11432{
11433 HEXDSP(hx_chain_t_append_list, this, mba, list);
11434}
11435
11436//--------------------------------------------------------------------------
11437inline const chain_t *block_chains_t::get_chain(const chain_t &ch) const
11438{
11439 return (const chain_t *)HEXDSP(hx_block_chains_t_get_chain, this, &ch);
11440}
11441
11442//--------------------------------------------------------------------------
11443inline void block_chains_t::print(qstring *vout) const
11444{
11445 HEXDSP(hx_block_chains_t_print, this, vout);
11446}
11447
11448//--------------------------------------------------------------------------
11449inline const char *block_chains_t::dstr() const
11450{
11451 return (const char *)HEXDSP(hx_block_chains_t_dstr, this);
11452}
11453
11454//--------------------------------------------------------------------------
11456{
11457 return (int)(size_t)HEXDSP(hx_graph_chains_t_for_all_chains, this, &cv, gca_flags);
11458}
11459
11460//--------------------------------------------------------------------------
11462{
11463 HEXDSP(hx_graph_chains_t_release, this);
11464}
11465
11466//--------------------------------------------------------------------------
11467inline void minsn_t::init(ea_t _ea)
11468{
11469 HEXDSP(hx_minsn_t_init, this, _ea);
11470}
11471
11472//--------------------------------------------------------------------------
11473inline void minsn_t::copy(const minsn_t &m)
11474{
11475 HEXDSP(hx_minsn_t_copy, this, &m);
11476}
11477
11478//--------------------------------------------------------------------------
11480{
11481 HEXDSP(hx_minsn_t_set_combined, this);
11482}
11483
11484//--------------------------------------------------------------------------
11485inline void minsn_t::swap(minsn_t &m)
11486{
11487 HEXDSP(hx_minsn_t_swap, this, &m);
11488}
11489
11490//--------------------------------------------------------------------------
11491inline void minsn_t::print(qstring *vout, int shins_flags) const
11492{
11493 HEXDSP(hx_minsn_t_print, this, vout, shins_flags);
11494}
11495
11496//--------------------------------------------------------------------------
11497inline const char *minsn_t::dstr() const
11498{
11499 return (const char *)HEXDSP(hx_minsn_t_dstr, this);
11500}
11501
11502//--------------------------------------------------------------------------
11503inline void minsn_t::setaddr(ea_t new_ea)
11504{
11505 HEXDSP(hx_minsn_t_setaddr, this, new_ea);
11506}
11507
11508//--------------------------------------------------------------------------
11509inline int minsn_t::optimize_subtree(mblock_t *blk, minsn_t *top, minsn_t *parent, ea_t *converted_call, int optflags)
11510{
11511 return (int)(size_t)HEXDSP(hx_minsn_t_optimize_subtree, this, blk, top, parent, converted_call, optflags);
11512}
11513
11514//--------------------------------------------------------------------------
11516{
11517 return (int)(size_t)HEXDSP(hx_minsn_t_for_all_ops, this, &mv);
11518}
11519
11520//--------------------------------------------------------------------------
11522{
11523 return (int)(size_t)HEXDSP(hx_minsn_t_for_all_insns, this, &mv);
11524}
11525
11526//--------------------------------------------------------------------------
11528{
11529 HEXDSP(hx_minsn_t__make_nop, this);
11530}
11531
11532//--------------------------------------------------------------------------
11533inline bool minsn_t::equal_insns(const minsn_t &m, int eqflags) const
11534{
11535 return (uchar)(size_t)HEXDSP(hx_minsn_t_equal_insns, this, &m, eqflags) != 0;
11536}
11537
11538//--------------------------------------------------------------------------
11539inline int minsn_t::lexcompare(const minsn_t &ri) const
11540{
11541 return (int)(size_t)HEXDSP(hx_minsn_t_lexcompare, this, &ri);
11542}
11543
11544//--------------------------------------------------------------------------
11545inline bool minsn_t::is_noret_call(int flags)
11546{
11547 return (uchar)(size_t)HEXDSP(hx_minsn_t_is_noret_call, this, flags) != 0;
11548}
11549
11550//--------------------------------------------------------------------------
11551inline bool minsn_t::is_helper(const char *name) const
11552{
11553 return (uchar)(size_t)HEXDSP(hx_minsn_t_is_helper, this, name) != 0;
11554}
11555
11556//--------------------------------------------------------------------------
11557inline minsn_t *minsn_t::find_call(bool with_helpers) const
11558{
11559 return (minsn_t *)HEXDSP(hx_minsn_t_find_call, this, with_helpers);
11560}
11561
11562//--------------------------------------------------------------------------
11563inline bool minsn_t::has_side_effects(bool include_ldx_and_divs) const
11564{
11565 return (uchar)(size_t)HEXDSP(hx_minsn_t_has_side_effects, this, include_ldx_and_divs) != 0;
11566}
11567
11568//--------------------------------------------------------------------------
11570{
11571 return (minsn_t *)HEXDSP(hx_minsn_t_find_opcode, this, mcode);
11572}
11573
11574//--------------------------------------------------------------------------
11575inline const minsn_t *minsn_t::find_ins_op(const mop_t **other, mcode_t op) const
11576{
11577 return (const minsn_t *)HEXDSP(hx_minsn_t_find_ins_op, this, other, op);
11578}
11579
11580//--------------------------------------------------------------------------
11581inline const mop_t *minsn_t::find_num_op(const mop_t **other) const
11582{
11583 return (const mop_t *)HEXDSP(hx_minsn_t_find_num_op, this, other);
11584}
11585
11586//--------------------------------------------------------------------------
11587inline bool minsn_t::modifies_d() const
11588{
11589 return (uchar)(size_t)HEXDSP(hx_minsn_t_modifies_d, this) != 0;
11590}
11591
11592//--------------------------------------------------------------------------
11593inline bool minsn_t::is_between(const minsn_t *m1, const minsn_t *m2) const
11594{
11595 return (uchar)(size_t)HEXDSP(hx_minsn_t_is_between, this, m1, m2) != 0;
11596}
11597
11598//--------------------------------------------------------------------------
11600{
11601 return (uchar)(size_t)HEXDSP(hx_minsn_t_may_use_aliased_memory, this) != 0;
11602}
11603
11604//--------------------------------------------------------------------------
11605inline int minsn_t::serialize(bytevec_t *b) const
11606{
11607 return (int)(size_t)HEXDSP(hx_minsn_t_serialize, this, b);
11608}
11609
11610//--------------------------------------------------------------------------
11611inline bool minsn_t::deserialize(const uchar *bytes, size_t nbytes, int format_version)
11612{
11613 return (uchar)(size_t)HEXDSP(hx_minsn_t_deserialize, this, bytes, nbytes, format_version) != 0;
11614}
11615
11616//--------------------------------------------------------------------------
11617inline const minsn_t *getf_reginsn(const minsn_t *ins)
11618{
11619 return (const minsn_t *)HEXDSP(hx_getf_reginsn, ins);
11620}
11621
11622//--------------------------------------------------------------------------
11623inline const minsn_t *getb_reginsn(const minsn_t *ins)
11624{
11625 return (const minsn_t *)HEXDSP(hx_getb_reginsn, ins);
11626}
11627
11628//--------------------------------------------------------------------------
11630{
11631 intval64_t retval;
11632 HEXDSP(hx_int64_emulator_t_mop_value, &retval, this, &mop);
11633 return retval;
11634}
11635
11636//--------------------------------------------------------------------------
11638{
11639 intval64_t retval;
11640 HEXDSP(hx_int64_emulator_t_minsn_value, &retval, this, &insn);
11641 return retval;
11642}
11643
11644//--------------------------------------------------------------------------
11645inline void mblock_t::init()
11646{
11647 HEXDSP(hx_mblock_t_init, this);
11648}
11649
11650//--------------------------------------------------------------------------
11651inline void mblock_t::print(vd_printer_t &vp) const
11652{
11653 HEXDSP(hx_mblock_t_print, this, &vp);
11654}
11655
11656//--------------------------------------------------------------------------
11657inline void mblock_t::dump() const
11658{
11659 HEXDSP(hx_mblock_t_dump, this);
11660}
11661
11662//--------------------------------------------------------------------------
11663inline AS_PRINTF(2, 0) void mblock_t::vdump_block(const char *title, va_list va) const
11664{
11665 HEXDSP(hx_mblock_t_vdump_block, this, title, va);
11666}
11667
11668//--------------------------------------------------------------------------
11670{
11671 return (minsn_t *)HEXDSP(hx_mblock_t_insert_into_block, this, nm, om);
11672}
11673
11674//--------------------------------------------------------------------------
11676{
11677 return (minsn_t *)HEXDSP(hx_mblock_t_remove_from_block, this, m);
11678}
11679
11680//--------------------------------------------------------------------------
11682{
11683 return (int)(size_t)HEXDSP(hx_mblock_t_for_all_insns, this, &mv);
11684}
11685
11686//--------------------------------------------------------------------------
11688{
11689 return (int)(size_t)HEXDSP(hx_mblock_t_for_all_ops, this, &mv);
11690}
11691
11692//--------------------------------------------------------------------------
11694{
11695 return (int)(size_t)HEXDSP(hx_mblock_t_for_all_uses, this, list, i1, i2, &mmv);
11696}
11697
11698//--------------------------------------------------------------------------
11699inline int mblock_t::optimize_insn(minsn_t *m, int optflags)
11700{
11701 return (int)(size_t)HEXDSP(hx_mblock_t_optimize_insn, this, m, optflags);
11702}
11703
11704//--------------------------------------------------------------------------
11706{
11707 return (int)(size_t)HEXDSP(hx_mblock_t_optimize_block, this);
11708}
11709
11710//--------------------------------------------------------------------------
11711inline int mblock_t::build_lists(bool kill_deads)
11712{
11713 return (int)(size_t)HEXDSP(hx_mblock_t_build_lists, this, kill_deads);
11714}
11715
11716//--------------------------------------------------------------------------
11718{
11719 return (int)(size_t)HEXDSP(hx_mblock_t_optimize_useless_jump, this);
11720}
11721
11722//--------------------------------------------------------------------------
11723inline void mblock_t::append_use_list(mlist_t *list, const mop_t &op, maymust_t maymust, bitrange_t mask) const
11724{
11725 HEXDSP(hx_mblock_t_append_use_list, this, list, &op, maymust, &mask);
11726}
11727
11728//--------------------------------------------------------------------------
11729inline void mblock_t::append_def_list(mlist_t *list, const mop_t &op, maymust_t maymust) const
11730{
11731 HEXDSP(hx_mblock_t_append_def_list, this, list, &op, maymust);
11732}
11733
11734//--------------------------------------------------------------------------
11735inline mlist_t mblock_t::build_use_list(const minsn_t &ins, maymust_t maymust) const
11736{
11737 mlist_t retval;
11738 HEXDSP(hx_mblock_t_build_use_list, &retval, this, &ins, maymust);
11739 return retval;
11740}
11741
11742//--------------------------------------------------------------------------
11743inline mlist_t mblock_t::build_def_list(const minsn_t &ins, maymust_t maymust) const
11744{
11745 mlist_t retval;
11746 HEXDSP(hx_mblock_t_build_def_list, &retval, this, &ins, maymust);
11747 return retval;
11748}
11749
11750//--------------------------------------------------------------------------
11751inline const minsn_t *mblock_t::find_first_use(mlist_t *list, const minsn_t *i1, const minsn_t *i2, maymust_t maymust) const
11752{
11753 return (const minsn_t *)HEXDSP(hx_mblock_t_find_first_use, this, list, i1, i2, maymust);
11754}
11755
11756//--------------------------------------------------------------------------
11757inline const minsn_t *mblock_t::find_redefinition(const mlist_t &list, const minsn_t *i1, const minsn_t *i2, maymust_t maymust) const
11758{
11759 return (const minsn_t *)HEXDSP(hx_mblock_t_find_redefinition, this, &list, i1, i2, maymust);
11760}
11761
11762//--------------------------------------------------------------------------
11763inline bool mblock_t::is_rhs_redefined(const minsn_t *ins, const minsn_t *i1, const minsn_t *i2) const
11764{
11765 return (uchar)(size_t)HEXDSP(hx_mblock_t_is_rhs_redefined, this, ins, i1, i2) != 0;
11766}
11767
11768//--------------------------------------------------------------------------
11769inline minsn_t *mblock_t::find_access(const mop_t &op, minsn_t **parent, const minsn_t *mend, int fdflags) const
11770{
11771 return (minsn_t *)HEXDSP(hx_mblock_t_find_access, this, &op, parent, mend, fdflags);
11772}
11773
11774//--------------------------------------------------------------------------
11775inline bool mblock_t::get_valranges(valrng_t *res, const vivl_t &vivl, int vrflags) const
11776{
11777 return (uchar)(size_t)HEXDSP(hx_mblock_t_get_valranges, this, res, &vivl, vrflags) != 0;
11778}
11779
11780//--------------------------------------------------------------------------
11781inline bool mblock_t::get_valranges(valrng_t *res, const vivl_t &vivl, const minsn_t *m, int vrflags) const
11782{
11783 return (uchar)(size_t)HEXDSP(hx_mblock_t_get_valranges_, this, res, &vivl, m, vrflags) != 0;
11784}
11785
11786//--------------------------------------------------------------------------
11787inline size_t mblock_t::get_reginsn_qty() const
11788{
11789 return (size_t)HEXDSP(hx_mblock_t_get_reginsn_qty, this);
11790}
11791
11792//--------------------------------------------------------------------------
11794{
11795 return (uchar)(size_t)HEXDSP(hx_mba_ranges_t_range_contains, this, ea) != 0;
11796}
11797
11798//--------------------------------------------------------------------------
11800{
11801 sval_t retval;
11802 HEXDSP(hx_mba_t_stkoff_vd2ida, &retval, this, off);
11803 return retval;
11804}
11805
11806//--------------------------------------------------------------------------
11808{
11809 sval_t retval;
11810 HEXDSP(hx_mba_t_stkoff_ida2vd, &retval, this, off);
11811 return retval;
11812}
11813
11814//--------------------------------------------------------------------------
11815inline vdloc_t mba_t::idaloc2vd(const argloc_t &loc, int width, sval_t spd)
11816{
11817 vdloc_t retval;
11818 HEXDSP(hx_mba_t_idaloc2vd, &retval, &loc, width, spd);
11819 return retval;
11820}
11821
11822//--------------------------------------------------------------------------
11823inline vdloc_t mba_t::idaloc2vd(const argloc_t &loc, int width) const
11824{
11825 vdloc_t retval;
11826 HEXDSP(hx_mba_t_idaloc2vd_, &retval, this, &loc, width);
11827 return retval;
11828}
11829
11830//--------------------------------------------------------------------------
11831inline argloc_t mba_t::vd2idaloc(const vdloc_t &loc, int width, sval_t spd)
11832{
11833 argloc_t retval;
11834 HEXDSP(hx_mba_t_vd2idaloc, &retval, &loc, width, spd);
11835 return retval;
11836}
11837
11838//--------------------------------------------------------------------------
11839inline argloc_t mba_t::vd2idaloc(const vdloc_t &loc, int width) const
11840{
11841 argloc_t retval;
11842 HEXDSP(hx_mba_t_vd2idaloc_, &retval, this, &loc, width);
11843 return retval;
11844}
11845
11846//--------------------------------------------------------------------------
11847inline void mba_t::term()
11848{
11849 HEXDSP(hx_mba_t_term, this);
11850}
11851
11852//--------------------------------------------------------------------------
11854{
11855 return (func_t *)HEXDSP(hx_mba_t_get_curfunc, this);
11856}
11857
11858//--------------------------------------------------------------------------
11860{
11861 return (merror_t)(size_t)HEXDSP(hx_mba_t_set_maturity, this, mat);
11862}
11863
11864//--------------------------------------------------------------------------
11865inline int mba_t::optimize_local(int locopt_bits)
11866{
11867 return (int)(size_t)HEXDSP(hx_mba_t_optimize_local, this, locopt_bits);
11868}
11869
11870//--------------------------------------------------------------------------
11872{
11873 return (merror_t)(size_t)HEXDSP(hx_mba_t_build_graph, this);
11874}
11875
11876//--------------------------------------------------------------------------
11878{
11879 return (mbl_graph_t *)HEXDSP(hx_mba_t_get_graph, this);
11880}
11881
11882//--------------------------------------------------------------------------
11883inline int mba_t::analyze_calls(int acflags)
11884{
11885 return (int)(size_t)HEXDSP(hx_mba_t_analyze_calls, this, acflags);
11886}
11887
11888//--------------------------------------------------------------------------
11890{
11891 return (merror_t)(size_t)HEXDSP(hx_mba_t_optimize_global, this);
11892}
11893
11894//--------------------------------------------------------------------------
11896{
11897 HEXDSP(hx_mba_t_alloc_lvars, this);
11898}
11899
11900//--------------------------------------------------------------------------
11901inline void mba_t::dump() const
11902{
11903 HEXDSP(hx_mba_t_dump, this);
11904}
11905
11906//--------------------------------------------------------------------------
11907inline AS_PRINTF(3, 0) void mba_t::vdump_mba(bool _verify, const char *title, va_list va) const
11908{
11909 HEXDSP(hx_mba_t_vdump_mba, this, _verify, title, va);
11910}
11911
11912//--------------------------------------------------------------------------
11913inline void mba_t::print(vd_printer_t &vp) const
11914{
11915 HEXDSP(hx_mba_t_print, this, &vp);
11916}
11917
11918//--------------------------------------------------------------------------
11919inline void mba_t::verify(bool always) const
11920{
11921 HEXDSP(hx_mba_t_verify, this, always);
11922}
11923
11924//--------------------------------------------------------------------------
11925inline void mba_t::mark_chains_dirty()
11926{
11927 HEXDSP(hx_mba_t_mark_chains_dirty, this);
11928}
11929
11930//--------------------------------------------------------------------------
11932{
11933 return (mblock_t *)HEXDSP(hx_mba_t_insert_block, this, bblk);
11934}
11935
11936//--------------------------------------------------------------------------
11938{
11939 return (mblock_t *)HEXDSP(hx_mba_t_split_block, this, blk, start_insn);
11940}
11941
11942//--------------------------------------------------------------------------
11944{
11945 return (uchar)(size_t)HEXDSP(hx_mba_t_remove_block, this, blk) != 0;
11946}
11947
11948//--------------------------------------------------------------------------
11949inline bool mba_t::remove_blocks(int start_blk, int end_blk)
11950{
11951 return (uchar)(size_t)HEXDSP(hx_mba_t_remove_blocks, this, start_blk, end_blk) != 0;
11952}
11953
11954//--------------------------------------------------------------------------
11955inline mblock_t *mba_t::copy_block(mblock_t *blk, int new_serial, int cpblk_flags)
11956{
11957 return (mblock_t *)HEXDSP(hx_mba_t_copy_block, this, blk, new_serial, cpblk_flags);
11958}
11959
11960//--------------------------------------------------------------------------
11962{
11963 return (uchar)(size_t)HEXDSP(hx_mba_t_remove_empty_and_unreachable_blocks, this) != 0;
11964}
11965
11966//--------------------------------------------------------------------------
11968{
11969 return (uchar)(size_t)HEXDSP(hx_mba_t_merge_blocks, this) != 0;
11970}
11971
11972//--------------------------------------------------------------------------
11974{
11975 return (int)(size_t)HEXDSP(hx_mba_t_for_all_ops, this, &mv);
11976}
11977
11978//--------------------------------------------------------------------------
11980{
11981 return (int)(size_t)HEXDSP(hx_mba_t_for_all_insns, this, &mv);
11982}
11983
11984//--------------------------------------------------------------------------
11986{
11987 return (int)(size_t)HEXDSP(hx_mba_t_for_all_topinsns, this, &mv);
11988}
11989
11990//--------------------------------------------------------------------------
11991inline mop_t *mba_t::find_mop(op_parent_info_t *ctx, ea_t ea, bool is_dest, const mlist_t &list)
11992{
11993 return (mop_t *)HEXDSP(hx_mba_t_find_mop, this, ctx, ea, is_dest, &list);
11994}
11995
11996//--------------------------------------------------------------------------
11997inline minsn_t *mba_t::create_helper_call(ea_t ea, const char *helper, const tinfo_t *rettype, const mcallargs_t *callargs, const mop_t *out)
11998{
11999 return (minsn_t *)HEXDSP(hx_mba_t_create_helper_call, this, ea, helper, rettype, callargs, out);
12000}
12001
12002//--------------------------------------------------------------------------
12003inline void mba_t::get_func_output_lists(mlist_t *return_regs, mlist_t *spoiled, const tinfo_t &type, ea_t call_ea, bool tail_call)
12004{
12005 HEXDSP(hx_mba_t_get_func_output_lists, this, return_regs, spoiled, &type, call_ea, tail_call);
12006}
12007
12008//--------------------------------------------------------------------------
12009inline lvar_t &mba_t::arg(int n)
12010{
12011 return *(lvar_t *)HEXDSP(hx_mba_t_arg, this, n);
12012}
12013
12014//--------------------------------------------------------------------------
12016{
12017 ea_t retval;
12018 HEXDSP(hx_mba_t_alloc_fict_ea, &retval, this, real_ea);
12019 return retval;
12020}
12021
12022//--------------------------------------------------------------------------
12023inline ea_t mba_t::map_fict_ea(ea_t fict_ea) const
12024{
12025 ea_t retval;
12026 HEXDSP(hx_mba_t_map_fict_ea, &retval, this, fict_ea);
12027 return retval;
12028}
12029
12030//--------------------------------------------------------------------------
12031inline void mba_t::serialize(bytevec_t &vout) const
12032{
12033 HEXDSP(hx_mba_t_serialize, this, &vout);
12034}
12035
12036//--------------------------------------------------------------------------
12037inline WARN_UNUSED_RESULT mba_t *mba_t::deserialize(const uchar *bytes, size_t nbytes)
12038{
12039 return (mba_t *)HEXDSP(hx_mba_t_deserialize, bytes, nbytes);
12040}
12041
12042//--------------------------------------------------------------------------
12043inline void mba_t::save_snapshot(const char *description)
12044{
12045 HEXDSP(hx_mba_t_save_snapshot, this, description);
12046}
12047
12048//--------------------------------------------------------------------------
12049inline mreg_t mba_t::alloc_kreg(size_t size, bool check_size)
12050{
12051 return (mreg_t)(size_t)HEXDSP(hx_mba_t_alloc_kreg, this, size, check_size);
12052}
12053
12054//--------------------------------------------------------------------------
12055inline void mba_t::free_kreg(mreg_t reg, size_t size)
12056{
12057 HEXDSP(hx_mba_t_free_kreg, this, reg, size);
12058}
12059
12060//--------------------------------------------------------------------------
12061inline merror_t mba_t::inline_func(codegen_t &cdg, int blknum, mba_ranges_t &ranges, int decomp_flags, int inline_flags)
12062{
12063 return (merror_t)(size_t)HEXDSP(hx_mba_t_inline_func, this, &cdg, blknum, &ranges, decomp_flags, inline_flags);
12064}
12065
12066//--------------------------------------------------------------------------
12067inline const stkpnt_t *mba_t::locate_stkpnt(ea_t ea) const
12068{
12069 return (const stkpnt_t *)HEXDSP(hx_mba_t_locate_stkpnt, this, ea);
12070}
12071
12072//--------------------------------------------------------------------------
12073inline bool mba_t::set_lvar_name(lvar_t &v, const char *name, int flagbits)
12074{
12075 return (uchar)(size_t)HEXDSP(hx_mba_t_set_lvar_name, this, &v, name, flagbits) != 0;
12076}
12077
12078//--------------------------------------------------------------------------
12079inline bool mbl_graph_t::is_accessed_globally(const mlist_t &list, int b1, int b2, const minsn_t *m1, const minsn_t *m2, access_type_t access_type, maymust_t maymust) const
12080{
12081 return (uchar)(size_t)HEXDSP(hx_mbl_graph_t_is_accessed_globally, this, &list, b1, b2, m1, m2, access_type, maymust) != 0;
12082}
12083
12084//--------------------------------------------------------------------------
12086{
12087 return (graph_chains_t *)HEXDSP(hx_mbl_graph_t_get_ud, this, gctype);
12088}
12089
12090//--------------------------------------------------------------------------
12092{
12093 return (graph_chains_t *)HEXDSP(hx_mbl_graph_t_get_du, this, gctype);
12094}
12095
12096//--------------------------------------------------------------------------
12098{
12099 return (merror_t)(size_t)HEXDSP(hx_cdg_insn_iterator_t_next, this, ins);
12100}
12101
12102//--------------------------------------------------------------------------
12103inline void codegen_t::clear()
12104{
12105 HEXDSP(hx_codegen_t_clear, this);
12106}
12107
12108//--------------------------------------------------------------------------
12109inline minsn_t *codegen_t::emit(mcode_t code, int width, uval_t l, uval_t r, uval_t d, int offsize)
12110{
12111 return (minsn_t *)HEXDSP(hx_codegen_t_emit, this, code, width, l, r, d, offsize);
12112}
12113
12114//--------------------------------------------------------------------------
12115inline minsn_t *codegen_t::emit(mcode_t code, const mop_t *l, const mop_t *r, const mop_t *d)
12116{
12117 return (minsn_t *)HEXDSP(hx_codegen_t_emit_, this, code, l, r, d);
12118}
12119
12120//--------------------------------------------------------------------------
12121inline bool change_hexrays_config(const char *directive)
12122{
12123 return (uchar)(size_t)HEXDSP(hx_change_hexrays_config, directive) != 0;
12124}
12125
12126//--------------------------------------------------------------------------
12127inline const char *get_hexrays_version()
12128{
12129 return (const char *)HEXDSP(hx_get_hexrays_version);
12130}
12131
12132//--------------------------------------------------------------------------
12133inline vdui_t *open_pseudocode(ea_t ea, int flags)
12134{
12135 return (vdui_t *)HEXDSP(hx_open_pseudocode, ea, flags);
12136}
12137
12138//--------------------------------------------------------------------------
12140{
12141 return (uchar)(size_t)HEXDSP(hx_close_pseudocode, f) != 0;
12142}
12143
12144//--------------------------------------------------------------------------
12146{
12147 return (vdui_t *)HEXDSP(hx_get_widget_vdui, f);
12148}
12149
12150//--------------------------------------------------------------------------
12151inline bool decompile_many(const char *outfile, const eavec_t *funcaddrs, int flags)
12152{
12153 return (uchar)(size_t)HEXDSP(hx_decompile_many, outfile, funcaddrs, flags) != 0;
12154}
12155
12156//--------------------------------------------------------------------------
12158{
12159 qstring retval;
12160 HEXDSP(hx_hexrays_failure_t_desc, &retval, this);
12161 return retval;
12162}
12163
12164//--------------------------------------------------------------------------
12165inline void send_database(const hexrays_failure_t &err, bool silent)
12166{
12167 HEXDSP(hx_send_database, &err, silent);
12168}
12169
12170//--------------------------------------------------------------------------
12171inline bool gco_info_t::append_to_list(mlist_t *list, const mba_t *mba) const
12172{
12173 return (uchar)(size_t)HEXDSP(hx_gco_info_t_append_to_list, this, list, mba) != 0;
12174}
12175
12176//--------------------------------------------------------------------------
12178{
12179 return (uchar)(size_t)HEXDSP(hx_get_current_operand, out) != 0;
12180}
12181
12182//--------------------------------------------------------------------------
12183inline void remitem(const citem_t *e)
12184{
12185 HEXDSP(hx_remitem, e);
12186}
12187
12188//--------------------------------------------------------------------------
12190{
12191 return (ctype_t)(size_t)HEXDSP(hx_negated_relation, op);
12192}
12193
12194//--------------------------------------------------------------------------
12196{
12197 return (ctype_t)(size_t)HEXDSP(hx_swapped_relation, op);
12198}
12199
12200//--------------------------------------------------------------------------
12202{
12203 return (type_sign_t)(size_t)HEXDSP(hx_get_op_signness, op);
12204}
12205
12206//--------------------------------------------------------------------------
12208{
12209 return (ctype_t)(size_t)HEXDSP(hx_asgop, cop);
12210}
12211
12212//--------------------------------------------------------------------------
12214{
12215 return (ctype_t)(size_t)HEXDSP(hx_asgop_revert, cop);
12216}
12217
12218//--------------------------------------------------------------------------
12219inline void cnumber_t::print(qstring *vout, const tinfo_t &type, const citem_t *parent, bool *nice_stroff) const
12220{
12221 HEXDSP(hx_cnumber_t_print, this, vout, &type, parent, nice_stroff);
12222}
12223
12224//--------------------------------------------------------------------------
12226{
12227 uint64 retval;
12228 HEXDSP(hx_cnumber_t_value, &retval, this, &type);
12229 return retval;
12230}
12231
12232//--------------------------------------------------------------------------
12234{
12235 HEXDSP(hx_cnumber_t_assign, this, v, nbytes, sign);
12236}
12237
12238//--------------------------------------------------------------------------
12239inline int cnumber_t::compare(const cnumber_t &r) const
12240{
12241 return (int)(size_t)HEXDSP(hx_cnumber_t_compare, this, &r);
12242}
12243
12244//--------------------------------------------------------------------------
12245inline int var_ref_t::compare(const var_ref_t &r) const
12246{
12247 return (int)(size_t)HEXDSP(hx_var_ref_t_compare, this, &r);
12248}
12249
12250//--------------------------------------------------------------------------
12251inline int citem_locator_t::compare(const citem_locator_t &r) const
12252{
12253 return (int)(size_t)HEXDSP(hx_citem_locator_t_compare, this, &r);
12254}
12255
12256//--------------------------------------------------------------------------
12257inline bool citem_t::contains_expr(const cexpr_t *e) const
12258{
12259 return (uchar)(size_t)HEXDSP(hx_citem_t_contains_expr, this, e) != 0;
12260}
12261
12262//--------------------------------------------------------------------------
12263inline bool citem_t::contains_label() const
12264{
12265 return (uchar)(size_t)HEXDSP(hx_citem_t_contains_label, this) != 0;
12266}
12267
12268//--------------------------------------------------------------------------
12269inline const citem_t *citem_t::find_parent_of(const citem_t *item) const
12270{
12271 return (const citem_t *)HEXDSP(hx_citem_t_find_parent_of, this, item);
12272}
12273
12274//--------------------------------------------------------------------------
12276{
12277 return (citem_t *)HEXDSP(hx_citem_t_find_closest_addr, this, _ea);
12278}
12279
12280//--------------------------------------------------------------------------
12282{
12283 return *(cexpr_t *)HEXDSP(hx_cexpr_t_assign, this, &r);
12284}
12285
12286//--------------------------------------------------------------------------
12287inline int cexpr_t::compare(const cexpr_t &r) const
12288{
12289 return (int)(size_t)HEXDSP(hx_cexpr_t_compare, this, &r);
12290}
12291
12292//--------------------------------------------------------------------------
12294{
12295 HEXDSP(hx_cexpr_t_replace_by, this, r);
12296}
12297
12298//--------------------------------------------------------------------------
12299inline void cexpr_t::cleanup()
12300{
12301 HEXDSP(hx_cexpr_t_cleanup, this);
12302}
12303
12304//--------------------------------------------------------------------------
12305inline void cexpr_t::put_number(cfunc_t *func, uint64 value, int nbytes, type_sign_t sign)
12306{
12307 HEXDSP(hx_cexpr_t_put_number, this, func, value, nbytes, sign);
12308}
12309
12310//--------------------------------------------------------------------------
12311inline void cexpr_t::print1(qstring *vout, const cfunc_t *func) const
12312{
12313 HEXDSP(hx_cexpr_t_print1, this, vout, func);
12314}
12315
12316//--------------------------------------------------------------------------
12317inline void cexpr_t::calc_type(bool recursive)
12318{
12319 HEXDSP(hx_cexpr_t_calc_type, this, recursive);
12320}
12321
12322//--------------------------------------------------------------------------
12323inline bool cexpr_t::equal_effect(const cexpr_t &r) const
12324{
12325 return (uchar)(size_t)HEXDSP(hx_cexpr_t_equal_effect, this, &r) != 0;
12326}
12327
12328//--------------------------------------------------------------------------
12329inline bool cexpr_t::is_child_of(const citem_t *parent) const
12330{
12331 return (uchar)(size_t)HEXDSP(hx_cexpr_t_is_child_of, this, parent) != 0;
12332}
12333
12334//--------------------------------------------------------------------------
12335inline bool cexpr_t::contains_operator(ctype_t needed_op, int times) const
12336{
12337 return (uchar)(size_t)HEXDSP(hx_cexpr_t_contains_operator, this, needed_op, times) != 0;
12338}
12339
12340//--------------------------------------------------------------------------
12342{
12343 bit_bound_t retval;
12344 HEXDSP(hx_cexpr_t_get_high_nbit_bound, &retval, this);
12345 return retval;
12346}
12347
12348//--------------------------------------------------------------------------
12350{
12351 return (int)(size_t)HEXDSP(hx_cexpr_t_get_low_nbit_bound, this);
12352}
12353
12354//--------------------------------------------------------------------------
12355inline bool cexpr_t::requires_lvalue(const cexpr_t *child) const
12356{
12357 return (uchar)(size_t)HEXDSP(hx_cexpr_t_requires_lvalue, this, child) != 0;
12358}
12359
12360//--------------------------------------------------------------------------
12361inline bool cexpr_t::has_side_effects() const
12362{
12363 return (uchar)(size_t)HEXDSP(hx_cexpr_t_has_side_effects, this) != 0;
12364}
12365
12366//--------------------------------------------------------------------------
12367inline bool cexpr_t::maybe_ptr() const
12368{
12369 return (uchar)(size_t)HEXDSP(hx_cexpr_t_maybe_ptr, this) != 0;
12370}
12371
12372//--------------------------------------------------------------------------
12373inline const char *cexpr_t::dstr() const
12374{
12375 return (const char *)HEXDSP(hx_cexpr_t_dstr, this);
12376}
12377
12378//--------------------------------------------------------------------------
12379inline cif_t &cif_t::assign(const cif_t &r)
12380{
12381 return *(cif_t *)HEXDSP(hx_cif_t_assign, this, &r);
12382}
12383
12384//--------------------------------------------------------------------------
12385inline int cif_t::compare(const cif_t &r) const
12386{
12387 return (int)(size_t)HEXDSP(hx_cif_t_compare, this, &r);
12388}
12389
12390//--------------------------------------------------------------------------
12392{
12393 return *(cloop_t *)HEXDSP(hx_cloop_t_assign, this, &r);
12394}
12395
12396//--------------------------------------------------------------------------
12397inline int cfor_t::compare(const cfor_t &r) const
12398{
12399 return (int)(size_t)HEXDSP(hx_cfor_t_compare, this, &r);
12400}
12401
12402//--------------------------------------------------------------------------
12403inline int cwhile_t::compare(const cwhile_t &r) const
12404{
12405 return (int)(size_t)HEXDSP(hx_cwhile_t_compare, this, &r);
12406}
12407
12408//--------------------------------------------------------------------------
12409inline int cdo_t::compare(const cdo_t &r) const
12410{
12411 return (int)(size_t)HEXDSP(hx_cdo_t_compare, this, &r);
12412}
12413
12414//--------------------------------------------------------------------------
12415inline int creturn_t::compare(const creturn_t &r) const
12416{
12417 return (int)(size_t)HEXDSP(hx_creturn_t_compare, this, &r);
12418}
12419
12420//--------------------------------------------------------------------------
12421inline int cgoto_t::compare(const cgoto_t &r) const
12422{
12423 return (int)(size_t)HEXDSP(hx_cgoto_t_compare, this, &r);
12424}
12425
12426//--------------------------------------------------------------------------
12427inline int casm_t::compare(const casm_t &r) const
12428{
12429 return (int)(size_t)HEXDSP(hx_casm_t_compare, this, &r);
12430}
12431
12432//--------------------------------------------------------------------------
12434{
12435 return *(cinsn_t *)HEXDSP(hx_cinsn_t_assign, this, &r);
12436}
12437
12438//--------------------------------------------------------------------------
12439inline int cinsn_t::compare(const cinsn_t &r) const
12440{
12441 return (int)(size_t)HEXDSP(hx_cinsn_t_compare, this, &r);
12442}
12443
12444//--------------------------------------------------------------------------
12446{
12447 HEXDSP(hx_cinsn_t_replace_by, this, r);
12448}
12449
12450//--------------------------------------------------------------------------
12451inline void cinsn_t::cleanup()
12452{
12453 HEXDSP(hx_cinsn_t_cleanup, this);
12454}
12455
12456//--------------------------------------------------------------------------
12458{
12459 return *(cinsn_t *)HEXDSP(hx_cinsn_t_new_insn, this, insn_ea);
12460}
12461
12462//--------------------------------------------------------------------------
12464{
12465 return *(cif_t *)HEXDSP(hx_cinsn_t_create_if, this, cnd);
12466}
12467
12468//--------------------------------------------------------------------------
12469inline void cinsn_t::print(int indent, vc_printer_t &vp, use_curly_t use_curly) const
12470{
12471 HEXDSP(hx_cinsn_t_print, this, indent, &vp, use_curly);
12472}
12473
12474//--------------------------------------------------------------------------
12475inline void cinsn_t::print1(qstring *vout, const cfunc_t *func) const
12476{
12477 HEXDSP(hx_cinsn_t_print1, this, vout, func);
12478}
12479
12480//--------------------------------------------------------------------------
12481inline bool cinsn_t::is_ordinary_flow() const
12482{
12483 return (uchar)(size_t)HEXDSP(hx_cinsn_t_is_ordinary_flow, this) != 0;
12484}
12485
12486//--------------------------------------------------------------------------
12487inline bool cinsn_t::contains_insn(ctype_t type, int times) const
12488{
12489 return (uchar)(size_t)HEXDSP(hx_cinsn_t_contains_insn, this, type, times) != 0;
12490}
12491
12492//--------------------------------------------------------------------------
12494{
12495 return (uchar)(size_t)HEXDSP(hx_cinsn_t_collect_free_breaks, this, breaks) != 0;
12496}
12497
12498//--------------------------------------------------------------------------
12500{
12501 return (uchar)(size_t)HEXDSP(hx_cinsn_t_collect_free_continues, this, continues) != 0;
12502}
12503
12504//--------------------------------------------------------------------------
12505inline const char *cinsn_t::dstr() const
12506{
12507 return (const char *)HEXDSP(hx_cinsn_t_dstr, this);
12508}
12509
12510//--------------------------------------------------------------------------
12511inline int cblock_t::compare(const cblock_t &r) const
12512{
12513 return (int)(size_t)HEXDSP(hx_cblock_t_compare, this, &r);
12514}
12515
12516//--------------------------------------------------------------------------
12517inline int carglist_t::compare(const carglist_t &r) const
12518{
12519 return (int)(size_t)HEXDSP(hx_carglist_t_compare, this, &r);
12520}
12521
12522//--------------------------------------------------------------------------
12523inline int ccase_t::compare(const ccase_t &r) const
12524{
12525 return (int)(size_t)HEXDSP(hx_ccase_t_compare, this, &r);
12526}
12527
12528//--------------------------------------------------------------------------
12529inline int ccases_t::compare(const ccases_t &r) const
12530{
12531 return (int)(size_t)HEXDSP(hx_ccases_t_compare, this, &r);
12532}
12533
12534//--------------------------------------------------------------------------
12535inline int cswitch_t::compare(const cswitch_t &r) const
12536{
12537 return (int)(size_t)HEXDSP(hx_cswitch_t_compare, this, &r);
12538}
12539
12540//--------------------------------------------------------------------------
12541inline int catchexpr_t::compare(const catchexpr_t &r) const
12542{
12543 return (int)(size_t)HEXDSP(hx_catchexpr_t_compare, this, &r);
12544}
12545
12546//--------------------------------------------------------------------------
12547inline int ccatch_t::compare(const ccatch_t &r) const
12548{
12549 return (int)(size_t)HEXDSP(hx_ccatch_t_compare, this, &r);
12550}
12551
12552//--------------------------------------------------------------------------
12553inline int ctry_t::compare(const ctry_t &r) const
12554{
12555 return (int)(size_t)HEXDSP(hx_ctry_t_compare, this, &r);
12556}
12557
12558//--------------------------------------------------------------------------
12559inline int cthrow_t::compare(const cthrow_t &r) const
12560{
12561 return (int)(size_t)HEXDSP(hx_cthrow_t_compare, this, &r);
12562}
12563
12564//--------------------------------------------------------------------------
12566{
12567 return (int)(size_t)HEXDSP(hx_ctree_visitor_t_apply_to, this, item, parent);
12568}
12569
12570//--------------------------------------------------------------------------
12572{
12573 return (int)(size_t)HEXDSP(hx_ctree_visitor_t_apply_to_exprs, this, item, parent);
12574}
12575
12576//--------------------------------------------------------------------------
12578{
12579 return (uchar)(size_t)HEXDSP(hx_ctree_parentee_t_recalc_parent_types, this) != 0;
12580}
12581
12582//--------------------------------------------------------------------------
12584{
12585 return (uchar)(size_t)HEXDSP(hx_cfunc_parentee_t_calc_rvalue_type, this, target, e) != 0;
12586}
12587
12588//--------------------------------------------------------------------------
12589inline int ctree_item_t::get_udm(udm_t *udm, tinfo_t *parent, uint64 *p_offset) const
12590{
12591 return (int)(size_t)HEXDSP(hx_ctree_item_t_get_udm, this, udm, parent, p_offset);
12592}
12593
12594//--------------------------------------------------------------------------
12595inline int ctree_item_t::get_edm(tinfo_t *parent) const
12596{
12597 return (int)(size_t)HEXDSP(hx_ctree_item_t_get_edm, this, parent);
12598}
12599
12600//--------------------------------------------------------------------------
12602{
12603 return (lvar_t *)HEXDSP(hx_ctree_item_t_get_lvar, this);
12604}
12605
12606//--------------------------------------------------------------------------
12608{
12609 ea_t retval;
12610 HEXDSP(hx_ctree_item_t_get_ea, &retval, this);
12611 return retval;
12612}
12613
12614//--------------------------------------------------------------------------
12615inline int ctree_item_t::get_label_num(int gln_flags) const
12616{
12617 return (int)(size_t)HEXDSP(hx_ctree_item_t_get_label_num, this, gln_flags);
12618}
12619
12620//--------------------------------------------------------------------------
12621inline void ctree_item_t::print(qstring *vout) const
12622{
12623 HEXDSP(hx_ctree_item_t_print, this, vout);
12624}
12625
12626//--------------------------------------------------------------------------
12627inline const char *ctree_item_t::dstr() const
12628{
12629 return (const char *)HEXDSP(hx_ctree_item_t_dstr, this);
12630}
12631
12632//--------------------------------------------------------------------------
12634{
12635 return (cexpr_t *)HEXDSP(hx_lnot, e);
12636}
12637
12638//--------------------------------------------------------------------------
12640{
12641 return (cinsn_t *)HEXDSP(hx_new_block);
12642}
12643
12644//--------------------------------------------------------------------------
12645inline AS_PRINTF(3, 0) cexpr_t *vcreate_helper(bool standalone, const tinfo_t &type, const char *format, va_list va)
12646{
12647 return (cexpr_t *)HEXDSP(hx_vcreate_helper, standalone, &type, format, va);
12648}
12649
12650//--------------------------------------------------------------------------
12651inline AS_PRINTF(3, 0) cexpr_t *vcall_helper(const tinfo_t &rettype, carglist_t *args, const char *format, va_list va)
12652{
12653 return (cexpr_t *)HEXDSP(hx_vcall_helper, &rettype, args, format, va);
12654}
12655
12656//--------------------------------------------------------------------------
12657inline cexpr_t *make_num(uint64 n, cfunc_t *func, ea_t ea, int opnum, type_sign_t sign, int size)
12658{
12659 return (cexpr_t *)HEXDSP(hx_make_num, n, func, ea, opnum, sign, size);
12660}
12661
12662//--------------------------------------------------------------------------
12664{
12665 return (cexpr_t *)HEXDSP(hx_make_ref, e);
12666}
12667
12668//--------------------------------------------------------------------------
12669inline cexpr_t *dereference(cexpr_t *e, int ptrsize, bool is_flt)
12670{
12671 return (cexpr_t *)HEXDSP(hx_dereference, e, ptrsize, is_flt);
12672}
12673
12674//--------------------------------------------------------------------------
12675inline void save_user_labels(ea_t func_ea, const user_labels_t *user_labels, const cfunc_t *func)
12676{
12677 HEXDSP(hx_save_user_labels, func_ea, user_labels, func);
12678}
12679
12680//--------------------------------------------------------------------------
12681inline void save_user_cmts(ea_t func_ea, const user_cmts_t *user_cmts)
12682{
12683 HEXDSP(hx_save_user_cmts, func_ea, user_cmts);
12684}
12685
12686//--------------------------------------------------------------------------
12687inline void save_user_numforms(ea_t func_ea, const user_numforms_t *numforms)
12688{
12689 HEXDSP(hx_save_user_numforms, func_ea, numforms);
12690}
12691
12692//--------------------------------------------------------------------------
12693inline void save_user_iflags(ea_t func_ea, const user_iflags_t *iflags)
12694{
12695 HEXDSP(hx_save_user_iflags, func_ea, iflags);
12696}
12697
12698//--------------------------------------------------------------------------
12699inline void save_user_unions(ea_t func_ea, const user_unions_t *unions)
12700{
12701 HEXDSP(hx_save_user_unions, func_ea, unions);
12702}
12703
12704//--------------------------------------------------------------------------
12705inline user_labels_t *restore_user_labels(ea_t func_ea, const cfunc_t *func)
12706{
12707 return (user_labels_t *)HEXDSP(hx_restore_user_labels, func_ea, func);
12708}
12709
12710//--------------------------------------------------------------------------
12712{
12713 return (user_cmts_t *)HEXDSP(hx_restore_user_cmts, func_ea);
12714}
12715
12716//--------------------------------------------------------------------------
12718{
12719 return (user_numforms_t *)HEXDSP(hx_restore_user_numforms, func_ea);
12720}
12721
12722//--------------------------------------------------------------------------
12724{
12725 return (user_iflags_t *)HEXDSP(hx_restore_user_iflags, func_ea);
12726}
12727
12728//--------------------------------------------------------------------------
12730{
12731 return (user_unions_t *)HEXDSP(hx_restore_user_unions, func_ea);
12732}
12733
12734//--------------------------------------------------------------------------
12735inline void cfunc_t::build_c_tree()
12736{
12737 HEXDSP(hx_cfunc_t_build_c_tree, this);
12738}
12739
12740//--------------------------------------------------------------------------
12741inline void cfunc_t::verify(allow_unused_labels_t aul, bool even_without_debugger) const
12742{
12743 HEXDSP(hx_cfunc_t_verify, this, aul, even_without_debugger);
12744}
12745
12746//--------------------------------------------------------------------------
12747inline void cfunc_t::print_dcl(qstring *vout) const
12748{
12749 HEXDSP(hx_cfunc_t_print_dcl, this, vout);
12750}
12751
12752//--------------------------------------------------------------------------
12753inline void cfunc_t::print_func(vc_printer_t &vp) const
12754{
12755 HEXDSP(hx_cfunc_t_print_func, this, &vp);
12756}
12757
12758//--------------------------------------------------------------------------
12760{
12761 return (uchar)(size_t)HEXDSP(hx_cfunc_t_get_func_type, this, type) != 0;
12762}
12763
12764//--------------------------------------------------------------------------
12766{
12767 return (lvars_t *)HEXDSP(hx_cfunc_t_get_lvars, this);
12768}
12769
12770//--------------------------------------------------------------------------
12772{
12773 sval_t retval;
12774 HEXDSP(hx_cfunc_t_get_stkoff_delta, &retval, this);
12775 return retval;
12776}
12777
12778//--------------------------------------------------------------------------
12780{
12781 return (citem_t *)HEXDSP(hx_cfunc_t_find_label, this, label);
12782}
12783
12784//--------------------------------------------------------------------------
12786{
12787 HEXDSP(hx_cfunc_t_remove_unused_labels, this);
12788}
12789
12790//--------------------------------------------------------------------------
12791inline const char *cfunc_t::get_user_cmt(const treeloc_t &loc, cmt_retrieval_type_t rt) const
12792{
12793 return (const char *)HEXDSP(hx_cfunc_t_get_user_cmt, this, &loc, rt);
12794}
12795
12796//--------------------------------------------------------------------------
12797inline void cfunc_t::set_user_cmt(const treeloc_t &loc, const char *cmt)
12798{
12799 HEXDSP(hx_cfunc_t_set_user_cmt, this, &loc, cmt);
12800}
12801
12802//--------------------------------------------------------------------------
12804{
12805 return (int32)(size_t)HEXDSP(hx_cfunc_t_get_user_iflags, this, &loc);
12806}
12807
12808//--------------------------------------------------------------------------
12809inline void cfunc_t::set_user_iflags(const citem_locator_t &loc, int32 iflags)
12810{
12811 HEXDSP(hx_cfunc_t_set_user_iflags, this, &loc, iflags);
12812}
12813
12814//--------------------------------------------------------------------------
12815inline bool cfunc_t::has_orphan_cmts() const
12816{
12817 return (uchar)(size_t)HEXDSP(hx_cfunc_t_has_orphan_cmts, this) != 0;
12818}
12819
12820//--------------------------------------------------------------------------
12822{
12823 return (int)(size_t)HEXDSP(hx_cfunc_t_del_orphan_cmts, this);
12824}
12825
12826//--------------------------------------------------------------------------
12828{
12829 return (uchar)(size_t)HEXDSP(hx_cfunc_t_get_user_union_selection, this, ea, path) != 0;
12830}
12831
12832//--------------------------------------------------------------------------
12834{
12835 HEXDSP(hx_cfunc_t_set_user_union_selection, this, ea, &path);
12836}
12837
12838//--------------------------------------------------------------------------
12839inline void cfunc_t::save_user_labels() const
12840{
12841 HEXDSP(hx_cfunc_t_save_user_labels, this);
12842}
12843
12844//--------------------------------------------------------------------------
12845inline void cfunc_t::save_user_cmts() const
12846{
12847 HEXDSP(hx_cfunc_t_save_user_cmts, this);
12848}
12849
12850//--------------------------------------------------------------------------
12852{
12853 HEXDSP(hx_cfunc_t_save_user_numforms, this);
12854}
12855
12856//--------------------------------------------------------------------------
12857inline void cfunc_t::save_user_iflags() const
12858{
12859 HEXDSP(hx_cfunc_t_save_user_iflags, this);
12860}
12861
12862//--------------------------------------------------------------------------
12863inline void cfunc_t::save_user_unions() const
12864{
12865 HEXDSP(hx_cfunc_t_save_user_unions, this);
12866}
12867
12868//--------------------------------------------------------------------------
12869inline bool cfunc_t::get_line_item(const char *line, int x, bool is_ctree_line, ctree_item_t *phead, ctree_item_t *pitem, ctree_item_t *ptail)
12870{
12871 return (uchar)(size_t)HEXDSP(hx_cfunc_t_get_line_item, this, line, x, is_ctree_line, phead, pitem, ptail) != 0;
12872}
12873
12874//--------------------------------------------------------------------------
12876{
12877 return *(hexwarns_t *)HEXDSP(hx_cfunc_t_get_warnings, this);
12878}
12879
12880//--------------------------------------------------------------------------
12882{
12883 return *(eamap_t *)HEXDSP(hx_cfunc_t_get_eamap, this);
12884}
12885
12886//--------------------------------------------------------------------------
12888{
12889 return *(boundaries_t *)HEXDSP(hx_cfunc_t_get_boundaries, this);
12890}
12891
12892//--------------------------------------------------------------------------
12894{
12895 return *(const strvec_t *)HEXDSP(hx_cfunc_t_get_pseudocode, this);
12896}
12897
12898//--------------------------------------------------------------------------
12900{
12901 HEXDSP(hx_cfunc_t_refresh_func_ctext, this);
12902}
12903
12904//--------------------------------------------------------------------------
12906{
12908}
12909
12910//--------------------------------------------------------------------------
12911inline bool cfunc_t::gather_derefs(const ctree_item_t &ci, udt_type_data_t *udm) const
12912{
12913 return (uchar)(size_t)HEXDSP(hx_cfunc_t_gather_derefs, this, &ci, udm) != 0;
12914}
12915
12916//--------------------------------------------------------------------------
12917inline bool cfunc_t::find_item_coords(const citem_t *item, int *px, int *py)
12918{
12919 return (uchar)(size_t)HEXDSP(hx_cfunc_t_find_item_coords, this, item, px, py) != 0;
12920}
12921
12922//--------------------------------------------------------------------------
12923inline void cfunc_t::cleanup()
12924{
12925 HEXDSP(hx_cfunc_t_cleanup, this);
12926}
12927
12928//--------------------------------------------------------------------------
12930{
12932}
12933
12934//--------------------------------------------------------------------------
12935inline cfuncptr_t decompile(const mba_ranges_t &mbr, hexrays_failure_t *hf, int decomp_flags)
12936{
12937 return cfuncptr_t((cfunc_t *)HEXDSP(hx_decompile, &mbr, hf, decomp_flags));
12938}
12939
12940//--------------------------------------------------------------------------
12941inline mba_t *gen_microcode(const mba_ranges_t &mbr, hexrays_failure_t *hf, const mlist_t *retlist, int decomp_flags, mba_maturity_t reqmat)
12942{
12943 return (mba_t *)HEXDSP(hx_gen_microcode, &mbr, hf, retlist, decomp_flags, reqmat);
12944}
12945
12946//--------------------------------------------------------------------------
12948{
12949 return cfuncptr_t((cfunc_t *)HEXDSP(hx_create_cfunc, mba));
12950}
12951
12952//--------------------------------------------------------------------------
12953inline bool mark_cfunc_dirty(ea_t ea, bool close_views)
12954{
12955 return (uchar)(size_t)HEXDSP(hx_mark_cfunc_dirty, ea, close_views) != 0;
12956}
12957
12958//--------------------------------------------------------------------------
12960{
12961 HEXDSP(hx_clear_cached_cfuncs);
12962}
12963
12964//--------------------------------------------------------------------------
12965inline bool has_cached_cfunc(ea_t ea)
12966{
12967 return (uchar)(size_t)HEXDSP(hx_has_cached_cfunc, ea) != 0;
12968}
12969
12970//--------------------------------------------------------------------------
12971inline const char *get_ctype_name(ctype_t op)
12972{
12973 return (const char *)HEXDSP(hx_get_ctype_name, op);
12974}
12975
12976//--------------------------------------------------------------------------
12978{
12979 qstring retval;
12980 HEXDSP(hx_create_field_name, &retval, &type, offset);
12981 return retval;
12982}
12983
12984//--------------------------------------------------------------------------
12985inline bool install_hexrays_callback(hexrays_cb_t *callback, void *ud)
12986{
12987 return (uchar)(size_t)HEXDSP(hx_install_hexrays_callback, callback, ud) != 0;
12988}
12989
12990//--------------------------------------------------------------------------
12991inline int remove_hexrays_callback(hexrays_cb_t *callback, void *ud)
12992{
12993 auto hrdsp = HEXDSP;
12994 return hrdsp == nullptr ? 0 : (int)(size_t)hrdsp(hx_remove_hexrays_callback, callback, ud);
12995}
12996
12997//--------------------------------------------------------------------------
12998inline bool vdui_t::set_locked(bool v)
12999{
13000 return (uchar)(size_t)HEXDSP(hx_vdui_t_set_locked, this, v) != 0;
13001}
13002
13003//--------------------------------------------------------------------------
13004inline void vdui_t::refresh_view(bool redo_mba)
13005{
13006 HEXDSP(hx_vdui_t_refresh_view, this, redo_mba);
13007}
13008
13009//--------------------------------------------------------------------------
13010inline void vdui_t::refresh_ctext(bool activate)
13011{
13012 HEXDSP(hx_vdui_t_refresh_ctext, this, activate);
13013}
13014
13015//--------------------------------------------------------------------------
13016inline void vdui_t::switch_to(cfuncptr_t f, bool activate)
13017{
13018 HEXDSP(hx_vdui_t_switch_to, this, &f, activate);
13019}
13020
13021//--------------------------------------------------------------------------
13023{
13024 return (cnumber_t *)HEXDSP(hx_vdui_t_get_number, this);
13025}
13026
13027//--------------------------------------------------------------------------
13029{
13030 return (int)(size_t)HEXDSP(hx_vdui_t_get_current_label, this);
13031}
13032
13033//--------------------------------------------------------------------------
13034inline void vdui_t::clear()
13035{
13036 HEXDSP(hx_vdui_t_clear, this);
13037}
13038
13039//--------------------------------------------------------------------------
13041{
13042 return (uchar)(size_t)HEXDSP(hx_vdui_t_refresh_cpos, this, idv) != 0;
13043}
13044
13045//--------------------------------------------------------------------------
13047{
13048 return (uchar)(size_t)HEXDSP(hx_vdui_t_get_current_item, this, idv) != 0;
13049}
13050
13051//--------------------------------------------------------------------------
13053{
13054 return (uchar)(size_t)HEXDSP(hx_vdui_t_ui_rename_lvar, this, v) != 0;
13055}
13056
13057//--------------------------------------------------------------------------
13058inline bool vdui_t::rename_lvar(lvar_t *v, const char *name, bool is_user_name)
13059{
13060 return (uchar)(size_t)HEXDSP(hx_vdui_t_rename_lvar, this, v, name, is_user_name) != 0;
13061}
13062
13063//--------------------------------------------------------------------------
13065{
13066 return (uchar)(size_t)HEXDSP(hx_vdui_t_ui_set_call_type, this, e) != 0;
13067}
13068
13069//--------------------------------------------------------------------------
13071{
13072 return (uchar)(size_t)HEXDSP(hx_vdui_t_ui_set_lvar_type, this, v) != 0;
13073}
13074
13075//--------------------------------------------------------------------------
13077{
13078 return (uchar)(size_t)HEXDSP(hx_vdui_t_set_lvar_type, this, v, &type) != 0;
13079}
13080
13081//--------------------------------------------------------------------------
13083{
13084 return (uchar)(size_t)HEXDSP(hx_vdui_t_set_noptr_lvar, this, v) != 0;
13085}
13086
13087//--------------------------------------------------------------------------
13089{
13090 return (uchar)(size_t)HEXDSP(hx_vdui_t_ui_edit_lvar_cmt, this, v) != 0;
13091}
13092
13093//--------------------------------------------------------------------------
13094inline bool vdui_t::set_lvar_cmt(lvar_t *v, const char *cmt)
13095{
13096 return (uchar)(size_t)HEXDSP(hx_vdui_t_set_lvar_cmt, this, v, cmt) != 0;
13097}
13098
13099//--------------------------------------------------------------------------
13101{
13102 return (uchar)(size_t)HEXDSP(hx_vdui_t_ui_map_lvar, this, v) != 0;
13103}
13104
13105//--------------------------------------------------------------------------
13107{
13108 return (uchar)(size_t)HEXDSP(hx_vdui_t_ui_unmap_lvar, this, v) != 0;
13109}
13110
13111//--------------------------------------------------------------------------
13112inline bool vdui_t::map_lvar(lvar_t *from, lvar_t *to)
13113{
13114 return (uchar)(size_t)HEXDSP(hx_vdui_t_map_lvar, this, from, to) != 0;
13115}
13116
13117//--------------------------------------------------------------------------
13118inline bool vdui_t::set_udm_type(tinfo_t &udt_type, int udm_idx)
13119{
13120 return (uchar)(size_t)HEXDSP(hx_vdui_t_set_udm_type, this, &udt_type, udm_idx) != 0;
13121}
13122
13123//--------------------------------------------------------------------------
13124inline bool vdui_t::rename_udm(tinfo_t &udt_type, int udm_idx)
13125{
13126 return (uchar)(size_t)HEXDSP(hx_vdui_t_rename_udm, this, &udt_type, udm_idx) != 0;
13127}
13128
13129//--------------------------------------------------------------------------
13131{
13132 return (uchar)(size_t)HEXDSP(hx_vdui_t_set_global_type, this, ea) != 0;
13133}
13134
13135//--------------------------------------------------------------------------
13137{
13138 return (uchar)(size_t)HEXDSP(hx_vdui_t_rename_global, this, ea) != 0;
13139}
13140
13141//--------------------------------------------------------------------------
13142inline bool vdui_t::rename_label(int label)
13143{
13144 return (uchar)(size_t)HEXDSP(hx_vdui_t_rename_label, this, label) != 0;
13145}
13146
13147//--------------------------------------------------------------------------
13148inline bool vdui_t::jump_enter(input_device_t idv, int omflags)
13149{
13150 return (uchar)(size_t)HEXDSP(hx_vdui_t_jump_enter, this, idv, omflags) != 0;
13151}
13152
13153//--------------------------------------------------------------------------
13155{
13156 return (uchar)(size_t)HEXDSP(hx_vdui_t_ctree_to_disasm, this) != 0;
13157}
13158
13159//--------------------------------------------------------------------------
13160inline cmt_type_t vdui_t::calc_cmt_type(size_t lnnum, cmt_type_t cmttype) const
13161{
13162 return (cmt_type_t)(size_t)HEXDSP(hx_vdui_t_calc_cmt_type, this, lnnum, cmttype);
13163}
13164
13165//--------------------------------------------------------------------------
13166inline bool vdui_t::edit_cmt(const treeloc_t &loc)
13167{
13168 return (uchar)(size_t)HEXDSP(hx_vdui_t_edit_cmt, this, &loc) != 0;
13169}
13170
13171//--------------------------------------------------------------------------
13173{
13174 return (uchar)(size_t)HEXDSP(hx_vdui_t_edit_func_cmt, this) != 0;
13175}
13176
13177//--------------------------------------------------------------------------
13179{
13180 return (uchar)(size_t)HEXDSP(hx_vdui_t_del_orphan_cmts, this) != 0;
13181}
13182
13183//--------------------------------------------------------------------------
13184inline bool vdui_t::set_num_radix(int base)
13185{
13186 return (uchar)(size_t)HEXDSP(hx_vdui_t_set_num_radix, this, base) != 0;
13187}
13188
13189//--------------------------------------------------------------------------
13191{
13192 return (uchar)(size_t)HEXDSP(hx_vdui_t_set_num_enum, this) != 0;
13193}
13194
13195//--------------------------------------------------------------------------
13197{
13198 return (uchar)(size_t)HEXDSP(hx_vdui_t_set_num_stroff, this) != 0;
13199}
13200
13201//--------------------------------------------------------------------------
13203{
13204 return (uchar)(size_t)HEXDSP(hx_vdui_t_invert_sign, this) != 0;
13205}
13206
13207//--------------------------------------------------------------------------
13209{
13210 return (uchar)(size_t)HEXDSP(hx_vdui_t_invert_bits, this) != 0;
13211}
13212
13213//--------------------------------------------------------------------------
13214inline bool vdui_t::collapse_item(bool hide)
13215{
13216 return (uchar)(size_t)HEXDSP(hx_vdui_t_collapse_item, this, hide) != 0;
13217}
13218
13219//--------------------------------------------------------------------------
13220inline bool vdui_t::collapse_lvars(bool hide)
13221{
13222 return (uchar)(size_t)HEXDSP(hx_vdui_t_collapse_lvars, this, hide) != 0;
13223}
13224
13225//--------------------------------------------------------------------------
13226inline bool vdui_t::split_item(bool split)
13227{
13228 return (uchar)(size_t)HEXDSP(hx_vdui_t_split_item, this, split) != 0;
13229}
13230
13231//--------------------------------------------------------------------------
13232inline int select_udt_by_offset(const qvector<tinfo_t> *udts, const ui_stroff_ops_t &ops, ui_stroff_applicator_t &applicator)
13233{
13234 return (int)(size_t)HEXDSP(hx_select_udt_by_offset, udts, &ops, &applicator);
13235}
13236
13237#ifdef __NT__
13238#pragma warning(pop)
13239#endif
13240#endif
DECLARE_TYPE_AS_MOVABLE(compiled_binpat_t)
qchar * extract(void)
Extract C string from _qstring. Must qfree() it.
Definition pro.h:3297
Describes an argument location.
Definition typeinf.hpp:1101
Definition hexrays.hpp:1871
This class manages the offset and size of a value that occupies a number of contiguous bits within so...
Definition bitrange.hpp:16
Bit set class. See https://en.wikipedia.org/wiki/Bit_array.
Definition hexrays.hpp:1789
bool hexapi empty() const
Definition hexrays.hpp:10787
DECLARE_COMPARISONS(bitset_t)
int hexapi count() const
Definition hexrays.hpp:10793
bool includes(const bitset_t &ml) const
Definition hexrays.hpp:1834
void print(qstring *vout, int(*get_bit_name)(qstring *out, int bit, int width, void *ud)=nullptr, void *ud=nullptr) const
bool hexapi sub(int bit)
Definition hexrays.hpp:10733
void hexapi shift_down(int shift)
Definition hexrays.hpp:10757
bool hexapi fill_gaps(int total_nbits)
Definition hexrays.hpp:10817
bool hexapi add(int bit)
Definition hexrays.hpp:10715
void inc(iterator &p, int n=1) const
Definition hexrays.hpp:1854
bool hexapi has_any(int bit, int width) const
Definition hexrays.hpp:10775
bool hexapi has_all(int bit, int width) const
Definition hexrays.hpp:10769
bitset_t()
Definition hexrays.hpp:1794
iterator end() const
Definition hexrays.hpp:1851
int front() const
Definition hexrays.hpp:1852
iterator const_iterator
Definition hexrays.hpp:1848
int back() const
Definition hexrays.hpp:1853
HEXRAYS_MEMORY_ALLOCATION_FUNCS() class iterator
Definition hexrays.hpp:1837
bool hexapi has(int bit) const
Definition hexrays.hpp:10763
~bitset_t()
Definition hexrays.hpp:1796
void swap(bitset_t &r)
Definition hexrays.hpp:1801
void hexapi fill_with_ones(int maxbit)
Definition hexrays.hpp:10811
bool hexapi cut_at(int maxbit)
Definition hexrays.hpp:10751
int hexapi last() const
Definition hexrays.hpp:10805
void clear()
Definition hexrays.hpp:1828
iterator begin() const
Definition hexrays.hpp:1850
bitset_t & operator=(const bitset_t &m)
Definition hexrays.hpp:1806
const char *hexapi dstr() const
Definition hexrays.hpp:10781
bool hexapi is_subset_of(const bitset_t &ml) const
Definition hexrays.hpp:10835
void extract(intvec_t &out) const
bool hexapi has_common(const bitset_t &ml) const
Definition hexrays.hpp:10823
bool hexapi intersect(const bitset_t &ml)
Definition hexrays.hpp:10829
bitset_t &hexapi copy(const bitset_t &m)
Definition hexrays.hpp:10709
iterator itat(int n) const
Definition hexrays.hpp:1849
Chains of one block.
Definition hexrays.hpp:3518
const chain_t * get_stk_chain(sval_t off, int width=1) const
Get chain for the specified stack offset.
Definition hexrays.hpp:3532
void hexapi print(qstring *vout) const
Definition hexrays.hpp:11443
const chain_t * get_reg_chain(mreg_t reg, int width=1) const
Get chain for the specified register.
Definition hexrays.hpp:3524
const chain_t * get_chain(const voff_t &k, int width=1) const
Get chain for the specified value offset.
Definition hexrays.hpp:3540
chain_t * get_reg_chain(mreg_t reg, int width=1)
Definition hexrays.hpp:3526
chain_t * get_stk_chain(sval_t off, int width=1)
Definition hexrays.hpp:3534
chain_t * get_chain(const voff_t &k, int width=1)
Definition hexrays.hpp:3542
const char *hexapi dstr() const
Definition hexrays.hpp:11449
chain_t * get_chain(const chain_t &ch)
Definition hexrays.hpp:3548
Vector of bytes (use for dynamic memory)
Definition pro.h:3773
~chain_keeper_t()
Definition hexrays.hpp:5456
block_chains_t & back()
Definition hexrays.hpp:5462
int for_all_chains(chain_visitor_t &cv, int gca)
Definition hexrays.hpp:5464
chain_keeper_t(graph_chains_t *_gc)
Definition hexrays.hpp:5455
block_chains_t & operator[](size_t idx)
Definition hexrays.hpp:5460
block_chains_t & front()
Definition hexrays.hpp:5461
ud (use->def) and du (def->use) chain.
Definition hexrays.hpp:3444
const char *hexapi dstr() const
Definition hexrays.hpp:11425
sval_t get_stkoff() const
Definition hexrays.hpp:3482
void set_inited(bool b)
Definition hexrays.hpp:3477
bool includes(const chain_t &r) const
Definition hexrays.hpp:3485
bool operator<(const chain_t &r) const
Definition hexrays.hpp:3489
bool is_term() const
Definition hexrays.hpp:3476
void hexapi append_list(const mba_t *mba, mlist_t *list) const
Append the contents of the chain to the specified list of locations.
Definition hexrays.hpp:11431
int width
size of the value in bytes
Definition hexrays.hpp:3449
bool is_stkoff() const
Definition hexrays.hpp:3471
chain_t()
Definition hexrays.hpp:3461
void hexapi print(qstring *vout) const
Definition hexrays.hpp:11419
bool is_replaced() const
Definition hexrays.hpp:3472
bool is_overlapped() const
Definition hexrays.hpp:3473
void set_value(const chain_t &r)
Definition hexrays.hpp:3466
bool overlap(const chain_t &r) const
Definition hexrays.hpp:3483
void set_term(bool b)
Definition hexrays.hpp:3480
uchar flags
combination Chain properties bits
Definition hexrays.hpp:3451
bool is_inited() const
Definition hexrays.hpp:3469
bool is_fake() const
Definition hexrays.hpp:3474
int varnum
allocated variable index (-1 - not allocated yet)
Definition hexrays.hpp:3450
bool is_reg() const
Definition hexrays.hpp:3470
bool is_passreg() const
Definition hexrays.hpp:3475
mreg_t get_reg() const
Definition hexrays.hpp:3481
chain_t(mopt_t t, sval_t off, int w=1, int v=-1)
Definition hexrays.hpp:3462
void clear_varnum()
Definition hexrays.hpp:3495
const voff_t & key() const
Definition hexrays.hpp:3468
const voff_t endoff() const
Definition hexrays.hpp:3487
void set_replaced(bool b)
Definition hexrays.hpp:3478
void set_overlapped(bool b)
Definition hexrays.hpp:3479
chain_t(const voff_t &_k, int w=1)
Definition hexrays.hpp:3464
Helper class to generate the initial microcode.
Definition hexrays.hpp:5583
virtual bool idaapi store_operand(int n, const mop_t &mop, int flags=0, minsn_t **outins=nullptr)
Generate microcode to store an operand.
virtual mreg_t idaapi load_effective_address(int n, int flags=0)=0
Generate microcode to calculate the address of a memory operand.
cdg_insn_iterator_t ii
Definition hexrays.hpp:5589
codegen_t()=delete
virtual ~codegen_t()
Definition hexrays.hpp:5593
char ignore_micro
Definition hexrays.hpp:5588
virtual mreg_t idaapi load_operand(int opnum, int flags=0)=0
Generate microcode to load one operand.
minsn_t *idaapi emit_micro_mvm(mcode_t code, op_dtype_t dtype, uval_t l, uval_t r, uval_t d, int offsize)
Emit one microinstruction.
Definition hexrays.hpp:5672
virtual merror_t idaapi gen_micro()=0
Generate microcode for one instruction.
void hexapi clear()
Definition hexrays.hpp:12103
virtual void idaapi microgen_completed()
This method is called when the microcode generation is done.
Definition hexrays.hpp:5623
virtual merror_t idaapi analyze_prolog(const class qflow_chart_t &fc, const class bitset_t &reachable)=0
Analyze prolog/epilog of the function to decompile.
mblock_t * mb
Definition hexrays.hpp:5586
minsn_t *hexapi emit(mcode_t code, int width, uval_t l, uval_t r, uval_t d, int offsize)
Emit one microinstruction.
Definition hexrays.hpp:12109
virtual merror_t idaapi prepare_gen_micro()
Setup internal data to handle new instruction.
Definition hexrays.hpp:5632
insn_t insn
Definition hexrays.hpp:5587
mba_t * mba
Definition hexrays.hpp:5585
size_t reserved[4]
Definition hexrays.hpp:5590
Class to enumerate all function instructions and data sorted by addresses.
Definition funcs.hpp:784
A function is a set of continuous ranges of addresses with characteristics.
Definition funcs.hpp:85
Class to enumerate all function tails sorted by addresses.
Definition funcs.hpp:713
gdl graph interface - includes only functions required to draw it
Definition gdl.hpp:248
Definition hexrays.hpp:3569
void hexapi release()
Unlock the chains.
Definition hexrays.hpp:11461
bool is_locked() const
Are the chains locked?
Definition hexrays.hpp:3590
~graph_chains_t()
Definition hexrays.hpp:3572
int hexapi for_all_chains(chain_visitor_t &cv, int gca_flags)
Visit all chains.
Definition hexrays.hpp:11455
void swap(graph_chains_t &r)
Definition hexrays.hpp:3595
void acquire()
Lock the chains.
Definition hexrays.hpp:3592
Definition hexrays.hpp:4143
intval64_t hexapi mop_value(const mop_t &mop)
Definition hexrays.hpp:11629
virtual intval64_t get_mop_value(const mop_t &mop)=0
intval64_t hexapi minsn_value(const minsn_t &insn)
Definition hexrays.hpp:11637
virtual ~int64_emulator_t()
Definition hexrays.hpp:4145
Definition hexrays.hpp:3927
intval64_t smod(const intval64_t &o) const
Definition hexrays.hpp:4045
void print(qstring *vout) const
Definition hexrays.hpp:3935
intval64_t sar(const intval64_t &o) const
Definition hexrays.hpp:4078
intval64_t sdiv(const intval64_t &o) const
Definition hexrays.hpp:4016
intval64_t operator!() const
Definition hexrays.hpp:4111
intval64_t high(int target_sz) const
Definition hexrays.hpp:3978
intval64_t sext(int target_sz) const
Definition hexrays.hpp:3957
intval64_t operator|(const intval64_t &o) const
Definition hexrays.hpp:4084
intval64_t operator^(const intval64_t &o) const
Definition hexrays.hpp:4098
intval64_t operator&(const intval64_t &o) const
Definition hexrays.hpp:4091
intval64_t operator~() const
Definition hexrays.hpp:4117
intval64_t operator+(const intval64_t &o) const
Definition hexrays.hpp:3986
intval64_t operator*(const intval64_t &o) const
Definition hexrays.hpp:4000
bool operator!=(const intval64_t &o) const
Definition hexrays.hpp:3944
intval64_t operator<<(const intval64_t &o) const
Definition hexrays.hpp:4066
intval64_t operator>>(const intval64_t &o) const
Definition hexrays.hpp:4072
uint64 uval() const
Definition hexrays.hpp:3934
int64 sval() const
Definition hexrays.hpp:3933
intval64_t operator-(const intval64_t &o) const
Definition hexrays.hpp:3993
intval64_t zext(int target_sz) const
Definition hexrays.hpp:3964
bool operator<(const intval64_t &o) const
Definition hexrays.hpp:3950
intval64_t(uint64 v=0, int _s=1)
Definition hexrays.hpp:3932
uint64 val
Definition hexrays.hpp:3929
bool operator==(const intval64_t &o) const
Definition hexrays.hpp:3938
intval64_t low(int target_sz) const
Definition hexrays.hpp:3971
intval64_t operator%(const intval64_t &o) const
Definition hexrays.hpp:4037
int size
Definition hexrays.hpp:3930
intval64_t operator/(const intval64_t &o) const
Definition hexrays.hpp:4007
intval64_t operator-() const
Definition hexrays.hpp:4105
Definition hexrays.hpp:1973
DEFINE_MEMORY_ALLOCATION_FUNCS() void swap(ivlset_tpl &r)
Definition hexrays.hpp:1987
void set_all_values()
Definition hexrays.hpp:1997
bag_t bag
Definition hexrays.hpp:1978
bool single_value() const
Definition hexrays.hpp:1998
const_iterator begin() const
Definition hexrays.hpp:2006
void qclear()
Definition hexrays.hpp:1995
void clear()
Definition hexrays.hpp:1994
bool operator!=(const Ivl &v) const
Definition hexrays.hpp:2002
const_iterator end() const
Definition hexrays.hpp:2007
bool verify() const
const Ivl & lastivl() const
Definition hexrays.hpp:1991
ivlset_tpl()
Definition hexrays.hpp:1985
size_t nivls() const
Definition hexrays.hpp:1992
bag_t::iterator iterator
Definition hexrays.hpp:2004
static bool ivl_all_values(const Ivl &ivl)
Definition hexrays.hpp:1982
qvector< Ivl > bag_t
Definition hexrays.hpp:1975
iterator begin()
Definition hexrays.hpp:2008
bool all_values() const
Definition hexrays.hpp:1996
ivlset_tpl(const Ivl &ivl)
Definition hexrays.hpp:1986
bool single_value(T v) const
Definition hexrays.hpp:1999
const Ivl & getivl(int idx) const
Definition hexrays.hpp:1990
bool empty() const
Definition hexrays.hpp:1993
bool operator==(const Ivl &v) const
Definition hexrays.hpp:2001
iterator end()
Definition hexrays.hpp:2009
bag_t::const_iterator const_iterator
Definition hexrays.hpp:2005
Definition of a local variable (register or stack) var lvar.
Definition hexrays.hpp:1183
void set_arg_var()
Definition hexrays.hpp:1318
bool is_spoiled_var() const
Is spoiled var? (meaningful only during lvar allocation)
Definition hexrays.hpp:1276
void set_shared()
Definition hexrays.hpp:1348
void set_mreg_done()
Definition hexrays.hpp:1314
void set_decl_unused()
Definition hexrays.hpp:1346
void set_non_typed()
Definition hexrays.hpp:1308
void clr_used_byref()
Definition hexrays.hpp:1345
uint64 divisor
max known divisor of the variable
Definition hexrays.hpp:1233
void clr_shared()
Definition hexrays.hpp:1349
void clr_fake_var()
Definition hexrays.hpp:1321
bool is_arg_var() const
Is the function argument?
Definition hexrays.hpp:1266
bool typed() const
Has the variable a type?
Definition hexrays.hpp:1246
void clr_overlapped_var()
Definition hexrays.hpp:1323
tinfo_t tif
variable type
Definition hexrays.hpp:1229
void set_used()
Definition hexrays.hpp:1305
friend class mba_t
Definition hexrays.hpp:1184
void clr_mreg_done()
Definition hexrays.hpp:1315
void clr_arg_var()
Definition hexrays.hpp:1319
bool is_partialy_typed() const
Variable type should be handled as a partial one.
Definition hexrays.hpp:1278
bool is_shared() const
Is lvar mapped to several chains.
Definition hexrays.hpp:1302
int defblk
first block defining the variable.
Definition hexrays.hpp:1231
void set_automapped()
Definition hexrays.hpp:1342
void clr_mapdst_var()
Definition hexrays.hpp:1329
bool is_aliasable(const mba_t *mba) const
Is the variable aliasable?
Definition hexrays.hpp:1410
void set_spoiled_var()
Definition hexrays.hpp:1326
void set_typed()
Definition hexrays.hpp:1307
void clr_notarg()
Definition hexrays.hpp:1341
qstring cmt
variable comment string
Definition hexrays.hpp:1228
void clr_user_type()
Definition hexrays.hpp:1312
void set_dummy_arg()
Definition hexrays.hpp:1338
void clr_automapped()
Definition hexrays.hpp:1343
void hexapi append_list(const mba_t *mba, mlist_t *lst, bool pad_if_scattered=false) const
Append local variable to mlist.
Definition hexrays.hpp:10600
lvar_t(const qstring &n, const vdloc_t &l, ea_t e, const tinfo_t &t, int w, int db)
Definition hexrays.hpp:1236
void set_noptr_var()
Definition hexrays.hpp:1332
bool hexapi set_lvar_type(const tinfo_t &t, bool may_fail=false)
Set variable type Note: this function does not modify the idb, only the lvar instance in the memory.
Definition hexrays.hpp:10588
bool hexapi is_promoted_arg() const
Is the promoted function argument?
Definition hexrays.hpp:10576
bool was_scattered_arg() const
Was lvar transformed from a scattered argument?
Definition hexrays.hpp:1304
void clr_spoiled_var()
Definition hexrays.hpp:1327
bool is_automapped() const
Was the variable automatically mapped to another variable?
Definition hexrays.hpp:1296
bool has_common_bit(const vdloc_t &loc, asize_t width2) const
Does the variable overlap with the specified location?
Definition hexrays.hpp:1359
bool has_regname() const
Has a register name? (like _RAX)
Definition hexrays.hpp:1288
bool mreg_done() const
Have corresponding microregs been replaced by references to this variable?
Definition hexrays.hpp:1248
bool is_used_byref() const
Was the address of the variable taken?
Definition hexrays.hpp:1298
bool has_common(const lvar_t &v) const
Do variables overlap?
Definition hexrays.hpp:1354
bool used() const
Is the variable used in the code?
Definition hexrays.hpp:1244
bool has_user_type() const
Has user-defined type?
Definition hexrays.hpp:1262
bool is_decl_unused() const
Was declared as __unused by the user? See CVAR_UNUSED.
Definition hexrays.hpp:1300
void set_partialy_typed()
Definition hexrays.hpp:1330
void clr_floating_var()
Definition hexrays.hpp:1325
void set_floating_var()
Definition hexrays.hpp:1324
bool is_fake_var() const
Is fake return variable?
Definition hexrays.hpp:1270
void clear_used()
Definition hexrays.hpp:1306
void set_overlapped_var()
Definition hexrays.hpp:1322
qstring name
variable name.
Definition hexrays.hpp:1225
lvar_t()
Definition hexrays.hpp:1235
bool hexapi set_width(int w, int svw_flags=0)
Change the variable width.
Definition hexrays.hpp:10594
void set_split_var()
Definition hexrays.hpp:1336
void clr_decl_unused()
Definition hexrays.hpp:1347
const char *hexapi dstr() const
Definition hexrays.hpp:10570
void clr_user_info()
Definition hexrays.hpp:1309
void set_user_name()
Definition hexrays.hpp:1310
bool is_dummy_arg() const
Is a dummy argument (added to fill a hole in the argument list)
Definition hexrays.hpp:1292
void clr_unknown_width()
Definition hexrays.hpp:1317
bool is_unknown_width() const
Do we know the width of the variable?
Definition hexrays.hpp:1252
void clr_noptr_var()
Definition hexrays.hpp:1333
void clr_dummy_arg()
Definition hexrays.hpp:1339
void set_thisarg()
Definition hexrays.hpp:1334
bool in_asm() const
Is variable used in an instruction translated into __asm?
Definition hexrays.hpp:1290
void set_scattered_arg()
Definition hexrays.hpp:1350
bool is_overlapped_var() const
Is overlapped variable?
Definition hexrays.hpp:1272
bool hexapi accepts_type(const tinfo_t &t, bool may_change_thisarg=false)
Check if the variable accept the specified type.
Definition hexrays.hpp:10582
void clr_thisarg()
Definition hexrays.hpp:1335
bool has_user_name() const
Has user-defined name?
Definition hexrays.hpp:1260
void set_unknown_width()
Definition hexrays.hpp:1316
void set_fake_var()
Definition hexrays.hpp:1320
void set_used_byref()
Definition hexrays.hpp:1344
bool has_user_info() const
Has any user-defined information?
Definition hexrays.hpp:1254
bool is_floating_var() const
Used by a fpu insn?
Definition hexrays.hpp:1274
void set_mapdst_var()
Definition hexrays.hpp:1328
bool is_notarg() const
Is a local variable? (local variable cannot be an input argument)
Definition hexrays.hpp:1294
bool has_nice_name() const
Does the variable have a nice name?
Definition hexrays.hpp:1250
void set_notarg()
Definition hexrays.hpp:1340
void clr_scattered_arg()
Definition hexrays.hpp:1351
void clr_user_name()
Definition hexrays.hpp:1313
void clr_split_var()
Definition hexrays.hpp:1337
void set_user_type()
Definition hexrays.hpp:1311
bool is_thisarg() const
Is 'this' argument of a C++ member function?
Definition hexrays.hpp:1284
bool is_result_var() const
Is the function result?
Definition hexrays.hpp:1264
void clr_partialy_typed()
Definition hexrays.hpp:1331
bool is_split_var() const
Is a split variable?
Definition hexrays.hpp:1286
int width
variable size in bytes
Definition hexrays.hpp:1230
bool is_noptr_var() const
Variable type should not be a pointer.
Definition hexrays.hpp:1280
const tinfo_t & type() const
Get variable type.
Definition hexrays.hpp:1364
bool is_mapdst_var() const
Other variable(s) map to this var?
Definition hexrays.hpp:1282
tinfo_t & type()
Definition hexrays.hpp:1365
void set_final_lvar_type(const tinfo_t &t)
Set final variable type.
Definition hexrays.hpp:1383
Array of micro blocks representing microcode for a decompiled function.
Definition hexrays.hpp:4856
int hexapi for_all_ops(mop_visitor_t &mv)
Visit all operands of all instructions.
Definition hexrays.hpp:11973
merror_t hexapi set_maturity(mba_maturity_t mat)
Set maturity level.
Definition hexrays.hpp:11859
mblock_t *hexapi copy_block(mblock_t *blk, int new_serial, int cpblk_flags=3)
Make a copy of a block.
Definition hexrays.hpp:11955
void hexapi dump() const
Dump microcode to a file.
Definition hexrays.hpp:11901
bool use_frame() const
Definition hexrays.hpp:5139
ea_t entry_ea
Definition hexrays.hpp:5053
mreg_t hexapi alloc_kreg(size_t size, bool check_size=true)
Allocate a kernel register.
Definition hexrays.hpp:12049
bool graph_insns() const
Definition hexrays.hpp:4930
int pfn_flags
copy of func_t::flags
Definition hexrays.hpp:5064
mblock_t ** natural
natural order of blocks
Definition hexrays.hpp:5107
bool lvars_allocated() const
Definition hexrays.hpp:4943
mblock_t * blocks
double linked list of blocks
Definition hexrays.hpp:5106
bool rtype_refined() const
Definition hexrays.hpp:4933
static argloc_t hexapi vd2idaloc(const vdloc_t &loc, int width, sval_t spd)
Definition hexrays.hpp:11831
bool has_over_chains() const
Definition hexrays.hpp:4953
bool generated_asserts() const
Definition hexrays.hpp:4947
sval_t minstkref
The lowest stack location whose address was taken.
Definition hexrays.hpp:5074
mbl_graph_t *hexapi get_graph()
Get control graph.
Definition hexrays.hpp:11877
bool chain_varnums_ok() const
Definition hexrays.hpp:4944
qstring error_strarg
Definition hexrays.hpp:5104
bool lvars_renamed() const
Definition hexrays.hpp:4952
bool is_pattern() const
Definition hexrays.hpp:4938
bool hexapi set_lvar_name(lvar_t &v, const char *name, int flagbits)
Definition hexrays.hpp:12073
argloc_t get_ida_argloc(const lvar_t &v) const
Definition hexrays.hpp:5048
void set_mba_flags(int f)
Definition hexrays.hpp:4966
bool argidx_sorted() const
Definition hexrays.hpp:4956
ivlset_t aliased_memory
aliased_memory+restricted_memory=ALLMEM
Definition hexrays.hpp:5082
static vdloc_t hexapi idaloc2vd(const argloc_t &loc, int width, sval_t spd)
Definition hexrays.hpp:11815
ea_t hexapi map_fict_ea(ea_t fict_ea) const
Resolve a fictional address.
Definition hexrays.hpp:12023
bool hexapi remove_empty_and_unreachable_blocks()
Delete all empty and unreachable blocks.
Definition hexrays.hpp:11961
const char va_list va const
Definition hexrays.hpp:5207
ea_t hexapi alloc_fict_ea(ea_t real_ea)
Allocate a fictional address.
Definition hexrays.hpp:12015
bool short_display() const
Definition hexrays.hpp:4928
merror_t hexapi optimize_global()
Optimize microcode globally.
Definition hexrays.hpp:11889
bool display_valnums() const
Definition hexrays.hpp:4937
int get_mba_flags() const
Definition hexrays.hpp:4964
bool write_to_const_detected() const
Definition hexrays.hpp:5115
vdump_mba(_verify, title, va)
bool prop_complex() const
Definition hexrays.hpp:4963
sval_t stacksize
The maximal size of the function stack including bytes allocated for outgoing call arguments (up to r...
Definition hexrays.hpp:5068
const ivl_t & get_lvars_region() const
Definition hexrays.hpp:5763
mba_ranges_t mbr
Definition hexrays.hpp:5052
void hexapi print(vd_printer_t &vp) const
Print microcode to any destination.
const mblock_t * get_mblock(uint n) const
Get basic block by its serial number.
Definition hexrays.hpp:5238
mlist_t spoiled_list
MBA_SPLINFO && !final_type: info in vd format.
Definition hexrays.hpp:5092
sval_t frregs
size of saved registers range in the stack frame
Definition hexrays.hpp:5062
void set_mba_flags2(int f)
Definition hexrays.hpp:4968
bool use_wingraph32() const
Definition hexrays.hpp:4935
int hexapi for_all_topinsns(minsn_visitor_t &mv)
Visit all top level instructions.
Definition hexrays.hpp:11985
bool deleted_pairs() const
Definition hexrays.hpp:4949
void clr_mba_flags(int f)
Definition hexrays.hpp:4967
int calc_shins_flags() const
Definition hexrays.hpp:4971
sval_t minargref
The lowest stack argument location whose address was taken This location and locations above it can b...
Definition hexrays.hpp:5076
lvars_t vars
local variables
Definition hexrays.hpp:5098
reginfovec_t idb_spoiled
MBA_SPLINFO && final_type: info in ida format.
Definition hexrays.hpp:5091
sval_t frsize
size of local stkvars range in the stack frame
Definition hexrays.hpp:5061
ivl_with_name_t std_ivls[6]
we treat memory as consisting of 6 parts see memreg_index_t
Definition hexrays.hpp:5109
void hexapi get_func_output_lists(mlist_t *return_regs, mlist_t *spoiled, const tinfo_t &type, ea_t call_ea=BADADDR, bool tail_call=false)
Prepare the lists of registers & memory that are defined/killed by a function.
Definition hexrays.hpp:12003
int retvaridx
index of variable holding the return value -1 means none
Definition hexrays.hpp:5100
int fti_flags
FTI_... constants for the current function.
Definition hexrays.hpp:5093
sval_t fullsize
Full stack size including incoming args.
Definition hexrays.hpp:5067
char reserved[]
Definition hexrays.hpp:5133
bool set_nice_lvar_name(lvar_t &v, const char *name)
Definition hexrays.hpp:5443
bool range_contains(ea_t ea) const
Definition hexrays.hpp:5140
bool regargs_is_not_aligned() const
Definition hexrays.hpp:5123
int get_mba_flags2() const
Definition hexrays.hpp:4965
mba_maturity_t maturity
current maturity level
Definition hexrays.hpp:5086
const char * title
Definition hexrays.hpp:5207
sval_t hexapi stkoff_vd2ida(sval_t off) const
Definition hexrays.hpp:11799
int hexapi optimize_local(int locopt_bits)
Optimize each basic block locally.
Definition hexrays.hpp:11865
void hexapi alloc_lvars()
Allocate local variables.
Definition hexrays.hpp:11895
bool is_thunk() const
Definition hexrays.hpp:4939
void hexapi free_kreg(mreg_t reg, size_t size)
Free a kernel register.
Definition hexrays.hpp:12055
const stkpnt_t *hexapi locate_stkpnt(ea_t ea) const
Definition hexrays.hpp:12067
bool is_dtr() const
Definition hexrays.hpp:4961
const ivl_t & get_args_region() const
Definition hexrays.hpp:5773
mba_maturity_t reqmat
required maturity level
Definition hexrays.hpp:5087
bool is_ctr() const
Definition hexrays.hpp:4960
sval_t fpd
frame pointer delta
Definition hexrays.hpp:5063
bool set_user_lvar_name(lvar_t &v, const char *name)
Definition hexrays.hpp:5444
bool valranges_done() const
Definition hexrays.hpp:4954
uchar occurred_warns[32]
Definition hexrays.hpp:5113
bool saverest_done() const
Definition hexrays.hpp:4940
const ivl_t & get_shadow_region() const
Definition hexrays.hpp:5768
const lvar_t & arg(int n) const
Definition hexrays.hpp:5351
bool should_beautify() const
Definition hexrays.hpp:4932
qstring label
name of the function or pattern (colored)
Definition hexrays.hpp:5097
bool has_outlines() const
Definition hexrays.hpp:4959
void hexapi verify(bool always) const
Verify microcode consistency.
rlist_t consumed_argregs
registers converted into stack arguments, should not be used as arguments
Definition hexrays.hpp:5084
void hexapi save_snapshot(const char *description)
Create and save microcode snapshot.
Definition hexrays.hpp:12043
bool hexapi remove_blocks(int start_blk, int end_blk)
Definition hexrays.hpp:11949
bool lvar_names_ok() const
Definition hexrays.hpp:4951
const ivl_t & get_std_region(memreg_index_t idx) const
Get information about various memory regions.
Definition hexrays.hpp:5758
bool has_stack_retval() const
Definition hexrays.hpp:4958
bool optimized() const
Definition hexrays.hpp:4927
AS_PRINTF(3, 0) void hexapi vdump_mba(bool _verify
sval_t tmpstk_size
size of the temporary stack part (which dynamically changes with push/pops)
Definition hexrays.hpp:5059
void clr_mba_flags2(int f)
Definition hexrays.hpp:4969
bool hexapi remove_block(mblock_t *blk)
Delete a block.
Definition hexrays.hpp:11943
void hexapi mark_chains_dirty()
Mark the microcode use-def chains dirty.
tinfo_t idb_type
function type as retrieved from the database
Definition hexrays.hpp:5090
mblock_t * get_mblock(uint n)
Definition hexrays.hpp:5239
bool final_type
is the function type final? (specified by the user)
Definition hexrays.hpp:5089
sval_t spd_adjust
If sp>0, the max positive sp value.
Definition hexrays.hpp:5079
bool code16_bit_removed() const
Definition hexrays.hpp:4957
bool precise_defeas() const
Definition hexrays.hpp:4926
int npurged
-1 - unknown
Definition hexrays.hpp:5057
ea_t error_ea
during microcode generation holds ins.ea
Definition hexrays.hpp:5103
int qty
number of basic blocks
Definition hexrays.hpp:5056
hexwarns_t notes
Definition hexrays.hpp:5112
HEXRAYS_MEMORY_ALLOCATION_FUNCS() void hexapi term()
ivl_t get_stack_region() const
Definition hexrays.hpp:5778
~mba_t()
Definition hexrays.hpp:5135
bool show_reduction() const
Definition hexrays.hpp:4929
func_t *hexapi get_curfunc() const
Definition hexrays.hpp:11853
merror_t hexapi build_graph()
Build control flow graph.
Definition hexrays.hpp:11871
bool bad_call_sp_detected() const
Definition hexrays.hpp:5119
int shadow_args
size of shadow argument area
Definition hexrays.hpp:5066
ea_t last_prolog_ea
Definition hexrays.hpp:5054
callcnv_t cc
calling convention
Definition hexrays.hpp:5058
minsn_t *hexapi create_helper_call(ea_t ea, const char *helper, const tinfo_t *rettype=nullptr, const mcallargs_t *callargs=nullptr, const mop_t *out=nullptr)
Create a call of a helper function.
Definition hexrays.hpp:11997
bool may_refine_rettype() const
Definition hexrays.hpp:4934
mblock_t *hexapi split_block(mblock_t *blk, minsn_t *start_insn)
Split a block: insert a new one after the block, move some instructions to new block.
Definition hexrays.hpp:11937
sval_t argbase() const
Definition hexrays.hpp:5028
bool hexapi merge_blocks()
Merge blocks.
Definition hexrays.hpp:11967
bool common_stkvars_stkargs() const
Definition hexrays.hpp:4950
bool really_alloc() const
Definition hexrays.hpp:4942
bool is_stkarg(const lvar_t &v) const
Definition hexrays.hpp:5038
intvec_t argidx
input arguments (indexes into 'vars')
Definition hexrays.hpp:5099
ssize_t get_stkvar(udm_t *udm, sval_t vd_stkoff, uval_t *p_idaoff=nullptr, tinfo_t *p_frame=nullptr) const
static WARN_UNUSED_RESULT mba_t *hexapi deserialize(const uchar *bytes, size_t nbytes)
Deserialize a byte sequence into mbl array.
Definition hexrays.hpp:12037
bool loaded_gdl() const
Definition hexrays.hpp:4931
int hexapi for_all_insns(minsn_visitor_t &mv)
Visit all instructions.
Definition hexrays.hpp:11979
bool is_snippet() const
Definition hexrays.hpp:5141
int retsize
size of return address in the stack frame
Definition hexrays.hpp:5065
bool returns_fpval() const
Definition hexrays.hpp:4945
bool callinfo_built() const
Definition hexrays.hpp:4941
bool display_numaddrs() const
Definition hexrays.hpp:4936
int hexapi analyze_calls(int acflags)
Analyze calls and determine calling conventions.
Definition hexrays.hpp:11883
merror_t hexapi inline_func(codegen_t &cdg, int blknum, mba_ranges_t &ranges, int decomp_flags=0, int inline_flags=0)
Inline a range.
Definition hexrays.hpp:12061
bool argidx_ok() const
Definition hexrays.hpp:4955
mblock_t *hexapi insert_block(int bblk)
Insert a block in the middle of the mbl array.
Definition hexrays.hpp:11931
void hexapi serialize(bytevec_t &vout) const
Serialize mbl array into a sequence of bytes.
Definition hexrays.hpp:12031
bool propagated_asserts() const
Definition hexrays.hpp:4948
bool is_cdtr() const
Definition hexrays.hpp:4962
mlist_t nodel_memory
global dead elimination may not delete references to this area
Definition hexrays.hpp:5083
sval_t inargoff
offset of the first stack argument; after fix_scattered_movs() INARGOFF may be less than STACKSIZE
Definition hexrays.hpp:5071
void clr_cdtr()
Definition hexrays.hpp:4970
sval_t hexapi stkoff_ida2vd(sval_t off) const
Definition hexrays.hpp:11807
mop_t *hexapi find_mop(op_parent_info_t *ctx, ea_t ea, bool is_dest, const mlist_t &list)
Find an operand in the microcode.
Definition hexrays.hpp:11991
ivlset_t gotoff_stkvars
stkvars that hold .got offsets. considered to be unaliasable
Definition hexrays.hpp:5080
bool has_bad_sp() const
Definition hexrays.hpp:5127
ea_t first_epilog_ea
Definition hexrays.hpp:5055
lvar_t &hexapi arg(int n)
Get input argument of the decompiled function.
Definition hexrays.hpp:12009
bool has_passregs() const
Definition hexrays.hpp:4946
ea_t minstkref_ea
address with lowest minstkref (for debugging)
Definition hexrays.hpp:5075
va_start(va, title)
va_end(va)
ivlset_t restricted_memory
Definition hexrays.hpp:5081
Control flow graph of microcode.
Definition hexrays.hpp:5482
int get_chain_stamp() const
Definition hexrays.hpp:5531
bool is_redefined_globally(const mlist_t &list, int b1, int b2, const minsn_t *m1, const minsn_t *m2, maymust_t maymust=MAY_ACCESS) const
Is LIST redefined in the graph?
Definition hexrays.hpp:5540
graph_chains_t *hexapi get_ud(gctype_t gctype)
Get use-def chains.
Definition hexrays.hpp:12085
graph_chains_t *hexapi get_du(gctype_t gctype)
Get def-use chains.
Definition hexrays.hpp:12091
bool is_ud_chain_dirty(gctype_t gctype)
Is the use-def chain of the specified kind dirty?
Definition hexrays.hpp:5519
bool is_used_globally(const mlist_t &list, int b1, int b2, const minsn_t *m1, const minsn_t *m2, maymust_t maymust=MAY_ACCESS) const
Is LIST used in the graph?
Definition hexrays.hpp:5544
bool is_du_chain_dirty(gctype_t gctype)
Is the def-use chain of the specified kind dirty?
Definition hexrays.hpp:5526
mblock_t * get_mblock(int n) const
Definition hexrays.hpp:5547
Microcode of one basic block.
Definition hexrays.hpp:4184
ea_t end
end address note: we cannot rely on start/end addresses very much because instructions are propagated...
Definition hexrays.hpp:4217
mlist_t dnu
data that is defined but not used in the block
Definition hexrays.hpp:4232
bool lists_ready() const
Definition hexrays.hpp:4253
sval_t minbargref
the same for arguments
Definition hexrays.hpp:4238
HEXRAYS_MEMORY_ALLOCATION_FUNCS() bool empty() const
Definition hexrays.hpp:4272
void mark_lists_dirty()
Definition hexrays.hpp:4248
minsn_t * head
pointer to the first instruction of the block
Definition hexrays.hpp:4221
void hexapi append_use_list(mlist_t *list, const mop_t &op, maymust_t maymust, bitrange_t mask=MAXRANGE) const
Append use-list of an operand.
Definition hexrays.hpp:11723
minsn_t * tail
pointer to the last instruction of the block
Definition hexrays.hpp:4222
minsn_t *hexapi insert_into_block(minsn_t *nm, minsn_t *om)
Insert instruction into the doubly linked list.
friend class codegen_t
Definition hexrays.hpp:4185
vdump_block(title, va)
mblock_type_t type
block type (BLT_NONE - not computed yet)
Definition hexrays.hpp:4225
int serial
block number
Definition hexrays.hpp:4224
intvec_t succset
control flow graph: list of our successors use nsucc() and succ() to access it
Definition hexrays.hpp:4242
void hexapi print(vd_printer_t &vp) const
Print block contents.
Definition hexrays.hpp:11651
void hexapi dump() const
Dump block info.
Definition hexrays.hpp:11657
const minsn_t *hexapi find_redefinition(const mlist_t &list, const minsn_t *i1, const minsn_t *i2, maymust_t maymust=MAY_ACCESS) const
Find the first insn that redefines any part of the list in the insn range.
Definition hexrays.hpp:11757
bool is_branch() const
Definition hexrays.hpp:4613
va_start(va, title)
int hexapi optimize_insn(minsn_t *m, int optflags=OPTI_MINSTKREF|OPTI_COMBINSNS)
Optimize one instruction in the context of the block.
Definition hexrays.hpp:11699
int hexapi for_all_ops(mop_visitor_t &mv)
Visit all operands.
Definition hexrays.hpp:11687
mblock_t()=delete
bool is_used(mlist_t *list, const minsn_t *i1, const minsn_t *i2, maymust_t maymust=MAY_ACCESS) const
Is the list used by the specified instruction range?
Definition hexrays.hpp:4449
minsn_t * find_def(const mop_t &op, minsn_t **p_i1, const minsn_t *i2, int fdflags)
Definition hexrays.hpp:4552
bool is_simple_goto_block() const
Definition hexrays.hpp:4614
const minsn_t *hexapi find_first_use(mlist_t *list, const minsn_t *i1, const minsn_t *i2, maymust_t maymust=MAY_ACCESS) const
Find the first insn that uses the specified list in the insn range.
Definition hexrays.hpp:11751
bool is_nway() const
Definition hexrays.hpp:4612
void request_demote64()
Definition hexrays.hpp:4251
mblock_t * prevb
previous block in the doubly linked list
Definition hexrays.hpp:4190
mlist_t mustbuse
data that must be used by the block
Definition hexrays.hpp:4228
AS_PRINTF(2, 0) void hexapi vdump_block(const char *title
intvec_t predset
control flow graph: list of our predecessors use npred() and pred() to access it
Definition hexrays.hpp:4240
minsn_t *hexapi find_access(const mop_t &op, minsn_t **parent, const minsn_t *mend, int fdflags) const
Find the instruction that accesses the specified operand.
Definition hexrays.hpp:11769
mlist_t maybuse
data that may be used by the block
Definition hexrays.hpp:4229
bool is_simple_jcnd_block() const
Definition hexrays.hpp:4620
bool hexapi is_rhs_redefined(const minsn_t *ins, const minsn_t *i1, const minsn_t *i2) const
Is the right hand side of the instruction redefined the insn range?
Definition hexrays.hpp:11763
mlist_t hexapi build_def_list(const minsn_t &ins, maymust_t maymust) const
Build def-list of an instruction.
Definition hexrays.hpp:11743
mlist_t maybdef
data that may be defined by the block
Definition hexrays.hpp:4231
int make_lists_ready()
Definition hexrays.hpp:4254
int npred() const
Get number of block predecessors.
Definition hexrays.hpp:4262
mlist_t dead_at_start
data that is dead at the block entry
Definition hexrays.hpp:4227
int hexapi optimize_useless_jump()
Remove a jump at the end of the block if it is useless.
Definition hexrays.hpp:11717
bool hexapi get_valranges(valrng_t *res, const vivl_t &vivl, int vrflags) const
Find possible values for a block.
Definition hexrays.hpp:11775
char reserved[]
Definition hexrays.hpp:4246
mlist_t mustbdef
data that must be defined by the block
Definition hexrays.hpp:4230
bool is_unknown_call() const
Definition hexrays.hpp:4611
int hexapi for_all_insns(minsn_visitor_t &mv)
Visit all instructions.
Definition hexrays.hpp:11681
int pred(int n) const
Definition hexrays.hpp:4266
sval_t maxbsp
maximal sp value in the block (0...stacksize)
Definition hexrays.hpp:4234
minsn_t * find_first_use(mlist_t *list, minsn_t *i1, const minsn_t *i2, maymust_t maymust=MAY_ACCESS) const
Definition hexrays.hpp:4464
uint32 flags
combination of Basic block properties bits
Definition hexrays.hpp:4191
bool is_redefined(const mlist_t &list, const minsn_t *i1, const minsn_t *i2, maymust_t maymust=MAY_ACCESS) const
Is the list redefined by the specified instructions?
Definition hexrays.hpp:4479
minsn_t * find_redefinition(const mlist_t &list, minsn_t *i1, const minsn_t *i2, maymust_t maymust=MAY_ACCESS) const
Definition hexrays.hpp:4501
void hexapi append_def_list(mlist_t *list, const mop_t &op, maymust_t maymust) const
Append def-list of an operand.
Definition hexrays.hpp:11729
bool needs_propagation() const
Definition hexrays.hpp:4250
int nsucc() const
Get number of block successors.
Definition hexrays.hpp:4264
void make_nop(minsn_t *m)
Erase the instruction (convert it to nop) and mark the lists dirty.
Definition hexrays.hpp:4603
int hexapi optimize_block()
Optimize a basic block.
Definition hexrays.hpp:11705
sval_t minbstkref
lowest stack location accessible with indirect addressing (offset from the stack bottom) initially it...
Definition hexrays.hpp:4235
mba_t * mba
the parent micro block array
Definition hexrays.hpp:4223
minsn_t *hexapi remove_from_block(minsn_t *m)
Remove instruction from the doubly linked list.
Definition hexrays.hpp:11675
bool lists_dirty() const
Definition hexrays.hpp:4252
va_list va const
Definition hexrays.hpp:4284
minsn_t * find_use(const mop_t &op, minsn_t **p_i1, const minsn_t *i2, int fdflags)
Definition hexrays.hpp:4560
bool is_call_block() const
Definition hexrays.hpp:4610
mblock_t * nextb
next block in the doubly linked list
Definition hexrays.hpp:4189
int hexapi build_lists(bool kill_deads)
Build def-use lists and eliminate deads.
Definition hexrays.hpp:11711
mlist_t hexapi build_use_list(const minsn_t &ins, maymust_t maymust) const
Build use-list of an instruction.
Definition hexrays.hpp:11735
int succ(int n) const
Definition hexrays.hpp:4268
int hexapi for_all_uses(mlist_t *list, minsn_t *i1, minsn_t *i2, mlist_mop_visitor_t &mmv)
Visit all operands that use LIST.
Definition hexrays.hpp:11693
virtual ~mblock_t()
size_t hexapi get_reginsn_qty() const
Calculate number of regular instructions in the block.
Definition hexrays.hpp:11787
void request_propagation()
Definition hexrays.hpp:4249
A call argument.
Definition hexrays.hpp:3149
const char *hexapi dstr() const
Definition hexrays.hpp:11331
void set_regarg(mreg_t mr, char dt, type_sign_t sign=type_unsigned)
Definition hexrays.hpp:3168
uint32 flags
FAI_...
Definition hexrays.hpp:3156
void make_uint(int val, ea_t val_ea, int opno=0)
Definition hexrays.hpp:3178
void copy_mop(const mop_t &op)
Definition hexrays.hpp:3160
void set_regarg(mreg_t mr, const tinfo_t &tif)
Definition hexrays.hpp:3164
void hexapi set_regarg(mreg_t mr, int sz, const tinfo_t &tif)
Definition hexrays.hpp:11337
tinfo_t type
formal argument type
Definition hexrays.hpp:3153
argloc_t argloc
ida argloc
Definition hexrays.hpp:3155
void hexapi print(qstring *vout, int shins_flags=SHINS_SHORT|SHINS_VALNUM) const
Definition hexrays.hpp:11325
ea_t ea
address where the argument was initialized.
Definition hexrays.hpp:3151
void make_int(int val, ea_t val_ea, int opno=0)
Definition hexrays.hpp:3173
mcallarg_t()
Definition hexrays.hpp:3158
qstring name
formal argument name
Definition hexrays.hpp:3154
mcallarg_t(const mop_t &rarg)
Definition hexrays.hpp:3159
Information about a call.
Definition hexrays.hpp:3264
mcallargs_t args
call arguments
Definition hexrays.hpp:3272
mcallinfo_t(ea_t _callee=BADADDR, int _sargs=0)
Definition hexrays.hpp:3311
int flags
combination of Call properties... bits
Definition hexrays.hpp:3287
int call_spd
sp value at call insn
Definition hexrays.hpp:3269
mlist_t return_regs
list of values returned by the function
Definition hexrays.hpp:3278
void hexapi print(qstring *vout, int size=-1, int shins_flags=SHINS_SHORT|SHINS_VALNUM) const
Definition hexrays.hpp:11363
ivlset_t visible_memory
what memory is visible to the call?
Definition hexrays.hpp:3282
HEXRAYS_MEMORY_ALLOCATION_FUNCS() int hexapi lexcompare(const mcallinfo_t &f) const
const char *hexapi dstr() const
Definition hexrays.hpp:11369
mlist_t spoiled
list of spoiled locations (includes return_regs)
Definition hexrays.hpp:3279
ea_t callee
address of the called function, if known
Definition hexrays.hpp:3266
type_attrs_t fti_attrs
extended function attributes
Definition hexrays.hpp:3309
mlist_t dead_regs
registers defined by the function but never used.
Definition hexrays.hpp:3283
mopvec_t retregs
return register(s) (e.g., AX, AX:DX, etc.) this vector is built from return_regs
Definition hexrays.hpp:3273
bool is_vararg() const
Definition hexrays.hpp:3319
funcrole_t role
function role
Definition hexrays.hpp:3308
tinfo_t return_type
type of the returned value
Definition hexrays.hpp:3275
int stkargs_top
first offset past stack arguments
Definition hexrays.hpp:3270
callcnv_t cc
calling convention
Definition hexrays.hpp:3271
argloc_t return_argloc
location of the returned value
Definition hexrays.hpp:3276
int solid_args
number of solid args.
Definition hexrays.hpp:3267
tinfo_t hexapi get_type() const
Definition hexrays.hpp:11355
mlist_t pass_regs
passthrough registers: registers that depend on input values (subset of spoiled)
Definition hexrays.hpp:3280
bool hexapi set_type(const tinfo_t &type)
Definition hexrays.hpp:11349
List of switch cases and targets.
Definition hexrays.hpp:3326
size_t size() const
Definition hexrays.hpp:3335
void resize(int s)
Definition hexrays.hpp:3336
casevec_t values
expression values for each target
Definition hexrays.hpp:3328
DECLARE_COMPARISONS(mcases_t)
intvec_t targets
target block numbers
Definition hexrays.hpp:3329
void swap(mcases_t &r)
Definition hexrays.hpp:3331
HEXRAYS_MEMORY_ALLOCATION_FUNCS() bool empty() const
Definition hexrays.hpp:3333
void hexapi print(qstring *vout) const
Definition hexrays.hpp:11381
const char *hexapi dstr() const
Definition hexrays.hpp:11387
Microinstruction class insn.
Definition hexrays.hpp:3604
void set_wild_match()
Definition hexrays.hpp:3693
bool is_ignlowsrc() const
Definition hexrays.hpp:3670
minsn_t * find_ins_op(mop_t **other, mcode_t op=m_nop)
Definition hexrays.hpp:3872
void hexapi set_combined()
Definition hexrays.hpp:11479
bool is_tailcall() const
Definition hexrays.hpp:3664
int hexapi optimize_subtree(mblock_t *blk, minsn_t *top, minsn_t *parent, ea_t *converted_call, int optflags=OPTI_MINSTKREF)
Optimize instruction in its context.
Definition hexrays.hpp:11509
bool is_wild_match() const
Definition hexrays.hpp:3668
bool was_split() const
Definition hexrays.hpp:3675
void set_farcall()
Definition hexrays.hpp:3683
bool is_propagatable() const
Definition hexrays.hpp:3669
void set_assert()
Definition hexrays.hpp:3690
void set_ignlowsrc()
Definition hexrays.hpp:3695
void clr_ignlowsrc()
Definition hexrays.hpp:3696
mop_t r
right operand
Definition hexrays.hpp:3614
minsn_t * prev
prev insn in doubly linked list. check also previ()
Definition hexrays.hpp:3611
bool hexapi is_noret_call(int flags=0)
Is a non-returing call?
Definition hexrays.hpp:11545
void set_split_size(int s)
Definition hexrays.hpp:3706
void set_noret_icall()
Definition hexrays.hpp:3698
void set_combinable()
Definition hexrays.hpp:3702
bool hexapi may_use_aliased_memory() const
Is it possible for the instruction to use aliased memory?
Definition hexrays.hpp:11599
bool contains_opcode(mcode_t mcode) const
Does the instruction have the specified opcode?
Definition hexrays.hpp:3858
minsn_t * next
next insn in doubly linked list. check also nexti()
Definition hexrays.hpp:3610
bool modifies_pair_mop() const
Definition hexrays.hpp:3888
bool is_multimov() const
Definition hexrays.hpp:3673
int hexapi lexcompare(const minsn_t &ri) const
Definition hexrays.hpp:11539
void set_extstx()
Definition hexrays.hpp:3685
bool contains_call(bool with_helpers=false) const
Does the instruction contain a call?
Definition hexrays.hpp:3836
bool is_combined() const
Definition hexrays.hpp:3660
int hexapi for_all_insns(minsn_visitor_t &mv)
Visit all instructions.
Definition hexrays.hpp:11521
bool hexapi has_side_effects(bool include_ldx_and_divs=false) const
Does the instruction have a side effect?
Definition hexrays.hpp:11563
funcrole_t get_role() const
Get the function role of a call.
Definition hexrays.hpp:3845
void set_unmerged()
Definition hexrays.hpp:3705
const minsn_t *hexapi find_ins_op(const mop_t **other, mcode_t op=m_nop) const
Find an operand that is a subinsruction with the specified opcode.
Definition hexrays.hpp:11575
int get_split_size() const
Definition hexrays.hpp:3714
void clr_noret_icall()
Definition hexrays.hpp:3699
bool is_mbarrier() const
Definition hexrays.hpp:3676
void clr_propagatable()
Definition hexrays.hpp:3694
void clr_fpinsn()
Definition hexrays.hpp:3689
void hexapi setaddr(ea_t new_ea)
Change the instruction address.
Definition hexrays.hpp:11503
bool is_farcall() const
Definition hexrays.hpp:3661
ea_t ea
instruction address
Definition hexrays.hpp:3612
bool is_memcpy() const
Definition hexrays.hpp:3846
void hexapi print(qstring *vout, int shins_flags=SHINS_SHORT|SHINS_VALNUM) const
Generate insn text into the buffer.
Definition hexrays.hpp:11491
bool is_readflags() const
Definition hexrays.hpp:3850
bool hexapi modifies_d() const
Does the instruction modify its 'd' operand?
Definition hexrays.hpp:11587
bool is_inverted_jx() const
Definition hexrays.hpp:3671
bool is_persistent() const
Definition hexrays.hpp:3667
minsn_t(ea_t _ea)
Constructor.
Definition hexrays.hpp:3721
mop_t l
left operand
Definition hexrays.hpp:3613
bool is_like_move() const
Definition hexrays.hpp:3883
int optimize_solo(int optflags=0)
Optimize one instruction without context.
Definition hexrays.hpp:3751
bool was_noret_icall() const
Definition hexrays.hpp:3672
bool is_cleaning_pop() const
Definition hexrays.hpp:3662
void set_fpinsn()
Definition hexrays.hpp:3688
void clr_combined()
Definition hexrays.hpp:3682
bool hexapi is_between(const minsn_t *m1, const minsn_t *m2) const
Is the instruction in the specified range of instructions?
Definition hexrays.hpp:11593
bool was_unmerged() const
Definition hexrays.hpp:3677
void set_persistent()
Definition hexrays.hpp:3692
const mop_t *hexapi find_num_op(const mop_t **other) const
Find a numeric operand of the current instruction.
Definition hexrays.hpp:11581
HEXRAYS_MEMORY_ALLOCATION_FUNCS() minsn_t &operator
Assignment operator. It does not copy prev/next fields.
void set_tailcall()
Definition hexrays.hpp:3686
int hexapi for_all_ops(mop_visitor_t &mv)
Visit all instruction operands.
Definition hexrays.hpp:11515
bool is_alloca() const
Definition hexrays.hpp:3848
bool is_fpinsn() const
Definition hexrays.hpp:3665
minsn_t(const minsn_t &m)
Definition hexrays.hpp:3722
bool is_after(const minsn_t *m) const
Is the instruction after the specified one?
Definition hexrays.hpp:3899
bool is_memset() const
Definition hexrays.hpp:3847
int hexapi serialize(bytevec_t *b) const
Serialize an instruction.
Definition hexrays.hpp:11605
void clr_multimov()
Definition hexrays.hpp:3701
mop_t d
destination operand
Definition hexrays.hpp:3615
bool is_unknown_call() const
Is an unknown call?
Definition hexrays.hpp:3822
void clr_tailcall()
Definition hexrays.hpp:3687
bool is_extstx() const
Definition hexrays.hpp:3663
minsn_t *hexapi find_call(bool with_helpers=false) const
Find a call instruction.
Definition hexrays.hpp:11557
bool is_assert() const
Definition hexrays.hpp:3666
bool hexapi equal_insns(const minsn_t &m, int eqflags) const
Compare instructions.
Definition hexrays.hpp:11533
bool was_unpaired() const
Definition hexrays.hpp:3678
void set_cleaning_pop()
Definition hexrays.hpp:3684
const minsn_t * find_opcode(mcode_t mcode) const
Find a (sub)insruction with the specified opcode.
Definition hexrays.hpp:3862
mop_t * find_num_op(mop_t **other)
Definition hexrays.hpp:3880
const char *hexapi dstr() const
Get displayable text without tags in a static buffer.
Definition hexrays.hpp:11497
bool is_bswap() const
Definition hexrays.hpp:3849
bool is_combinable() const
Definition hexrays.hpp:3674
void set_multimov()
Definition hexrays.hpp:3700
void set_optional()
Definition hexrays.hpp:3680
bool hexapi is_helper(const char *name) const
Is a helper call with the specified name?
Definition hexrays.hpp:11551
void hexapi _make_nop()
Convert instruction to nop.
Definition hexrays.hpp:11527
void set_mbarrier()
Definition hexrays.hpp:3704
bool is_optional() const
Definition hexrays.hpp:3659
void clr_combinable()
Definition hexrays.hpp:3703
mcode_t opcode
instruction opcode
Definition hexrays.hpp:3608
void clr_assert()
Definition hexrays.hpp:3691
bool is_mov() const
Definition hexrays.hpp:3882
bool hexapi deserialize(const uchar *bytes, size_t nbytes, int format_version)
Deserialize an instruction.
Definition hexrays.hpp:11611
int iprops
combination of instruction property bits bits
Definition hexrays.hpp:3609
void set_inverted_jx()
Definition hexrays.hpp:3697
Address of an operand (mop_l, mop_v, mop_S, mop_r)
Definition hexrays.hpp:3119
mop_addr_t(const mop_addr_t &ra)
Definition hexrays.hpp:3125
mop_addr_t & operator=(const mop_addr_t &rop)
Definition hexrays.hpp:3130
int lexcompare(const mop_addr_t &ra) const
Definition hexrays.hpp:3137
int outsize
Definition hexrays.hpp:3122
mop_addr_t()
Definition hexrays.hpp:3124
mop_addr_t(const mop_t &ra, int isz, int osz)
Definition hexrays.hpp:3127
int insize
Definition hexrays.hpp:3121
Pair of operands.
Definition hexrays.hpp:3110
mop_t lop
low operand
Definition hexrays.hpp:3112
mop_t hop
high operand
Definition hexrays.hpp:3113
A microinstruction operand.
Definition hexrays.hpp:2564
int64 signed_value() const
Definition hexrays.hpp:2969
bool is_one() const
Definition hexrays.hpp:2988
void hexapi _make_gvar(ea_t ea)
Create a global variable operand without erasing previous data.
Definition hexrays.hpp:11187
bool double_size(side_effect_t sideff=WITH_SIDEFF)
Definition hexrays.hpp:3076
bool is_for_abi() const
Definition hexrays.hpp:2627
friend int lexcompare(const mop_t &a, const mop_t &b)
Definition hexrays.hpp:2939
int b
Definition hexrays.hpp:2604
bool is_negative_constant() const
Definition hexrays.hpp:2994
HEXRAYS_MEMORY_ALLOCATION_FUNCS() void zero()
Definition hexrays.hpp:2651
bool has_side_effects(bool include_ldx_and_divs=false) const
Has any side effects?
Definition hexrays.hpp:5703
uint8 oprops
Operand properties.
Definition hexrays.hpp:2571
bool is_insn() const
Is a sub-instruction?
Definition hexrays.hpp:2888
int hexapi for_all_ops(mop_visitor_t &mv, const tinfo_t *type=nullptr, bool is_target=false)
Visit the operand and all its sub-operands.
Definition hexrays.hpp:11253
void make_reg(mreg_t reg, int _size)
Definition hexrays.hpp:2744
bool hexapi is_constant(uint64 *out=nullptr, bool is_signed=true) const
Retrieve value of a constant integer operand.
Definition hexrays.hpp:11265
uint64 unsigned_value() const
Definition hexrays.hpp:2970
bool hexapi is_zero_extended_from(int nbytes) const
Does the high part of the operand consist of zero bytes?
Definition hexrays.hpp:11235
mopt_t t
Operand type.
Definition hexrays.hpp:2568
bool is_reg() const
Is a register operand?
Definition hexrays.hpp:2860
void hexapi create_from_insn(const minsn_t *m)
Create operand from an instruction.
Definition hexrays.hpp:11169
~mop_t()
Definition hexrays.hpp:2647
bool hexapi create_from_mlist(mba_t *mba, const mlist_t &lst, sval_t fullsize)
Create operand from mlist_t.
Definition hexrays.hpp:11145
void hexapi make_reg_pair(int loreg, int hireg, int halfsize)
Create pair of registers.
Definition hexrays.hpp:11199
bool is_mblock() const
Is a block reference?
Definition hexrays.hpp:2876
bool is_glbaddr_from_fixup() const
Definition hexrays.hpp:2637
bool is_lowaddr() const
Definition hexrays.hpp:2626
void _make_lvar(mba_t *mba, int idx, sval_t off=0)
Create a local variable operand.
Definition hexrays.hpp:2752
bool is_pcval() const
Definition hexrays.hpp:2633
bool hexapi make_low_half(int width)
Make the low part of the operand.
Definition hexrays.hpp:11277
bool hexapi get_stkoff(sval_t *p_vdoff) const
Get the referenced stack offset.
Definition hexrays.hpp:11271
uint16 valnum
Value number.
Definition hexrays.hpp:2587
bool empty() const
Definition hexrays.hpp:2853
void set_udt()
Definition hexrays.hpp:2618
ssize_t get_stkvar(udm_t *udm=nullptr, uval_t *p_idaoff=nullptr) const
Retrieve the referenced stack variable.
Definition hexrays.hpp:3007
void _make_blkref(int blknum)
Create a block reference operand without erasing previous data.
Definition hexrays.hpp:2797
int size
Operand size.
Definition hexrays.hpp:2591
bool hexapi preserve_side_effects(mblock_t *blk, minsn_t *top, bool *moved_calls=nullptr)
Move subinstructions with side effects out of the operand.
Definition hexrays.hpp:11313
bool is_glbvar() const
Is a global variable?
Definition hexrays.hpp:2855
bool hexapi equal_mops(const mop_t &rop, int eqflags) const
Compare operands.
Definition hexrays.hpp:11241
mop_addr_t * a
Definition hexrays.hpp:2607
char * helper
Definition hexrays.hpp:2608
void hexapi print(qstring *vout, int shins_flags=SHINS_SHORT|SHINS_VALNUM) const
Definition hexrays.hpp:11133
bool hexapi change_size(int nsize, side_effect_t sideff=WITH_SIDEFF)
Change the operand size.
Definition hexrays.hpp:11307
bool is_reg(mreg_t _r) const
Is the specified register?
Definition hexrays.hpp:2862
const minsn_t * get_insn(mcode_t code) const
Get subinstruction of the operand.
Definition hexrays.hpp:5717
mnumber_t * nnn
Definition hexrays.hpp:2600
mcases_t * c
Definition hexrays.hpp:2610
bool hexapi make_fpnum(const void *bytes, size_t _size)
Create a floating point constant operand.
Definition hexrays.hpp:11181
void _make_cases(mcases_t *_cases)
Create a 'switch cases' operand without erasing previous data.
Definition hexrays.hpp:2835
void set_lowaddr()
Definition hexrays.hpp:2620
void make_insn(minsn_t *ins)
Create a nested instruction.
Definition hexrays.hpp:2791
scif_t * scif
Definition hexrays.hpp:2613
void hexapi make_number(uint64 _value, int _size, ea_t _ea=BADADDR, int opnum=0)
Create an integer constant operand.
Definition hexrays.hpp:11175
bool is_arglist() const
Is a list of arguments?
Definition hexrays.hpp:2866
bool is_impptr_done() const
Definition hexrays.hpp:2622
bool is_equal_to(uint64 n, bool is_signed=true) const
Definition hexrays.hpp:2982
mop_t(const mop_t &rop)
Definition hexrays.hpp:2643
bool hexapi make_first_half(int width)
Make the first part of the operand.
Definition hexrays.hpp:11289
bool is_stkvar() const
Is a stack variable?
Definition hexrays.hpp:2857
void make_stkvar(mba_t *mba, sval_t off)
Definition hexrays.hpp:2776
void set_impptr_done()
Definition hexrays.hpp:2617
bool hexapi is_sign_extended_from(int nbytes) const
Does the high part of the operand consist of the sign bytes?
Definition hexrays.hpp:11229
void set_for_abi()
Definition hexrays.hpp:2621
bool hexapi make_high_half(int width)
Make the high part of the operand.
Definition hexrays.hpp:11283
const char *hexapi dstr() const
Definition hexrays.hpp:11139
bool operator!=(const mop_t &rop) const
Definition hexrays.hpp:2934
uint64 value(bool is_signed) const
Retrieve value of a constant integer operand.
Definition hexrays.hpp:2968
void apply_xds(ea_t ea, int newsize)
Definition hexrays.hpp:3104
bool is_undef_val() const
Definition hexrays.hpp:2625
bool is_glbaddr() const
Is address of a global memory cell?
Definition hexrays.hpp:5727
void _make_reg(mreg_t reg)
Create a register operand without erasing previous data.
Definition hexrays.hpp:2731
mcallinfo_t * f
Definition hexrays.hpp:2605
bool is_scattered() const
Is a scattered operand?
Definition hexrays.hpp:2880
void hexapi erase()
Definition hexrays.hpp:11127
void _make_insn(minsn_t *ins)
Create a nested instruction without erasing previous data.
Definition hexrays.hpp:5697
void _make_strlit(const char *str)
Create a constant string operand.
Definition hexrays.hpp:2811
mop_t & operator=(const mop_t &rop)
Definition hexrays.hpp:2645
bool is_kreg() const
Is a kernel register?
Definition hexrays.hpp:5708
bool is_cc() const
Is a condition code?
Definition hexrays.hpp:2868
bool is_reg(mreg_t _r, int _size) const
Is the specified register of the specified size?
Definition hexrays.hpp:2864
void hexapi swap(mop_t &rop)
Definition hexrays.hpp:11121
int hexapi for_all_scattered_submops(scif_visitor_t &sv) const
Visit all sub-operands of a scattered operand.
Definition hexrays.hpp:11259
bool is_bit_reg() const
Definition hexrays.hpp:2872
bool is_zero() const
Definition hexrays.hpp:2987
bool hexapi create_from_ivlset(mba_t *mba, const ivlset_t &ivs, sval_t fullsize)
Create operand from ivlset_t.
Definition hexrays.hpp:11151
void make_reg(mreg_t reg)
Create a register operand.
Definition hexrays.hpp:2743
bool is_extended_from(int nbytes, bool is_signed) const
Does the high part of the operand consist of zero or sign bytes?
Definition hexrays.hpp:2917
bool hexapi shift_mop(int offset)
Shift the operand.
Definition hexrays.hpp:11301
mop_t &hexapi assign(const mop_t &rop)
Definition hexrays.hpp:11115
bool is_positive_constant() const
Definition hexrays.hpp:2989
bool is_udt() const
Definition hexrays.hpp:2623
mop_pair_t * pair
Definition hexrays.hpp:2612
mreg_t r
Definition hexrays.hpp:2599
void _make_stkvar(mba_t *mba, sval_t off)
Create a stack variable operand.
Definition hexrays.hpp:2771
bool is_stkaddr() const
Is address of a stack variable?
Definition hexrays.hpp:5737
mop_t(mreg_t _r, int _s)
Definition hexrays.hpp:2644
bool hexapi is01() const
Are the possible values of the operand only 0 and 1?
Definition hexrays.hpp:11223
void set_undef_val()
Definition hexrays.hpp:2619
fnumber_t * fpc
Definition hexrays.hpp:2611
ea_t g
Definition hexrays.hpp:2603
mop_t()
Definition hexrays.hpp:2642
void _make_strlit(qstring *str)
Definition hexrays.hpp:2816
bool operator==(const mop_t &rop) const
Definition hexrays.hpp:2933
bool is_ccflags() const
Definition hexrays.hpp:2628
char * cstr
Definition hexrays.hpp:2609
void hexapi make_helper(const char *name)
Create a helper operand.
Definition hexrays.hpp:11205
minsn_t * d
Definition hexrays.hpp:2601
void hexapi create_from_vdloc(mba_t *mba, const vdloc_t &loc, int _size)
Create operand from vdloc_t.
Definition hexrays.hpp:11157
void make_blkref(int blknum)
Create a global variable operand.
Definition hexrays.hpp:2803
void _make_callinfo(mcallinfo_t *fi)
Create a call info operand without erasing previous data.
Definition hexrays.hpp:2826
stkvar_ref_t * s
Definition hexrays.hpp:2602
void _make_reg(mreg_t reg, int _size)
Definition hexrays.hpp:2736
bool hexapi make_second_half(int width)
Make the second part of the operand.
Definition hexrays.hpp:11295
void erase_but_keep_size()
Definition hexrays.hpp:2655
lvar_ref_t * l
Definition hexrays.hpp:2606
bool probably_floating() const
Definition hexrays.hpp:2624
void hexapi create_from_scattered_vdloc(mba_t *mba, const char *name, tinfo_t type, const vdloc_t &loc)
Create operand from scattered vdloc_t.
Definition hexrays.hpp:11163
void hexapi apply_ld_mcode(mcode_t mcode, ea_t ea, int newsize)
Apply a unary opcode to the operand.
Definition hexrays.hpp:11319
void update_numop_value(uint64 val)
Definition hexrays.hpp:2971
void hexapi make_gvar(ea_t ea)
Create a global variable operand.
Definition hexrays.hpp:11193
bool is_mblock(int serial) const
Is a block reference to the specified block?
Definition hexrays.hpp:2878
void apply_xdu(ea_t ea, int newsize)
Definition hexrays.hpp:3103
void _make_pair(mop_pair_t *_pair)
Create a pair operand without erasing previous data.
Definition hexrays.hpp:2844
bool hexapi may_use_aliased_memory() const
Is it possible for the operand to use aliased memory?
Definition hexrays.hpp:11217
Definition hexrays.hpp:1864
node_bitset_t(int node)
Definition hexrays.hpp:1867
node_bitset_t()
Definition hexrays.hpp:1866
Node ordering in a graph.
Definition gdl.hpp:142
A flow chart for a function, or a set of address ranges.
Definition gdl.hpp:443
Linked list Note: linked list is not movable!
Definition pro.h:4038
Smart pointer to objects derived from qrefcnt_obj_t.
Definition pro.h:2920
Reimplementation of stack class from STL.
Definition pro.h:2774
Reimplementation of vector class from STL.
Definition pro.h:2250
const Ivl * const_iterator
Definition pro.h:2607
void swap(qvector< T > &r) noexcept
Replace all attributes of this qvector with that of 'r', and vice versa.
Definition pro.h:2560
iterator end(void)
Get an iterator that points to the end of the qvector (NOT the last element)
Definition pro.h:2610
qvector(void)
Definition pro.h:2328
lvar_saved_info_t * iterator
Definition pro.h:2606
iterator begin(void)
Get an iterator that points to the first element in the qvector.
Definition pro.h:2609
void push_back(ea_t &&x)
Definition pro.h:2361
Definition hexrays.hpp:2048
const char *hexapi dstr() const
Definition hexrays.hpp:10957
rlist_t & operator=(const rlist_t &)=default
rlist_t(mreg_t reg, int width)
Definition hexrays.hpp:2052
rlist_t()
Definition hexrays.hpp:2050
rlist_t(const rlist_t &m)
Definition hexrays.hpp:2051
void hexapi print(qstring *vout) const
Definition hexrays.hpp:10951
~rlist_t()
Definition hexrays.hpp:2053
Used to manage arguments that are described by multiple locations (also see ALOC_DIST)
Definition typeinf.hpp:1343
Definition hexrays.hpp:2261
friend class simple_graph_t
Definition hexrays.hpp:2262
bool operator==(const iterator &n) const
Definition hexrays.hpp:2266
bool operator!=(const iterator &n) const
Definition hexrays.hpp:2267
int operator*() const
Definition hexrays.hpp:2268
Definition hexrays.hpp:2222
void calc_outgoing_edges(const intvec_t &sub, edgevec_t &el) const
int front() const
Definition hexrays.hpp:2273
void inc(iterator &p, int n=1) const
Definition hexrays.hpp:2274
void hexapi compute_dominators(array_of_node_bitset_t &domin, bool post=false) const
Definition hexrays.hpp:11043
void find_reaching_nodes(int n, node_bitset_t &reaching) const
bool colored_gdl_edges
Definition hexrays.hpp:2231
void hexapi compute_immediate_dominators(const array_of_node_bitset_t &domin, intvec_t &idomin, bool post=false) const
Definition hexrays.hpp:11049
void depth_first_postorder(node_ordering_t *post, edge_mapper_t *et) const
iterator begin() const
Definition hexrays.hpp:2271
bool path_exists(int m, int n) const
bool path_back(const array_of_node_bitset_t &domin, int m, int n) const
void compute_dominator_info(struct dominator_info_t &di)
intvec_t find_dead_nodes() const
iterator const_iterator
Definition hexrays.hpp:2270
bool path_back(const edge_mapper_t &et, int m, int n) const
int const newapi
Definition hexrays.hpp:2235
void depth_first_postorder_for_all_entries(node_ordering_t *post) const
int hexapi depth_first_preorder(node_ordering_t *pre) const
Definition hexrays.hpp:11055
bool is_connected_without(const edge_t &forbidden_edge, const intvec_t &dead_nodes) const
qstring title
Definition hexrays.hpp:2230
int hexapi depth_first_postorder(node_ordering_t *post) const
Definition hexrays.hpp:11061
virtual int hexapi goup(int node) const newapi
Definition hexrays.hpp:11067
HEXRAYS_MEMORY_ALLOCATION_FUNCS() virtual bool ignore_edge(int
iterator end() const
Definition hexrays.hpp:2272
Primary mechanism for managing type information.
Definition typeinf.hpp:3046
bool create_typedef(const typedef_type_data_t &p, type_t decl_type=BTF_TYPEDEF, bool try_ordinal=true)
Definition typeinf.hpp:3893
void swap(tinfo_t &r)
Assign this = r and r = this.
Definition typeinf.hpp:3195
size_t get_size(uint32 *p_effalign=nullptr, int gts_code=0) const
Get the type size in bytes.
Definition typeinf.hpp:3317
Abstract class: User-defined call generator derived classes should implement method 'match'.
Definition hexrays.hpp:1762
~udc_filter_t()
Definition hexrays.hpp:1766
virtual bool match(codegen_t &cdg) override=0
return true if the filter object should be applied to given instruction
bool hexapi init(const char *decl)
Definition hexrays.hpp:10691
void hexapi cleanup()
Cleanup the filter This function properly clears type information associated to this filter.
Definition hexrays.hpp:10685
bool empty() const
Definition hexrays.hpp:1778
virtual merror_t hexapi apply(codegen_t &cdg) override
generate microcode for an instruction
Definition hexrays.hpp:10697
Definition hexrays.hpp:376
void set_unk()
Definition hexrays.hpp:428
void hexapi set_cmp(cmpop_t cmp, uvlr_t _value)
Definition hexrays.hpp:10286
DEFINE_MEMORY_ALLOCATION_FUNCS() void set_none()
Definition hexrays.hpp:424
const char *hexapi dstr() const
Definition hexrays.hpp:10328
uvlr_t max_svalue() const
Definition hexrays.hpp:461
valrng_t(int size_=MAX_VLR_SIZE)
Definition hexrays.hpp:417
bool hexapi cvt_to_single_value(uvlr_t *v) const
Definition hexrays.hpp:10334
bool is_unknown() const
Definition hexrays.hpp:449
bool empty() const
Definition hexrays.hpp:447
char reserved[sizeof(qvector< int >)]
Definition hexrays.hpp:409
uvlr_t zeroes
Definition hexrays.hpp:406
bool hexapi unite_with(const valrng_t &r)
Definition hexrays.hpp:10304
void hexapi set_eq(uvlr_t v)
Definition hexrays.hpp:10280
void hexapi copy(const valrng_t &r)
Definition hexrays.hpp:10262
void swap(valrng_t &r)
Definition hexrays.hpp:422
int size
Definition hexrays.hpp:392
int flags
Definition hexrays.hpp:378
bool hexapi has(uvlr_t v) const
Definition hexrays.hpp:10316
uvlr_t value
Definition hexrays.hpp:399
DECLARE_COMPARISONS(valrng_t)
valrng_t(const valrng_t &r)
Definition hexrays.hpp:419
void set_all()
Definition hexrays.hpp:427
int get_size() const
Definition hexrays.hpp:458
void hexapi print(qstring *vout) const
Definition hexrays.hpp:10322
bool all_values() const
Definition hexrays.hpp:448
valrng_t & operator=(const valrng_t &r)
Definition hexrays.hpp:421
bool hexapi cvt_to_cmp(cmpop_t *cmp, uvlr_t *val) const
Definition hexrays.hpp:10340
bool hexapi reduce_size(int new_size)
Definition hexrays.hpp:10292
svlr_t stride
Definition hexrays.hpp:402
void hexapi inverse()
Definition hexrays.hpp:10310
valrng_t &hexapi assign(const valrng_t &r)
Definition hexrays.hpp:10268
uvlr_t min_svalue() const
Definition hexrays.hpp:460
uvlr_t ones
Definition hexrays.hpp:407
uvlr_t limit
Definition hexrays.hpp:400
void hexapi clear()
Definition hexrays.hpp:10256
~valrng_t()
Definition hexrays.hpp:420
bool hexapi intersect_with(const valrng_t &r)
Definition hexrays.hpp:10298
uvlr_t max_value() const
Definition hexrays.hpp:459
Definition hexrays.hpp:1103
int reg1() const
Definition hexrays.hpp:1109
void _set_reg1(int r1)
Definition hexrays.hpp:1114
bool hexapi is_aliasable(const mba_t *mb, int size) const
Definition hexrays.hpp:10540
const char *hexapi dstr(int width=0) const
Definition hexrays.hpp:10528
void set_reg1(int r1)
Definition hexrays.hpp:1117
DECLARE_COMPARISONS(vdloc_t)
System independent counterparts of FILE* related functions from Clib.
Low level graph drawing operations.
constexpr THREAD_SAFE bool is_vararg_cc(callcnv_t cc)
Does the calling convention use ellipsis?
Definition typeinf.hpp:1466
const argloc_type_t ALOC_REG2
register pair
Definition typeinf.hpp:957
const callcnv_t CM_CC_INVALID
this value is invalid
Definition typeinf.hpp:878
const callcnv_t CM_CC_UNKNOWN
unknown calling convention
Definition typeinf.hpp:879
merror_t
Definition hexrays.hpp:513
@ MERR_ONLY32
only 32-bit functions can be decompiled for the current database
Definition hexrays.hpp:539
@ MERR_LICENSE
no license available
Definition hexrays.hpp:538
@ MERR_CANCELED
decompilation has been cancelled
Definition hexrays.hpp:533
@ MERR_UNKTYPE
undefined type s (currently unused error code)
Definition hexrays.hpp:529
@ MERR_BADFRAME
function frame is wrong
Definition hexrays.hpp:528
@ MERR_BUSY
already decompiling a function
Definition hexrays.hpp:541
@ MERR_HUGESTACK
stack frame is too big
Definition hexrays.hpp:524
@ MERR_BADBLK
bad block found
Definition hexrays.hpp:519
@ MERR_BADIDB
inconsistent database information
Definition hexrays.hpp:530
@ MERR_CLOUD
cloud: s
Definition hexrays.hpp:549
@ MERR_EXCEPTION
exception analysis failed
Definition hexrays.hpp:523
@ MERR_BLOCK
no error, switch to new block
Definition hexrays.hpp:515
@ MERR_FUNCSIZE
too big function
Definition hexrays.hpp:544
@ MERR_PARTINIT
partially initialized variable s
Definition hexrays.hpp:536
@ MERR_BADRANGES
bad input ranges
Definition hexrays.hpp:545
@ MERR_DSLOT
bad instruction in the delay slot
Definition hexrays.hpp:547
@ MERR_OK
ok
Definition hexrays.hpp:514
@ MERR_INSN
cannot convert to microcode
Definition hexrays.hpp:517
@ MERR_COMPLEX
too complex function
Definition hexrays.hpp:537
@ MERR_BADARCH
current architecture is not supported
Definition hexrays.hpp:546
@ MERR_ONLY64
only 64-bit functions can be decompiled for the current database
Definition hexrays.hpp:540
@ MERR_RECDEPTH
max recursion depth reached during lvar allocation
Definition hexrays.hpp:534
@ MERR_FARPTR
far memory model is supported only for pc
Definition hexrays.hpp:542
@ MERR_STOP
no error, stop the analysis
Definition hexrays.hpp:548
@ MERR_BADCALL
could not determine call arguments
Definition hexrays.hpp:527
@ MERR_EMULATOR
emulator: s
Definition hexrays.hpp:550
@ MERR_SIZEOF
wrong basic type sizes in compiler settings
Definition hexrays.hpp:531
@ MERR_EXTERN
special segments cannot be decompiled
Definition hexrays.hpp:543
@ MERR_BITNESS
16-bit functions cannot be decompiled
Definition hexrays.hpp:526
@ MERR_LOOP
internal code: redo last loop (never reported)
Definition hexrays.hpp:552
@ MERR_REDO
redecompilation has been requested
Definition hexrays.hpp:532
@ MERR_PROLOG
prolog analysis failed
Definition hexrays.hpp:521
@ MERR_LVARS
local variable allocation failed
Definition hexrays.hpp:525
@ MERR_INTERR
internal error
Definition hexrays.hpp:516
@ MERR_OVERLAP
variables would overlap: s
Definition hexrays.hpp:535
@ MERR_BADSP
positive sp value has been found
Definition hexrays.hpp:520
@ MERR_SWITCH
wrong switch idiom
Definition hexrays.hpp:522
@ MERR_MAX_ERR
Definition hexrays.hpp:551
@ MERR_MEM
not enough memory
Definition hexrays.hpp:518
idaman THREAD_SAFE va_list va
See qsscanf()
Definition err.h:21
idaman THREAD_SAFE const char * format
Definition fpro.h:78
idaman THREAD_SAFE AS_PRINTF(1, 0) void ida_export vqperror(const char *format
Print error message to stderr (analog of perror)
idaman const char * end
Definition pro.h:1001
int code
Definition fpro.h:88
idaman size_t n
Definition pro.h:997
const type_sign_t type_unsigned
unsigned type
Definition typeinf.hpp:675
qvector< type_attr_t > type_attrs_t
this vector must be sorted by keys
Definition typeinf.hpp:669
int type_sign_t
type signedness
Definition typeinf.hpp:671
const type_sign_t no_sign
no sign, or unknown
Definition typeinf.hpp:673
const type_t BTF_UINT
unsigned int
Definition typeinf.hpp:411
const type_t BTF_INT
int, unknown signedness
Definition typeinf.hpp:410
tinfo_t hexapi dummy_ptrtype(int ptrsize, bool isfp)
Generate a dummy pointer type.
Definition hexrays.hpp:10492
bool hexapi get_type(uval_t id, tinfo_t *tif, type_source_t guess)
Get a global type.
Definition hexrays.hpp:10516
bool hexapi set_type(uval_t id, const tinfo_t &tif, type_source_t source, bool force=false)
Set a global type.
Definition hexrays.hpp:10522
bool hexapi is_type_correct(const type_t *ptr)
Verify a type string.
Definition hexrays.hpp:10438
int hexapi partial_type_num(const tinfo_t &type)
Calculate number of partial subtypes.
Definition hexrays.hpp:10462
bool hexapi is_small_udt(const tinfo_t &tif)
Is a small structure or union?
Definition hexrays.hpp:10444
THREAD_SAFE bool is_inplace_def(const tinfo_t &type)
Is struct/union/enum definition (not declaration)?
Definition hexrays.hpp:988
type_source_t
Type source (where the type information comes from)
Definition hexrays.hpp:1059
bool hexapi is_bool_type(const tinfo_t &type)
Is a boolean type?
Definition hexrays.hpp:10456
bool hexapi is_nonbool_type(const tinfo_t &type)
Is definitely a non-boolean type?
Definition hexrays.hpp:10450
tinfo_t hexapi get_int_type_by_width_and_sign(int srcwidth, type_sign_t sign)
Create a type info by width and sign.
Definition hexrays.hpp:10476
THREAD_SAFE bool is_ptr_or_array(type_t t)
Is a pointer or array type?
Definition hexrays.hpp:976
tinfo_t hexapi create_typedef(const char *name)
Create a reference to a named type.
Definition hexrays.hpp:10508
const char *hexapi dstr(const tinfo_t *tif)
Print the specified type info.
Definition hexrays.hpp:10432
tinfo_t hexapi get_unk_type(int size)
Create a partial type info by width.
Definition hexrays.hpp:10484
THREAD_SAFE bool is_paf(type_t t)
Is a pointer, array, or function type?
Definition hexrays.hpp:982
tinfo_t hexapi make_pointer(const tinfo_t &type)
Create a pointer type.
Definition hexrays.hpp:10500
tinfo_t hexapi get_float_type(int width)
Get a type of a floating point value with the specified width.
Definition hexrays.hpp:10468
@ TS_DONTREF
Definition hexrays.hpp:1066
@ GUESSED_WEAK
Definition hexrays.hpp:1061
@ GUESSED_DATA
Definition hexrays.hpp:1063
@ TS_SHRINK
Definition hexrays.hpp:1065
@ GUESSED_FUNC
Definition hexrays.hpp:1062
@ TS_NOELL
Definition hexrays.hpp:1064
@ GUESSED_NONE
Definition hexrays.hpp:1060
@ TS_MASK
Definition hexrays.hpp:1067
input_device_t
Type of the input device.
Definition hexrays.hpp:8099
@ USE_MOUSE
Mouse.
Definition hexrays.hpp:8101
@ USE_KEYBOARD
Keyboard.
Definition hexrays.hpp:8100
bool is_break_consumer(ctype_t op)
Does a break statement influence the specified statement code?
Definition hexrays.hpp:6125
operand_locator_t const & user_numforms_first(user_numforms_iterator_t p)
Get reference to the current map key.
Definition hexrays.hpp:9170
const maymust_t MAYMUST_ACCESS_MASK
Definition hexrays.hpp:479
void udcall_map_free(udcall_map_t *map)
Delete udcall_map_t instance.
Definition hexrays.hpp:9475
int hexapi select_udt_by_offset(const qvector< tinfo_t > *udts, const ui_stroff_ops_t &ops, ui_stroff_applicator_t &applicator)
Select UDT.
Definition hexrays.hpp:13232
cursor_item_type_t
Type of the cursor item.
Definition hexrays.hpp:7183
@ VDI_FUNC
the function itself (the very first line with the function prototype)
Definition hexrays.hpp:7187
@ VDI_TAIL
cursor is at (beyond) the line end (commentable line)
Definition hexrays.hpp:7188
@ VDI_LVAR
declaration of local variable
Definition hexrays.hpp:7186
@ VDI_NONE
undefined
Definition hexrays.hpp:7184
@ VDI_EXPR
c-tree item
Definition hexrays.hpp:7185
boundaries_iterator_t boundaries_end(const boundaries_t *map)
Get iterator pointing to the end of boundaries_t.
Definition hexrays.hpp:10083
size_t iterator_word
Definition hexrays.hpp:9140
THREAD_SAFE mcode_t jcnd2set(mcode_t code)
Definition hexrays.hpp:730
user_cmts_iterator_t user_cmts_prev(user_cmts_iterator_t p)
Move to the previous element.
Definition hexrays.hpp:9555
size_t user_numforms_size(user_numforms_t *map)
Get size of user_numforms_t.
Definition hexrays.hpp:9250
boundaries_iterator_t boundaries_find(const boundaries_t *map, const cinsn_t *&key)
Find the specified key in boundaries_t.
Definition hexrays.hpp:10056
void user_cmts_clear(user_cmts_t *map)
Clear user_cmts_t.
Definition hexrays.hpp:9570
const cmt_type_t CMT_FUNC
Function comment.
Definition hexrays.hpp:8153
memreg_index_t
< memory region types
Definition hexrays.hpp:4733
@ MMIDX_SHADOW
stack: shadow arguments
Definition hexrays.hpp:4737
@ MMIDX_GLBLOW
global memory: low part
Definition hexrays.hpp:4734
@ MMIDX_GLBHIGH
global memory: high part
Definition hexrays.hpp:4739
@ MMIDX_ARGS
stack: regular stack arguments
Definition hexrays.hpp:4738
@ MMIDX_RETADDR
stack: return address
Definition hexrays.hpp:4736
@ MMIDX_LVARS
stack: local variables
Definition hexrays.hpp:4735
const maymust_t EXCLUDE_PASS_REGS
Definition hexrays.hpp:486
bool is_unary(ctype_t op)
Is unary operator?
Definition hexrays.hpp:6060
user_iflags_iterator_t user_iflags_insert(user_iflags_t *map, const citem_locator_t &key, const int32 &val)
Insert new (citem_locator_t, int32) pair into user_iflags_t.
Definition hexrays.hpp:9629
THREAD_SAFE mcode_t hexapi get_unsigned_mcode(mcode_t code)
Definition hexrays.hpp:10384
THREAD_SAFE bool is_unsigned_mcode(mcode_t code)
Definition hexrays.hpp:766
const mopt_t mop_d
result of another instruction
Definition hexrays.hpp:2371
const cmt_type_t CMT_BLOCK2
Posterior block comment.
Definition hexrays.hpp:8151
const minsn_t *hexapi getb_reginsn(const minsn_t *ins)
Skip assertions backward.
Definition hexrays.hpp:11623
void user_labels_clear(user_labels_t *map)
Clear user_labels_t.
Definition hexrays.hpp:9897
bool hexapi arglocs_overlap(const vdloc_t &loc1, size_t w1, const vdloc_t &loc2, size_t w2)
Do two arglocs overlap?
Definition hexrays.hpp:10552
enum hexrays_event_t ENUM_SIZE(int)
Decompiler events.
Definition hexrays.hpp:7839
user_cmts_iterator_t user_cmts_end(const user_cmts_t *map)
Get iterator pointing to the end of user_cmts_t.
Definition hexrays.hpp:9538
const size_t bitset_shift
Definition hexrays.hpp:1785
void * hexdsp_t(int code,...)
Hex-Rays decompiler dispatcher.
Definition hexrays.hpp:7832
THREAD_SAFE bool hexapi must_mcode_close_block(mcode_t mcode, bool including_calls)
Must an instruction with the given opcode be the last one in a block?
Definition hexrays.hpp:10354
size_t user_unions_size(user_unions_t *map)
Get size of user_unions_t.
Definition hexrays.hpp:9795
user_labels_t *hexapi restore_user_labels(ea_t func_ea, const cfunc_t *func=nullptr)
Restore user defined labels from the database.
Definition hexrays.hpp:12705
bool is_relational(ctype_t op)
Is comparison operator?
Definition hexrays.hpp:6062
uvlr_t max_vlr_value(int size)
Definition hexrays.hpp:318
const mreg_t mr_sf
Definition hexrays.hpp:783
bool is_signed_cmpop(cmpop_t cmpop)
Definition hexrays.hpp:354
bool init_hexrays_plugin(int flags=0)
Check that your plugin is compatible with hex-rays decompiler.
Definition hexrays.hpp:9147
qvector< mlist_t > mlistvec_t
Definition hexrays.hpp:2117
void lvar_mapping_clear(lvar_mapping_t *map)
Clear lvar_mapping_t.
Definition hexrays.hpp:9352
merror_t hexapi convert_to_user_call(const udcall_t &udc, codegen_t &cdg)
try to generate user-defined call for an instruction
Definition hexrays.hpp:10672
item_preciser_t
Comment item preciser.
Definition hexrays.hpp:6228
@ ITP_ASM
__asm-line
Definition hexrays.hpp:6236
@ ITP_CASE
bit for switch cases
Definition hexrays.hpp:6248
@ ITP_BLOCK2
closing block comment.
Definition hexrays.hpp:6246
@ ITP_SEMI
semicolon
Definition hexrays.hpp:6239
@ ITP_INNER_LAST
Definition hexrays.hpp:6234
@ ITP_CURLY2
}
Definition hexrays.hpp:6241
@ ITP_SIGN
if this bit is set too, then we have a negative case value
Definition hexrays.hpp:6249
@ ITP_EMPTY
nothing
Definition hexrays.hpp:6230
@ ITP_COLON
: (label)
Definition hexrays.hpp:6243
@ ITP_ELSE
else-line
Definition hexrays.hpp:6237
@ ITP_DO
do-line
Definition hexrays.hpp:6238
@ ITP_ARG64
Definition hexrays.hpp:6232
@ ITP_CURLY1
{
Definition hexrays.hpp:6240
@ ITP_BRACE1
Definition hexrays.hpp:6233
@ ITP_ARG1
, (64 entries are reserved for 64 call arguments)
Definition hexrays.hpp:6231
@ ITP_BRACE2
)
Definition hexrays.hpp:6242
@ ITP_TRY
C++ try statement.
Definition hexrays.hpp:6247
@ ITP_BLOCK1
opening block comment.
Definition hexrays.hpp:6244
user_unions_iterator_t user_unions_prev(user_unions_iterator_t p)
Move to the previous element.
Definition hexrays.hpp:9773
int mreg_t
Micro register.
Definition hexrays.hpp:267
std::set< ea_t > easet_t
Definition hexrays.hpp:281
bool is_bitop(ctype_t op)
Is bit related operator?
Definition hexrays.hpp:6101
ivl_tpl< uval_t > uval_ivl_t
Definition hexrays.hpp:1890
user_unions_iterator_t user_unions_next(user_unions_iterator_t p)
Move to the next element.
Definition hexrays.hpp:9765
const svlr_t MIN_VLR_SVALUE
Definition hexrays.hpp:315
user_numforms_iterator_t user_numforms_find(const user_numforms_t *map, const operand_locator_t &key)
Find the specified key in user_numforms_t.
Definition hexrays.hpp:9184
void user_cmts_free(user_cmts_t *map)
Delete user_cmts_t instance.
Definition hexrays.hpp:9584
udcall_map_iterator_t udcall_map_insert(udcall_map_t *map, const ea_t &key, const udcall_t &val)
Insert new (ea_t, udcall_t) pair into udcall_map_t.
Definition hexrays.hpp:9411
const maymust_t INCLUDE_DEAD_RETREGS
Definition hexrays.hpp:497
size_t mbitmap_t
Definition hexrays.hpp:1782
const mopt_t mop_l
local variable
Definition hexrays.hpp:2376
user_iflags_iterator_t user_iflags_next(user_iflags_iterator_t p)
Move to the next element.
Definition hexrays.hpp:9656
void hexapi remitem(const citem_t *e)
Definition hexrays.hpp:12183
const maymust_t CALL_SPOILS_ONLY_ARGS
Definition hexrays.hpp:500
void user_iflags_clear(user_iflags_t *map)
Clear user_iflags_t.
Definition hexrays.hpp:9679
const int64 HEXRAYS_API_MAGIC
Definition hexrays.hpp:7833
bool hexapi has_cached_cfunc(ea_t ea)
Do we have a cached decompilation result for 'ea'?
Definition hexrays.hpp:12965
udcall_map_iterator_t udcall_map_end(const udcall_map_t *map)
Get iterator pointing to the end of udcall_map_t.
Definition hexrays.hpp:9429
cexpr_t *hexapi lnot(cexpr_t *e)
Logically negate the specified expression.
Definition hexrays.hpp:12633
bool hexapi mark_cfunc_dirty(ea_t ea, bool close_views=false)
Flush the cached decompilation results.
Definition hexrays.hpp:12953
eamap_iterator_t eamap_prev(eamap_iterator_t p)
Move to the previous element.
Definition hexrays.hpp:9991
const cmt_type_t CMT_TAIL
Indented comment.
Definition hexrays.hpp:8149
boundaries_iterator_t boundaries_begin(const boundaries_t *map)
Get iterator pointing to the beginning of boundaries_t.
Definition hexrays.hpp:10074
bool is_additive(ctype_t op)
Is additive operator?
Definition hexrays.hpp:6083
vdui_t *hexapi open_pseudocode(ea_t ea, int flags)
Open pseudocode window.
Definition hexrays.hpp:12133
const tinfo_t const char va_list va
Definition hexrays.hpp:7301
intvec_t & user_unions_second(user_unions_iterator_t p)
Get reference to the current map value.
Definition hexrays.hpp:9722
int hexapi get_mreg_name(qstring *out, mreg_t reg, int width, void *ud=nullptr)
Get the microregister name.
Definition hexrays.hpp:11011
std::map< cinsn_t *, rangeset_t > boundaries_t
Definition hexrays.hpp:7455
void hexapi save_user_labels(ea_t func_ea, const user_labels_t *user_labels, const cfunc_t *func=nullptr)
Save user defined labels into the database.
Definition hexrays.hpp:12675
rangeset_t & boundaries_second(boundaries_iterator_t p)
Get reference to the current map value.
Definition hexrays.hpp:10049
ssize_t idaapi hexrays_cb_t(void *ud, hexrays_event_t event, va_list va)
Handler of decompiler events.
Definition hexrays.hpp:8073
qvector< ui_stroff_op_t > ui_stroff_ops_t
Definition hexrays.hpp:8478
cmt_retrieval_type_t
Comment retrieval type.
Definition hexrays.hpp:6277
@ RETRIEVE_ALWAYS
Retrieve comment even if it has been used.
Definition hexrays.hpp:6279
@ RETRIEVE_ONCE
Retrieve comment if it has not been used yet.
Definition hexrays.hpp:6278
uvlr_t max_vlr_svalue(int size)
Definition hexrays.hpp:330
bool hexapi modify_user_lvar_info(ea_t func_ea, uint mli_flags, const lvar_saved_info_t &info)
Modify saved local variable settings of one variable.
Definition hexrays.hpp:10642
size_t user_cmts_size(user_cmts_t *map)
Get size of user_cmts_t.
Definition hexrays.hpp:9577
user_numforms_iterator_t user_numforms_begin(const user_numforms_t *map)
Get iterator pointing to the beginning of user_numforms_t.
Definition hexrays.hpp:9202
void hexapi print_vdloc(qstring *vout, const vdloc_t &loc, int nbytes)
Print vdloc.
Definition hexrays.hpp:10546
void user_cmts_erase(user_cmts_t *map, user_cmts_iterator_t p)
Erase current element from user_cmts_t.
Definition hexrays.hpp:9563
eamap_iterator_t eamap_find(const eamap_t *map, const ea_t &key)
Find the specified key in eamap_t.
Definition hexrays.hpp:9947
bool op_uses_z(ctype_t op)
Does operator use the 'z' field of cexpr_t?
Definition hexrays.hpp:6056
THREAD_SAFE bool is_mcode_convertible_to_jmp(mcode_t mcode)
Definition hexrays.hpp:683
void hexapi clear_cached_cfuncs()
Flush all cached decompilation results.
Definition hexrays.hpp:12959
ea_t const & user_unions_first(user_unions_iterator_t p)
Get reference to the current map key.
Definition hexrays.hpp:9715
lvar_mapping_iterator_t lvar_mapping_end(const lvar_mapping_t *map)
Get iterator pointing to the end of lvar_mapping_t.
Definition hexrays.hpp:9320
lvar_locator_t & lvar_mapping_second(lvar_mapping_iterator_t p)
Get reference to the current map value.
Definition hexrays.hpp:9286
size_t udcall_map_size(udcall_map_t *map)
Get size of udcall_map_t.
Definition hexrays.hpp:9468
void hexapi save_user_iflags(ea_t func_ea, const user_iflags_t *iflags)
Save user defined citem iflags into the database.
Definition hexrays.hpp:12693
bool accepts_small_udts(ctype_t op)
Is the operator allowed on small structure or union?
Definition hexrays.hpp:6142
const minsn_t *hexapi getf_reginsn(const minsn_t *ins)
Skip assertions forward.
Definition hexrays.hpp:11617
udcall_map_iterator_t udcall_map_begin(const udcall_map_t *map)
Get iterator pointing to the beginning of udcall_map_t.
Definition hexrays.hpp:9420
const cmt_type_t CMT_LVAR
Local variable comment.
Definition hexrays.hpp:8152
user_numforms_iterator_t user_numforms_prev(user_numforms_iterator_t p)
Move to the previous element.
Definition hexrays.hpp:9228
std::map< ea_t, udcall_t > udcall_map_t
Definition hexrays.hpp:1694
bool hexapi change_hexrays_config(const char *directive)
Parse DIRECTIVE and update the current configuration variables.
Definition hexrays.hpp:12121
va_end(va)
void block_chains_free(block_chains_t *set)
Delete block_chains_t instance.
Definition hexrays.hpp:10231
qvector< mop_t > mopvec_t
Definition hexrays.hpp:286
cfuncptr_t decompile_snippet(const rangevec_t &ranges, hexrays_failure_t *hf=nullptr, int decomp_flags=0)
Decompile a snippet.
Definition hexrays.hpp:7720
qvector< bitset_t > array_of_bitsets
Definition hexrays.hpp:1859
eamap_iterator_t eamap_next(eamap_iterator_t p)
Move to the next element.
Definition hexrays.hpp:9983
udcall_map_iterator_t udcall_map_next(udcall_map_iterator_t p)
Move to the next element.
Definition hexrays.hpp:9438
bool is_commutative(ctype_t op)
Is commutative operator?
Definition hexrays.hpp:6070
const maymust_t MAY_ACCESS
Definition hexrays.hpp:477
udcall_map_iterator_t udcall_map_prev(udcall_map_iterator_t p)
Move to the previous element.
Definition hexrays.hpp:9446
void user_numforms_erase(user_numforms_t *map, user_numforms_iterator_t p)
Erase current element from user_numforms_t.
Definition hexrays.hpp:9236
std::map< treeloc_t, citem_cmt_t > user_cmts_t
Definition hexrays.hpp:6292
const mlist_t &hexapi get_temp_regs()
Get list of temporary registers.
Definition hexrays.hpp:10987
void hexapi save_user_cmts(ea_t func_ea, const user_cmts_t *user_cmts)
Save user defined comments into the database.
Definition hexrays.hpp:12681
std::map< lvar_locator_t, lvar_locator_t > lvar_mapping_t
Local variable mapping (is used to merge variables)
Definition hexrays.hpp:1523
const tinfo_t const char va_start(va, format)
user_numforms_iterator_t user_numforms_next(user_numforms_iterator_t p)
Move to the next element.
Definition hexrays.hpp:9220
eamap_iterator_t eamap_begin(const eamap_t *map)
Get iterator pointing to the beginning of eamap_t.
Definition hexrays.hpp:9965
ea_t hexapi get_merror_desc(qstring *out, merror_t code, mba_t *mba)
Get textual description of an error code.
Definition hexrays.hpp:10346
const mopt_t mop_b
micro basic block (mblock_t)
Definition hexrays.hpp:2374
std::set< voff_t > voff_set_t
Definition hexrays.hpp:265
block_chains_iterator_t block_chains_next(block_chains_iterator_t p)
Move to the next element.
Definition hexrays.hpp:10194
mcode_t
Definition hexrays.hpp:573
@ m_stx
Definition hexrays.hpp:575
@ m_ofadd
Definition hexrays.hpp:600
@ m_setbe
Definition hexrays.hpp:611
@ m_fdiv
Definition hexrays.hpp:646
@ m_call
Definition hexrays.hpp:630
@ m_jbe
Definition hexrays.hpp:622
@ m_low
Definition hexrays.hpp:584
@ m_und
Definition hexrays.hpp:635
@ m_ldx
Definition hexrays.hpp:576
@ m_setb
Definition hexrays.hpp:609
@ m_bnot
Definition hexrays.hpp:581
@ m_and
Definition hexrays.hpp:594
@ m_push
Definition hexrays.hpp:633
@ m_xdu
Definition hexrays.hpp:583
@ m_fsub
Definition hexrays.hpp:644
@ m_setg
Definition hexrays.hpp:612
@ m_fadd
Definition hexrays.hpp:643
@ m_jae
Definition hexrays.hpp:619
@ m_i2f
Definition hexrays.hpp:639
@ m_sdiv
Definition hexrays.hpp:590
@ m_seta
Definition hexrays.hpp:610
@ m_cfadd
Definition hexrays.hpp:599
@ m_mul
Definition hexrays.hpp:588
@ m_ja
Definition hexrays.hpp:621
@ m_seto
Definition hexrays.hpp:604
@ m_jz
Definition hexrays.hpp:618
@ m_or
Definition hexrays.hpp:593
@ m_shl
Definition hexrays.hpp:596
@ m_setae
Definition hexrays.hpp:608
@ m_ldc
Definition hexrays.hpp:577
@ m_udiv
Definition hexrays.hpp:589
@ m_neg
Definition hexrays.hpp:579
@ m_setge
Definition hexrays.hpp:613
@ m_setnz
Definition hexrays.hpp:606
@ m_cfshr
Definition hexrays.hpp:602
@ m_setz
Definition hexrays.hpp:607
@ m_jle
Definition hexrays.hpp:626
@ m_jcnd
Definition hexrays.hpp:616
@ m_shr
Definition hexrays.hpp:597
@ m_setp
Definition hexrays.hpp:605
@ m_sar
Definition hexrays.hpp:598
@ m_fmul
Definition hexrays.hpp:645
@ m_ret
Definition hexrays.hpp:632
@ m_add
Definition hexrays.hpp:586
@ m_lnot
Definition hexrays.hpp:580
@ m_sets
Definition hexrays.hpp:603
@ m_cfshl
Definition hexrays.hpp:601
@ m_nop
Definition hexrays.hpp:574
@ m_smod
Definition hexrays.hpp:592
@ m_fneg
Definition hexrays.hpp:642
@ m_pop
Definition hexrays.hpp:634
@ m_setl
Definition hexrays.hpp:614
@ m_goto
Definition hexrays.hpp:629
@ m_setle
Definition hexrays.hpp:615
@ m_xor
Definition hexrays.hpp:595
@ m_jtbl
Definition hexrays.hpp:627
@ m_ext
Definition hexrays.hpp:636
@ m_icall
Definition hexrays.hpp:631
@ m_sub
Definition hexrays.hpp:587
@ m_jnz
Definition hexrays.hpp:617
@ m_umod
Definition hexrays.hpp:591
@ m_f2i
Definition hexrays.hpp:637
@ m_jb
Definition hexrays.hpp:620
@ m_f2f
Definition hexrays.hpp:641
@ m_ijmp
Definition hexrays.hpp:628
@ m_f2u
Definition hexrays.hpp:638
@ m_jge
Definition hexrays.hpp:624
@ m_u2f
Definition hexrays.hpp:640
@ m_jg
Definition hexrays.hpp:623
@ m_high
Definition hexrays.hpp:585
@ m_jl
Definition hexrays.hpp:625
@ m_mov
Definition hexrays.hpp:578
@ m_xds
Definition hexrays.hpp:582
const mopt_t mop_S
local stack variable (they exist until MMAT_LVARS)
Definition hexrays.hpp:2372
int32 & user_iflags_second(user_iflags_iterator_t p)
Get reference to the current map value.
Definition hexrays.hpp:9613
user_unions_t * user_unions_new()
Create a new user_unions_t instance.
Definition hexrays.hpp:9809
size_t boundaries_size(boundaries_t *map)
Get size of boundaries_t.
Definition hexrays.hpp:10122
void eamap_erase(eamap_t *map, eamap_iterator_t p)
Erase current element from eamap_t.
Definition hexrays.hpp:9999
const mopt_t mop_sc
scattered
Definition hexrays.hpp:2382
THREAD_SAFE mcode_t hexapi swap_mcode_relation(mcode_t code)
Definition hexrays.hpp:10372
const int NOSIZE
wrong or unexisting operand size
Definition hexrays.hpp:2384
bool hexapi get_current_operand(gco_info_t *out)
Get the instruction operand under the cursor.
Definition hexrays.hpp:12177
size_t eamap_size(eamap_t *map)
Get size of eamap_t.
Definition hexrays.hpp:10013
void block_chains_clear(block_chains_t *set)
Clear block_chains_t.
Definition hexrays.hpp:10217
chain_t & block_chains_get(block_chains_iterator_t p)
Get reference to the current set value.
Definition hexrays.hpp:10151
bool op_uses_y(ctype_t op)
Does operator use the 'y' field of cexpr_t?
Definition hexrays.hpp:6054
allow_unused_labels_t
Unused label disposition.
Definition hexrays.hpp:7267
@ ALLOW_UNUSED_LABELS
Unused labels are permitted.
Definition hexrays.hpp:7269
@ FORBID_UNUSED_LABELS
Unused labels cause interr.
Definition hexrays.hpp:7268
const size_t bitset_width
Definition hexrays.hpp:1783
user_labels_iterator_t user_labels_begin(const user_labels_t *map)
Get iterator pointing to the beginning of user_labels_t.
Definition hexrays.hpp:9856
THREAD_SAFE bool is_signed_mcode(mcode_t code)
Definition hexrays.hpp:764
int const & user_labels_first(user_labels_iterator_t p)
Get reference to the current map key.
Definition hexrays.hpp:9824
THREAD_SAFE bool is_mcode_commutative(mcode_t mcode)
Definition hexrays.hpp:691
const mreg_t mr_pf
Definition hexrays.hpp:785
qlist< cinsn_t > cinsn_list_t
Definition hexrays.hpp:6846
qstring hexapi create_field_name(const tinfo_t &type, uval_t offset=BADADDR)
Definition hexrays.hpp:12977
cexpr_t *hexapi dereference(cexpr_t *e, int ptrsize, bool is_flt=false)
Dereference a pointer.
Definition hexrays.hpp:12669
const mopt_t mop_z
none
Definition hexrays.hpp:2367
boundaries_iterator_t boundaries_prev(boundaries_iterator_t p)
Move to the previous element.
Definition hexrays.hpp:10100
lvar_mapping_iterator_t lvar_mapping_prev(lvar_mapping_iterator_t p)
Move to the previous element.
Definition hexrays.hpp:9337
const mreg_t mr_cf
Definition hexrays.hpp:781
const mopt_t mop_fn
floating point constant
Definition hexrays.hpp:2380
void *hexapi hexrays_alloc(size_t size)
Definition hexrays.hpp:10244
user_labels_iterator_t user_labels_find(const user_labels_t *map, const int &key)
Find the specified key in user_labels_t.
Definition hexrays.hpp:9838
bool is_lvalue(ctype_t op)
Is Lvalue operator?
Definition hexrays.hpp:6131
const mreg_t mr_zf
Definition hexrays.hpp:782
bool hexapi parse_user_call(udcall_t *udc, const char *decl, bool silent)
Convert function type declaration into internal structure.
Definition hexrays.hpp:10666
THREAD_SAFE bool hexapi is_mcode_propagatable(mcode_t mcode)
May opcode be propagated?
Definition hexrays.hpp:10360
user_labels_iterator_t user_labels_insert(user_labels_t *map, const int &key, const qstring &val)
Insert new (int, qstring) pair into user_labels_t.
Definition hexrays.hpp:9847
THREAD_SAFE bool is_mcode_shift(mcode_t mcode)
Definition hexrays.hpp:704
user_unions_iterator_t user_unions_end(const user_unions_t *map)
Get iterator pointing to the end of user_unions_t.
Definition hexrays.hpp:9756
cinsn_t *const & boundaries_first(boundaries_iterator_t p)
Get reference to the current map key.
Definition hexrays.hpp:10042
user_cmts_iterator_t user_cmts_begin(const user_cmts_t *map)
Get iterator pointing to the beginning of user_cmts_t.
Definition hexrays.hpp:9529
const cmt_type_t CMT_NONE
No comment is possible.
Definition hexrays.hpp:8148
cexpr_t *hexapi make_num(uint64 n, cfunc_t *func=nullptr, ea_t ea=BADADDR, int opnum=0, type_sign_t sign=no_sign, int size=0)
Create a number expression.
Definition hexrays.hpp:12657
const maymust_t INCLUDE_RESTRICTED
Definition hexrays.hpp:499
const char *hexapi get_ctype_name(ctype_t op)
Definition hexrays.hpp:12971
block_chains_iterator_t block_chains_find(const block_chains_t *set, const chain_t &val)
Find the specified key in set block_chains_t.
Definition hexrays.hpp:10158
user_cmts_iterator_t user_cmts_insert(user_cmts_t *map, const treeloc_t &key, const citem_cmt_t &val)
Insert new (treeloc_t, citem_cmt_t) pair into user_cmts_t.
Definition hexrays.hpp:9520
qvector< cfuncptr_t > cfuncptrs_t
Definition hexrays.hpp:7656
user_numforms_iterator_t user_numforms_insert(user_numforms_t *map, const operand_locator_t &key, const number_format_t &val)
Insert new (operand_locator_t, number_format_t) pair into user_numforms_t.
Definition hexrays.hpp:9193
THREAD_SAFE bool is_mcode_jcond(mcode_t mcode)
Definition hexrays.hpp:681
qstack< history_item_t > history_t
Navigation history.
Definition hexrays.hpp:8143
uint64 uvlr_t
Definition hexrays.hpp:310
void user_iflags_erase(user_iflags_t *map, user_iflags_iterator_t p)
Erase current element from user_iflags_t.
Definition hexrays.hpp:9672
const mopt_t mop_r
register (they exist until MMAT_LVARS)
Definition hexrays.hpp:2368
const maymust_t INCLUDE_SPOILED_REGS
Definition hexrays.hpp:484
qvector< citem_t * > citem_pointers_t
Vector of parents.
Definition hexrays.hpp:6196
cinsnptrvec_t & eamap_second(eamap_iterator_t p)
Get reference to the current map value.
Definition hexrays.hpp:9940
void boundaries_free(boundaries_t *map)
Delete boundaries_t instance.
Definition hexrays.hpp:10129
std::map< ea_t, intvec_t > user_unions_t
Definition hexrays.hpp:6315
eamap_iterator_t eamap_end(const eamap_t *map)
Get iterator pointing to the end of eamap_t.
Definition hexrays.hpp:9974
void udcall_map_clear(udcall_map_t *map)
Clear udcall_map_t.
Definition hexrays.hpp:9461
user_cmts_iterator_t user_cmts_next(user_cmts_iterator_t p)
Move to the next element.
Definition hexrays.hpp:9547
bool hexapi modify_user_lvars(ea_t entry_ea, user_lvar_modifier_t &mlv)
Modify saved local variable settings.
Definition hexrays.hpp:10636
ea_t const & eamap_first(eamap_iterator_t p)
Get reference to the current map key.
Definition hexrays.hpp:9933
const mopt_t mop_a
mop_addr_t: address of operand (mop_l, mop_v, mop_S, mop_r)
Definition hexrays.hpp:2377
const cmt_type_t CMT_BLOCK1
Anterioir block comment.
Definition hexrays.hpp:8150
const mopt_t mop_str
immediate string constant (user representation)
Definition hexrays.hpp:2370
bool accepts_udts(ctype_t op)
Definition hexrays.hpp:6066
bool is_prepost(ctype_t op)
Is pre/post increment/decrement operator?
Definition hexrays.hpp:6068
uint8 mopt_t
Instruction operand types.
Definition hexrays.hpp:2365
void eamap_clear(eamap_t *map)
Clear eamap_t.
Definition hexrays.hpp:10006
gctype_t
Kind of use-def and def-use chains.
Definition hexrays.hpp:5471
@ GC_DIRTY_ALL
bitmask to represent all chains
Definition hexrays.hpp:5476
@ GC_ASR
all the above and assertions
Definition hexrays.hpp:5473
@ GC_END
number of chain types
Definition hexrays.hpp:5475
@ GC_REGS_AND_STKVARS
registers and stkvars (restricted memory only)
Definition hexrays.hpp:5472
@ GC_XDSU
only registers calculated with FULL_XDSU
Definition hexrays.hpp:5474
user_iflags_t *hexapi restore_user_iflags(ea_t func_ea)
Restore user defined citem iflags from the database.
Definition hexrays.hpp:12723
ctree_maturity_t
Ctree maturity level.
Definition hexrays.hpp:6202
@ CMAT_CPA
corrected pointer arithmetic
Definition hexrays.hpp:6208
@ CMAT_FINAL
ready-to-use
Definition hexrays.hpp:6211
@ CMAT_CASTED
added necessary casts
Definition hexrays.hpp:6210
@ CMAT_BUILT
just generated
Definition hexrays.hpp:6204
@ CMAT_NICE
nicefied expressions
Definition hexrays.hpp:6206
@ CMAT_TRANS2
applied second wave of transformations
Definition hexrays.hpp:6207
@ CMAT_TRANS3
applied third wave of transformations
Definition hexrays.hpp:6209
@ CMAT_TRANS1
applied first wave of transformations
Definition hexrays.hpp:6205
@ CMAT_ZERO
does not exist
Definition hexrays.hpp:6203
const mreg_t mr_first
Definition hexrays.hpp:788
DECLARE_TYPE_AS_MOVABLE(valrng_t)
bool is_loop(ctype_t op)
Is loop statement code?
Definition hexrays.hpp:6118
type_sign_t hexapi get_op_signness(ctype_t op)
Get operator sign. Meaningful for sign-dependent operators, like cot_sdiv.
Definition hexrays.hpp:12201
qvector< uint64 > uint64vec_t
Definition hexrays.hpp:287
user_unions_t *hexapi restore_user_unions(ea_t func_ea)
Restore user defined union field selections from the database.
Definition hexrays.hpp:12729
const maymust_t FULL_XDSU
Definition hexrays.hpp:488
qvector< block_chains_t > block_chains_vec_t
Graph chains.
Definition hexrays.hpp:3567
block_chains_iterator_t block_chains_insert(block_chains_t *set, const chain_t &val)
Insert new (chain_t) into set block_chains_t.
Definition hexrays.hpp:10167
uvlr_t min_vlr_svalue(int size)
Definition hexrays.hpp:324
cfuncptr_t hexapi create_cfunc(mba_t *mba)
Create a new cfunc_t object.
Definition hexrays.hpp:12947
ctype_t hexapi negated_relation(ctype_t op)
Negate a comparison operator. For example, cot_sge becomes cot_slt.
Definition hexrays.hpp:12189
THREAD_SAFE bool is_mcode_xdsu(mcode_t mcode)
Definition hexrays.hpp:673
THREAD_SAFE bool is_mcode_fpu(mcode_t mcode)
Definition hexrays.hpp:689
qvector< mreg_t > mregvec_t
Definition hexrays.hpp:288
user_numforms_iterator_t user_numforms_end(const user_numforms_t *map)
Get iterator pointing to the end of user_numforms_t.
Definition hexrays.hpp:9211
THREAD_SAFE mcode_t set2jcnd(mcode_t code)
Definition hexrays.hpp:723
int hexapi mreg2reg(mreg_t reg, int width)
Map a microregister to a processor register.
Definition hexrays.hpp:11005
const mopt_t mop_p
operand pair
Definition hexrays.hpp:2381
size_t user_iflags_size(user_iflags_t *map)
Get size of user_iflags_t.
Definition hexrays.hpp:9686
mreg_t hexapi reg2mreg(int reg)
Map a processor register to a microregister.
Definition hexrays.hpp:10999
@ MAX_VLR_SIZE
Definition hexrays.hpp:312
THREAD_SAFE bool is_mcode_addsub(mcode_t mcode)
Definition hexrays.hpp:671
qvector< catchexpr_t > catchexprs_t
Definition hexrays.hpp:6930
cexpr_t * e
Definition hexrays.hpp:7308
ctype_t hexapi swapped_relation(ctype_t op)
Swap a comparison operator. For example, cot_sge becomes cot_sle.
Definition hexrays.hpp:12195
int cmt_type_t
Comment types.
Definition hexrays.hpp:8146
qvector< mcallarg_t > mcallargs_t
Definition hexrays.hpp:3185
use_curly_t
Should curly braces be printed?
Definition hexrays.hpp:6665
@ USE_CURLY_BRACES
print curly braces without any checks
Definition hexrays.hpp:6668
@ CALC_CURLY_BRACES
print curly braces if necessary
Definition hexrays.hpp:6666
@ NO_CURLY_BRACES
don't print curly braces
Definition hexrays.hpp:6667
udcall_map_iterator_t udcall_map_find(const udcall_map_t *map, const ea_t &key)
Find the specified key in udcall_map_t.
Definition hexrays.hpp:9402
void user_numforms_clear(user_numforms_t *map)
Clear user_numforms_t.
Definition hexrays.hpp:9243
ctype_t
Ctree item code.
Definition hexrays.hpp:5950
@ cot_asgxor
x ^= y
Definition hexrays.hpp:5955
@ cot_call
x(...)
Definition hexrays.hpp:6008
@ cot_ule
x <= y unsigned
Definition hexrays.hpp:5978
@ cot_asgsdiv
x /= y signed
Definition hexrays.hpp:5963
@ cit_break
break-statement
Definition hexrays.hpp:6030
@ cot_cast
(type)x
Definition hexrays.hpp:5999
@ cot_sgt
x > y signed or fpu (see EXFL_FPOP)
Definition hexrays.hpp:5979
@ cit_throw
C++ throw-statement.
Definition hexrays.hpp:6036
@ cot_sdiv
x / y signed
Definition hexrays.hpp:5989
@ cit_do
do-statement
Definition hexrays.hpp:6028
@ cot_insn
instruction in expression, internal representation only
Definition hexrays.hpp:6017
@ cot_lor
x || y
Definition hexrays.hpp:5968
@ cot_tern
x ? y : z
Definition hexrays.hpp:5967
@ cot_asgbor
x |= y
Definition hexrays.hpp:5954
@ cit_block
block-statement: { ... }
Definition hexrays.hpp:6023
@ cit_continue
continue-statement
Definition hexrays.hpp:6031
@ cot_lnot
!x
Definition hexrays.hpp:6000
@ cot_last
Definition hexrays.hpp:6021
@ cot_asgshl
x <<= y
Definition hexrays.hpp:5962
@ cot_ptr
*x, access size in 'ptrsize'
Definition hexrays.hpp:6002
@ cot_preinc
++x
Definition hexrays.hpp:6006
@ cot_shl
x << y
Definition hexrays.hpp:5985
@ cot_obj
obj_ea
Definition hexrays.hpp:6015
@ cot_neg
-x
Definition hexrays.hpp:5998
@ cot_xor
x ^ y
Definition hexrays.hpp:5971
@ cot_add
x + y
Definition hexrays.hpp:5986
@ cot_sshr
x >> y signed
Definition hexrays.hpp:5983
@ cit_try
C++ try-statement.
Definition hexrays.hpp:6035
@ cot_asg
x = y
Definition hexrays.hpp:5953
@ cot_type
arbitrary type
Definition hexrays.hpp:6020
@ cot_sub
x - y
Definition hexrays.hpp:5987
@ cot_slt
x < y signed or fpu (see EXFL_FPOP)
Definition hexrays.hpp:5981
@ cot_mul
x * y
Definition hexrays.hpp:5988
@ cot_udiv
x / y unsigned
Definition hexrays.hpp:5990
@ cot_asgsshr
x >>= y signed
Definition hexrays.hpp:5960
@ cot_eq
x == y int or fpu (see EXFL_FPOP)
Definition hexrays.hpp:5973
@ cit_return
return-statement
Definition hexrays.hpp:6032
@ cot_asgadd
x += y
Definition hexrays.hpp:5957
@ cot_ref
&x
Definition hexrays.hpp:6003
@ cot_ne
x != y int or fpu (see EXFL_FPOP)
Definition hexrays.hpp:5974
@ cit_empty
instruction types start here
Definition hexrays.hpp:6022
@ cit_asm
asm-statement
Definition hexrays.hpp:6034
@ cot_predec
–x
Definition hexrays.hpp:6007
@ cot_asgmul
x *= y
Definition hexrays.hpp:5959
@ cot_helper
arbitrary name
Definition hexrays.hpp:6019
@ cot_fneg
-x fp
Definition hexrays.hpp:5997
@ cot_ult
x < y unsigned
Definition hexrays.hpp:5982
@ cot_uge
x >= y unsigned
Definition hexrays.hpp:5976
@ cot_fadd
x + y fp
Definition hexrays.hpp:5993
@ cot_asgushr
x >>= y unsigned
Definition hexrays.hpp:5961
@ cot_fnum
fpc
Definition hexrays.hpp:6013
@ cot_postdec
x–
Definition hexrays.hpp:6005
@ cot_memref
x.m
Definition hexrays.hpp:6010
@ cot_postinc
x++
Definition hexrays.hpp:6004
@ cot_sizeof
sizeof(x)
Definition hexrays.hpp:6018
@ cot_sle
x <= y signed or fpu (see EXFL_FPOP)
Definition hexrays.hpp:5977
@ cot_ushr
x >> y unsigned
Definition hexrays.hpp:5984
@ cot_fdiv
x / y fp
Definition hexrays.hpp:5996
@ cit_while
while-statement
Definition hexrays.hpp:6027
@ cot_fsub
x - y fp
Definition hexrays.hpp:5994
@ cot_str
string constant (user representation)
Definition hexrays.hpp:6014
@ cot_var
v
Definition hexrays.hpp:6016
@ cot_sge
x >= y signed or fpu (see EXFL_FPOP)
Definition hexrays.hpp:5975
@ cit_goto
goto-statement
Definition hexrays.hpp:6033
@ cit_switch
switch-statement
Definition hexrays.hpp:6029
@ cot_asgband
x &= y
Definition hexrays.hpp:5956
@ cot_empty
Definition hexrays.hpp:5951
@ cot_asgsmod
x %= y signed
Definition hexrays.hpp:5965
@ cot_num
n
Definition hexrays.hpp:6012
@ cot_band
x & y
Definition hexrays.hpp:5972
@ cot_bnot
~x
Definition hexrays.hpp:6001
@ cot_comma
x, y
Definition hexrays.hpp:5952
@ cot_asgsub
x -= y
Definition hexrays.hpp:5958
@ cit_if
if-statement
Definition hexrays.hpp:6025
@ cot_smod
x % y signed
Definition hexrays.hpp:5991
@ cot_bor
x | y
Definition hexrays.hpp:5970
@ cot_umod
x % y unsigned
Definition hexrays.hpp:5992
@ cot_memptr
x->m, access size in 'ptrsize'
Definition hexrays.hpp:6011
@ cit_end
Definition hexrays.hpp:6037
@ cot_asgumod
x %= y unsigned
Definition hexrays.hpp:5966
@ cot_ugt
x > y unsigned
Definition hexrays.hpp:5980
@ cot_asgudiv
x /= y unsigned
Definition hexrays.hpp:5964
@ cot_idx
x[y]
Definition hexrays.hpp:6009
@ cot_fmul
x * y fp
Definition hexrays.hpp:5995
@ cit_expr
expression-statement: expr;
Definition hexrays.hpp:6024
@ cot_land
x && y
Definition hexrays.hpp:5969
@ cit_for
for-statement
Definition hexrays.hpp:6026
const tinfo_t & type
Definition hexrays.hpp:7301
lvar_mapping_iterator_t lvar_mapping_next(lvar_mapping_iterator_t p)
Move to the next element.
Definition hexrays.hpp:9329
bool hexapi restore_user_lvar_settings(lvar_uservec_t *lvinf, ea_t func_ea)
Restore user defined local variable settings in the database.
Definition hexrays.hpp:10624
cfuncptr_t hexapi decompile(const mba_ranges_t &mbr, hexrays_failure_t *hf=nullptr, int decomp_flags=0)
Decompile a snippet or a function.
Definition hexrays.hpp:12935
std::set< minsn_t * > minsn_ptr_set_t
Definition hexrays.hpp:282
funcrole_t
Function roles.
Definition hexrays.hpp:3191
@ ROLE_3WAYCMP1
3-way compare helper, returns 0/1/2
Definition hexrays.hpp:3225
@ ROLE_VA_COPY
va_copy() function
Definition hexrays.hpp:3216
@ ROLE_UNK
unknown function role
Definition hexrays.hpp:3192
@ ROLE_VA_ARG
va_arg() macro
Definition hexrays.hpp:3215
@ ROLE_BITTEST
[lock] bt
Definition hexrays.hpp:3211
@ ROLE_BUG
BUG() helper macro: never returns, causes exception.
Definition hexrays.hpp:3202
@ ROLE_SSE_CMP4
e.g. _mm_cmpgt_ss
Definition hexrays.hpp:3231
@ ROLE_EMPTY
empty, does not do anything (maybe spoils regs)
Definition hexrays.hpp:3193
@ ROLE_MEMSET64
memset64(void *dst, uint64 value, size_t count);
Definition hexrays.hpp:3196
@ ROLE_ALLOCA
alloca() function
Definition hexrays.hpp:3203
@ ROLE_WMEMCPY
wchar_t *wmemcpy(wchar_t *dst, const wchar_t *src, size_t n)
Definition hexrays.hpp:3226
@ ROLE_FASTFAIL
__fastfail()
Definition hexrays.hpp:3207
@ ROLE_SATURATED_MUL
saturated_mul
Definition hexrays.hpp:3210
@ ROLE_BITTESTANDSET
[lock] bts
Definition hexrays.hpp:3212
@ ROLE_WCSCPY
wchar_t *wcscpy(wchar_t *dst, const wchar_t *src);
Definition hexrays.hpp:3228
@ ROLE_SSE_CMP8
e.g. _mm_cmpgt_sd
Definition hexrays.hpp:3232
@ ROLE_STRCAT
strcat(char *dst, const char *src);
Definition hexrays.hpp:3200
@ ROLE_TAIL
char *tail(const char *str);
Definition hexrays.hpp:3201
@ ROLE_CFSUB3
carry flag after subtract with carry
Definition hexrays.hpp:3221
@ ROLE_READFLAGS
__readeflags, __readcallersflags
Definition hexrays.hpp:3208
@ ROLE_MEMCPY
memcpy(void *dst, const void *src, size_t count);
Definition hexrays.hpp:3197
@ ROLE_OFSUB3
overflow flag after subtract with carry
Definition hexrays.hpp:3222
@ ROLE_PRESENT
present() function (used in patterns)
Definition hexrays.hpp:3205
@ ROLE_BITTESTANDCOMPLEMENT
[lock] btc
Definition hexrays.hpp:3214
@ ROLE_ABS
integer absolute value
Definition hexrays.hpp:3223
@ ROLE_VA_START
va_start() function
Definition hexrays.hpp:3217
@ ROLE_STRLEN
strlen(const char *src);
Definition hexrays.hpp:3199
@ ROLE_STRCPY
strcpy(char *dst, const char *src);
Definition hexrays.hpp:3198
@ ROLE_WCSLEN
size_t wcslen(const wchar_t *s)
Definition hexrays.hpp:3229
@ ROLE_ROR
rotate right
Definition hexrays.hpp:3220
@ ROLE_MEMSET
memset(void *dst, uchar value, size_t count);
Definition hexrays.hpp:3194
@ ROLE_IS_MUL_OK
is_mul_ok
Definition hexrays.hpp:3209
@ ROLE_VA_END
va_end() function
Definition hexrays.hpp:3218
@ ROLE_WMEMSET
wchar_t *wmemset(wchar_t *dst, wchar_t wc, size_t n)
Definition hexrays.hpp:3227
@ ROLE_CONTAINING_RECORD
CONTAINING_RECORD() macro.
Definition hexrays.hpp:3206
@ ROLE_BITTESTANDRESET
[lock] btr
Definition hexrays.hpp:3213
@ ROLE_MEMSET32
memset32(void *dst, uint32 value, size_t count);
Definition hexrays.hpp:3195
@ ROLE_BSWAP
bswap() function (any size)
Definition hexrays.hpp:3204
@ ROLE_ROL
rotate left
Definition hexrays.hpp:3219
@ ROLE_WCSCAT
wchar_t *wcscat(wchar_t *dst, const wchar_t *src)
Definition hexrays.hpp:3230
@ ROLE_3WAYCMP0
3-way compare helper, returns -1/0/1
Definition hexrays.hpp:3224
bool hexapi remove_optblock_handler(optblock_t *opt)
Remove a block level custom optimizer.
Definition hexrays.hpp:11036
user_labels_t * user_labels_new()
Create a new user_labels_t instance.
Definition hexrays.hpp:9918
user_labels_iterator_t user_labels_end(const user_labels_t *map)
Get iterator pointing to the end of user_labels_t.
Definition hexrays.hpp:9865
bool hexapi close_pseudocode(TWidget *f)
Close pseudocode window.
Definition hexrays.hpp:12139
void hexapi close_hexrays_waitbox()
Close the waitbox displayed by the decompiler.
Definition hexrays.hpp:12929
bool hexapi install_hexrays_callback(hexrays_cb_t *callback, void *ud)
Install handler for decompiler events.
Definition hexrays.hpp:12985
user_iflags_t * user_iflags_new()
Create a new user_iflags_t instance.
Definition hexrays.hpp:9700
void boundaries_clear(boundaries_t *map)
Clear boundaries_t.
Definition hexrays.hpp:10115
const mopt_t mop_n
immediate number constant
Definition hexrays.hpp:2369
const maymust_t INCLUDE_UNUSED_SRC
Definition hexrays.hpp:495
user_numforms_t * user_numforms_new()
Create a new user_numforms_t instance.
Definition hexrays.hpp:9264
mba_t * create_empty_mba(const mba_ranges_t &mbr, hexrays_failure_t *hf=nullptr)
Create an empty microcode object.
Definition hexrays.hpp:7746
user_unions_iterator_t user_unions_find(const user_unions_t *map, const ea_t &key)
Find the specified key in user_unions_t.
Definition hexrays.hpp:9729
hexcall_t
API call numbers.
Definition hexrays.hpp:8515
@ hx_user_numforms_end
Definition hexrays.hpp:8517
@ hx_save_user_numforms
Definition hexrays.hpp:9042
@ hx_cexpr_t_requires_lvalue
Definition hexrays.hpp:8992
@ hx_user_labels_first
Definition hexrays.hpp:8598
@ hx_user_unions_free
Definition hexrays.hpp:8592
@ hx_mblock_t_vdump_block
Definition hexrays.hpp:8879
@ hx_simple_graph_t_compute_immediate_dominators
Definition hexrays.hpp:8776
@ hx_vdui_t_map_lvar
Definition hexrays.hpp:9111
@ hx_mba_t_alloc_kreg
Definition hexrays.hpp:8938
@ hx_valrng_t_assign
Definition hexrays.hpp:8649
@ hx_mop_t_create_from_insn
Definition hexrays.hpp:8799
@ hx_block_chains_prev
Definition hexrays.hpp:8636
@ hx_cnumber_t_assign
Definition hexrays.hpp:8968
@ hx_lvar_t_dstr
Definition hexrays.hpp:8696
@ hx_cfunc_t_set_user_union_selection
Definition hexrays.hpp:9066
@ hx_lvar_ref_t_var
Definition hexrays.hpp:8784
@ hx_vdui_t_set_lvar_type
Definition hexrays.hpp:9105
@ hx_vdui_t_clear
Definition hexrays.hpp:9098
@ hx_getf_reginsn
Definition hexrays.hpp:8874
@ hx_cthrow_t_compare
Definition hexrays.hpp:9003
@ hx_mba_t_alloc_fict_ea
Definition hexrays.hpp:8933
@ hx_valrng_t_set_eq
Definition hexrays.hpp:8651
@ hx_has_cached_cfunc
Definition hexrays.hpp:9087
@ hx_restore_user_labels
Definition hexrays.hpp:9045
@ hx_udcall_map_begin
Definition hexrays.hpp:8542
@ hx_mark_cfunc_dirty
Definition hexrays.hpp:9085
@ hx_user_labels_second
Definition hexrays.hpp:8599
@ hx_ivlset_t_count
Definition hexrays.hpp:8754
@ hx_user_labels_begin
Definition hexrays.hpp:8594
@ hx_lvar_mapping_end
Definition hexrays.hpp:8530
@ hx_lvar_locator_t_compare
Definition hexrays.hpp:8694
@ hx_eamap_find
Definition hexrays.hpp:8613
@ hx_user_numforms_begin
Definition hexrays.hpp:8516
@ hx_bitset_t_is_subset_of
Definition hexrays.hpp:8741
@ hx_mba_t_map_fict_ea
Definition hexrays.hpp:8934
@ hx_mop_t_make_second_half
Definition hexrays.hpp:8820
@ hx_cfunc_t_save_user_iflags
Definition hexrays.hpp:9070
@ hx_valrng_t_copy
Definition hexrays.hpp:8648
@ hx_get_merror_desc
Definition hexrays.hpp:8662
@ hx_cexpr_t_get_high_nbit_bound
Definition hexrays.hpp:8990
@ hx_mblock_t_optimize_insn
Definition hexrays.hpp:8885
@ hx_cinsn_t_new_insn
Definition hexrays.hpp:9010
@ hx_cfunc_t_del_orphan_cmts
Definition hexrays.hpp:9064
@ hx_remove_optblock_handler
Definition hexrays.hpp:8774
@ hx_cfunc_t_build_c_tree
Definition hexrays.hpp:9050
@ hx_valrng_t_compare
Definition hexrays.hpp:8650
@ hx_mba_t_stkoff_ida2vd
Definition hexrays.hpp:8902
@ hx_send_database
Definition hexrays.hpp:8957
@ hx_bitset_t_add_
Definition hexrays.hpp:8722
@ hx_boundaries_free
Definition hexrays.hpp:8631
@ hx_mop_t_is_zero_extended_from
Definition hexrays.hpp:8810
@ hx_locate_lvar
Definition hexrays.hpp:8710
@ hx_mbl_graph_t_get_du
Definition hexrays.hpp:8945
@ hx_ctree_item_t_get_lvar
Definition hexrays.hpp:9028
@ hx_create_typedef
Definition hexrays.hpp:8686
@ hx_boundaries_clear
Definition hexrays.hpp:8629
@ hx_cexpr_t_replace_by
Definition hexrays.hpp:8982
@ hx_mop_t_lexcompare
Definition hexrays.hpp:8812
@ hx_cfor_t_compare
Definition hexrays.hpp:8999
@ hx_mcases_t_compare
Definition hexrays.hpp:8833
@ hx_eamap_next
Definition hexrays.hpp:8609
@ hx_minsn_t_swap
Definition hexrays.hpp:8852
@ hx_mop_t_create_from_ivlset
Definition hexrays.hpp:8796
@ hx_cexpr_t_contains_operator
Definition hexrays.hpp:8989
@ hx_save_user_lvar_settings
Definition hexrays.hpp:8707
@ hx_is_small_udt
Definition hexrays.hpp:8676
@ hx_cfunc_t_get_user_iflags
Definition hexrays.hpp:9061
@ hx_eamap_second
Definition hexrays.hpp:8612
@ hx_dummy_ptrtype
Definition hexrays.hpp:8683
@ hx_boundaries_begin
Definition hexrays.hpp:8620
@ hx_mba_t_insert_block
Definition hexrays.hpp:8921
@ hx_vdui_t_set_global_type
Definition hexrays.hpp:9114
@ hx_user_iflags_find
Definition hexrays.hpp:8574
@ hx_user_labels_new
Definition hexrays.hpp:8606
@ hx_minsn_t_find_call
Definition hexrays.hpp:8864
@ hx_cfunc_t_remove_unused_labels
Definition hexrays.hpp:9058
@ hx_user_cmts_erase
Definition hexrays.hpp:8563
@ hx_vdloc_t_dstr
Definition hexrays.hpp:8689
@ hx_get_signed_mcode
Definition hexrays.hpp:8667
@ hx_user_cmts_end
Definition hexrays.hpp:8556
@ hx_cinsn_t_contains_insn
Definition hexrays.hpp:9015
@ hx_decompile
Definition hexrays.hpp:9082
@ hx_mba_t_remove_empty_and_unreachable_blocks
Definition hexrays.hpp:8924
@ hx_mop_t_for_all_scattered_submops
Definition hexrays.hpp:8814
@ hx_mop_t_erase
Definition hexrays.hpp:8792
@ hx_ivlset_t_contains
Definition hexrays.hpp:8756
@ hx_lvar_t_append_list_
Definition hexrays.hpp:8702
@ hx_lvar_t_set_lvar_type
Definition hexrays.hpp:8699
@ hx_vdui_t_jump_enter
Definition hexrays.hpp:9117
@ hx_mop_t_make_number
Definition hexrays.hpp:8800
@ hx_mba_t_deserialize
Definition hexrays.hpp:8936
@ hx_mblock_t_append_def_list
Definition hexrays.hpp:8890
@ hx_catchexpr_t_compare
Definition hexrays.hpp:9132
@ hx_user_iflags_first
Definition hexrays.hpp:8572
@ hx_asgop_revert
Definition hexrays.hpp:8965
@ hx_cfunc_t_find_item_coords
Definition hexrays.hpp:9079
@ hx_mop_t_make_first_half
Definition hexrays.hpp:8819
@ hx_user_iflags_size
Definition hexrays.hpp:8578
@ hx_cfunc_t_save_user_unions
Definition hexrays.hpp:9071
@ hx_new_block
Definition hexrays.hpp:9034
@ hx_udcall_map_erase
Definition hexrays.hpp:8550
@ hx_vdui_t_rename_label
Definition hexrays.hpp:9116
@ hx_ctree_item_t_dstr
Definition hexrays.hpp:9032
@ hx_boundaries_prev
Definition hexrays.hpp:8623
@ hx_lvar_mapping_free
Definition hexrays.hpp:8540
@ hx_bitset_t_has_any
Definition hexrays.hpp:8731
@ hx_decompile_many
Definition hexrays.hpp:8955
@ hx_user_cmts_next
Definition hexrays.hpp:8557
@ hx_ctree_item_t_get_ea
Definition hexrays.hpp:9029
@ hx_mop_t_apply_ld_mcode
Definition hexrays.hpp:8824
@ hx_lvar_mapping_clear
Definition hexrays.hpp:8538
@ hx_gco_info_t_append_to_list
Definition hexrays.hpp:8958
@ hx_parse_user_call
Definition hexrays.hpp:8713
@ hx_minsn_t_may_use_aliased_memory
Definition hexrays.hpp:8871
@ hx_chain_t_dstr
Definition hexrays.hpp:8841
@ hx_mba_t_build_graph
Definition hexrays.hpp:8911
@ hx_lvar_mapping_second
Definition hexrays.hpp:8534
@ hx_vdui_t_set_num_enum
Definition hexrays.hpp:9124
@ hx_cinsn_t_print
Definition hexrays.hpp:9012
@ hx_restore_user_numforms
Definition hexrays.hpp:9047
@ hx_lvar_locator_t_dstr
Definition hexrays.hpp:8695
@ hx_mop_t_create_from_vdloc
Definition hexrays.hpp:8797
@ hx_user_cmts_find
Definition hexrays.hpp:8561
@ hx_mblock_t_find_redefinition
Definition hexrays.hpp:8894
@ hx_mblock_t_optimize_block
Definition hexrays.hpp:8886
@ hx_user_cmts_first
Definition hexrays.hpp:8559
@ hx_user_numforms_free
Definition hexrays.hpp:8527
@ hx_mbl_graph_t_get_ud
Definition hexrays.hpp:8944
@ hx_mop_t_swap
Definition hexrays.hpp:8791
@ hx_udcall_map_clear
Definition hexrays.hpp:8551
@ hx_vdui_t_ui_set_call_type
Definition hexrays.hpp:9103
@ hx_user_labels_size
Definition hexrays.hpp:8604
@ hx_get_hexrays_version
Definition hexrays.hpp:8951
@ hx_vdui_t_rename_lvar
Definition hexrays.hpp:9102
@ hx_mba_t_stkoff_vd2ida
Definition hexrays.hpp:8901
@ hx_lvar_t_append_list
Definition hexrays.hpp:8701
@ hx_minsn_t_is_helper
Definition hexrays.hpp:8863
@ hx_cfunc_t_get_warnings
Definition hexrays.hpp:9073
@ hx_mreg2reg
Definition hexrays.hpp:8769
@ hx_save_user_iflags
Definition hexrays.hpp:9043
@ hx_user_unions_size
Definition hexrays.hpp:8591
@ hx_lvar_mapping_new
Definition hexrays.hpp:8541
@ hx_get_current_operand
Definition hexrays.hpp:8959
@ hx_mba_t_for_all_ops
Definition hexrays.hpp:8926
@ hx_bitset_t_count
Definition hexrays.hpp:8734
@ hx_eamap_end
Definition hexrays.hpp:8608
@ hx_bitset_t_has_common
Definition hexrays.hpp:8739
@ hx_user_cmts_free
Definition hexrays.hpp:8566
@ hx_cfunc_t_save_user_numforms
Definition hexrays.hpp:9069
@ hx_vdui_t_set_lvar_cmt
Definition hexrays.hpp:9108
@ hx_user_numforms_second
Definition hexrays.hpp:8521
@ hx_vdui_t_collapse_lvars
Definition hexrays.hpp:9129
@ hx_user_iflags_next
Definition hexrays.hpp:8570
@ hx_mblock_t_insert_into_block
Definition hexrays.hpp:8880
@ hx_vdui_t_set_locked
Definition hexrays.hpp:9092
@ hx_boundaries_erase
Definition hexrays.hpp:8628
@ hx_hexrays_free
Definition hexrays.hpp:8646
@ hx_ctree_parentee_t_recalc_parent_types
Definition hexrays.hpp:8973
@ hx_user_labels_find
Definition hexrays.hpp:8600
@ hx_mblock_t_build_use_list
Definition hexrays.hpp:8891
@ hx_user_cmts_clear
Definition hexrays.hpp:8564
@ hx_mblock_t_optimize_useless_jump
Definition hexrays.hpp:8888
@ hx_vdui_t_ui_set_lvar_type
Definition hexrays.hpp:9104
@ hx_bitset_t_goup
Definition hexrays.hpp:8743
@ hx_mop_t_is01
Definition hexrays.hpp:8808
@ hx_minsn_t_copy
Definition hexrays.hpp:8850
@ hx_cif_t_compare
Definition hexrays.hpp:8997
@ hx_mblock_t_get_valranges
Definition hexrays.hpp:8897
@ hx_cexpr_t_maybe_ptr
Definition hexrays.hpp:8994
@ hx_vdui_t_ctree_to_disasm
Definition hexrays.hpp:9118
@ hx_valrng_t_cvt_to_single_value
Definition hexrays.hpp:8660
@ hx_set_type
Definition hexrays.hpp:8688
@ hx_mba_t_locate_stkpnt
Definition hexrays.hpp:8941
@ hx_save_user_cmts
Definition hexrays.hpp:9041
@ hx_cfunc_t_get_boundaries
Definition hexrays.hpp:9075
@ hx_vdui_t_split_item
Definition hexrays.hpp:9130
@ hx_mop_t_preserve_side_effects
Definition hexrays.hpp:8823
@ hx_cfunc_t_recalc_item_addresses
Definition hexrays.hpp:9135
@ hx_create_field_name
Definition hexrays.hpp:9089
@ hx_cinsn_t_create_if
Definition hexrays.hpp:9011
@ hx_cexpr_t_assign
Definition hexrays.hpp:8980
@ hx_vdui_t_collapse_item
Definition hexrays.hpp:9128
@ hx_mblock_t_is_rhs_redefined
Definition hexrays.hpp:8895
@ hx_mcallinfo_t_lexcompare
Definition hexrays.hpp:8828
@ hx_mba_t_find_mop
Definition hexrays.hpp:8929
@ hx_get_type
Definition hexrays.hpp:8687
@ hx_vdui_t_switch_to
Definition hexrays.hpp:9095
@ hx_ivlset_t_includes
Definition hexrays.hpp:8757
@ hx_simple_graph_t_depth_first_preorder
Definition hexrays.hpp:8777
@ hx_cexpr_t_calc_type
Definition hexrays.hpp:8986
@ hx_eamap_insert
Definition hexrays.hpp:8614
@ hx_cnumber_t_value
Definition hexrays.hpp:8967
@ hx_get_mreg_name
Definition hexrays.hpp:8770
@ hx_mba_t_alloc_lvars
Definition hexrays.hpp:8915
@ hx_cnumber_t_compare
Definition hexrays.hpp:8969
@ hx_cinsn_t_collect_free_breaks
Definition hexrays.hpp:9016
@ hx_valrng_t_dstr
Definition hexrays.hpp:8659
@ hx_lvars_t_find_lvar
Definition hexrays.hpp:8705
@ hx_install_optblock_handler
Definition hexrays.hpp:8773
@ hx_vdui_t_rename_global
Definition hexrays.hpp:9115
@ hx_restore_user_defined_calls
Definition hexrays.hpp:8711
@ hx_get_unsigned_mcode
Definition hexrays.hpp:8668
@ hx_vdui_t_refresh_cpos
Definition hexrays.hpp:9099
@ hx_swapped_relation
Definition hexrays.hpp:8962
@ hx_vdui_t_get_current_item
Definition hexrays.hpp:9100
@ hx_cfunc_t_get_user_union_selection
Definition hexrays.hpp:9065
@ hx_get_int_type_by_width_and_sign
Definition hexrays.hpp:8681
@ hx_mop_t_get_stkoff
Definition hexrays.hpp:8816
@ hx_user_labels_clear
Definition hexrays.hpp:8603
@ hx_user_iflags_erase
Definition hexrays.hpp:8576
@ hx_cinsn_t_assign
Definition hexrays.hpp:9006
@ hx_get_temp_regs
Definition hexrays.hpp:8766
@ hx_block_chains_erase
Definition hexrays.hpp:8640
@ hx_ivlset_t_print
Definition hexrays.hpp:8752
@ hx_eamap_clear
Definition hexrays.hpp:8616
@ hx_mba_t_term
Definition hexrays.hpp:8907
@ hx_cexpr_t_print1
Definition hexrays.hpp:8985
@ hx_ivlset_t_sub_
Definition hexrays.hpp:8750
@ hx_lvar_mapping_insert
Definition hexrays.hpp:8536
@ hx_udc_filter_t_init
Definition hexrays.hpp:8717
@ hx_user_unions_end
Definition hexrays.hpp:8582
@ hx_install_microcode_filter
Definition hexrays.hpp:8715
@ hx_make_num
Definition hexrays.hpp:9037
@ hx_modify_user_lvar_info
Definition hexrays.hpp:8709
@ hx_mblock_t_dump
Definition hexrays.hpp:8878
@ hx_mblock_t_get_reginsn_qty
Definition hexrays.hpp:8899
@ hx_udcall_map_free
Definition hexrays.hpp:8553
@ hx_cdo_t_compare
Definition hexrays.hpp:9001
@ hx_udcall_map_insert
Definition hexrays.hpp:8549
@ hx_mblock_t_find_first_use
Definition hexrays.hpp:8893
@ hx_mba_t_idaloc2vd
Definition hexrays.hpp:8903
@ hx_mlist_t_compare
Definition hexrays.hpp:8765
@ hx_mcallinfo_t_set_type
Definition hexrays.hpp:8829
@ hx_mba_t_optimize_global
Definition hexrays.hpp:8914
@ hx_vdui_t_set_num_radix
Definition hexrays.hpp:9123
@ hx_mba_t_merge_blocks
Definition hexrays.hpp:8925
@ hx_mba_t_analyze_calls
Definition hexrays.hpp:8913
@ hx_bitset_t_fill_with_ones
Definition hexrays.hpp:8737
@ hx_cfunc_t_verify
Definition hexrays.hpp:9051
@ hx_minsn_t_set_combined
Definition hexrays.hpp:8851
@ hx_user_numforms_prev
Definition hexrays.hpp:8519
@ hx_mutable_graph_t_resize
Definition hexrays.hpp:8780
@ hx_minsn_t_serialize
Definition hexrays.hpp:8872
@ hx_mblock_t_for_all_insns
Definition hexrays.hpp:8882
@ hx_install_optinsn_handler
Definition hexrays.hpp:8771
@ hx_mop_t_copy
Definition hexrays.hpp:8789
@ hx_ctree_item_t_get_udm
Definition hexrays.hpp:9026
@ hx_boundaries_size
Definition hexrays.hpp:8630
@ hx_select_udt_by_offset
Definition hexrays.hpp:9131
@ hx_ctree_item_t_print
Definition hexrays.hpp:9031
@ hx_hexrays_failure_t_desc
Definition hexrays.hpp:8956
@ hx_block_chains_get
Definition hexrays.hpp:8637
@ hx_user_labels_end
Definition hexrays.hpp:8595
@ hx_cfunc_t_gather_derefs
Definition hexrays.hpp:9078
@ hx_lvars_t_find
Definition hexrays.hpp:8704
@ hx_remove_hexrays_callback
Definition hexrays.hpp:9091
@ hx_mop_t_assign
Definition hexrays.hpp:8790
@ hx_int64_emulator_t_minsn_value
Definition hexrays.hpp:9137
@ hx_user_cmts_insert
Definition hexrays.hpp:8562
@ hx_bitset_t_cut_at
Definition hexrays.hpp:8727
@ hx_cwhile_t_compare
Definition hexrays.hpp:9000
@ hx_cexpr_t_put_number
Definition hexrays.hpp:8984
@ hx_cexpr_t_compare
Definition hexrays.hpp:8981
@ hx_graph_chains_t_for_all_chains
Definition hexrays.hpp:8847
@ hx_user_iflags_free
Definition hexrays.hpp:8579
@ hx_user_iflags_prev
Definition hexrays.hpp:8571
@ hx_mba_t_create_helper_call
Definition hexrays.hpp:8930
@ hx_user_cmts_new
Definition hexrays.hpp:8567
@ hx_simple_graph_t_depth_first_postorder
Definition hexrays.hpp:8778
@ hx_vcall_helper
Definition hexrays.hpp:9036
@ hx_make_pointer
Definition hexrays.hpp:8685
@ hx_ivlset_t_sub
Definition hexrays.hpp:8749
@ hx_mutable_graph_t_del_edge
Definition hexrays.hpp:8782
@ hx_bitset_t_sub__
Definition hexrays.hpp:8726
@ hx_udc_filter_t_apply
Definition hexrays.hpp:8718
@ hx_bitset_t_intersect
Definition hexrays.hpp:8740
@ hx_block_chains_insert
Definition hexrays.hpp:8639
@ hx_negated_relation
Definition hexrays.hpp:8961
@ hx_user_unions_begin
Definition hexrays.hpp:8581
@ hx_cfunc_t_get_lvars
Definition hexrays.hpp:9055
@ hx_user_iflags_second
Definition hexrays.hpp:8573
@ hx_eamap_begin
Definition hexrays.hpp:8607
@ hx_vdui_t_ui_edit_lvar_cmt
Definition hexrays.hpp:9107
@ hx_cinsn_t_replace_by
Definition hexrays.hpp:9008
@ hx_boundaries_find
Definition hexrays.hpp:8626
@ hx_bitset_t_count_
Definition hexrays.hpp:8735
@ hx_bitset_t_has
Definition hexrays.hpp:8729
@ hx_fnumber_t_print
Definition hexrays.hpp:8787
@ hx_get_float_type
Definition hexrays.hpp:8680
@ hx_bitset_t_add
Definition hexrays.hpp:8721
@ hx_cfunc_t_cleanup
Definition hexrays.hpp:9080
@ hx_bitset_t_sub_
Definition hexrays.hpp:8725
@ hx_user_unions_new
Definition hexrays.hpp:8593
@ hx_user_iflags_end
Definition hexrays.hpp:8569
@ hx_minsn_t__make_nop
Definition hexrays.hpp:8859
@ hx_cdg_insn_iterator_t_next
Definition hexrays.hpp:8946
@ hx_user_unions_prev
Definition hexrays.hpp:8584
@ hx_mop_t_make_high_half
Definition hexrays.hpp:8818
@ hx_mba_t_dump
Definition hexrays.hpp:8916
@ hx_codegen_t_clear
Definition hexrays.hpp:8947
@ hx_simple_graph_t_goup
Definition hexrays.hpp:8779
@ hx_ivlset_t_has_common_
Definition hexrays.hpp:8755
@ hx_cgoto_t_compare
Definition hexrays.hpp:9004
@ hx_mop_t_change_size
Definition hexrays.hpp:8822
@ hx_ivlset_t_has_common
Definition hexrays.hpp:8751
@ hx_block_chains_clear
Definition hexrays.hpp:8641
@ hx_vdui_t_set_num_stroff
Definition hexrays.hpp:9125
@ hx_mlist_t_addmem
Definition hexrays.hpp:8762
@ hx_ccase_t_compare
Definition hexrays.hpp:9021
@ hx_ivlset_t_addmasked
Definition hexrays.hpp:8748
@ hx_getb_reginsn
Definition hexrays.hpp:8875
@ hx_vivl_t_print
Definition hexrays.hpp:8838
@ hx_mblock_t_remove_from_block
Definition hexrays.hpp:8881
@ hx_cfunc_t_get_line_item
Definition hexrays.hpp:9072
@ hx_mba_t_save_snapshot
Definition hexrays.hpp:8937
@ hx_vcreate_helper
Definition hexrays.hpp:9035
@ hx_eamap_size
Definition hexrays.hpp:8617
@ hx_mblock_t_for_all_ops
Definition hexrays.hpp:8883
@ hx_udc_filter_t_cleanup
Definition hexrays.hpp:8716
@ hx_minsn_t_setaddr
Definition hexrays.hpp:8855
@ hx_citem_t_find_closest_addr
Definition hexrays.hpp:8979
@ hx_mop_t_dstr
Definition hexrays.hpp:8794
@ hx_mop_t_is_constant
Definition hexrays.hpp:8815
@ hx_codegen_t_emit
Definition hexrays.hpp:8948
@ hx_mop_t_make_helper
Definition hexrays.hpp:8805
@ hx_user_cmts_begin
Definition hexrays.hpp:8555
@ hx_bitset_t_bitset_t
Definition hexrays.hpp:8719
@ hx_create_cfunc
Definition hexrays.hpp:9084
@ hx_cfunc_t_refresh_func_ctext
Definition hexrays.hpp:9077
@ hx_vivl_t_intersect
Definition hexrays.hpp:8837
@ hx_mop_t_make_gvar
Definition hexrays.hpp:8803
@ hx_mba_t_for_all_insns
Definition hexrays.hpp:8927
@ hx_close_pseudocode
Definition hexrays.hpp:8953
@ hx_cfunc_t_get_eamap
Definition hexrays.hpp:9074
@ hx_mcases_t_dstr
Definition hexrays.hpp:8835
@ hx_lvar_t_is_promoted_arg
Definition hexrays.hpp:8697
@ hx_restore_user_unions
Definition hexrays.hpp:9049
@ hx_mop_t_equal_mops
Definition hexrays.hpp:8811
@ hx_block_chains_find
Definition hexrays.hpp:8638
@ hx_mcallarg_t_print
Definition hexrays.hpp:8825
@ hx_minsn_t_deserialize
Definition hexrays.hpp:8873
@ hx_mbl_graph_t_is_accessed_globally
Definition hexrays.hpp:8943
@ hx_user_labels_insert
Definition hexrays.hpp:8601
@ hx_operand_locator_t_compare
Definition hexrays.hpp:8670
@ hx_valrng_t_intersect_with
Definition hexrays.hpp:8654
@ hx_qstring_printer_t_print
Definition hexrays.hpp:8673
@ hx_ctry_t_compare
Definition hexrays.hpp:9025
@ hx_mblock_t_get_valranges_
Definition hexrays.hpp:8898
@ hx_mblock_t_build_lists
Definition hexrays.hpp:8887
@ hx_cinsn_t_print1
Definition hexrays.hpp:9013
@ hx_ivlset_t_compare
Definition hexrays.hpp:8759
@ hx_cexpr_t_has_side_effects
Definition hexrays.hpp:8993
@ hx_restore_user_lvar_settings
Definition hexrays.hpp:8706
@ hx_minsn_t_for_all_ops
Definition hexrays.hpp:8857
@ hx_mba_t_inline_func
Definition hexrays.hpp:8940
@ hx_valrng_t_clear
Definition hexrays.hpp:8647
@ hx_minsn_t_print
Definition hexrays.hpp:8853
@ hx_mba_t_idaloc2vd_
Definition hexrays.hpp:8904
@ hx_vdui_t_get_number
Definition hexrays.hpp:9096
@ hx_remitem
Definition hexrays.hpp:8960
@ hx_user_numforms_insert
Definition hexrays.hpp:8523
@ hx_mba_t_remove_block
Definition hexrays.hpp:8922
@ hx_cfunc_t_save_user_cmts
Definition hexrays.hpp:9068
@ hx_cexpr_t_dstr
Definition hexrays.hpp:8995
@ hx_bitset_t_shift_down
Definition hexrays.hpp:8728
@ hx_dstr
Definition hexrays.hpp:8674
@ hx_ctree_visitor_t_apply_to_exprs
Definition hexrays.hpp:8972
@ hx_user_iflags_clear
Definition hexrays.hpp:8577
@ hx_cblock_t_compare
Definition hexrays.hpp:9019
@ hx_print_vdloc
Definition hexrays.hpp:8692
@ hx_remove_optinsn_handler
Definition hexrays.hpp:8772
@ hx_mba_t_get_func_output_lists
Definition hexrays.hpp:8931
@ hx_minsn_t_modifies_d
Definition hexrays.hpp:8869
@ hx_cfunc_t_get_stkoff_delta
Definition hexrays.hpp:9056
@ hx_eamap_prev
Definition hexrays.hpp:8610
@ hx_boundaries_end
Definition hexrays.hpp:8621
@ hx_udcall_map_new
Definition hexrays.hpp:8554
@ hx_user_numforms_find
Definition hexrays.hpp:8522
@ hx_user_labels_erase
Definition hexrays.hpp:8602
@ hx_install_hexrays_callback
Definition hexrays.hpp:9090
@ hx_cfunc_t_set_user_cmt
Definition hexrays.hpp:9060
@ hx_vd_printer_t_print
Definition hexrays.hpp:8671
@ hx_mutable_graph_t_goup
Definition hexrays.hpp:8781
@ hx_cnumber_t_print
Definition hexrays.hpp:8966
@ hx_valrng_t_reduce_size
Definition hexrays.hpp:8653
@ hx_save_user_labels
Definition hexrays.hpp:9040
@ hx_open_pseudocode
Definition hexrays.hpp:8952
@ hx_mba_ranges_t_range_contains
Definition hexrays.hpp:8900
@ hx_valrng_t_inverse
Definition hexrays.hpp:8656
@ hx_rlist_t_dstr
Definition hexrays.hpp:8761
@ hx_mop_t_make_reg_pair
Definition hexrays.hpp:8804
@ hx_casm_t_compare
Definition hexrays.hpp:9005
@ hx_user_iflags_begin
Definition hexrays.hpp:8568
@ hx_vdui_t_invert_bits
Definition hexrays.hpp:9127
@ hx_bitset_t_sub
Definition hexrays.hpp:8724
@ hx_cif_t_assign
Definition hexrays.hpp:8996
@ hx_arglocs_overlap
Definition hexrays.hpp:8693
@ hx_eamap_new
Definition hexrays.hpp:8619
@ hx_user_unions_clear
Definition hexrays.hpp:8590
@ hx_get_ctype_name
Definition hexrays.hpp:9088
@ hx_dereference
Definition hexrays.hpp:9039
@ hx_block_chains_next
Definition hexrays.hpp:8635
@ hx_user_labels_next
Definition hexrays.hpp:8596
@ hx_get_op_signness
Definition hexrays.hpp:8963
@ hx_bitset_t_add__
Definition hexrays.hpp:8723
@ hx_mop_t_may_use_aliased_memory
Definition hexrays.hpp:8807
@ hx_restore_user_iflags
Definition hexrays.hpp:9048
@ hx_vdui_t_rename_udm
Definition hexrays.hpp:9113
@ hx_simple_graph_t_compute_dominators
Definition hexrays.hpp:8775
@ hx_vdui_t_refresh_view
Definition hexrays.hpp:9093
@ hx_mba_t_set_lvar_name
Definition hexrays.hpp:8942
@ hx_mop_t_shift_mop
Definition hexrays.hpp:8821
@ hx_bitset_t_has_all
Definition hexrays.hpp:8730
@ hx_change_hexrays_config
Definition hexrays.hpp:8950
@ hx_ivlset_t_dstr
Definition hexrays.hpp:8753
@ hx_cfunc_t_has_orphan_cmts
Definition hexrays.hpp:9063
@ hx_block_chains_new
Definition hexrays.hpp:8644
@ hx_cinsn_t_is_ordinary_flow
Definition hexrays.hpp:9014
@ hx_hexrays_alloc
Definition hexrays.hpp:8645
@ hx_vdui_t_set_noptr_lvar
Definition hexrays.hpp:9106
@ hx_eamap_free
Definition hexrays.hpp:8618
@ hx_vdui_t_refresh_ctext
Definition hexrays.hpp:9094
@ hx_partial_type_num
Definition hexrays.hpp:8679
@ hx_lvar_mapping_next
Definition hexrays.hpp:8531
@ hx_cfunc_t_set_user_iflags
Definition hexrays.hpp:9062
@ hx_vdui_t_del_orphan_cmts
Definition hexrays.hpp:9122
@ hx_stkvar_ref_t_compare
Definition hexrays.hpp:8785
@ hx_valrng_t_set_cmp
Definition hexrays.hpp:8652
@ hx_cfunc_t_print_dcl
Definition hexrays.hpp:9052
@ hx_bitset_t_compare
Definition hexrays.hpp:8742
@ hx_lnot
Definition hexrays.hpp:9033
@ hx_user_numforms_erase
Definition hexrays.hpp:8524
@ hx_user_numforms_new
Definition hexrays.hpp:8528
@ hx_cfunc_t_print_func
Definition hexrays.hpp:9053
@ hx_restore_user_cmts
Definition hexrays.hpp:9046
@ hx_block_chains_free
Definition hexrays.hpp:8643
@ hx_minsn_t_equal_insns
Definition hexrays.hpp:8860
@ hx_mop_t_for_all_ops
Definition hexrays.hpp:8813
@ hx_vdloc_t_is_aliasable
Definition hexrays.hpp:8691
@ hx_ccases_t_compare
Definition hexrays.hpp:9022
@ hx_block_chains_begin
Definition hexrays.hpp:8633
@ hx_udcall_map_first
Definition hexrays.hpp:8546
@ hx_mcode_modifies_d
Definition hexrays.hpp:8669
@ hx_udcall_map_size
Definition hexrays.hpp:8552
@ hx_mcallarg_t_set_regarg
Definition hexrays.hpp:8827
@ hx_ivl_t_dstr
Definition hexrays.hpp:8744
@ hx_mba_t_print
Definition hexrays.hpp:8918
@ hx_reg2mreg
Definition hexrays.hpp:8768
@ hx_lvar_mapping_first
Definition hexrays.hpp:8533
@ hx_mba_t_vd2idaloc
Definition hexrays.hpp:8905
@ hx_mblock_t_print
Definition hexrays.hpp:8877
@ hx_user_unions_first
Definition hexrays.hpp:8585
@ hx_vivl_t_dstr
Definition hexrays.hpp:8839
@ hx_user_numforms_clear
Definition hexrays.hpp:8525
@ hx_stkvar_ref_t_get_stkvar
Definition hexrays.hpp:8786
@ hx_mba_t_get_graph
Definition hexrays.hpp:8912
@ hx_mcallinfo_t_get_type
Definition hexrays.hpp:8830
@ hx_mba_t_arg
Definition hexrays.hpp:8932
@ hx_vdui_t_ui_rename_lvar
Definition hexrays.hpp:9101
@ hx_mba_t_mark_chains_dirty
Definition hexrays.hpp:8920
@ hx_lvar_ref_t_compare
Definition hexrays.hpp:8783
@ hx_get_widget_vdui
Definition hexrays.hpp:8954
@ hx_bitset_t_copy
Definition hexrays.hpp:8720
@ hx_udcall_map_find
Definition hexrays.hpp:8548
@ hx_bitset_t_last
Definition hexrays.hpp:8736
@ hx_user_labels_prev
Definition hexrays.hpp:8597
@ hx_bitset_t_fill_gaps
Definition hexrays.hpp:8738
@ hx_asgop
Definition hexrays.hpp:8964
@ hx_var_ref_t_compare
Definition hexrays.hpp:8970
@ hx_carglist_t_compare
Definition hexrays.hpp:9020
@ hx_mblock_t_init
Definition hexrays.hpp:8876
@ hx_mlist_t_dstr
Definition hexrays.hpp:8764
@ hx_minsn_t_is_noret_call
Definition hexrays.hpp:8862
@ hx_mcallinfo_t_print
Definition hexrays.hpp:8831
@ hx_mblock_t_build_def_list
Definition hexrays.hpp:8892
@ hx_user_unions_find
Definition hexrays.hpp:8587
@ hx_mop_t_create_from_mlist
Definition hexrays.hpp:8795
@ hx_vdui_t_set_udm_type
Definition hexrays.hpp:9112
@ hx_is_kreg
Definition hexrays.hpp:8767
@ hx_udcall_map_next
Definition hexrays.hpp:8544
@ hx_bitset_t_empty
Definition hexrays.hpp:8733
@ hx_codegen_t_emit_
Definition hexrays.hpp:8949
@ hx_block_chains_t_dstr
Definition hexrays.hpp:8846
@ hx_file_printer_t_print
Definition hexrays.hpp:8672
@ hx_mop_t_make_fpnum
Definition hexrays.hpp:8801
@ hx_vdui_t_ui_map_lvar
Definition hexrays.hpp:9109
@ hx_cfunc_t_get_func_type
Definition hexrays.hpp:9054
@ hx_udcall_map_end
Definition hexrays.hpp:8543
@ hx_cloop_t_assign
Definition hexrays.hpp:8998
@ hx_clear_cached_cfuncs
Definition hexrays.hpp:9086
@ hx_save_user_unions
Definition hexrays.hpp:9044
@ hx_mcallinfo_t_dstr
Definition hexrays.hpp:8832
@ hx_ccatch_t_compare
Definition hexrays.hpp:9024
@ hx_user_unions_insert
Definition hexrays.hpp:8588
@ hx_vdui_t_ui_unmap_lvar
Definition hexrays.hpp:9110
@ hx_cfunc_t_get_pseudocode
Definition hexrays.hpp:9076
@ hx_minsn_t_has_side_effects
Definition hexrays.hpp:8865
@ hx_user_iflags_insert
Definition hexrays.hpp:8575
@ hx_mba_t_vdump_mba
Definition hexrays.hpp:8917
@ hx_mba_t_split_block
Definition hexrays.hpp:9133
@ hx_user_unions_second
Definition hexrays.hpp:8586
@ hx_chain_t_append_list_
Definition hexrays.hpp:8843
@ hx_minsn_t_find_num_op
Definition hexrays.hpp:8868
@ hx_ctree_item_t_get_label_num
Definition hexrays.hpp:9030
@ hx_cfunc_parentee_t_calc_rvalue_type
Definition hexrays.hpp:8974
@ hx_is_mcode_propagatable
Definition hexrays.hpp:8664
@ hx_ivlset_t_add_
Definition hexrays.hpp:8747
@ hx_mba_t_get_curfunc
Definition hexrays.hpp:8908
@ hx_mblock_t_find_access
Definition hexrays.hpp:8896
@ hx_boundaries_first
Definition hexrays.hpp:8624
@ hx_vdui_t_calc_cmt_type
Definition hexrays.hpp:9119
@ hx_block_chains_size
Definition hexrays.hpp:8642
@ hx_vdui_t_edit_cmt
Definition hexrays.hpp:9120
@ hx_lvar_mapping_begin
Definition hexrays.hpp:8529
@ hx_must_mcode_close_block
Definition hexrays.hpp:8663
@ hx_boundaries_next
Definition hexrays.hpp:8622
@ hx_block_chains_t_get_chain
Definition hexrays.hpp:8844
@ hx_valrng_t_print
Definition hexrays.hpp:8658
@ hx_make_ref
Definition hexrays.hpp:9038
@ hx_citem_locator_t_compare
Definition hexrays.hpp:8975
@ hx_mop_t_is_sign_extended_from
Definition hexrays.hpp:8809
@ hx_vdui_t_invert_sign
Definition hexrays.hpp:9126
@ hx_modify_user_lvars
Definition hexrays.hpp:8708
@ hx_mblock_t_append_use_list
Definition hexrays.hpp:8889
@ hx_chain_t_print
Definition hexrays.hpp:8840
@ hx_user_labels_free
Definition hexrays.hpp:8605
@ hx_vdloc_t_compare
Definition hexrays.hpp:8690
@ hx_is_type_correct
Definition hexrays.hpp:8675
@ hx_mba_t_optimize_local
Definition hexrays.hpp:8910
@ hx_is_bool_type
Definition hexrays.hpp:8678
@ hx_negate_mcode_relation
Definition hexrays.hpp:8665
@ hx_ivlset_t_intersect
Definition hexrays.hpp:8758
@ hx_ivlset_t_add
Definition hexrays.hpp:8746
@ hx_boundaries_insert
Definition hexrays.hpp:8627
@ hx_creturn_t_compare
Definition hexrays.hpp:9002
@ hx_get_member_type
Definition hexrays.hpp:8684
@ hx_cinsn_t_dstr
Definition hexrays.hpp:9018
@ hx_eamap_erase
Definition hexrays.hpp:8615
@ hx_minsn_t_is_between
Definition hexrays.hpp:8870
@ hx_fnumber_t_dstr
Definition hexrays.hpp:8788
@ hx_mba_t_vd2idaloc_
Definition hexrays.hpp:8906
@ hx_mba_t_copy_block
Definition hexrays.hpp:8923
@ hx_valrng_t_cvt_to_cmp
Definition hexrays.hpp:8661
@ hx_close_hexrays_waitbox
Definition hexrays.hpp:9081
@ hx_user_cmts_size
Definition hexrays.hpp:8565
@ hx_bitset_t_dstr
Definition hexrays.hpp:8732
@ hx_citem_t_find_parent_of
Definition hexrays.hpp:8978
@ hx_mba_t_free_kreg
Definition hexrays.hpp:8939
@ hx_citem_t_contains_label
Definition hexrays.hpp:8977
@ hx_cfunc_t_save_user_labels
Definition hexrays.hpp:9067
@ hx_cexpr_t_get_low_nbit_bound
Definition hexrays.hpp:8991
@ hx_boundaries_new
Definition hexrays.hpp:8632
@ hx_mba_t_remove_blocks
Definition hexrays.hpp:9134
@ hx_get_unk_type
Definition hexrays.hpp:8682
@ hx_mop_t_make_low_half
Definition hexrays.hpp:8817
@ hx_user_unions_next
Definition hexrays.hpp:8583
@ hx_mop_t_print
Definition hexrays.hpp:8793
@ hx_block_chains_t_print
Definition hexrays.hpp:8845
@ hx_cfunc_t_get_user_cmt
Definition hexrays.hpp:9059
@ hx_user_cmts_prev
Definition hexrays.hpp:8558
@ hx_minsn_t_optimize_subtree
Definition hexrays.hpp:8856
@ hx_chain_t_append_list
Definition hexrays.hpp:8842
@ hx_user_unions_erase
Definition hexrays.hpp:8589
@ hx_vdui_t_get_current_label
Definition hexrays.hpp:9097
@ hx_eamap_first
Definition hexrays.hpp:8611
@ hx_vdui_t_edit_func_cmt
Definition hexrays.hpp:9121
@ hx_mop_t_create_from_scattered_vdloc
Definition hexrays.hpp:8798
@ hx_lvar_mapping_erase
Definition hexrays.hpp:8537
@ hx_mba_t_serialize
Definition hexrays.hpp:8935
@ hx_rlist_t_print
Definition hexrays.hpp:8760
@ hx_cswitch_t_compare
Definition hexrays.hpp:9023
@ hx_user_cmts_second
Definition hexrays.hpp:8560
@ hx_mba_t_verify
Definition hexrays.hpp:8919
@ hx_cinsn_t_cleanup
Definition hexrays.hpp:9009
@ hx_block_chains_end
Definition hexrays.hpp:8634
@ hx_boundaries_second
Definition hexrays.hpp:8625
@ hx_mba_t_set_maturity
Definition hexrays.hpp:8909
@ hx_lvar_t_set_width
Definition hexrays.hpp:8700
@ hx_ctree_visitor_t_apply_to
Definition hexrays.hpp:8971
@ hx_ivl_t_compare
Definition hexrays.hpp:8745
@ hx_valrng_t_unite_with
Definition hexrays.hpp:8655
@ hx_minsn_t_find_opcode
Definition hexrays.hpp:8866
@ hx_lvar_t_accepts_type
Definition hexrays.hpp:8698
@ hx_cinsn_t_collect_free_continues
Definition hexrays.hpp:9017
@ hx_cexpr_t_equal_effect
Definition hexrays.hpp:8987
@ hx_swap_mcode_relation
Definition hexrays.hpp:8666
@ hx_udcall_map_second
Definition hexrays.hpp:8547
@ hx_graph_chains_t_release
Definition hexrays.hpp:8848
@ hx_is_nonbool_type
Definition hexrays.hpp:8677
@ hx_user_numforms_next
Definition hexrays.hpp:8518
@ hx_cexpr_t_cleanup
Definition hexrays.hpp:8983
@ hx_lvars_t_find_stkvar
Definition hexrays.hpp:8703
@ hx_minsn_t_find_ins_op
Definition hexrays.hpp:8867
@ hx_mblock_t_for_all_uses
Definition hexrays.hpp:8884
@ hx_lvar_mapping_size
Definition hexrays.hpp:8539
@ hx_valrng_t_has
Definition hexrays.hpp:8657
@ hx_cinsn_t_compare
Definition hexrays.hpp:9007
@ hx_udcall_map_prev
Definition hexrays.hpp:8545
@ hx_citem_t_contains_expr
Definition hexrays.hpp:8976
@ hx_int64_emulator_t_mop_value
Definition hexrays.hpp:9136
@ hx_user_numforms_first
Definition hexrays.hpp:8520
@ hx_gen_microcode
Definition hexrays.hpp:9083
@ hx_vivl_t_extend_to_cover
Definition hexrays.hpp:8836
@ hx_cexpr_t_is_child_of
Definition hexrays.hpp:8988
@ hx_ctree_item_t_get_edm
Definition hexrays.hpp:9027
@ hx_mop_t__make_gvar
Definition hexrays.hpp:8802
@ hx_save_user_defined_calls
Definition hexrays.hpp:8712
@ hx_lvar_mapping_find
Definition hexrays.hpp:8535
@ hx_minsn_t_lexcompare
Definition hexrays.hpp:8861
@ hx_mcallarg_t_dstr
Definition hexrays.hpp:8826
@ hx_user_iflags_new
Definition hexrays.hpp:8580
@ hx_minsn_t_for_all_insns
Definition hexrays.hpp:8858
@ hx_convert_to_user_call
Definition hexrays.hpp:8714
@ hx_mop_t_is_bit_reg
Definition hexrays.hpp:8806
@ hx_minsn_t_dstr
Definition hexrays.hpp:8854
@ hx_mlist_t_print
Definition hexrays.hpp:8763
@ hx_lvar_mapping_prev
Definition hexrays.hpp:8532
@ hx_cfunc_t_find_label
Definition hexrays.hpp:9057
@ hx_minsn_t_init
Definition hexrays.hpp:8849
@ hx_mba_t_for_all_topinsns
Definition hexrays.hpp:8928
@ hx_mcases_t_print
Definition hexrays.hpp:8834
@ hx_user_numforms_size
Definition hexrays.hpp:8526
mba_t mbl_array_t
Definition hexrays.hpp:5446
boundaries_t * boundaries_new()
Create a new boundaries_t instance.
Definition hexrays.hpp:10136
side_effect_t
How to handle side effect of change_size() Sometimes we need to create a temporary operand and change...
Definition hexrays.hpp:2548
@ ONLY_SIDEFF
only handle side effects
Definition hexrays.hpp:2553
@ ANY_REGSIZE
any register size is permitted
Definition hexrays.hpp:2554
@ NO_SIDEFF
change operand size but ignore side effects if you decide to keep the changed operand,...
Definition hexrays.hpp:2549
@ ANY_FPSIZE
any size of floating operand is permitted
Definition hexrays.hpp:2555
@ WITH_SIDEFF
change operand size and handle side effects
Definition hexrays.hpp:2552
int hexapi remove_hexrays_callback(hexrays_cb_t *callback, void *ud)
Uninstall handler for decompiler events.
Definition hexrays.hpp:12991
bool is_assignment(ctype_t op)
Is assignment operator?
Definition hexrays.hpp:6064
void hexapi save_user_numforms(ea_t func_ea, const user_numforms_t *numforms)
Save user defined number formats into the database.
Definition hexrays.hpp:12687
void user_numforms_free(user_numforms_t *map)
Delete user_numforms_t instance.
Definition hexrays.hpp:9257
std::map< int, qstring > user_labels_t
Definition hexrays.hpp:7272
user_unions_iterator_t user_unions_begin(const user_unions_t *map)
Get iterator pointing to the beginning of user_unions_t.
Definition hexrays.hpp:9747
void hexapi install_optblock_handler(optblock_t *opt)
Install a block level custom optimizer.
Definition hexrays.hpp:11030
cexpr_t *hexapi make_ref(cexpr_t *e)
Create a reference.
Definition hexrays.hpp:12663
THREAD_SAFE bool is_mcode_convertible_to_set(mcode_t mcode)
Definition hexrays.hpp:685
THREAD_SAFE bool is_mcode_j1(mcode_t mcode)
Definition hexrays.hpp:679
qvector< ivlset_t > array_of_ivlsets
Definition hexrays.hpp:2043
boundaries_iterator_t boundaries_next(boundaries_iterator_t p)
Move to the next element.
Definition hexrays.hpp:10092
THREAD_SAFE bool is_may_access(maymust_t maymust)
Definition hexrays.hpp:504
void user_unions_erase(user_unions_t *map, user_unions_iterator_t p)
Erase current element from user_unions_t.
Definition hexrays.hpp:9781
number_format_t & user_numforms_second(user_numforms_iterator_t p)
Get reference to the current map value.
Definition hexrays.hpp:9177
mba_t *hexapi gen_microcode(const mba_ranges_t &mbr, hexrays_failure_t *hf=nullptr, const mlist_t *retlist=nullptr, int decomp_flags=0, mba_maturity_t reqmat=MMAT_GLBOPT3)
Generate microcode of an arbitrary code snippet.
Definition hexrays.hpp:12941
void user_unions_free(user_unions_t *map)
Delete user_unions_t instance.
Definition hexrays.hpp:9802
bool is_logical(ctype_t op)
Is logical operator?
Definition hexrays.hpp:6110
bool hexapi install_microcode_filter(microcode_filter_t *filter, bool install=true)
register/unregister non-standard microcode generator
Definition hexrays.hpp:10678
lvar_locator_t const & lvar_mapping_first(lvar_mapping_iterator_t p)
Get reference to the current map key.
Definition hexrays.hpp:9279
qvector< lvar_saved_info_t > lvar_saved_infos_t
Definition hexrays.hpp:1520
citem_cmt_t & user_cmts_second(user_cmts_iterator_t p)
Get reference to the current map value.
Definition hexrays.hpp:9504
THREAD_SAFE mcode_t hexapi negate_mcode_relation(mcode_t code)
Definition hexrays.hpp:10366
qvector< mop_t * > mopptrs_t
Definition hexrays.hpp:285
user_iflags_iterator_t user_iflags_find(const user_iflags_t *map, const citem_locator_t &key)
Find the specified key in user_iflags_t.
Definition hexrays.hpp:9620
const maymust_t EXCLUDE_VOLATILE
Definition hexrays.hpp:493
const mopt_t mop_f
list of arguments
Definition hexrays.hpp:2375
eamap_iterator_t eamap_insert(eamap_t *map, const ea_t &key, const cinsnptrvec_t &val)
Insert new (ea_t, cinsnptrvec_t) pair into eamap_t.
Definition hexrays.hpp:9956
cfuncptr_t decompile_func(func_t *pfn, hexrays_failure_t *hf=nullptr, int decomp_flags=0)
Decompile a function.
Definition hexrays.hpp:7703
void lvar_mapping_free(lvar_mapping_t *map)
Delete lvar_mapping_t instance.
Definition hexrays.hpp:9366
size_t block_chains_size(block_chains_t *set)
Get size of block_chains_t.
Definition hexrays.hpp:10224
ea_t const & udcall_map_first(udcall_map_iterator_t p)
Get reference to the current map key.
Definition hexrays.hpp:9388
void user_labels_free(user_labels_t *map)
Delete user_labels_t instance.
Definition hexrays.hpp:9911
size_t lvar_mapping_size(lvar_mapping_t *map)
Get size of lvar_mapping_t.
Definition hexrays.hpp:9359
bool is_unsigned_cmpop(cmpop_t cmpop)
Definition hexrays.hpp:350
void hexapi install_optinsn_handler(optinsn_t *opt)
Install an instruction level custom optimizer.
Definition hexrays.hpp:11017
const mreg_t mr_none
Definition hexrays.hpp:780
void user_iflags_free(user_iflags_t *map)
Delete user_iflags_t instance.
Definition hexrays.hpp:9693
bool rename_lvar(ea_t func_ea, const char *oldname, const char *newname)
Rename a local variable.
Definition hexrays.hpp:1664
qrefcnt_t< cfunc_t > cfuncptr_t
Definition hexrays.hpp:289
qvector< cblock_pos_t > cblock_posvec_t
Definition hexrays.hpp:6997
user_iflags_iterator_t user_iflags_begin(const user_iflags_t *map)
Get iterator pointing to the beginning of user_iflags_t.
Definition hexrays.hpp:9638
void user_labels_erase(user_labels_t *map, user_labels_iterator_t p)
Erase current element from user_labels_t.
Definition hexrays.hpp:9890
THREAD_SAFE bool hexapi mcode_modifies_d(mcode_t mcode)
Definition hexrays.hpp:10390
const mreg_t mr_cc
Definition hexrays.hpp:787
lvar_mapping_iterator_t lvar_mapping_find(const lvar_mapping_t *map, const lvar_locator_t &key)
Find the specified key in lvar_mapping_t.
Definition hexrays.hpp:9293
lvar_mapping_iterator_t lvar_mapping_begin(const lvar_mapping_t *map)
Get iterator pointing to the beginning of lvar_mapping_t.
Definition hexrays.hpp:9311
qvector< hexwarn_t > hexwarns_t
Definition hexrays.hpp:4713
user_numforms_t *hexapi restore_user_numforms(ea_t func_ea)
Restore user defined number formats from the database.
Definition hexrays.hpp:12717
eamap_t * eamap_new()
Create a new eamap_t instance.
Definition hexrays.hpp:10027
block_chains_iterator_t block_chains_end(const block_chains_t *set)
Get iterator pointing to the end of block_chains_t.
Definition hexrays.hpp:10185
lvar_mapping_iterator_t lvar_mapping_insert(lvar_mapping_t *map, const lvar_locator_t &key, const lvar_locator_t &val)
Insert new (lvar_locator_t, lvar_locator_t) pair into lvar_mapping_t.
Definition hexrays.hpp:9302
void hexapi save_user_unions(ea_t func_ea, const user_unions_t *unions)
Save user defined union field selections into the database.
Definition hexrays.hpp:12699
cmpop_t
Definition hexrays.hpp:338
@ CMP_A
Definition hexrays.hpp:343
@ CMP_GT
Definition hexrays.hpp:345
@ CMP_LT
Definition hexrays.hpp:347
@ CMP_NZ
Definition hexrays.hpp:339
@ CMP_GE
Definition hexrays.hpp:346
@ CMP_LE
Definition hexrays.hpp:348
@ CMP_B
Definition hexrays.hpp:342
@ CMP_Z
Definition hexrays.hpp:340
@ CMP_BE
Definition hexrays.hpp:344
@ CMP_AE
Definition hexrays.hpp:341
qvector< minsn_t * > minsnptrs_t
Definition hexrays.hpp:284
bool op_uses_x(ctype_t op)
Does operator use the 'x' field of cexpr_t?
Definition hexrays.hpp:6052
const maymust_t ONE_ACCESS_TYPE
Definition hexrays.hpp:481
citem_locator_t const & user_iflags_first(user_iflags_iterator_t p)
Get reference to the current map key.
Definition hexrays.hpp:9606
bool is_cmpop_without_eq(cmpop_t cmpop)
Definition hexrays.hpp:365
const maymust_t MUST_ACCESS
Definition hexrays.hpp:476
const uvlr_t MAX_VLR_VALUE
Definition hexrays.hpp:313
user_unions_iterator_t user_unions_insert(user_unions_t *map, const ea_t &key, const intvec_t &val)
Insert new (ea_t, intvec_t) pair into user_unions_t.
Definition hexrays.hpp:9738
carglist_t * args
Definition hexrays.hpp:7323
const maymust_t WITH_ASSERTS
Definition hexrays.hpp:491
bool hexapi locate_lvar(lvar_locator_t *out, ea_t func_ea, const char *varname)
Find a variable by name.
Definition hexrays.hpp:10648
user_cmts_t * user_cmts_new()
Create a new user_cmts_t instance.
Definition hexrays.hpp:9591
qvector< cinsn_t * > cinsnptrvec_t
Vector of pointers to statements.
Definition hexrays.hpp:6744
const mopt_t mop_c
mcases
Definition hexrays.hpp:2379
udcall_t & udcall_map_second(udcall_map_iterator_t p)
Get reference to the current map value.
Definition hexrays.hpp:9395
block_chains_t * block_chains_new()
Create a new block_chains_t instance.
Definition hexrays.hpp:10238
void term_hexrays_plugin()
Stop working with hex-rays decompiler.
Definition hexrays.hpp:9155
mblock_type_t
Basic block types.
Definition hexrays.hpp:4164
@ BLT_NONE
unknown block type
Definition hexrays.hpp:4165
@ BLT_XTRN
external block (out of function address)
Definition hexrays.hpp:4171
@ BLT_STOP
stops execution regularly (must be the last block)
Definition hexrays.hpp:4166
@ BLT_2WAY
passes execution to two blocks (conditional jump)
Definition hexrays.hpp:4169
@ BLT_0WAY
does not have successors (tail is a noret function)
Definition hexrays.hpp:4167
@ BLT_1WAY
passes execution to one block (regular or goto block)
Definition hexrays.hpp:4168
@ BLT_NWAY
passes execution to many blocks (switch idiom)
Definition hexrays.hpp:4170
const mreg_t mr_of
Definition hexrays.hpp:784
AS_PRINTF(3, 0) cexpr_t *hexapi vcreate_helper(bool standalone
Create a helper object.
Definition hexrays.hpp:11907
ctype_t hexapi asgop_revert(ctype_t cop)
Convert assignment operator into plain operator.
Definition hexrays.hpp:12213
size_t user_labels_size(user_labels_t *map)
Get size of user_labels_t.
Definition hexrays.hpp:9904
THREAD_SAFE bool is_mcode_divmod(mcode_t op)
Definition hexrays.hpp:711
block_chains_iterator_t block_chains_begin(const block_chains_t *set)
Get iterator pointing to the beginning of block_chains_t.
Definition hexrays.hpp:10176
bool hexapi decompile_many(const char *outfile, const eavec_t *funcaddrs, int flags)
Batch decompilation.
Definition hexrays.hpp:12151
qvector< ccatch_t > ccatchvec_t
Definition hexrays.hpp:6945
void boundaries_erase(boundaries_t *map, boundaries_iterator_t p)
Erase current element from boundaries_t.
Definition hexrays.hpp:10108
boundaries_iterator_t boundaries_insert(boundaries_t *map, const cinsn_t *&key, const rangeset_t &val)
Insert new (cinsn_t *, rangeset_t) pair into boundaries_t.
Definition hexrays.hpp:10065
user_cmts_iterator_t user_cmts_find(const user_cmts_t *map, const treeloc_t &key)
Find the specified key in user_cmts_t.
Definition hexrays.hpp:9511
std::map< ea_t, cinsnptrvec_t > eamap_t
Definition hexrays.hpp:7453
const svlr_t MAX_VLR_SVALUE
Definition hexrays.hpp:314
void hexapi hexrays_free(void *ptr)
Definition hexrays.hpp:10250
vdui_t *hexapi get_widget_vdui(TWidget *f)
Get the vdui_t instance associated to the TWidget.
Definition hexrays.hpp:12145
const mopt_t mop_v
global variable
Definition hexrays.hpp:2373
user_iflags_iterator_t user_iflags_end(const user_iflags_t *map)
Get iterator pointing to the end of user_iflags_t.
Definition hexrays.hpp:9647
int maymust_t
Definition hexrays.hpp:473
user_labels_iterator_t user_labels_prev(user_labels_iterator_t p)
Move to the previous element.
Definition hexrays.hpp:9882
THREAD_SAFE bool is_mcode_set(mcode_t mcode)
Definition hexrays.hpp:675
user_iflags_iterator_t user_iflags_prev(user_iflags_iterator_t p)
Move to the previous element.
Definition hexrays.hpp:9664
bool is_multiplicative(ctype_t op)
Is multiplicative operator?
Definition hexrays.hpp:6091
citem_pointers_t parents_t
Definition hexrays.hpp:6197
void udcall_map_erase(udcall_map_t *map, udcall_map_iterator_t p)
Erase current element from udcall_map_t.
Definition hexrays.hpp:9454
cinsn_t *hexapi new_block()
Create a new block-statement.
Definition hexrays.hpp:12639
mba_maturity_t
Microcode maturity levels.
Definition hexrays.hpp:4718
@ MMAT_LOCOPT
local optimization of each basic block is complete.
Definition hexrays.hpp:4722
@ MMAT_LVARS
allocated local variables
Definition hexrays.hpp:4728
@ MMAT_CALLS
detected call arguments. see also hxe_calls_done
Definition hexrays.hpp:4724
@ MMAT_GLBOPT1
performed the first pass of global optimization
Definition hexrays.hpp:4725
@ MMAT_PREOPTIMIZED
preoptimized pass is complete
Definition hexrays.hpp:4721
@ MMAT_ZERO
microcode does not exist
Definition hexrays.hpp:4719
@ MMAT_GLBOPT3
completed all global optimization. microcode is fixed now.
Definition hexrays.hpp:4727
@ MMAT_GLBOPT2
most global optimization passes are done
Definition hexrays.hpp:4726
@ MMAT_GENERATED
generated microcode
Definition hexrays.hpp:4720
THREAD_SAFE bool has_mcode_seloff(mcode_t op)
Definition hexrays.hpp:716
void hexapi save_user_lvar_settings(ea_t func_ea, const lvar_uservec_t &lvinf)
Save user defined local variable settings into the database.
Definition hexrays.hpp:10630
ctype_t hexapi asgop(ctype_t cop)
Convert plain operator into assignment operator. For example, cot_add returns cot_asgadd.
Definition hexrays.hpp:12207
bool hexapi restore_user_defined_calls(udcall_map_t *udcalls, ea_t func_ea)
Restore user defined function calls from the database.
Definition hexrays.hpp:10654
int64 svlr_t
Definition hexrays.hpp:311
bool hexapi remove_optinsn_handler(optinsn_t *opt)
Remove an instruction level custom optimizer.
Definition hexrays.hpp:11023
void eamap_free(eamap_t *map)
Delete eamap_t instance.
Definition hexrays.hpp:10020
warnid_t
Warning ids.
Definition hexrays.hpp:4631
@ WARN_OPT_VALRNG4
56 the cases s were optimized away because s
Definition hexrays.hpp:4688
@ WARN_OPT_VALRNG2
52 mask 0xX is shortened because s <= 0xX"
Definition hexrays.hpp:4684
@ WARN_GUESSED_TYPE
9 using guessed type s;
Definition hexrays.hpp:4641
@ WARN_BAD_STROFF
33 user specified stroff has not been processed: s
Definition hexrays.hpp:4665
@ WARN_OPT_USELESS_JCND
54 simplified comparisons for 's': s became s
Definition hexrays.hpp:4686
@ WARN_ODD_INPUT_REG
15 odd input register s
Definition hexrays.hpp:4647
@ WARN_ILL_FUNCTYPE
2 invalid function type 's' has been ignored
Definition hexrays.hpp:4634
@ WARN_ILL_PURGED
1 odd caller purged bytes d, correcting
Definition hexrays.hpp:4633
@ WARN_UNINITED_REG
28 reference to an uninitialized register has been removed: s
Definition hexrays.hpp:4660
@ WARN_ODD_ADDR_USE
16 odd use of a variable address
Definition hexrays.hpp:4648
@ WARN_CBUILD_LOOPS
13 too many cbuild loops
Definition hexrays.hpp:4645
@ WARN_BAD_VARSIZE
34 inconsistent variable size for 's'
Definition hexrays.hpp:4666
@ WARN_VARARG_MANY
5 too many varargs, some ignored
Definition hexrays.hpp:4637
@ WARN_MAX
may be used in notes as a placeholder when the warning id is not available
Definition hexrays.hpp:4689
@ WARN_UNBALANCED_STACK
51 unbalanced stack, ignored a potential tail call
Definition hexrays.hpp:4683
@ WARN_FRAG_LVAR
26 fragmented variable at s may be wrong
Definition hexrays.hpp:4658
@ WARN_BAD_PURGED
12 inconsistent function type and number of purged bytes
Definition hexrays.hpp:4644
@ WARN_UNSUPP_REG
35 unsupported processor register 's'
Definition hexrays.hpp:4667
@ WARN_VARARG_REGS
0 cannot handle register arguments in vararg function, discarded them
Definition hexrays.hpp:4632
@ WARN_MISSED_SWITCH
39 wrong markup of switch jump, skipped it
Definition hexrays.hpp:4671
@ WARN_UNDEF_LVAR
42 variable 's' is possibly undefined
Definition hexrays.hpp:4674
@ WARN_RET_LOCREF
47 returning address of temporary local variable 's'
Definition hexrays.hpp:4679
@ WARN_BAD_RETVAR
25 wrong return variable
Definition hexrays.hpp:4657
@ WARN_SUBFRAME_OVERFLOW
55 call arguments overflow the function chunk frame
Definition hexrays.hpp:4687
@ WARN_CR_NOFIELD
31 CONTAINING_RECORD: no field 's' in struct 's' at d
Definition hexrays.hpp:4663
@ WARN_BAD_CALL_SP
38 bad sp value at call
Definition hexrays.hpp:4670
@ WARN_WRITE_CONST
24 write access to const memory at a has been detected
Definition hexrays.hpp:4656
@ WARN_WIDEN_CHAINS
11 failed to widen chains
Definition hexrays.hpp:4643
@ WARN_ILL_FPU_STACK
18 inconsistent fpu stack
Definition hexrays.hpp:4650
@ WARN_SELFREF_PROP
19 self-referencing variable has been detected
Definition hexrays.hpp:4651
@ WARN_WRONG_VA_OFF
30 wrong offset of va_list variable
Definition hexrays.hpp:4662
@ WARN_BAD_STKPNT
41 wrong sp change point
Definition hexrays.hpp:4673
@ WARN_OPT_VALRNG
46 conditional instruction was optimized away because s
Definition hexrays.hpp:4678
@ WARN_BAD_SHADOW
45 ignored the value written to the shadow area of the succeeding call
Definition hexrays.hpp:4677
@ WARN_NO_SAVE_REST
14 could not find valid save-restore pair for s
Definition hexrays.hpp:4646
@ WARN_BAD_INSN
49 bad instruction
Definition hexrays.hpp:4681
@ WARN_ILL_ELLIPSIS
8 erroneously detected ellipsis type has been ignored
Definition hexrays.hpp:4640
@ WARN_EXP_LINVAR
10 failed to expand a linear variable
Definition hexrays.hpp:4642
@ WARN_VARARG_NOSTK
4 call vararg without local stack
Definition hexrays.hpp:4636
@ WARN_MUST_RET_FP
17 function return type is incorrect (must be floating point)
Definition hexrays.hpp:4649
@ WARN_JUMPOUT
43 control flows out of bounds
Definition hexrays.hpp:4675
@ WARN_BAD_FIELD_TYPE
23 incorrect structure member type for s::s, ignored
Definition hexrays.hpp:4655
@ WARN_WOULD_OVERLAP
20 variables would overlap: s
Definition hexrays.hpp:4652
@ WARN_FIXED_INSN
29 fixed broken insn
Definition hexrays.hpp:4661
@ WARN_VARARG_TCAL
3 cannot handle tail call to vararg
Definition hexrays.hpp:4635
@ WARN_ODD_ABI
50 encountered odd instruction for the current ABI
Definition hexrays.hpp:4682
@ WARN_HUGE_STKOFF
27 exceedingly huge offset into the stack frame
Definition hexrays.hpp:4659
@ WARN_ADDR_OUTARGS
6 cannot handle address arithmetics in outgoing argument area of stack frame – unused
Definition hexrays.hpp:4638
@ WARN_MAX_ARGS
22 too many input arguments, some ignored
Definition hexrays.hpp:4654
@ WARN_ARRAY_INARG
21 array has been used for an input argument
Definition hexrays.hpp:4653
@ WARN_UNALIGNED_ARG
36 unaligned function argument 's'
Definition hexrays.hpp:4668
@ WARN_CR_BADOFF
32 CONTAINING_RECORD: too small offset d for struct 's'
Definition hexrays.hpp:4664
@ WARN_BAD_SP
40 positive sp value a has been found
Definition hexrays.hpp:4672
@ WARN_OPT_VALRNG3
53 masking with 0XX was optimized away because s <= 0xX
Definition hexrays.hpp:4685
@ WARN_BAD_VALRNG
44 values range analysis failed
Definition hexrays.hpp:4676
@ WARN_DEP_UNK_CALLS
7 found interdependent unknown calls
Definition hexrays.hpp:4639
@ WARN_BAD_STD_TYPE
37 corrupted or unexisting local type 's'
Definition hexrays.hpp:4669
@ WARN_BAD_MAPDST
48 too short map destination 's' for variable 's'
Definition hexrays.hpp:4680
treeloc_t const & user_cmts_first(user_cmts_iterator_t p)
Get reference to the current map key.
Definition hexrays.hpp:9497
void block_chains_erase(block_chains_t *set, block_chains_iterator_t p)
Erase current element from block_chains_t.
Definition hexrays.hpp:10210
const int cc_count
Definition hexrays.hpp:786
block_chains_iterator_t block_chains_prev(block_chains_iterator_t p)
Move to the previous element.
Definition hexrays.hpp:10202
std::map< citem_locator_t, int32 > user_iflags_t
Definition hexrays.hpp:6309
user_cmts_t *hexapi restore_user_cmts(ea_t func_ea)
Restore user defined comments from the database.
Definition hexrays.hpp:12711
const cmt_type_t CMT_ALL
All comments.
Definition hexrays.hpp:8154
void user_unions_clear(user_unions_t *map)
Clear user_unions_t.
Definition hexrays.hpp:9788
const size_t bitset_align
Definition hexrays.hpp:1784
const mopt_t mop_h
helper function
Definition hexrays.hpp:2378
THREAD_SAFE bool is_mcode_set1(mcode_t mcode)
Definition hexrays.hpp:677
void lvar_mapping_erase(lvar_mapping_t *map, lvar_mapping_iterator_t p)
Erase current element from lvar_mapping_t.
Definition hexrays.hpp:9345
const char *hexapi get_hexrays_version()
Get decompiler version.
Definition hexrays.hpp:12127
bool is_binary(ctype_t op)
Is binary operator?
Definition hexrays.hpp:6058
std::map< operand_locator_t, number_format_t > user_numforms_t
Definition hexrays.hpp:875
ivlset_tpl< ivl_t, uval_t > uval_ivl_ivlset_t
Set of address intervals.
Definition hexrays.hpp:2017
bool is_cmpop_with_eq(cmpop_t cmpop)
Definition hexrays.hpp:358
lvar_mapping_t * lvar_mapping_new()
Create a new lvar_mapping_t instance.
Definition hexrays.hpp:9373
bool hexapi is_kreg(mreg_t r)
Is a kernel register?
Definition hexrays.hpp:10993
udcall_map_t * udcall_map_new()
Create a new udcall_map_t instance.
Definition hexrays.hpp:9482
void hexapi send_database(const hexrays_failure_t &err, bool silent)
Send the database to Hex-Rays.
Definition hexrays.hpp:12165
void hexapi save_user_defined_calls(ea_t func_ea, const udcall_map_t &udcalls)
Save user defined local function calls into the database.
Definition hexrays.hpp:10660
user_labels_iterator_t user_labels_next(user_labels_iterator_t p)
Move to the next element.
Definition hexrays.hpp:9874
qstring & user_labels_second(user_labels_iterator_t p)
Get reference to the current map value.
Definition hexrays.hpp:9831
std::set< qstring > strings_t
Definition hexrays.hpp:283
THREAD_SAFE bool is_mcode_call(mcode_t mcode)
Definition hexrays.hpp:687
THREAD_SAFE mcode_t hexapi get_signed_mcode(mcode_t code)
Definition hexrays.hpp:10378
Contains the inf structure definition and some functions common to the whole IDA project.
uchar inf_get_cc_size_i()
Definition ida.hpp:1001
uint32 callcnv_t
Definition ida.hpp:74
Contains definition of the interface to IDP modules.
qvector< reg_info_t > reginfovec_t
vector of register info objects
Definition idp.hpp:2718
IEEE floating point functions.
idaman THREAD_SAFE fpvalue_kind_t ida_export get_fpvalue_kind(const fpvalue_t &a, uint16 reserved=0)
const uint32 MAXEXP_LNGDBL
maximum exponent for 80-bit long double
Definition ieee.h:42
const uint32 MAXEXP_FLOAT
maximum exponent for 32-bit float
Definition ieee.h:40
const uint32 MAXEXP_DOUBLE
maximum exponent for 64-bit double
Definition ieee.h:41
idaman THREAD_SAFE int ida_export ecmp(const fpvalue_t &a, const fpvalue_t &b)
@ FPV_NAN
NaN.
Definition ieee.h:31
Defines the interface between the kernel and the UI.
idaman int64 size_t count
Definition kernwin.hpp:1366
int nbytes
Definition kernwin.hpp:2861
bool ok
Definition kernwin.hpp:7006
uval_t uval_t
Definition kernwin.hpp:1878
callui(ui_mbox, mbox_replace, format, va)
@ ui_broadcast
cb: broadcast call
Definition kernwin.hpp:398
asize_t size
Definition kernwin.hpp:6339
QT::QWidget TWidget
Definition kernwin.hpp:2024
qvector< simpleline_t > strvec_t
A collection of simple lines to populate a custom view.
Definition kernwin.hpp:1732
void(idaapi *range_marker)(ea_t ea
Pointer to range marker function (for idaviews and hexviews) This pointer is initialized by setup_ran...
unsigned __int64 uint64
Definition llong.hpp:13
__int64 int64
Definition llong.hpp:14
Definitions of IDP, LDR, PLUGIN module interfaces.
uchar type_t
In serialized form, a type is represented by a byte sequence.
Definition nalt.hpp:1317
THREAD_SAFE constexpr bool contains(uval_t off1, asize_t s1, uval_t off)
Does (off1,s1) contain off?
Definition pro.h:1469
THREAD_SAFE constexpr bool includes(uval_t off1, asize_t s1, uval_t off2, asize_t s2)
Does (off1,s1) include (off2,s2)?
Definition pro.h:1464
THREAD_SAFE constexpr bool overlap(uval_t off1, asize_t s1, uval_t off2, asize_t s2)
Do (off1,s1) and (off2,s2) overlap?
Definition pro.h:1459
This is the first header included in the IDA project.
idaman size_t const char time_t t
Definition pro.h:602
unsigned short uint16
unsigned 16 bit value
Definition pro.h:346
int bool
Definition pro.h:329
unsigned int uint32
unsigned 32 bit value
Definition pro.h:348
qvector< int > intvec_t
vector of integers
Definition pro.h:2765
uint64 asize_t
Definition pro.h:423
constexpr T make_mask(int count)
Make a mask of 'count' bits.
Definition pro.h:1521
constexpr T right_sshift(const T &value, int shift)
Shift by the amount exceeding the operand size*8 is undefined by the standard.
Definition pro.h:1491
uint8 op_dtype_t
Definition pro.h:460
adiff_t sval_t
signed value used by the processor.
Definition pro.h:446
short int16
signed 16 bit value
Definition pro.h:345
uint64 ea_t
Definition pro.h:421
constexpr T right_ushift(const T &value, int shift)
Shift by the amount exceeding the operand size*8 is undefined by the standard.
Definition pro.h:1486
uint32 flags_t
32-bit flags for each address
Definition pro.h:5008
int int32
signed 32 bit value
Definition pro.h:347
unsigned char uchar
unsigned 8 bit value
Definition pro.h:337
idaman THREAD_SAFE void ida_export qfree(void *alloc)
System independent free.
THREAD_SAFE void qswap(T &a, T &b)
Swap 2 objects of the same type using memory copies.
Definition pro.h:1715
idaman THREAD_SAFE char *ida_export qstrdup(const char *string)
System independent strdup.
void shift_down(T *dst, T *src, size_t cnt)
Move data down in memory.
Definition pro.h:2197
unsigned int uint
unsigned 32 bit value
Definition pro.h:339
int lexcompare(const T &a, const T &b)
Standard lexical comparison.
Definition pro.h:2888
qvector< ea_t > eavec_t
vector of addresses
Definition pro.h:2764
uint64 flags64_t
64-bit flags for each address
Definition pro.h:5009
ptrdiff_t ssize_t
Signed size_t - used to check for size overflows when the counter becomes negative.
Definition pro.h:381
idaman uint64 ida_export extend_sign(uint64 v, int nbytes, bool sign_extend)
Sign-, or zero-extend the value 'v' to occupy 64 bits.
INLINE THREAD_SAFE bool idaapi test_bit(const uchar *bitmap, size_t bit)
Test if 'bit' is set in 'bitmap'.
Definition pro.h:1364
void idaapi setflag(T &where, U bit, bool cnd)
Set a 'bit' in 'where' if 'value' if not zero.
Definition pro.h:1527
unsigned char uint8
unsigned 8 bit value
Definition pro.h:344
char int8
signed 8 bit value
Definition pro.h:342
constexpr T left_shift(const T &value, int shift)
Shift by the amount exceeding the operand size*8 is undefined by the standard.
Definition pro.h:1481
_qstring< char > qstring
regular string
Definition pro.h:3694
int compare(const T &a, const T &b)
Definition pro.h:4514
Definition hexrays.hpp:6319
bit_bound_t(int n=0, int s=0)
Definition hexrays.hpp:6328
int16 nbits
Definition hexrays.hpp:6320
int16 sbits
Definition hexrays.hpp:6322
Definition hexrays.hpp:10143
bool operator==(const block_chains_iterator_t &p) const
Definition hexrays.hpp:10145
iterator_word x
Definition hexrays.hpp:10144
bool operator!=(const block_chains_iterator_t &p) const
Definition hexrays.hpp:10146
Definition hexrays.hpp:10034
bool operator!=(const boundaries_iterator_t &p) const
Definition hexrays.hpp:10037
iterator_word x
Definition hexrays.hpp:10035
bool operator==(const boundaries_iterator_t &p) const
Definition hexrays.hpp:10036
Function argument.
Definition hexrays.hpp:6856
tinfo_t formal_type
formal parameter type (if known)
Definition hexrays.hpp:6858
bool is_vararg
is a vararg (matches ...)
Definition hexrays.hpp:6857
void consume_cexpr(cexpr_t *e)
Definition hexrays.hpp:6859
DECLARE_COMPARISONS(carg_t)
Definition hexrays.hpp:6864
Function argument list.
Definition hexrays.hpp:6873
tinfo_t functype
function object type
Definition hexrays.hpp:6874
void print(qstring *vout, const cfunc_t *func) const
carglist_t()
Definition hexrays.hpp:6879
int print(int curpos, vc_printer_t &vp) const
int flags
call flags
Definition hexrays.hpp:6875
DECLARE_COMPARISONS(carglist_t)
carglist_t(const tinfo_t &ftype, int fl=0)
Definition hexrays.hpp:6880
asm statement
Definition hexrays.hpp:6734
DECLARE_COMPARISONS(casm_t)
void print(const citem_t *parent, int indent, vc_printer_t &vp) const
void genasm(qstring *buf, ea_t ea) const
casm_t(ea_t ea)
Definition hexrays.hpp:6735
bool one_insn() const
Definition hexrays.hpp:6739
casm_t(const casm_t &r)
Definition hexrays.hpp:6736
Catch expression.
Definition hexrays.hpp:6915
void swap(catchexpr_t &r)
Definition hexrays.hpp:6922
cexpr_t obj
the caught object.
Definition hexrays.hpp:6916
DECLARE_COMPARISONS(catchexpr_t)
bool is_catch_all() const
Definition hexrays.hpp:6927
qstring fake_type
if not empty, type of the caught object.
Definition hexrays.hpp:6918
Additional position information for cblocks.
Definition hexrays.hpp:6989
cinsn_t * insn() const
Definition hexrays.hpp:6993
cinsn_t * prev_insn()
Definition hexrays.hpp:6994
cblock_t::iterator p
Definition hexrays.hpp:6991
bool is_first_insn() const
Definition hexrays.hpp:6992
cblock_t * blk
Definition hexrays.hpp:6990
Compound statement (curly braces)
Definition hexrays.hpp:6850
DECLARE_COMPARISONS(cblock_t)
Switch case. Usually cinsn_t is a block.
Definition hexrays.hpp:6888
uint64vec_t values
List of case values.
Definition hexrays.hpp:6889
DECLARE_COMPARISONS(ccase_t)
const uint64 & value(int i) const
Definition hexrays.hpp:6894
size_t size() const
Definition hexrays.hpp:6893
void set_insn(cinsn_t *i)
Vector of switch cases.
Definition hexrays.hpp:6900
DECLARE_COMPARISONS(ccases_t)
int find_value(uint64 v) const
Catch clause: "catch ( type obj )".
Definition hexrays.hpp:6934
void swap(ccatch_t &r)
Definition hexrays.hpp:6938
DECLARE_COMPARISONS(ccatch_t)
bool is_catch_all() const
Definition hexrays.hpp:6937
catchexprs_t exprs
Definition hexrays.hpp:6935
Definition hexrays.hpp:5553
ea_t ea
Definition hexrays.hpp:5555
cdg_insn_iterator_t(const cdg_insn_iterator_t &r)=default
const mba_t * mba
Definition hexrays.hpp:5554
ea_t end
Definition hexrays.hpp:5556
cdg_insn_iterator_t(const mba_t *mba_)
Definition hexrays.hpp:5563
bool is_severed_dslot() const
Definition hexrays.hpp:5571
ea_t severed_branch
Definition hexrays.hpp:5559
insn_t dslot_insn
Definition hexrays.hpp:5558
void start(const range_t &rng)
Definition hexrays.hpp:5572
bool dslot_with_xrefs() const
Definition hexrays.hpp:5569
cdg_insn_iterator_t & operator=(const cdg_insn_iterator_t &r)=default
bool ok() const
Definition hexrays.hpp:5567
ea_t dslot
Definition hexrays.hpp:5557
bool has_dslot() const
Definition hexrays.hpp:5568
bool is_likely_dslot
Definition hexrays.hpp:5561
merror_t hexapi next(insn_t *ins)
Definition hexrays.hpp:12097
Do-loop.
Definition hexrays.hpp:6713
DECLARE_COMPARISONS(cdo_t)
Statement with an expression.
Definition hexrays.hpp:6657
cexpr_t expr
Expression of the statement.
Definition hexrays.hpp:6658
Ctree item: expression.
Definition hexrays.hpp:6381
type_sign_t get_type_sign() const
Get expression sign.
Definition hexrays.hpp:6540
bit_bound_t hexapi get_high_nbit_bound() const
Get max number of bits that can really be used by the expression.
Definition hexrays.hpp:12341
int ptrsize
memory access size (used for cot_ptr, cot_memptr)
Definition hexrays.hpp:6408
uint32 exflags
Expression attributes
Definition hexrays.hpp:6417
~cexpr_t()
Definition hexrays.hpp:6471
bool contains_comma(int times=1) const
Does the expression contain a comma operator?
Definition hexrays.hpp:6520
void swap(cexpr_t &r)
Definition hexrays.hpp:6458
bool is_value_used(const citem_t *parent) const
Does the PARENT need the expression value.
void hexapi replace_by(cexpr_t *r)
Replace the expression.
Definition hexrays.hpp:12293
cexpr_t & operator=(const cexpr_t &r)
Definition hexrays.hpp:6468
bool is_type_unsigned() const
Is expression unsigned?
Definition hexrays.hpp:6542
void hexapi cleanup()
Cleanup the expression.
Definition hexrays.hpp:12299
bool is_nice_cond() const
Is nice condition?
Definition hexrays.hpp:6532
bool is_aliasable() const
Check if the expression if aliasable.
bool is_call_arg_of(const citem_t *parent) const
Is call argument?
Definition hexrays.hpp:6538
fnumber_t * fpc
used for cot_fnum
Definition hexrays.hpp:6385
cexpr_t(const cexpr_t &r)
Definition hexrays.hpp:6457
carglist_t * a
argument list (used for cot_call)
Definition hexrays.hpp:6401
bool hexapi requires_lvalue(const cexpr_t *child) const
Check if the expression requires an lvalue.
Definition hexrays.hpp:12355
void set_type_partial(bool val=true)
Definition hexrays.hpp:6445
uint64 numval() const
Get numeric value of the expression.
Definition hexrays.hpp:6566
bool is_zero_const() const
Check if the expression is a zero.
Definition hexrays.hpp:6592
void hexapi print1(qstring *vout, const cfunc_t *func) const
Print expression into one line.
Definition hexrays.hpp:12311
bool like_boolean() const
Does the expression look like a boolean expression?
cexpr_t * get_ptr_or_array()
Find pointer or array child.
Definition hexrays.hpp:6612
void set_vftable()
Definition hexrays.hpp:6444
const cexpr_t * find_op(ctype_t _op) const
Find the child with the specified operator.
Definition hexrays.hpp:6621
bool is_type_signed() const
Is expression signed?
Definition hexrays.hpp:6544
char * string
utf8 string constant, user representation (used for cot_str)
Definition hexrays.hpp:6414
bool is_vftable() const
Definition hexrays.hpp:6440
bool is_negative_const() const
Check if the expression is a negative number.
Definition hexrays.hpp:6577
bool is_nice_expr() const
Is nice expression?
Definition hexrays.hpp:6529
const cexpr_t * find_num_op() const
Find the operand with a numeric value.
Definition hexrays.hpp:6635
cinsn_t * insn
an embedded statement, they are prohibited at the final maturity stage (CMAT_FINAL)
Definition hexrays.hpp:6411
bool is_non_negative_const() const
Check if the expression is a non-negative number.
Definition hexrays.hpp:6582
bool is_const_value(uint64 _v) const
Check if the expression is a number with the specified value.
Definition hexrays.hpp:6572
void hexapi calc_type(bool recursive)
Calculate the type of the expression.
Definition hexrays.hpp:12317
bool is_type_partial() const
Definition hexrays.hpp:6437
cnumber_t * n
used for cot_num
Definition hexrays.hpp:6384
bool hexapi equal_effect(const cexpr_t &r) const
Compare two expressions.
Definition hexrays.hpp:12323
ea_t obj_ea
used for cot_obj
Definition hexrays.hpp:6391
cexpr_t * y
the second operand of the expression
Definition hexrays.hpp:6400
bool is_call_object_of(const citem_t *parent) const
Is call object?
Definition hexrays.hpp:6535
const cexpr_t * theother(const cexpr_t *what) const
Get the other operand.
Definition hexrays.hpp:6643
bool contains_insn_or_label() const
Does the expression contain an embedded statement operator or a label?
Definition hexrays.hpp:6524
cexpr_t &hexapi assign(const cexpr_t &r)
Definition hexrays.hpp:12281
bool is_odd_lvalue() const
Definition hexrays.hpp:6434
const char *hexapi dstr() const
Definition hexrays.hpp:12373
bool is_undef_val() const
Definition hexrays.hpp:6438
bool hexapi is_child_of(const citem_t *parent) const
Verify if the specified item is our parent.
Definition hexrays.hpp:12329
bool contains_insn(int times=1) const
Does the expression contain an embedded statement operator?
Definition hexrays.hpp:6522
cexpr_t()
Definition hexrays.hpp:6453
char * helper
helper name (used for cot_helper)
Definition hexrays.hpp:6413
bool is_jumpout() const
Definition hexrays.hpp:6439
var_ref_t v
used for cot_var
Definition hexrays.hpp:6390
DECLARE_COMPARISONS(cexpr_t)
bool hexapi has_side_effects() const
Check if the expression has side effects.
Definition hexrays.hpp:12361
void hexapi put_number(cfunc_t *func, uint64 value, int nbytes, type_sign_t sign=no_sign)
Assign a number to the expression.
Definition hexrays.hpp:12305
cexpr_t * z
the third operand of the expression
Definition hexrays.hpp:6407
int hexapi get_low_nbit_bound() const
Get min number of bits that are certainly required to represent the expression.
Definition hexrays.hpp:12349
bool is_cstr() const
Definition hexrays.hpp:6436
cexpr_t * theother(const cexpr_t *what)
Definition hexrays.hpp:6644
bool hexapi contains_operator(ctype_t needed_op, int times=1) const
Check if the expression contains the specified operator.
Definition hexrays.hpp:12335
bool is_fpop() const
Definition hexrays.hpp:6435
bool cpadone() const
Pointer arithmetic correction done for this expression?
Definition hexrays.hpp:6433
const cexpr_t * find_ptr_or_array(bool remove_eqsize_casts) const
Find the pointer operand.
bool is_non_zero_const() const
Check if the expression is a non-zero number.
Definition hexrays.hpp:6587
uint32 m
member offset (used for cot_memptr, cot_memref) for unions, the member number
Definition hexrays.hpp:6402
void set_cpadone()
Definition hexrays.hpp:6443
cexpr_t * x
the first operand of the expression
Definition hexrays.hpp:6397
cexpr_t * find_num_op()
Definition hexrays.hpp:6636
bool contains_comma_or_insn_or_label(int maxcommas=1) const
Does the expression contain a comma operator or an embedded statement operator or a label?
Definition hexrays.hpp:6526
tinfo_t type
expression type. must be carefully maintained
Definition hexrays.hpp:6416
bool get_1num_op(cexpr_t **o1, cexpr_t **o2)
Get pointers to operands.
Definition hexrays.hpp:7800
cexpr_t(ctype_t cexpr_op, cexpr_t *_x, cexpr_t *_y=nullptr, cexpr_t *_z=nullptr)
Definition hexrays.hpp:6454
cexpr_t * find_op(ctype_t _op)
Definition hexrays.hpp:6629
int refwidth
how many bytes are accessed? (-1: none)
Definition hexrays.hpp:6393
cexpr_t(mba_t *mba, const lvar_t &v)
bool get_const_value(uint64 *out) const
Get expression value.
Definition hexrays.hpp:6598
bool hexapi maybe_ptr() const
May the expression be a pointer?
Definition hexrays.hpp:12367
For-loop.
Definition hexrays.hpp:6699
cexpr_t init
Initialization expression.
Definition hexrays.hpp:6700
cexpr_t step
Step expression.
Definition hexrays.hpp:6701
DECLARE_COMPARISONS(cfor_t)
cfunc_parentee_t(cfunc_t *f, bool post=false)
Definition hexrays.hpp:7146
cfunc_t * func
Pointer to current function.
Definition hexrays.hpp:7145
bool hexapi calc_rvalue_type(tinfo_t *target, const cexpr_t *e)
Calculate rvalue type.
Definition hexrays.hpp:12583
Decompiled function. Decompilation result is kept here.
Definition hexrays.hpp:7462
void hexapi set_user_union_selection(ea_t ea, const intvec_t &path)
Set a union field selection.
Definition hexrays.hpp:12833
user_cmts_t * user_cmts
user-defined comments.
Definition hexrays.hpp:7471
cfunc_t(mba_t *mba)
user_unions_t * user_unions
user-defined union field selections.
Definition hexrays.hpp:7474
const char *hexapi get_user_cmt(const treeloc_t &loc, cmt_retrieval_type_t rt) const
Retrieve a user defined comment.
Definition hexrays.hpp:12791
void hexapi recalc_item_addresses()
Recalculate item adresses.
Definition hexrays.hpp:12905
void hexapi remove_unused_labels()
Remove unused labels.
Definition hexrays.hpp:12785
strvec_t sv
decompilation output: function text. use get_pseudocode
Definition hexrays.hpp:7488
sval_t hexapi get_stkoff_delta()
Get stack offset delta.
Definition hexrays.hpp:12771
void hexapi print_func(vc_printer_t &vp) const
Print function text.
Definition hexrays.hpp:12753
const strvec_t &hexapi get_pseudocode()
Get pointer to decompilation output: the pseudocode.
Definition hexrays.hpp:12893
citem_pointers_t treeitems
vector of pointers to citem_t objects (nodes constituting the ctree)
Definition hexrays.hpp:7490
bool hexapi get_line_item(const char *line, int x, bool is_ctree_line, ctree_item_t *phead, ctree_item_t *pitem, ctree_item_t *ptail)
Get ctree item for the specified cursor position.
Definition hexrays.hpp:12869
user_iflags_t * user_iflags
user-defined item flags ctree item iflags bits
Definition hexrays.hpp:7473
void hexapi set_user_iflags(const citem_locator_t &loc, int32 iflags)
Set citem iflags.
Definition hexrays.hpp:12809
int hdrlines
number of lines in the declaration area
Definition hexrays.hpp:7489
boundaries_t &hexapi get_boundaries()
Get pointer to map of instruction boundaries.
Definition hexrays.hpp:12887
hexwarns_t &hexapi get_warnings()
Get information about decompilation warnings.
Definition hexrays.hpp:12875
lvars_t *hexapi get_lvars()
Get vector of local variables.
Definition hexrays.hpp:12765
bool hexapi has_orphan_cmts() const
Check if there are orphan comments.
Definition hexrays.hpp:12815
void hexapi print_dcl(qstring *vout) const
Print function prototype.
Definition hexrays.hpp:12747
eamap_t * eamap
ea->insn map. use get_eamap
Definition hexrays.hpp:7486
user_numforms_t * numforms
user-defined number formats.
Definition hexrays.hpp:7472
HEXRAYS_MEMORY_ALLOCATION_FUNCS() void hexapi build_c_tree()
Generate the function body.
ctree_maturity_t maturity
maturity level
Definition hexrays.hpp:7467
void hexapi save_user_labels() const
Save user-defined labels into the database.
Definition hexrays.hpp:12839
void hexapi save_user_unions() const
Save user-defined union field selections into the database.
Definition hexrays.hpp:12863
intvec_t & argidx
list of arguments (indexes into vars)
Definition hexrays.hpp:7466
boundaries_t * boundaries
map of instruction boundaries. use get_boundaries
Definition hexrays.hpp:7487
int statebits
current cfunc_t state.
Definition hexrays.hpp:7480
citem_t *hexapi find_label(int label)
Find the label.
Definition hexrays.hpp:12779
user_labels_t * user_labels
user-defined labels.
Definition hexrays.hpp:7470
int refcnt
reference count to this object. use cfuncptr_t
Definition hexrays.hpp:7479
bool hexapi get_user_union_selection(ea_t ea, intvec_t *path)
Retrieve a user defined union field selection.
Definition hexrays.hpp:12827
void release()
Definition hexrays.hpp:7498
void hexapi save_user_iflags() const
Save user-defined iflags into the database.
Definition hexrays.hpp:12857
void hexapi refresh_func_ctext()
Refresh ctext after a ctree modification.
Definition hexrays.hpp:12899
char reserved[]
Definition hexrays.hpp:7493
int hexapi del_orphan_cmts()
Delete all orphan comments.
Definition hexrays.hpp:12821
void hexapi save_user_cmts() const
Save user-defined comments into the database.
Definition hexrays.hpp:12845
mba_t * mba
underlying microcode
Definition hexrays.hpp:7464
void hexapi set_user_cmt(const treeloc_t &loc, const char *cmt)
Set a user defined comment.
Definition hexrays.hpp:12797
ea_t entry_ea
function entry address
Definition hexrays.hpp:7463
bool hexapi find_item_coords(const citem_t *item, int *px, int *py)
Definition hexrays.hpp:12917
cinsn_t body
function body, must be a block
Definition hexrays.hpp:7465
eamap_t &hexapi get_eamap()
Get pointer to ea->insn map.
Definition hexrays.hpp:12881
bool hexapi gather_derefs(const ctree_item_t &ci, udt_type_data_t *udm=nullptr) const
Definition hexrays.hpp:12911
void hexapi verify(allow_unused_labels_t aul, bool even_without_debugger) const
Verify the ctree.
Definition hexrays.hpp:12741
~cfunc_t()
Definition hexrays.hpp:7497
bool hexapi get_func_type(tinfo_t *type) const
Get the function type.
Definition hexrays.hpp:12759
bool locked() const
Definition hexrays.hpp:7649
void hexapi save_user_numforms() const
Save user-defined number formats into the database.
Definition hexrays.hpp:12851
int32 hexapi get_user_iflags(const citem_locator_t &loc) const
Retrieve citem iflags.
Definition hexrays.hpp:12803
Goto statement.
Definition hexrays.hpp:6725
DECLARE_COMPARISONS(cgoto_t)
void print(const citem_t *parent, int indent, vc_printer_t &vp) const
int label_num
Target label number.
Definition hexrays.hpp:6726
Chain visitor class.
Definition hexrays.hpp:3558
virtual ~chain_visitor_t()
Definition hexrays.hpp:3560
block_chains_t * parent
parent of the current chain
Definition hexrays.hpp:3559
virtual int idaapi visit_chain(int nblock, chain_t &ch)=0
If statement.
Definition hexrays.hpp:6673
cinsn_t * ielse
Else-branch of the if-statement. May be nullptr.
Definition hexrays.hpp:6675
cif_t()
Definition hexrays.hpp:6676
DECLARE_COMPARISONS(cif_t)
void cleanup()
Definition hexrays.hpp:7781
cif_t & operator=(const cif_t &r)
Definition hexrays.hpp:6678
~cif_t()
Definition hexrays.hpp:6681
cif_t(const cif_t &r)
Definition hexrays.hpp:6677
cinsn_t * ithen
Then-branch of the if-statement.
Definition hexrays.hpp:6674
cif_t &hexapi assign(const cif_t &r)
Definition hexrays.hpp:12379
Ctree item: statement.
Definition hexrays.hpp:6749
cdo_t * cdo
details of do-statement
Definition hexrays.hpp:6757
ctry_t * ctry
details of try-statement
Definition hexrays.hpp:6762
bool contains_free_continue() const
Check if the statement has free continue statements.
Definition hexrays.hpp:6840
bool hexapi is_ordinary_flow() const
Check if the statement passes execution to the next statement.
Definition hexrays.hpp:12481
cinsn_t &hexapi assign(const cinsn_t &r)
Definition hexrays.hpp:12433
cinsn_t()
Definition hexrays.hpp:6766
void zero()
Overwrite with zeroes without cleaning memory or deleting children.
Definition hexrays.hpp:6785
cgoto_t * cgoto
details of goto-statement
Definition hexrays.hpp:6760
cif_t * cif
details of if-statement
Definition hexrays.hpp:6754
cexpr_t * cexpr
details of expression-statement
Definition hexrays.hpp:6753
void hexapi print1(qstring *vout, const cfunc_t *func) const
Print the statement into one line.
Definition hexrays.hpp:12475
~cinsn_t()
Definition hexrays.hpp:6772
cif_t &hexapi create_if(cexpr_t *cnd)
Create a new if-statement.
Definition hexrays.hpp:12463
cfor_t * cfor
details of for-statement
Definition hexrays.hpp:6755
cswitch_t * cswitch
details of switch-statement
Definition hexrays.hpp:6758
void hexapi print(int indent, vc_printer_t &vp, use_curly_t use_curly=CALC_CURLY_BRACES) const
Print the statement into many lines.
Definition hexrays.hpp:12469
bool hexapi collect_free_continues(cinsnptrvec_t *continues)
Collect free continue statements.
Definition hexrays.hpp:12499
void swap(cinsn_t &r)
Definition hexrays.hpp:6768
const char *hexapi dstr() const
Definition hexrays.hpp:12505
cinsn_t & operator=(const cinsn_t &r)
Definition hexrays.hpp:6769
void hexapi replace_by(cinsn_t *r)
Replace the statement.
Definition hexrays.hpp:12445
DECLARE_COMPARISONS(cinsn_t)
bool hexapi collect_free_breaks(cinsnptrvec_t *breaks)
Collect free break statements.
Definition hexrays.hpp:12493
void hexapi cleanup()
Cleanup the statement.
Definition hexrays.hpp:12451
bool hexapi contains_insn(ctype_t type, int times=1) const
Check if the statement contains a statement of the specified type.
Definition hexrays.hpp:12487
bool contains_free_break() const
Check if the statement has free break statements.
Definition hexrays.hpp:6838
cinsn_t &hexapi new_insn(ea_t insn_ea)
Create a new statement.
Definition hexrays.hpp:12457
cthrow_t * cthrow
details of throw-statement
Definition hexrays.hpp:6763
cwhile_t * cwhile
details of while-statement
Definition hexrays.hpp:6756
creturn_t * creturn
details of return-statement
Definition hexrays.hpp:6759
cblock_t * cblock
details of block-statement
Definition hexrays.hpp:6752
casm_t * casm
details of asm-statement
Definition hexrays.hpp:6761
cinsn_t(const cinsn_t &r)
Definition hexrays.hpp:6767
Ctree item comment.
Definition hexrays.hpp:6285
bool used
the comment has been retrieved?
Definition hexrays.hpp:6286
citem_cmt_t()
Definition hexrays.hpp:6287
citem_cmt_t(const char *s)
Definition hexrays.hpp:6288
Generic ctree item locator.
Definition hexrays.hpp:6297
DECLARE_COMPARISONS(citem_locator_t)
ea_t ea
citem address
Definition hexrays.hpp:6298
ctype_t op
citem operation
Definition hexrays.hpp:6299
citem_locator_t(ea_t _ea, ctype_t _op)
Definition hexrays.hpp:6302
citem_locator_t()=delete
Basic ctree item.
Definition hexrays.hpp:6337
bool hexapi contains_expr(const cexpr_t *e) const
Does the item contain an expression?
Definition hexrays.hpp:12257
ctype_t op
item type
Definition hexrays.hpp:6339
bool is_expr() const
Is an expression?
Definition hexrays.hpp:6356
citem_t(ctype_t o=cot_empty)
Definition hexrays.hpp:6347
citem_t *hexapi find_closest_addr(ea_t _ea)
Definition hexrays.hpp:12275
const citem_t *hexapi find_parent_of(const citem_t *item) const
Find parent of the specified item.
Definition hexrays.hpp:12269
~citem_t()
Definition hexrays.hpp:6370
void print1(qstring *vout, const cfunc_t *func) const
Print item into one line.
Definition hexrays.hpp:7789
bool hexapi contains_label() const
Does the item contain a label?
Definition hexrays.hpp:12263
citem_t * find_parent_of(const citem_t *item)
Definition hexrays.hpp:6366
int label_num
label number.
Definition hexrays.hpp:6340
int index
an index in cfunc_t::treeitems.
Definition hexrays.hpp:6345
void swap(citem_t &r)
Swap two citem_t.
Definition hexrays.hpp:6349
ea_t ea
address that corresponds to the item. may be BADADDR
Definition hexrays.hpp:6338
Base class for loop statements.
Definition hexrays.hpp:6687
void cleanup()
Definition hexrays.hpp:7782
~cloop_t()
Definition hexrays.hpp:6693
cloop_t & operator=(const cloop_t &r)
Definition hexrays.hpp:6691
cloop_t(cinsn_t *b=nullptr)
Definition hexrays.hpp:6689
cinsn_t * body
Definition hexrays.hpp:6688
cloop_t(const cloop_t &r)
Definition hexrays.hpp:6690
cloop_t &hexapi assign(const cloop_t &r)
Definition hexrays.hpp:12391
An immediate number.
Definition hexrays.hpp:6154
uint64 hexapi value(const tinfo_t &type) const
Get value.
Definition hexrays.hpp:12225
cnumber_t(int _opnum=0)
Definition hexrays.hpp:6157
void hexapi print(qstring *vout, const tinfo_t &type, const citem_t *parent=nullptr, bool *nice_stroff=nullptr) const
Get text representation.
Definition hexrays.hpp:12219
void hexapi assign(uint64 v, int nbytes, type_sign_t sign)
Assign new value.
Definition hexrays.hpp:12233
HEXRAYS_MEMORY_ALLOCATION_FUNCS() DECLARE_COMPARISONS(cnumber_t)
uint64 _value
its value
Definition hexrays.hpp:6155
number_format_t nf
how to represent it
Definition hexrays.hpp:6156
Return statement.
Definition hexrays.hpp:6719
DECLARE_COMPARISONS(creturn_t)
Switch statement.
Definition hexrays.hpp:6907
cnumber_t mvnf
Maximal switch value and number format.
Definition hexrays.hpp:6908
DECLARE_COMPARISONS(cswitch_t)
ccases_t cases
Switch cases: values and instructions.
Definition hexrays.hpp:6909
Cursor position in the output text (pseudocode).
Definition hexrays.hpp:8108
bool in_ctree(int hdrlines) const
Is the cursor in the variable/type declaration area?
Definition hexrays.hpp:8114
int lnnum
Line number.
Definition hexrays.hpp:8109
int y
y coordinate of the cursor within the window
Definition hexrays.hpp:8111
ctext_position_t(int _lnnum=-1, int _x=0, int _y=0)
Definition hexrays.hpp:8124
int x
x coordinate of the cursor within the window
Definition hexrays.hpp:8110
DECLARE_COMPARISONS(ctext_position_t)
Comparison operators.
Definition hexrays.hpp:8116
Throw statement.
Definition hexrays.hpp:6982
DECLARE_COMPARISONS(cthrow_t)
Invisible COLOR_ADDR tags in the output text are used to refer to ctree items and variables.
Definition hexrays.hpp:7164
uval_t value
Definition hexrays.hpp:7165
int get_index() const
Definition hexrays.hpp:7172
bool is_citem_anchor() const
Definition hexrays.hpp:7175
bool is_lvar_anchor() const
Definition hexrays.hpp:7176
item_preciser_t get_itp() const
Definition hexrays.hpp:7173
bool is_valid_anchor() const
Definition hexrays.hpp:7174
bool is_blkcmt_anchor() const
Definition hexrays.hpp:7178
bool is_itp_anchor() const
Definition hexrays.hpp:7177
Cursor item.
Definition hexrays.hpp:7194
int hexapi get_udm(udm_t *udm=nullptr, tinfo_t *parent=nullptr, uint64 *p_offset=nullptr) const
Get type of a structure field.
Definition hexrays.hpp:12589
const char *hexapi dstr() const
Definition hexrays.hpp:12627
lvar_t * l
VDI_LVAR: Local variable.
Definition hexrays.hpp:7201
citem_t * it
Definition hexrays.hpp:7198
int hexapi get_edm(tinfo_t *parent) const
Get type of an enum member.
Definition hexrays.hpp:12595
ea_t hexapi get_ea() const
Get address of the current item.
Definition hexrays.hpp:12607
cinsn_t * i
VDI_EXPR: Statement.
Definition hexrays.hpp:7200
int hexapi get_label_num(int gln_flags) const
Get label number of the current item.
Definition hexrays.hpp:12615
cursor_item_type_t citype
Item type.
Definition hexrays.hpp:7195
cfunc_t * f
VDI_FUNC: Function.
Definition hexrays.hpp:7202
treeloc_t loc
VDI_TAIL: Line tail.
Definition hexrays.hpp:7203
lvar_t *hexapi get_lvar() const
Get pointer to local variable.
Definition hexrays.hpp:12601
void hexapi print(qstring *vout) const
Definition hexrays.hpp:12621
cexpr_t * e
VDI_EXPR: Expression.
Definition hexrays.hpp:7199
bool is_citem() const
Is the current item is a ctree item?
Definition hexrays.hpp:7258
void verify(const mba_t *mba) const
bool hexapi recalc_parent_types()
Recalculate type of parent nodes.
Definition hexrays.hpp:12577
ctree_parentee_t(bool post=false)
Definition hexrays.hpp:7129
virtual ~ctree_visitor_t()
Definition hexrays.hpp:7051
void set_restart()
Restart the travesal. Meaningful only in apply_to_exprs()
Definition hexrays.hpp:7037
void clr_prune()
Do not prune children. This is an internal function, no need to call it.
Definition hexrays.hpp:7035
parents_t parents
Vector of parents of the current item.
Definition hexrays.hpp:7041
ctree_visitor_t(int _flags)
Constructor.
Definition hexrays.hpp:7049
bool maintain_parents() const
Should the parent information by maintained?
Definition hexrays.hpp:7022
int hexapi apply_to(citem_t *item, citem_t *parent)
Traverse ctree.
Definition hexrays.hpp:12565
cexpr_t * parent_expr()
Get parent of the current item as an expression.
Definition hexrays.hpp:7075
bool is_postorder() const
Should the leave...() functions be called?
Definition hexrays.hpp:7028
bool must_restart() const
Should the traversal restart?
Definition hexrays.hpp:7026
void clr_restart()
Do not restart. This is an internal function, no need to call it.
Definition hexrays.hpp:7039
bool only_insns() const
Should all expressions be automatically pruned?
Definition hexrays.hpp:7030
cblock_posvec_t bposvec
Vector of block positions.
Definition hexrays.hpp:7042
cinsn_t * parent_insn()
Get parent of the current item as a statement.
Definition hexrays.hpp:7082
void prune_now()
Prune children.
Definition hexrays.hpp:7033
virtual int idaapi visit_insn(cinsn_t *)
Visit a statement.
Definition hexrays.hpp:7097
int cv_flags
Ctree visitor property bits
Definition hexrays.hpp:7006
virtual int idaapi visit_expr(cexpr_t *)
Visit an expression.
Definition hexrays.hpp:7105
bool must_prune() const
Should the traversal skip the children of the current item?
Definition hexrays.hpp:7024
virtual int idaapi leave_expr(cexpr_t *)
Visit an expression after having visited its children.
Definition hexrays.hpp:7121
citem_t * parent_item()
Get parent of the current item as an item (statement or expression)
Definition hexrays.hpp:7069
virtual int idaapi leave_insn(cinsn_t *)
Visit a statement after having visited its children.
Definition hexrays.hpp:7113
int hexapi apply_to_exprs(citem_t *item, citem_t *parent)
Traverse only expressions.
Definition hexrays.hpp:12571
C++ Try statement.
Definition hexrays.hpp:6950
size_t new_state
new state number (internal, MSVC related)
Definition hexrays.hpp:6954
void print(const citem_t *parent, int indent, vc_printer_t &vp) const
bool is_wind
Is C++ wind statement?
Definition hexrays.hpp:6974
ccatchvec_t catchs
"catch all", if present, must be the last element.
Definition hexrays.hpp:6951
size_t old_state
old state number (internal, MSVC related)
Definition hexrays.hpp:6953
DECLARE_COMPARISONS(ctry_t)
While-loop.
Definition hexrays.hpp:6707
DECLARE_COMPARISONS(cwhile_t)
Definition hexrays.hpp:9925
bool operator==(const eamap_iterator_t &p) const
Definition hexrays.hpp:9927
iterator_word x
Definition hexrays.hpp:9926
bool operator!=(const eamap_iterator_t &p) const
Definition hexrays.hpp:9928
Edge connecting two graph nodes.
Definition gdl.hpp:86
Definition gdl.hpp:100
Helper class to convert binary data structures into text and put into a file.
Definition hexrays.hpp:909
const char override
Definition hexrays.hpp:917
FILE * fp
Output file pointer.
Definition hexrays.hpp:910
file_printer_t(FILE *_fp)
Constructor.
Definition hexrays.hpp:919
const char * format
Definition hexrays.hpp:917
AS_PRINTF(3, 4) int hexapi print(int indent
Print.
Floating point constant.
Definition hexrays.hpp:2509
int calc_max_exp() const
Definition hexrays.hpp:2521
void hexapi print(qstring *vout) const
Definition hexrays.hpp:11097
bool is_nan() const
Definition hexrays.hpp:2527
fpvalue_t fnum
Internal representation of the number.
Definition hexrays.hpp:2510
HEXRAYS_MEMORY_ALLOCATION_FUNCS() DECLARE_COMPARISONS(fnumber_t)
Definition hexrays.hpp:2516
const char *hexapi dstr() const
Definition hexrays.hpp:11103
int nbytes
Original size of the constant in bytes.
Definition hexrays.hpp:2511
Processor-independent representation of a floating point value.
Definition ieee.h:98
Result of get_current_operand()
Definition hexrays.hpp:5900
int regnum
if register, the register id
Definition hexrays.hpp:5905
vivl_t cvt_to_ivl() const
Convert operand info to VIVL.
Definition hexrays.hpp:5927
int flags
Definition hexrays.hpp:5908
qstring name
register or stkvar name
Definition hexrays.hpp:5901
bool is_def() const
Definition hexrays.hpp:5915
bool hexapi append_to_list(mlist_t *list, const mba_t *mba) const
Append operand info to LIST.
Definition hexrays.hpp:12171
bool is_use() const
Definition hexrays.hpp:5914
sval_t stkoff
if stkvar, stack offset
Definition hexrays.hpp:5904
bool is_reg() const
Definition hexrays.hpp:5913
int size
operand size
Definition hexrays.hpp:5907
Exception object: decompiler failure information.
Definition hexrays.hpp:5853
hexrays_failure_t(merror_t c, ea_t ea, const qstring &buf)
Definition hexrays.hpp:5859
hexrays_failure_t()
Definition hexrays.hpp:5857
hexrays_failure_t(merror_t c, ea_t ea, const char *buf=nullptr)
Definition hexrays.hpp:5858
qstring hexapi desc() const
Definition hexrays.hpp:12157
qstring str
string information
Definition hexrays.hpp:5856
merror_t code
Microcode error code
Definition hexrays.hpp:5854
ea_t errea
associated address
Definition hexrays.hpp:5855
Warning instances.
Definition hexrays.hpp:4695
ea_t ea
Address where the warning occurred.
Definition hexrays.hpp:4696
qstring text
Fully formatted text of the warning.
Definition hexrays.hpp:4698
warnid_t id
Warning id.
Definition hexrays.hpp:4697
DECLARE_COMPARISONS(hexwarn_t)
Definition hexrays.hpp:4699
ea_t curr_ea
Current address.
Definition hexrays.hpp:8134
ea_t func_ea
The entry address of the decompiled function.
Definition hexrays.hpp:8133
ea_t end
BADADDR-decompile a function; otherwise end of the range.
Definition hexrays.hpp:8135
history_item_t(ea_t fea=BADADDR, ea_t cea=BADADDR, int _lnnum=-1, int _x=0, int _y=0)
Definition hexrays.hpp:8136
history_item_t(ea_t fea, ea_t cea, const ctext_position_t &p)
Definition hexrays.hpp:8138
Definition hexrays.hpp:1892
bool contains(uval_t off2) const
Definition hexrays.hpp:1949
bool extend_to_cover(const ivl_t &r)
Definition hexrays.hpp:1903
void print(qstring *vout) const
void intersect(const ivl_t &r)
Definition hexrays.hpp:1921
ivl_t(uval_t _off=0, uval_t _size=0)
Definition hexrays.hpp:1897
bool overlap(const ivl_t &ivl) const
Definition hexrays.hpp:1939
DECLARE_COMPARISONS(ivl_t)
void clear()
Definition hexrays.hpp:1899
bool empty() const
Definition hexrays.hpp:1898
bool includes(const ivl_t &ivl) const
Definition hexrays.hpp:1944
static const ivl_t allmem
Definition hexrays.hpp:1955
const char *hexapi dstr() const
Definition hexrays.hpp:10853
Definition hexrays.hpp:1876
T end() const
Definition hexrays.hpp:1883
ivl_tpl(T _off, T _size)
Definition hexrays.hpp:1881
ivl_tpl()=delete
uval_t off
Definition hexrays.hpp:1879
uval_t last() const
Definition hexrays.hpp:1884
bool valid() const
Definition hexrays.hpp:1882
uval_t size
Definition hexrays.hpp:1880
Definition hexrays.hpp:1962
const char * whole
Definition hexrays.hpp:1964
const char * part
Definition hexrays.hpp:1965
ivl_t ivl
Definition hexrays.hpp:1963
ivl_with_name_t()
Definition hexrays.hpp:1966
Definition hexrays.hpp:2019
asize_t hexapi count() const
Definition hexrays.hpp:10913
bool hexapi addmasked(const ivlset_t &ivs, const ivl_t &mask)
Definition hexrays.hpp:10877
ivlset_t()
Definition hexrays.hpp:2021
bool sub(ea_t ea, asize_t size)
Definition hexrays.hpp:2028
bool hexapi sub(const ivl_t &ivl)
Definition hexrays.hpp:10883
DECLARE_COMPARISONS(ivlset_t)
bool add(ea_t ea, asize_t size)
Definition hexrays.hpp:2024
bool hexapi add(const ivl_t &ivl)
Definition hexrays.hpp:10865
bool hexapi intersect(const ivlset_t &ivs)
Definition hexrays.hpp:10939
ivlset_t(const ivl_t &ivl)
Definition hexrays.hpp:2022
ivlset_tpl< ivl_t, uval_t > inherited
Definition hexrays.hpp:2020
bool hexapi includes(const ivlset_t &ivs) const
Definition hexrays.hpp:10933
const char *hexapi dstr() const
Definition hexrays.hpp:10907
bool hexapi contains(uval_t off) const
Definition hexrays.hpp:10927
bool hexapi has_common(const ivl_t &ivl, bool strict=false) const
Definition hexrays.hpp:10895
void hexapi print(qstring *vout) const
Definition hexrays.hpp:10901
Local variable locator.
Definition hexrays.hpp:1141
bool is_reg2() const
Is variable located on two registers?
Definition hexrays.hpp:1161
bool is_reg1() const
Is variable located on one register?
Definition hexrays.hpp:1159
const scattered_aloc_t & get_scattered() const
Get information about scattered variable.
Definition hexrays.hpp:1173
HEXRAYS_MEMORY_ALLOCATION_FUNCS() const char *hexapi dstr() const
ea_t defea
Definition address.
Definition hexrays.hpp:1143
bool is_scattered() const
Is variable scattered?
Definition hexrays.hpp:1167
scattered_aloc_t & get_scattered()
Definition hexrays.hpp:1174
sval_t get_stkoff() const
Get offset of the varialbe in the stack frame.
Definition hexrays.hpp:1154
bool is_stk_var() const
Is variable located on the stack?
Definition hexrays.hpp:1165
bool is_reg_var() const
Is variable located on register(s)?
Definition hexrays.hpp:1163
mreg_t get_reg2() const
Get the number of the second register (works only for ALOC_REG2 lvars)
Definition hexrays.hpp:1171
vdloc_t location
Variable location.
Definition hexrays.hpp:1142
mreg_t get_reg1() const
Get the register number of the variable.
Definition hexrays.hpp:1169
DECLARE_COMPARISONS(lvar_locator_t)
lvar_locator_t(const vdloc_t &loc, ea_t ea)
Definition hexrays.hpp:1148
lvar_locator_t()
Definition hexrays.hpp:1147
Definition hexrays.hpp:9271
bool operator==(const lvar_mapping_iterator_t &p) const
Definition hexrays.hpp:9273
iterator_word x
Definition hexrays.hpp:9272
bool operator!=(const lvar_mapping_iterator_t &p) const
Definition hexrays.hpp:9274
Reference to a local variable. Used by mop_l.
Definition hexrays.hpp:2389
lvar_ref_t(mba_t *m, int i, sval_t o=0)
Definition hexrays.hpp:2400
HEXRAYS_MEMORY_ALLOCATION_FUNCS() void swap(lvar_ref_t &r)
Definition hexrays.hpp:2409
int idx
index into mba->vars
Definition hexrays.hpp:2399
mba_t *const mba
Pointer to the parent mba_t object.
Definition hexrays.hpp:2397
lvar_t &hexapi var() const
Retrieve the referenced variable.
Definition hexrays.hpp:11079
sval_t off
offset from the beginning of the variable
Definition hexrays.hpp:2398
lvar_ref_t & operator=(const lvar_ref_t &r)
Definition hexrays.hpp:2402
lvar_ref_t(const lvar_ref_t &r)
Definition hexrays.hpp:2401
DECLARE_COMPARISONS(lvar_ref_t)
Saved user settings for local variables: name, type, comment.
Definition hexrays.hpp:1463
bool is_nomap_lvar() const
Definition hexrays.hpp:1512
void set_keep()
Definition hexrays.hpp:1505
void clr_nomap_lvar()
Definition hexrays.hpp:1514
ssize_t size
Type size (if not initialized then -1)
Definition hexrays.hpp:1468
bool operator!=(const lvar_saved_info_t &r) const
Definition hexrays.hpp:1502
bool is_kept() const
Definition hexrays.hpp:1503
void clr_unused_lvar()
Definition hexrays.hpp:1517
qstring cmt
Comment.
Definition hexrays.hpp:1467
bool is_split_lvar() const
Definition hexrays.hpp:1506
void set_noptr_lvar()
Definition hexrays.hpp:1510
bool is_noptr_lvar() const
Definition hexrays.hpp:1509
void set_unused_lvar()
Definition hexrays.hpp:1516
bool operator==(const lvar_saved_info_t &r) const
Definition hexrays.hpp:1495
tinfo_t type
Type.
Definition hexrays.hpp:1466
void clr_noptr_lvar()
Definition hexrays.hpp:1511
int flags
saved user lvar info property bits
Definition hexrays.hpp:1469
lvar_locator_t ll
Variable locator.
Definition hexrays.hpp:1464
void clr_split_lvar()
Definition hexrays.hpp:1508
bool has_info() const
Definition hexrays.hpp:1486
void set_split_lvar()
Definition hexrays.hpp:1507
bool is_unused_lvar() const
Definition hexrays.hpp:1515
void set_nomap_lvar()
Definition hexrays.hpp:1513
qstring name
Name.
Definition hexrays.hpp:1465
void clear_keep()
Definition hexrays.hpp:1504
All user-defined information about local variables.
Definition hexrays.hpp:1527
void swap(lvar_uservec_t &r)
Definition hexrays.hpp:1547
void clear()
Definition hexrays.hpp:1554
int ulv_flags
Various flags. Possible values are from lvar_uservec_t property bits.
Definition hexrays.hpp:1545
uval_t stkoff_delta
Delta to add to IDA stack offset to calculate Hex-Rays stack offsets.
Definition hexrays.hpp:1537
lvar_mapping_t lmaps
Local variable mapping (used for merging variables)
Definition hexrays.hpp:1533
lvar_saved_infos_t lvvec
User-specified names, types, comments for lvars.
Definition hexrays.hpp:1530
bool empty() const
Definition hexrays.hpp:1561
lvar_saved_info_t * find_info(const lvar_locator_t &vloc)
find saved user settings for given var
Definition hexrays.hpp:1570
void keep_info(const lvar_t &v)
Preserve user settings for given var.
Definition hexrays.hpp:1581
Vector of local variables.
Definition hexrays.hpp:1420
int hexapi find_stkvar(sval_t spoff, int width)
Find a stack variable at the specified location.
Definition hexrays.hpp:10606
lvar_t *hexapi find(const lvar_locator_t &ll)
Find a variable at the specified location.
Definition hexrays.hpp:10612
int hexapi find_lvar(const vdloc_t &location, int width, int defblk=-1) const
Find a variable at the specified location.
Definition hexrays.hpp:10618
int find_input_lvar(const vdloc_t &argloc, int _size)
Find an input variable at the specified location.
Definition hexrays.hpp:1425
int find_input_reg(int reg, int _size=1)
Find an input register variable.
Definition hexrays.hpp:1432
Item iterator for mba_ranges_t.
Definition hexrays.hpp:4778
bool func_items_done
Definition hexrays.hpp:4781
ea_t current() const
Definition hexrays.hpp:4808
bool set(const mba_ranges_t &mbr)
Definition hexrays.hpp:4782
range_item_iterator_t rii
Definition hexrays.hpp:4779
bool next_code()
Definition hexrays.hpp:4795
func_item_iterator_t fii
Definition hexrays.hpp:4780
Chunk iterator for mba_ranges_t.
Definition hexrays.hpp:4826
bool is_snippet() const
Definition hexrays.hpp:4829
range_chunk_iterator_t rii
Definition hexrays.hpp:4827
bool next()
Definition hexrays.hpp:4837
bool set(const mba_ranges_t &mbr)
Definition hexrays.hpp:4830
func_tail_iterator_t fii
Definition hexrays.hpp:4828
const range_t & chunk() const
Definition hexrays.hpp:4844
Ranges to decompile. Either a function or an explicit vector of ranges.
Definition hexrays.hpp:4745
mba_ranges_t(func_t *_pfn=nullptr)
Definition hexrays.hpp:4749
bool is_fragmented() const
Definition hexrays.hpp:4756
void clear()
Definition hexrays.hpp:4753
ea_t start() const
Definition hexrays.hpp:4751
bool empty() const
Definition hexrays.hpp:4752
bool hexapi range_contains(ea_t ea) const
Definition hexrays.hpp:11793
bool is_snippet() const
Definition hexrays.hpp:4754
mba_ranges_t(const rangevec_t &r)
Definition hexrays.hpp:4750
rangevec_t ranges
snippet mode: ranges to decompile.
Definition hexrays.hpp:4747
func_t * pfn
function to decompile. if not null, then function mode.
Definition hexrays.hpp:4746
Generic microcode generator class.
Definition hexrays.hpp:1738
virtual merror_t apply(codegen_t &cdg)=0
generate microcode for an instruction
virtual bool match(codegen_t &cdg)=0
check if the filter object is to be applied
virtual ~microcode_filter_t()
Definition hexrays.hpp:1739
Micro instruction visitor.
Definition hexrays.hpp:2310
virtual int idaapi visit_minsn()=0
minsn_visitor_t(mba_t *_mba=nullptr, mblock_t *_blk=nullptr, minsn_t *_topins=nullptr)
Definition hexrays.hpp:2311
Definition hexrays.hpp:2348
virtual int idaapi visit_mop(mop_t *op)=0
minsn_t * curins
Definition hexrays.hpp:2350
bool prune
Should skip sub-operands of the current operand?
Definition hexrays.hpp:2355
mlist_t * list
Definition hexrays.hpp:2352
minsn_t * topins
Definition hexrays.hpp:2349
bool changed
Definition hexrays.hpp:2351
HEXRAYS_MEMORY_ALLOCATION_FUNCS() virtual ~mlist_mop_visitor_t()
Definition hexrays.hpp:2357
Definition hexrays.hpp:2063
bool add(mreg_t r, int size)
Definition hexrays.hpp:2073
bool add(const rlist_t &r)
Definition hexrays.hpp:2074
const char *hexapi dstr() const
Definition hexrays.hpp:10975
bool has_any(mreg_t r, int size) const
Definition hexrays.hpp:2099
void clear()
Definition hexrays.hpp:2096
bool intersect(const mlist_t &lst)
Definition hexrays.hpp:2104
bool add(const mlist_t &lst)
Definition hexrays.hpp:2076
DECLARE_COMPARISONS(mlist_t)
bool sub(const mlist_t &lst)
Definition hexrays.hpp:2085
rlist_t reg
Definition hexrays.hpp:2064
mlist_t(const ivl_t &ivl)
Definition hexrays.hpp:2068
bool has_memory() const
Definition hexrays.hpp:2100
bool sub(mreg_t r, int size)
Definition hexrays.hpp:2083
bool includes(const mlist_t &lst) const
Definition hexrays.hpp:2103
ivlset_t mem
Definition hexrays.hpp:2065
bool sub(const ivl_t &ivl)
Definition hexrays.hpp:2084
bool hexapi addmem(ea_t ea, asize_t size)
Definition hexrays.hpp:10963
bool is_subset_of(const mlist_t &lst) const
Definition hexrays.hpp:2111
mlist_t()
Definition hexrays.hpp:2067
asize_t count() const
Definition hexrays.hpp:2092
bool add(const ivl_t &ivl)
Definition hexrays.hpp:2075
void swap(mlist_t &r)
Definition hexrays.hpp:2071
bool has_all(mreg_t r, int size) const
Definition hexrays.hpp:2098
bool has_allmem() const
Definition hexrays.hpp:2101
bool empty() const
Definition hexrays.hpp:2095
void hexapi print(qstring *vout) const
Definition hexrays.hpp:10969
bool has(mreg_t r) const
Definition hexrays.hpp:2097
bool has_common(const mlist_t &lst) const
Definition hexrays.hpp:2102
mlist_t(mreg_t r, int size)
Definition hexrays.hpp:2069
An integer constant.
Definition hexrays.hpp:2483
uint64 org_value
Definition hexrays.hpp:2485
void update_value(uint64 val64)
Definition hexrays.hpp:2498
mnumber_t(uint64 v, ea_t _ea=BADADDR, int n=0)
Definition hexrays.hpp:2486
uint64 value
Definition hexrays.hpp:2484
HEXRAYS_MEMORY_ALLOCATION_FUNCS() DECLARE_COMPARISONS(mnumber_t)
Definition hexrays.hpp:2488
Micro operand visitor.
Definition hexrays.hpp:2323
mop_visitor_t(mba_t *_mba=nullptr, mblock_t *_blk=nullptr, minsn_t *_topins=nullptr)
Definition hexrays.hpp:2328
bool prune
Should skip sub-operands of the current operand?
Definition hexrays.hpp:2326
virtual int idaapi visit_mop(mop_t *op, const tinfo_t *type, bool is_target)=0
Number representation.
Definition hexrays.hpp:812
bool is_char() const
Is a character constant?
Definition hexrays.hpp:850
qstring type_name
for stroffs: structure for offsetof() for enums: enum name
Definition hexrays.hpp:830
number_format_t(int _opnum=0)
Contructor.
Definition hexrays.hpp:834
char opnum
operand number: 0..UA_MAXOP
Definition hexrays.hpp:814
bool is_stroff() const
Is a structure field offset?
Definition hexrays.hpp:852
bool has_unmutable_type() const
Definition hexrays.hpp:867
bool is_hex() const
Is a hexadecimal number?
Definition hexrays.hpp:842
bool is_numop() const
Is a number?
Definition hexrays.hpp:854
char props
properties: combination of NF_ bits (Number format property bits)
Definition hexrays.hpp:815
bool is_oct() const
Is a octal number?
Definition hexrays.hpp:846
flags_t flags32
low 32bit of flags (for compatibility)
Definition hexrays.hpp:813
char org_nbytes
original number size in bytes
Definition hexrays.hpp:829
uchar serial
for enums: constant serial number
Definition hexrays.hpp:828
bool is_dec() const
Is a decimal number?
Definition hexrays.hpp:844
flags64_t flags
ida flags, which describe number radix, enum, etc
Definition hexrays.hpp:832
bool is_enum() const
Is a symbolic constant?
Definition hexrays.hpp:848
bool is_fixed() const
Is number representation fixed?
Definition hexrays.hpp:840
int get_radix() const
Get number radix.
Definition hexrays.hpp:837
bool needs_to_be_inverted() const
Does the number need to be negated or bitwise negated?
Definition hexrays.hpp:857
The context info used by visitors.
Definition hexrays.hpp:2290
op_parent_info_t(mba_t *_mba=nullptr, mblock_t *_blk=nullptr, minsn_t *_topins=nullptr)
Definition hexrays.hpp:2296
mblock_t * blk
Definition hexrays.hpp:2292
virtual ~op_parent_info_t()
Definition hexrays.hpp:2301
minsn_t * topins
Definition hexrays.hpp:2293
minsn_t * curins
Definition hexrays.hpp:2294
mba_t * mba
Definition hexrays.hpp:2291
HEXRAYS_MEMORY_ALLOCATION_FUNCS() bool really_alloc() const
Operand locator.
Definition hexrays.hpp:796
ea_t ea
address of the original processor instruction
Definition hexrays.hpp:801
operand_locator_t(ea_t _ea, int _opnum)
Definition hexrays.hpp:803
DECLARE_COMPARISONS(operand_locator_t)
int opnum
operand number in the instruction
Definition hexrays.hpp:802
User defined callback to optimize microcode blocks.
Definition hexrays.hpp:2193
virtual ~optblock_t()
Definition hexrays.hpp:2194
virtual int idaapi func(mblock_t *blk)=0
Optimize a block.
User defined callback to optimize individual microcode instructions.
Definition hexrays.hpp:2161
virtual ~optinsn_t()
Definition hexrays.hpp:2162
virtual int idaapi func(mblock_t *blk, minsn_t *ins, int optflags)=0
Optimize an instruction.
Helper class to convert cfunc_t into a text string.
Definition hexrays.hpp:924
AS_PRINTF(3, 4) int hexapi print(int indent
Print.
const char * format
Definition hexrays.hpp:936
const char override
Definition hexrays.hpp:936
bool with_tags
Generate output with color tags.
Definition hexrays.hpp:925
qstring & s
Reference to the output string.
Definition hexrays.hpp:926
qstring_printer_t(const cfunc_t *f, qstring &_s, bool tags)
Constructor.
Definition hexrays.hpp:928
Chunk iterator of arbitrary rangevec items.
Definition hexrays.hpp:4816
const range_t & chunk() const
Definition hexrays.hpp:4821
const range_t * rptr
Definition hexrays.hpp:4817
const range_t * rend
Definition hexrays.hpp:4818
bool next()
Definition hexrays.hpp:4820
bool set(const rangevec_t &r)
Definition hexrays.hpp:4819
Item iterator of arbitrary rangevec items.
Definition hexrays.hpp:4767
ea_t cur
Definition hexrays.hpp:4770
const rangevec_t * ranges
Definition hexrays.hpp:4768
bool set(const rangevec_t &r)
ea_t current() const
Definition hexrays.hpp:4773
const range_t * rptr
Definition hexrays.hpp:4769
Base class for an range.
Definition range.hpp:35
ea_t end_ea
end_ea excluded
Definition range.hpp:38
ea_t start_ea
start_ea included
Definition range.hpp:37
Vector of range_t instances.
Definition range.hpp:93
Scattered operand info. Used for mop_sc.
Definition hexrays.hpp:2449
scif_t(mba_t *_mba, tinfo_t *tif, qstring *n=nullptr)
Definition hexrays.hpp:2466
tinfo_t type
Scattered operands always have type info assigned to them because without it we won't be able to mani...
Definition hexrays.hpp:2464
mba_t * mba
Pointer to the parent mba_t object.
Definition hexrays.hpp:2455
qstring name
Usually scattered operands are created from a function prototype, which has the name information.
Definition hexrays.hpp:2460
Scattered mop: visit each of the scattered locations as a separate mop.
Definition hexrays.hpp:2339
virtual int idaapi visit_scif_mop(const mop_t &r, int off)=0
HEXRAYS_MEMORY_ALLOCATION_FUNCS() virtual ~scif_visitor_t()
Definition hexrays.hpp:2340
Definition frame.hpp:59
Reference to a stack variable. Used for mop_S.
Definition hexrays.hpp:2421
sval_t off
Offset to the stack variable from the bottom of the stack frame.
Definition hexrays.hpp:2430
mba_t *const mba
Pointer to the parent mba_t object.
Definition hexrays.hpp:2425
ssize_t hexapi get_stkvar(udm_t *udm=nullptr, uval_t *p_idaoff=nullptr) const
Retrieve the referenced stack variable.
Definition hexrays.hpp:11091
HEXRAYS_MEMORY_ALLOCATION_FUNCS() void swap(stkvar_ref_t &r)
Definition hexrays.hpp:2434
stkvar_ref_t(mba_t *m, sval_t o)
Definition hexrays.hpp:2432
DECLARE_COMPARISONS(stkvar_ref_t)
Ctree location. Used to denote comment locations.
Definition hexrays.hpp:6255
ea_t ea
Definition hexrays.hpp:6256
item_preciser_t itp
Definition hexrays.hpp:6257
Definition hexrays.hpp:9380
bool operator==(const udcall_map_iterator_t &p) const
Definition hexrays.hpp:9382
iterator_word x
Definition hexrays.hpp:9381
bool operator!=(const udcall_map_iterator_t &p) const
Definition hexrays.hpp:9383
User-defined function calls.
Definition hexrays.hpp:1679
qstring name
Definition hexrays.hpp:1680
DECLARE_COMPARISONS(udcall_t)
Definition hexrays.hpp:1682
tinfo_t tif
Definition hexrays.hpp:1681
bool empty() const
Definition hexrays.hpp:1690
An object to represent struct or union members.
Definition typeinf.hpp:5300
Definition typeinf.hpp:5441
Callback to apply the selection.
Definition hexrays.hpp:8483
virtual ~ui_stroff_applicator_t()
Definition hexrays.hpp:8484
virtual bool idaapi apply(size_t opnum, const intvec_t &path, const tinfo_t &top_tif, const char *spath)=0
Select UDT for the operands using "Select offsets" widget.
Definition hexrays.hpp:8468
uval_t offset
operand offset, will be used when calculating the UDT path
Definition hexrays.hpp:8470
bool operator==(const ui_stroff_op_t &r) const
Definition hexrays.hpp:8471
qstring text
any text for the column "Operand" of widget
Definition hexrays.hpp:8469
bool operator!=(const ui_stroff_op_t &r) const
Definition hexrays.hpp:8475
Definition hexrays.hpp:9489
bool operator==(const user_cmts_iterator_t &p) const
Definition hexrays.hpp:9491
bool operator!=(const user_cmts_iterator_t &p) const
Definition hexrays.hpp:9492
iterator_word x
Definition hexrays.hpp:9490
Definition hexrays.hpp:9598
iterator_word x
Definition hexrays.hpp:9599
bool operator!=(const user_iflags_iterator_t &p) const
Definition hexrays.hpp:9601
bool operator==(const user_iflags_iterator_t &p) const
Definition hexrays.hpp:9600
Definition hexrays.hpp:9816
bool operator==(const user_labels_iterator_t &p) const
Definition hexrays.hpp:9818
bool operator!=(const user_labels_iterator_t &p) const
Definition hexrays.hpp:9819
iterator_word x
Definition hexrays.hpp:9817
Helper class to modify saved local variable settings.
Definition hexrays.hpp:1606
virtual ~user_lvar_modifier_t()
Definition hexrays.hpp:1607
virtual bool idaapi modify_lvars(lvar_uservec_t *lvinf)=0
Modify lvar settings.
Definition hexrays.hpp:9162
iterator_word x
Definition hexrays.hpp:9163
bool operator!=(const user_numforms_iterator_t &p) const
Definition hexrays.hpp:9165
bool operator==(const user_numforms_iterator_t &p) const
Definition hexrays.hpp:9164
Definition hexrays.hpp:9707
bool operator!=(const user_unions_iterator_t &p) const
Definition hexrays.hpp:9710
bool operator==(const user_unions_iterator_t &p) const
Definition hexrays.hpp:9709
iterator_word x
Definition hexrays.hpp:9708
Reference to a local variable.
Definition hexrays.hpp:6187
lvar_t & getv() const
Definition hexrays.hpp:6190
int idx
index into lvars_t
Definition hexrays.hpp:6189
HEXRAYS_MEMORY_ALLOCATION_FUNCS() DECLARE_COMPARISONS(var_ref_t)
mba_t * mba
pointer to the underlying micro array
Definition hexrays.hpp:6188
Helper class to convert cfunc_t into text.
Definition hexrays.hpp:897
char lastchar
internal: last printed character
Definition hexrays.hpp:899
const cfunc_t * func
cfunc_t to generate text for
Definition hexrays.hpp:898
vc_printer_t(const cfunc_t *f)
Constructor.
Definition hexrays.hpp:901
virtual bool idaapi oneliner() const newapi
Are we generating one-line text representation?
Definition hexrays.hpp:904
vd_failure_t()
Definition hexrays.hpp:5868
vd_failure_t(const hexrays_failure_t &_hf)
Definition hexrays.hpp:5871
hexrays_failure_t hf
Definition hexrays.hpp:5867
~vd_failure_t()
Definition hexrays.hpp:5877
vd_failure_t(merror_t code, ea_t ea, const char *buf=nullptr)
Definition hexrays.hpp:5869
virtual const char * what() const noexcept override
Definition hexrays.hpp:5874
qstring desc() const
Definition hexrays.hpp:5872
vd_failure_t(merror_t code, ea_t ea, const qstring &buf)
Definition hexrays.hpp:5870
vd_interr_t(ea_t ea, const qstring &buf)
Definition hexrays.hpp:5885
vd_interr_t(ea_t ea, const char *buf)
Definition hexrays.hpp:5886
Base helper class to convert binary data structures into text.
Definition hexrays.hpp:881
qstring tmpbuf
Definition hexrays.hpp:882
int hdrlines
number of header lines (prototype+typedef+lvars) valid at the end of print process
Definition hexrays.hpp:883
const char * format
Definition hexrays.hpp:891
AS_PRINTF(3, 4) virtual int hexapi print(int indent
Print.
Information about the pseudocode window.
Definition hexrays.hpp:8159
bool visible() const
Is the pseudocode window visible?
Definition hexrays.hpp:8170
bool hexapi rename_label(int label)
Rename a label.
Definition hexrays.hpp:13142
TWidget * ct
pseudocode view
Definition hexrays.hpp:8184
merror_t last_code
result of the last user action. See Microcode error code
Definition hexrays.hpp:8189
bool hexapi collapse_lvars(bool hide)
Collapse/uncollapse local variable declarations.
Definition hexrays.hpp:13220
bool hexapi set_lvar_cmt(lvar_t *v, const char *cmt)
Set local variable comment.
Definition hexrays.hpp:13094
bool hexapi set_global_type(ea_t ea)
Set global item type.
Definition hexrays.hpp:13130
void set_valid(bool v)
Definition hexrays.hpp:8180
bool hexapi refresh_cpos(input_device_t idv)
Refresh the current position.
Definition hexrays.hpp:13040
bool hexapi set_lvar_type(lvar_t *v, const tinfo_t &type)
Set local variable type.
Definition hexrays.hpp:13076
void hexapi refresh_ctext(bool activate=true)
Refresh pseudocode window.
Definition hexrays.hpp:13010
TWidget * toplevel
Definition hexrays.hpp:8185
ctree_item_t head
First ctree item on the current line (for block comments)
Definition hexrays.hpp:8193
bool hexapi map_lvar(lvar_t *from, lvar_t *to)
Map a local variable to another.
Definition hexrays.hpp:13112
bool hexapi invert_bits()
Bitwise negate a number.
Definition hexrays.hpp:13208
bool hexapi ui_map_lvar(lvar_t *v)
Map a local variable to another.
Definition hexrays.hpp:13100
void hexapi refresh_view(bool redo_mba)
Refresh pseudocode window.
Definition hexrays.hpp:13004
bool hexapi set_noptr_lvar(lvar_t *v)
Inform that local variable should have a non-pointer type This function permanently sets a correspond...
Definition hexrays.hpp:13082
int hexapi get_current_label()
Get current label.
Definition hexrays.hpp:13028
bool valid() const
Does the pseudocode window contain valid code?
Definition hexrays.hpp:8173
bool hexapi ui_set_lvar_type(lvar_t *v)
Set local variable type.
Definition hexrays.hpp:13070
void hexapi clear()
Clear the pseudocode window.
Definition hexrays.hpp:13034
bool hexapi ui_rename_lvar(lvar_t *v)
Rename local variable.
Definition hexrays.hpp:13052
ctree_item_t item
Current ctree item.
Definition hexrays.hpp:8194
ctext_position_t cpos
Current ctext position.
Definition hexrays.hpp:8192
bool hexapi invert_sign()
Negate a number.
Definition hexrays.hpp:13202
void set_visible(bool v)
Definition hexrays.hpp:8179
bool in_ctree() const
Is the current item a statement?
Definition hexrays.hpp:8226
bool hexapi edit_cmt(const treeloc_t &loc)
Edit an indented comment.
Definition hexrays.hpp:13166
int view_idx
pseudocode window index (0..)
Definition hexrays.hpp:8183
bool hexapi set_num_radix(int base)
Change number base.
Definition hexrays.hpp:13184
bool hexapi edit_func_cmt()
Edit a function comment.
Definition hexrays.hpp:13172
void hexapi switch_to(cfuncptr_t f, bool activate)
Display the specified pseudocode.
Definition hexrays.hpp:13016
bool hexapi del_orphan_cmts()
Delete all orphan comments.
Definition hexrays.hpp:13178
bool hexapi collapse_item(bool hide)
Collapse/uncollapse item.
Definition hexrays.hpp:13214
mba_t * mba
pointer to underlying microcode
Definition hexrays.hpp:8187
bool hexapi jump_enter(input_device_t idv, int omflags)
Process the Enter key.
Definition hexrays.hpp:13148
bool hexapi split_item(bool split)
Split/unsplit item.
Definition hexrays.hpp:13226
cfuncptr_t cfunc
pointer to function object
Definition hexrays.hpp:8188
bool hexapi set_udm_type(tinfo_t &udt_type, int udm_idx)
Set structure field type.
Definition hexrays.hpp:13118
bool hexapi rename_global(ea_t ea)
Rename global item.
Definition hexrays.hpp:13136
bool hexapi rename_lvar(lvar_t *v, const char *name, bool is_user_name)
Rename local variable.
Definition hexrays.hpp:13058
int flags
Properties of pseudocode window
Definition hexrays.hpp:8160
cmt_type_t hexapi calc_cmt_type(size_t lnnum, cmt_type_t cmttype) const
Check if the specified line can have a comment.
Definition hexrays.hpp:13160
bool hexapi get_current_item(input_device_t idv)
Get current item.
Definition hexrays.hpp:13046
bool hexapi ui_set_call_type(const cexpr_t *e)
Set type of a function call This function displays a dialog box and allows the user to change the typ...
Definition hexrays.hpp:13064
bool hexapi ctree_to_disasm()
Jump to disassembly.
Definition hexrays.hpp:13154
bool hexapi set_num_enum()
Convert number to symbolic constant.
Definition hexrays.hpp:13190
bool hexapi ui_edit_lvar_cmt(lvar_t *v)
Set local variable comment.
Definition hexrays.hpp:13088
bool hexapi rename_udm(tinfo_t &udt_type, int udm_idx)
Rename structure field.
Definition hexrays.hpp:13124
ctree_item_t tail
Tail ctree item on the current line (for indented comments)
Definition hexrays.hpp:8195
cnumber_t *hexapi get_number()
Get current number.
Definition hexrays.hpp:13022
bool hexapi ui_unmap_lvar(lvar_t *v)
Unmap a local variable.
Definition hexrays.hpp:13106
bool locked() const
Does the pseudocode window contain valid code?
Definition hexrays.hpp:8178
bool hexapi set_locked(bool v)
Definition hexrays.hpp:12998
bool hexapi set_num_stroff()
Convert number to structure field offset.
Definition hexrays.hpp:13196
Value interval (register or stack range)
Definition hexrays.hpp:3381
DECLARE_COMPARISONS(vivl_t)
Definition hexrays.hpp:3426
uval_t hexapi intersect(const vivl_t &r)
Intersect value intervals the same type.
Definition hexrays.hpp:11399
void set(mopt_t _type, sval_t _off, int _size=0)
Definition hexrays.hpp:3390
void hexapi print(qstring *vout) const
Definition hexrays.hpp:11407
void set(const voff_t &voff, int _size)
Definition hexrays.hpp:3392
vivl_t(mopt_t _type=mop_z, sval_t _off=-1, int _size=0)
Definition hexrays.hpp:3384
bool overlap(const vivl_t &r) const
Do two value intervals overlap?
Definition hexrays.hpp:3406
bool contains(const voff_t &voff2) const
Does our value interval contain the specified value offset?
Definition hexrays.hpp:3419
void set_stkoff(sval_t stkoff, int sz=0)
Definition hexrays.hpp:3394
vivl_t(const class chain_t &ch)
int size
Interval size in bytes.
Definition hexrays.hpp:3382
void set_reg(mreg_t mreg, int sz=0)
Definition hexrays.hpp:3395
bool includes(const vivl_t &r) const
Does our value interval include another?
Definition hexrays.hpp:3412
const char *hexapi dstr() const
Definition hexrays.hpp:11413
bool operator==(const mop_t &mop) const
Definition hexrays.hpp:3431
bool hexapi extend_to_cover(const vivl_t &r)
Extend a value interval using another value interval of the same type.
Definition hexrays.hpp:11393
vivl_t(const mop_t &op)
Definition hexrays.hpp:3387
Value offset (microregister number or stack offset)
Definition hexrays.hpp:3344
mreg_t get_reg() const
Definition hexrays.hpp:3364
sval_t diff(const voff_t &r) const
Definition hexrays.hpp:3369
void set(mopt_t _type, sval_t _off)
Definition hexrays.hpp:3356
void undef()
Definition hexrays.hpp:3359
bool is_stkoff() const
Definition hexrays.hpp:3363
voff_t(const mop_t &op)
Definition hexrays.hpp:3350
sval_t off
register number or stack offset
Definition hexrays.hpp:3345
bool defined() const
Definition hexrays.hpp:3361
void inc(sval_t delta)
Definition hexrays.hpp:3367
DECLARE_COMPARISONS(voff_t)
Definition hexrays.hpp:3371
voff_t add(int width) const
Definition hexrays.hpp:3368
voff_t(mopt_t _type, sval_t _off)
Definition hexrays.hpp:3349
void set_reg(mreg_t mreg)
Definition hexrays.hpp:3358
mopt_t type
mop_r - register, mop_S - stack, mop_z - undefined
Definition hexrays.hpp:3346
sval_t get_stkoff() const
Definition hexrays.hpp:3365
void set_stkoff(sval_t stkoff)
Definition hexrays.hpp:3357
bool is_reg() const
Definition hexrays.hpp:3362
voff_t()
Definition hexrays.hpp:3348
Type information in IDA.
THREAD_SAFE bool is_type_func(type_t t)
See BT_FUNC.
Definition typeinf.hpp:451
THREAD_SAFE bool is_type_array(type_t t)
See BT_ARRAY.
Definition typeinf.hpp:452
const size_t BADSIZE
bad type size
Definition typeinf.hpp:2021
THREAD_SAFE bool operator<(const bytevec_t &v1, const bytevec_t &v2)
Compare two bytevecs with '<'.
Definition typeinf.hpp:631
THREAD_SAFE bool is_type_ptr(type_t t)
See BT_PTR.
Definition typeinf.hpp:449
idaman size_t ida_export get_dtype_size(op_dtype_t dtype)
Get size of opt_::dtype field.
qvector< svalvec_t > casevec_t
Vector of case values - see calc_switch_cases()
Definition xref.hpp:402