IDA C++ SDK 9.2
Loading...
Searching...
No Matches
hexrays.hpp
Go to the documentation of this file.
1
86
87#pragma once
88#define __HEXRAYS_HPP
89
90#include <pro.h>
91#include <fpro.h>
92#include <qset.hpp>
93#include <qmap.hpp>
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>
228
229#ifdef __NT__
230#pragma warning(push)
231#pragma warning(disable:4062) // enumerator 'x' in switch of enum 'y' is not handled
232#pragma warning(disable:4265) // virtual functions without virtual destructor
233#endif
234
235#define hexapi
236
237// Lint suppressions:
238//lint -sem(mop_t::_make_cases, custodial(1))
239//lint -sem(mop_t::_make_pair, custodial(1))
240//lint -sem(mop_t::_make_callinfo, custodial(1))
241//lint -sem(mop_t::_make_insn, custodial(1))
242//lint -sem(mop_t::make_insn, custodial(1))
243
244// Microcode level forward definitions:
245class mop_t; // microinstruction operand
246class mop_pair_t; // pair of operands. example, :(edx.4,eax.4).8
247class mop_addr_t; // address of an operand. example: &global_var
248class mcallinfo_t; // function call info. example: <cdecl:"int x" #10.4>.8
249class mcases_t; // jump table cases. example: {0 => 12, 1 => 13}
250class minsn_t; // microinstruction
251class mblock_t; // basic block
252class mba_t; // array of blocks, represents microcode for a function
253class codegen_t; // helper class to generate the initial microcode
254class mbl_graph_t; // control flow graph of microcode
255class control_graph_t; // the result of structural analysis
256class edge_mapper_t;
257struct vdui_t; // widget representing the pseudocode window
258struct mba_stats_t; // statistics about decompilation of a function
259struct mlist_t; // list of memory and register locations
260struct voff_t; // value offset (microregister number or stack offset)
262struct vivl_t; // value interval (register or stack range)
263typedef int mreg_t;
264
265// Ctree level forward definitions:
266struct cfunc_t; // result of decompilation, the highest level object
267struct cfunc_parentee_t;// ctree visitor with parent access
268struct citem_t; // base class for cexpr_t and cinsn_t
269struct cexpr_t; // C expression
270struct cinsn_t; // C statement
271struct cblock_t; // C statement block (sequence of statements)
272struct cswitch_t; // C switch statement
273struct carg_t; // call argument
274struct carglist_t; // vector of call arguments
275struct ctry_t; // C++ try-statement
276struct cthrow_t; // C++ throw-statement
277
278typedef std::set<ea_t> easet_t;
287
288// Function frames must be smaller than this value, otherwise
289// the decompiler will bail out with MERR_HUGESTACK
290#define MAX_SUPPORTED_STACK_SIZE 0x100000 // 1MB
291
292//-------------------------------------------------------------------------
293// Original version of macro DEFINE_MEMORY_ALLOCATION_FUNCS
294// (uses decompiler-specific memory allocation functions)
295#define HEXRAYS_PLACEMENT_DELETE void operator delete(void *, void *) {}
296#define HEXRAYS_MEMORY_ALLOCATION_FUNCS() \
297 void *operator new (size_t _s) { return hexrays_alloc(_s); } \
298 void *operator new[](size_t _s) { return hexrays_alloc(_s); } \
299 void *operator new(size_t /*size*/, void *_v) { return _v; } \
300 void operator delete (void *_blk) { hexrays_free(_blk); } \
301 void operator delete[](void *_blk) { hexrays_free(_blk); } \
302 HEXRAYS_PLACEMENT_DELETE
303
304void *hexapi hexrays_alloc(size_t size);
305void hexapi hexrays_free(void *ptr);
306
308typedef int64 svlr_t;
309enum { MAX_VLR_SIZE = sizeof(uvlr_t) };
313
314//-------------------------------------------------------------------------
316{
317 return size == MAX_VLR_SIZE
319 : (uvlr_t(1) << (size * 8)) - 1;
320}
322{
323 return size == MAX_VLR_SIZE
325 : (uvlr_t(1) << (size * 8 - 1));
326}
328{
329 return size == MAX_VLR_SIZE
331 : (uvlr_t(1) << (size * 8 - 1)) - 1;
332}
333
335{ // the order of comparisons is the same as in microcode opcodes
346};
347inline bool is_unsigned_cmpop(cmpop_t cmpop)
348{
349 return cmpop >= CMP_AE && cmpop <= CMP_BE;
350}
351inline bool is_signed_cmpop(cmpop_t cmpop)
352{
353 return cmpop >= CMP_GT && cmpop <= CMP_LE;
354}
355inline bool is_cmpop_with_eq(cmpop_t cmpop)
356{
357 return cmpop == CMP_AE
358 || cmpop == CMP_BE
359 || cmpop == CMP_GE
360 || cmpop == CMP_LE;
361}
362inline bool is_cmpop_without_eq(cmpop_t cmpop)
363{
364 return cmpop == CMP_A
365 || cmpop == CMP_B
366 || cmpop == CMP_GT
367 || cmpop == CMP_LT;
368}
369
370//-------------------------------------------------------------------------
371// value-range class to keep possible operand value(s).
373{
374protected:
375 int flags;
376#define VLR_TYPE 0x0F // valrng_t type
377#define VLR_NONE 0x00 // no values
378#define VLR_ALL 0x01 // all values
379#define VLR_IVLS 0x02 // union of disjoint intervals
380#define VLR_RANGE 0x03 // strided range
381#define VLR_SRANGE 0x04 // strided range with signed bound
382#define VLR_BITS 0x05 // known bits
383#define VLR_SECT 0x06 // intersection of sub-ranges
384 // each sub-range should be simple or union
385#define VLR_UNION 0x07 // union of sub-ranges
386 // each sub-range should be simple or
387 // intersection
388#define VLR_UNK 0x08 // unknown value (like 'null' in SQL)
389 int size; // operand size: 1..8 bytes
390 // all values must fall within the size
391 union
392 {
393 struct // VLR_RANGE/VLR_SRANGE
394 { // values that are between VALUE and LIMIT
395 // and conform to: value+stride*N
396 uvlr_t value; // initial value
397 uvlr_t limit; // final value
398 // we adjust LIMIT to be on the STRIDE lattice
399 svlr_t stride; // stride between values
400 };
401 struct // VLR_BITS
402 {
403 uvlr_t zeroes; // bits known to be clear
404 uvlr_t ones; // bits known to be set
405 };
406 char reserved[sizeof(qvector<int>)];
407 // VLR_IVLS/VLR_SECT/VLR_UNION
408 };
409 void hexapi clear();
410 void hexapi copy(const valrng_t &r);
411 valrng_t &hexapi assign(const valrng_t &r);
412
413public:
414 explicit valrng_t(int size_ = MAX_VLR_SIZE)
415 : flags(VLR_NONE), size(size_), value(0), limit(0), stride(0) {}
416 valrng_t(const valrng_t &r) { copy(r); }
418 valrng_t &operator=(const valrng_t &r) { return assign(r); }
419 void swap(valrng_t &r) { qswap(*this, r); }
422
423 void set_none() { clear(); }
424 void set_all() { clear(); flags = VLR_ALL; }
425 void set_unk() { clear(); flags = VLR_UNK; }
426 void hexapi set_eq(uvlr_t v);
427 void hexapi set_cmp(cmpop_t cmp, uvlr_t _value);
428
429 // reduce size
430 // it takes the low part of size NEW_SIZE
431 // it returns "true" if size is changed successfully.
432 // e.g.: valrng_t vr(2); vr.set_eq(0x1234);
433 // vr.reduce_size(1);
434 // uvlr_t v; vr.cvt_to_single_value(&v);
435 // assert(v == 0x34);
436 bool hexapi reduce_size(int new_size);
437
438 // Perform intersection or union or inversion.
439 // \return did we change something in THIS?
440 bool hexapi intersect_with(const valrng_t &r);
441 bool hexapi unite_with(const valrng_t &r);
442 void hexapi inverse(); // works for VLR_IVLS only
443
444 bool empty() const { return flags == VLR_NONE; }
445 bool all_values() const { return flags == VLR_ALL; }
446 bool is_unknown() const { return flags == VLR_UNK; }
447 bool hexapi has(uvlr_t v) const;
448
449 void hexapi print(qstring *vout) const;
450 const char *hexapi dstr() const;
451
452 bool hexapi cvt_to_single_value(uvlr_t *v) const;
453 bool hexapi cvt_to_cmp(cmpop_t *cmp, uvlr_t *val) const;
454
455 int get_size() const { return size; }
456 uvlr_t max_value() const { return max_vlr_value(size); }
459};
461
462//-------------------------------------------------------------------------
463// Are we looking for 'must access' or 'may access' information?
464// 'must access' means that the code will always access the specified location(s)
465// 'may access' means that the code may in some cases access the specified location(s)
466// Example: ldx cs.2, r0.4, r1.4
467// MUST_ACCESS: r0.4 and r1.4, usually displayed as r0.8 because r0 and r1 are adjacent
468// MAY_ACCESS: r0.4 and r1.4, and all aliasable memory, because
469// ldx may access any part of the aliasable memory
470typedef int maymust_t;
471const maymust_t
472 // One of the following two bits should be specified:
473 MUST_ACCESS = 0x00, // access information we can count on
474 MAY_ACCESS = 0x01, // access information we should take into account
475 // Optionally combined with the following bits:
477
478 ONE_ACCESS_TYPE = 0x20, // for find_first_use():
479 // use only the specified maymust access type
480 // (by default it inverts the access type for def-lists)
481 INCLUDE_SPOILED_REGS = 0x40, // for build_def_list() with MUST_ACCESS:
482 // include spoiled registers in the list
483 EXCLUDE_PASS_REGS = 0x80, // for build_def_list() with MAY_ACCESS:
484 // exclude pass_regs from the list
485 FULL_XDSU = 0x100, // for build_def_list():
486 // if xds/xdu source and targets are the same
487 // treat it as if xdsu redefines the entire destination
488 WITH_ASSERTS = 0x200, // for find_first_use():
489 // do not ignore assertions
490 EXCLUDE_VOLATILE = 0x400, // for build_def_list():
491 // exclude volatile memory from the list
492 INCLUDE_UNUSED_SRC = 0x800, // for build_use_list():
493 // do not exclude unused source bytes for m_and/m_or insns
494 INCLUDE_DEAD_RETREGS = 0x1000, // for build_def_list():
495 // include dead returned registers in the list
496 INCLUDE_RESTRICTED = 0x2000,// for MAY_ACCESS: include restricted memory
497 CALL_SPOILS_ONLY_ARGS = 0x4000;// for build_def_list() & MAY_ACCESS:
498 // do not include global memory into the
499 // spoiled list of a call
500
501inline THREAD_SAFE bool is_may_access(maymust_t maymust)
502{
503 return (maymust & MAYMUST_ACCESS_MASK) != MUST_ACCESS;
504}
505
506//-------------------------------------------------------------------------
551
552
558
559ea_t hexapi get_merror_desc(qstring *out, merror_t code, mba_t *mba);
560
561//-------------------------------------------------------------------------
564{
566 ea_t errea = BADADDR;
569 hexrays_failure_t(merror_t c, ea_t ea, const char *buf=nullptr) : code(c), errea(ea), str(buf) {}
570 hexrays_failure_t(merror_t c, ea_t ea, const qstring &buf) : code(c), errea(ea), str(buf) {}
571 qstring hexapi desc() const;
572 HEXRAYS_MEMORY_ALLOCATION_FUNCS()
573};
574
576struct vd_failure_t : public std::exception
577{
580 vd_failure_t(merror_t code, ea_t ea, const char *buf=nullptr) : hf(code, ea, buf) {}
581 vd_failure_t(merror_t code, ea_t ea, const qstring &buf) : hf(code, ea, buf) {}
582 vd_failure_t(const hexrays_failure_t &_hf) : hf(_hf) {}
583 qstring desc() const { return hf.desc(); }
584#ifndef SWIG
585 virtual const char *what() const noexcept override { return "decompilation failure"; }
586#endif
587#ifdef __GNUC__
588 ~vd_failure_t() throw() {}
589#endif
590 HEXRAYS_MEMORY_ALLOCATION_FUNCS()
591};
592
595{
596 vd_interr_t(ea_t ea, const qstring &buf) : vd_failure_t(MERR_INTERR, ea, buf) {}
597 vd_interr_t(ea_t ea, const char *buf) : vd_failure_t(MERR_INTERR, ea, buf) {}
598};
599
600//-------------------------------------------------------------------------
601// List of microinstruction opcodes.
602// The order of setX and jX insns is important, it is used in the code.
603
604// Instructions marked with *F may have the FPINSN bit set and operate on fp values
605// Instructions marked with +F must have the FPINSN bit set. They always operate on fp values
606// Other instructions do not operate on fp values.
607
609{
610 m_nop = 0x00, // nop // no operation
611 m_stx = 0x01, // stx l, {r=sel, d=off} // store register to memory *F
612 m_ldx = 0x02, // ldx {l=sel,r=off}, d // load register from memory *F
613 m_ldc = 0x03, // ldc l=const, d // load constant
614 m_mov = 0x04, // mov l, d // move *F
615 m_neg = 0x05, // neg l, d // negate
616 m_lnot = 0x06, // lnot l, d // logical not
617 m_bnot = 0x07, // bnot l, d // bitwise not
618 m_xds = 0x08, // xds l, d // extend (signed)
619 m_xdu = 0x09, // xdu l, d // extend (unsigned)
620 m_low = 0x0A, // low l, d // take low part
621 m_high = 0x0B, // high l, d // take high part
622 m_add = 0x0C, // add l, r, d // l + r -> dst
623 m_sub = 0x0D, // sub l, r, d // l - r -> dst
624 m_mul = 0x0E, // mul l, r, d // l * r -> dst
625 m_udiv = 0x0F, // udiv l, r, d // l / r -> dst
626 m_sdiv = 0x10, // sdiv l, r, d // l / r -> dst
627 m_umod = 0x11, // umod l, r, d // l % r -> dst
628 m_smod = 0x12, // smod l, r, d // l % r -> dst
629 m_or = 0x13, // or l, r, d // bitwise or
630 m_and = 0x14, // and l, r, d // bitwise and
631 m_xor = 0x15, // xor l, r, d // bitwise xor
632 m_shl = 0x16, // shl l, r, d // shift logical left
633 m_shr = 0x17, // shr l, r, d // shift logical right
634 m_sar = 0x18, // sar l, r, d // shift arithmetic right
635 m_cfadd = 0x19, // cfadd l, r, d=carry // calculate carry bit of (l+r)
636 m_ofadd = 0x1A, // ofadd l, r, d=overf // calculate overflow bit of (l+r)
637 m_cfshl = 0x1B, // cfshl l, r, d=carry // calculate carry bit of (l<<r)
638 m_cfshr = 0x1C, // cfshr l, r, d=carry // calculate carry bit of (l>>r)
639 m_sets = 0x1D, // sets l, d=byte SF=1 Sign
640 m_seto = 0x1E, // seto l, r, d=byte OF=1 Overflow of (l-r)
641 m_setp = 0x1F, // setp l, r, d=byte PF=1 Unordered/Parity *F
642 m_setnz = 0x20, // setnz l, r, d=byte ZF=0 Not Equal *F
643 m_setz = 0x21, // setz l, r, d=byte ZF=1 Equal *F
644 m_setae = 0x22, // setae l, r, d=byte CF=0 Unsigned Above or Equal *F
645 m_setb = 0x23, // setb l, r, d=byte CF=1 Unsigned Below *F
646 m_seta = 0x24, // seta l, r, d=byte CF=0 & ZF=0 Unsigned Above *F
647 m_setbe = 0x25, // setbe l, r, d=byte CF=1 | ZF=1 Unsigned Below or Equal *F
648 m_setg = 0x26, // setg l, r, d=byte SF=OF & ZF=0 Signed Greater
649 m_setge = 0x27, // setge l, r, d=byte SF=OF Signed Greater or Equal
650 m_setl = 0x28, // setl l, r, d=byte SF!=OF Signed Less
651 m_setle = 0x29, // setle l, r, d=byte SF!=OF | ZF=1 Signed Less or Equal
652 m_jcnd = 0x2A, // jcnd l, d // d is mop_v or mop_b
653 m_jnz = 0x2B, // jnz l, r, d // ZF=0 Not Equal *F
654 m_jz = 0x2C, // jz l, r, d // ZF=1 Equal *F
655 m_jae = 0x2D, // jae l, r, d // CF=0 Unsigned Above or Equal *F
656 m_jb = 0x2E, // jb l, r, d // CF=1 Unsigned Below *F
657 m_ja = 0x2F, // ja l, r, d // CF=0 & ZF=0 Unsigned Above *F
658 m_jbe = 0x30, // jbe l, r, d // CF=1 | ZF=1 Unsigned Below or Equal *F
659 m_jg = 0x31, // jg l, r, d // SF=OF & ZF=0 Signed Greater
660 m_jge = 0x32, // jge l, r, d // SF=OF Signed Greater or Equal
661 m_jl = 0x33, // jl l, r, d // SF!=OF Signed Less
662 m_jle = 0x34, // jle l, r, d // SF!=OF | ZF=1 Signed Less or Equal
663 m_jtbl = 0x35, // jtbl l, r=mcases // Table jump
664 m_ijmp = 0x36, // ijmp {r=sel, d=off} // indirect unconditional jump
665 m_goto = 0x37, // goto l // l is mop_v or mop_b
666 m_call = 0x38, // call l d // l is mop_v or mop_b or mop_h
667 m_icall = 0x39, // icall {l=sel, r=off} d // indirect call
668 m_ret = 0x3A, // ret
669 m_push = 0x3B, // push l
670 m_pop = 0x3C, // pop d
671 m_und = 0x3D, // und d // undefine
672 m_ext = 0x3E, // ext in1, in2, out1 // external insn, not microcode *F
673 m_f2i = 0x3F, // f2i l, d int(l) => d; convert fp -> integer +F
674 m_f2u = 0x40, // f2u l, d uint(l)=> d; convert fp -> uinteger +F
675 m_i2f = 0x41, // i2f l, d fp(l) => d; convert integer -> fp +F
676 m_u2f = 0x42, // i2f l, d fp(l) => d; convert uinteger -> fp +F
677 m_f2f = 0x43, // f2f l, d l => d; change fp precision +F
678 m_fneg = 0x44, // fneg l, d -l => d; change sign +F
679 m_fadd = 0x45, // fadd l, r, d l + r => d; add +F
680 m_fsub = 0x46, // fsub l, r, d l - r => d; subtract +F
681 m_fmul = 0x47, // fmul l, r, d l * r => d; multiply +F
682 m_fdiv = 0x48, // fdiv l, r, d l / r => d; divide +F
683#define m_max 0x49 // first unused opcode
684};
685
693
694THREAD_SAFE bool hexapi must_mcode_close_block(mcode_t mcode, bool including_calls);
695
696
702
703THREAD_SAFE bool hexapi is_mcode_propagatable(mcode_t mcode);
704
705
706// Is add or sub instruction?
707inline THREAD_SAFE bool is_mcode_addsub(mcode_t mcode) { return mcode == m_add || mcode == m_sub; }
708// Is xds or xdu instruction? We use 'xdsu' as a shortcut for 'xds or xdu'
709inline THREAD_SAFE bool is_mcode_xdsu(mcode_t mcode) { return mcode == m_xds || mcode == m_xdu; }
710// Is a 'set' instruction? (an instruction that sets a condition code)
711inline THREAD_SAFE bool is_mcode_set(mcode_t mcode) { return mcode >= m_sets && mcode <= m_setle; }
712// Is a 1-operand 'set' instruction? Only 'sets' is in this group
713inline THREAD_SAFE bool is_mcode_set1(mcode_t mcode) { return mcode == m_sets; }
714// Is a 1-operand conditional jump instruction? Only 'jcnd' is in this group
715inline THREAD_SAFE bool is_mcode_j1(mcode_t mcode) { return mcode == m_jcnd; }
716// Is a conditional jump?
717inline THREAD_SAFE bool is_mcode_jcond(mcode_t mcode) { return mcode >= m_jcnd && mcode <= m_jle; }
718// Is a 'set' instruction that can be converted into a conditional jump?
719inline THREAD_SAFE bool is_mcode_convertible_to_jmp(mcode_t mcode) { return mcode >= m_setnz && mcode <= m_setle; }
720// Is a conditional jump instruction that can be converted into a 'set'?
721inline THREAD_SAFE bool is_mcode_convertible_to_set(mcode_t mcode) { return mcode >= m_jnz && mcode <= m_jle; }
722// Is a call instruction? (direct or indirect)
723inline THREAD_SAFE bool is_mcode_call(mcode_t mcode) { return mcode == m_call || mcode == m_icall; }
724// Must be an FPU instruction?
725inline THREAD_SAFE bool is_mcode_fpu(mcode_t mcode) { return mcode >= m_f2i; }
726// Is a commutative instruction?
727inline THREAD_SAFE bool is_mcode_commutative(mcode_t mcode)
728{
729 return mcode == m_add
730 || mcode == m_mul
731 || mcode == m_or
732 || mcode == m_and
733 || mcode == m_xor
734 || mcode == m_setz
735 || mcode == m_setnz
736 || mcode == m_cfadd
737 || mcode == m_ofadd;
738}
739// Is a shift instruction?
740inline THREAD_SAFE bool is_mcode_shift(mcode_t mcode)
741{
742 return mcode == m_shl
743 || mcode == m_shr
744 || mcode == m_sar;
745}
746// Is a kind of div or mod instruction?
747inline THREAD_SAFE bool is_mcode_divmod(mcode_t op)
748{
749 return op == m_udiv || op == m_sdiv || op == m_umod || op == m_smod;
750}
751// Is an instruction with the selector/offset pair?
752inline THREAD_SAFE bool has_mcode_seloff(mcode_t op)
753{
754 return op == m_ldx || op == m_stx || op == m_icall || op == m_ijmp;
755}
756
757// Convert setX opcode into corresponding jX opcode
758// This function relies on the order of setX and jX opcodes!
759inline THREAD_SAFE mcode_t set2jcnd(mcode_t code)
760{
761 return mcode_t(code - m_setnz + m_jnz);
762}
763
764// Convert setX opcode into corresponding jX opcode
765// This function relies on the order of setX and jX opcodes!
766inline THREAD_SAFE mcode_t jcnd2set(mcode_t code)
767{
768 return mcode_t(code + m_setnz - m_jnz);
769}
770
771// Negate a conditional opcode.
772// Conditional jumps can be negated, example: jle -> jg
773// 'Set' instruction can be negated, example: seta -> setbe
774// If the opcode cannot be negated, return m_nop
775THREAD_SAFE mcode_t hexapi negate_mcode_relation(mcode_t code);
776
777
778// Swap a conditional opcode.
779// Only conditional jumps and set instructions can be swapped.
780// The returned opcode the one required for swapped operands.
781// Example "x > y" is the same as "y < x", therefore swap(m_jg) is m_jl.
782// If the opcode cannot be swapped, return m_nop
783
784THREAD_SAFE mcode_t hexapi swap_mcode_relation(mcode_t code);
785
786// Return the opcode that performs signed operation.
787// Examples: jae -> jge; udiv -> sdiv
788// If the opcode cannot be transformed into signed form, simply return it.
789
790THREAD_SAFE mcode_t hexapi get_signed_mcode(mcode_t code);
791
792
793// Return the opcode that performs unsigned operation.
794// Examples: jl -> jb; xds -> xdu
795// If the opcode cannot be transformed into unsigned form, simply return it.
796
797THREAD_SAFE mcode_t hexapi get_unsigned_mcode(mcode_t code);
798
799// Does the opcode perform a signed operation?
800inline THREAD_SAFE bool is_signed_mcode(mcode_t code) { return get_unsigned_mcode(code) != code; }
801// Does the opcode perform a unsigned operation?
802inline THREAD_SAFE bool is_unsigned_mcode(mcode_t code) { return get_signed_mcode(code) != code; }
803
804
805// Does the 'd' operand gets modified by the instruction?
806// Example: "add l,r,d" modifies d, while instructions
807// like jcnd, ijmp, stx does not modify it.
808// Note: this function returns 'true' for m_ext but it may be wrong.
809// Use minsn_t::modifies_d() if you have minsn_t.
810
811THREAD_SAFE bool hexapi mcode_modifies_d(mcode_t mcode);
812
813
814// Processor condition codes are mapped to the first microregisters
815// The order is important, see mop_t::is_cc()
817const mreg_t mr_cf = mreg_t(0); // carry bit
818const mreg_t mr_zf = mreg_t(1); // zero bit
819const mreg_t mr_sf = mreg_t(2); // sign bit
820const mreg_t mr_of = mreg_t(3); // overflow bit
821const mreg_t mr_pf = mreg_t(4); // parity bit
822const int cc_count = mr_pf - mr_cf + 1; // number of condition code registers
823const mreg_t mr_cc = mreg_t(5); // synthetic condition code, used internally
824const mreg_t mr_first = mreg_t(8); // the first processor specific register
825
826//-------------------------------------------------------------------------
831struct operand_locator_t
832{
833private:
834 // forbid the default constructor, force the user to initialize objects of this class.
835 operand_locator_t() {}
836public:
838 int opnum;
839 operand_locator_t(ea_t _ea, int _opnum) : ea(_ea), opnum(_opnum) {}
840 DECLARE_COMPARISONS(operand_locator_t);
841 HEXRAYS_MEMORY_ALLOCATION_FUNCS()
842};
843
844//-------------------------------------------------------------------------
848{
850 char opnum;
851 char props = 0;
855#define NF_FIXED 0x01
856#define NF_NEGDONE 0x02
857#define NF_BINVDONE 0x04
858#define NF_NEGATE 0x08
859#define NF_BITNOT 0x10
860#define NF_VALID 0x20
865 char org_nbytes = 0;
870 number_format_t(int _opnum=0) : opnum(char(_opnum)) {}
873 int get_radix() const { return ::get_radix(flags, opnum); }
876 bool is_fixed() const { return props != 0; }
878 bool is_hex() const { return ::is_numop(flags, opnum) && get_radix() == 16; }
880 bool is_dec() const { return ::is_numop(flags, opnum) && get_radix() == 10; }
882 bool is_oct() const { return ::is_numop(flags, opnum) && get_radix() == 8; }
884 bool is_enum() const { return ::is_enum(flags, opnum); }
886 bool is_char() const { return ::is_char(flags, opnum); }
888 bool is_stroff() const { return ::is_stroff(flags, opnum); }
890 bool is_numop() const { return !is_enum() && !is_char() && !is_stroff(); }
894 {
895 return (props & (NF_NEGATE|NF_BITNOT)) != 0 // the user requested it
896 && (props & (NF_NEGDONE|NF_BINVDONE)) == 0; // not done yet
897 }
898 // symbolic constants and struct offsets cannot easily change
899 // their sign or size without a cast. only simple numbers can do that.
900 // for example, by modifying the expression type we can convert:
901 // 10u -> 10
902 // but replacing the type of a symbol constant would lead to an inconsistency.
904 {
905 return (props & NF_VALID) != 0 && (is_stroff() || is_enum());
906 }
907 HEXRAYS_MEMORY_ALLOCATION_FUNCS()
908};
909
910// Number formats are attached to (ea,opnum) pairs
912
913//-------------------------------------------------------------------------
917{
919 int hdrlines = 0;
927 AS_PRINTF(3, 4) virtual int hexapi print(int indent, const char *format, ...);
928 HEXRAYS_MEMORY_ALLOCATION_FUNCS()
929};
930
933{
934 const cfunc_t *func;
935 char lastchar = 0;
937 vc_printer_t(const cfunc_t *f) : func(f) {}
940 virtual bool idaapi oneliner() const newapi { return false; }
941};
942
945{
946 FILE *fp;
953 AS_PRINTF(3, 4) int hexapi print(int indent, const char *format, ...) override;
955 file_printer_t(FILE *_fp) : fp(_fp) {}
956};
957
960{
964 qstring_printer_t(const cfunc_t *f, qstring &_s, bool tags)
965 : vc_printer_t(f), with_tags(tags), s(_s) {}
966
972 AS_PRINTF(3, 4) int hexapi print(int indent, const char *format, ...) override;
973};
974
975//-------------------------------------------------------------------------
979
982
983const char *hexapi dstr(const tinfo_t *tif);
984
985
988
989bool hexapi is_type_correct(const type_t *ptr);
990
991
995
996bool hexapi is_small_udt(const tinfo_t &tif);
997
998
1001
1002bool hexapi is_nonbool_type(const tinfo_t &type);
1003
1004
1007
1008bool hexapi is_bool_type(const tinfo_t &type);
1009
1010
1012inline THREAD_SAFE bool is_ptr_or_array(type_t t)
1013{
1014 return is_type_ptr(t) || is_type_array(t);
1015}
1016
1018inline THREAD_SAFE bool is_paf(type_t t)
1019{
1020 return is_ptr_or_array(t) || is_type_func(t);
1021}
1022
1024inline THREAD_SAFE bool is_inplace_def(const tinfo_t &type)
1025{
1026 return type.is_decl_complex() && !type.is_typeref();
1027}
1028
1031
1032int hexapi partial_type_num(const tinfo_t &type);
1033
1034
1038
1039tinfo_t hexapi get_float_type(size_t width);
1040
1041
1046
1047tinfo_t hexapi get_int_type_by_width_and_sign(size_t srcwidth, type_sign_t sign);
1048
1049
1055
1056tinfo_t hexapi get_unk_type(size_t size);
1057
1058
1062
1063tinfo_t hexapi dummy_ptrtype(size_t ptrsize, bool isfp);
1064
1065
1070// the function will return 'char *'
1071
1072tinfo_t hexapi make_pointer(const tinfo_t &type);
1073
1074
1079
1080tinfo_t hexapi create_typedef(const char *name);
1081
1082
1087
1089{
1090 tinfo_t tif;
1091 tif.create_typedef(nullptr, n);
1092 return tif;
1093}
1094
1097{
1098 GUESSED_NONE, // not guessed, specified by the user
1099 GUESSED_WEAK, // not guessed, comes from idb
1100 GUESSED_FUNC, // guessed as a function
1101 GUESSED_DATA, // guessed as a data item
1102 TS_NOELL = 0x8000000, // can be used in set_type() to avoid merging into ellipsis
1103 TS_SHRINK = 0x4000000, // can be used in set_type() to prefer smaller arguments
1104 TS_DONTREF = 0x2000000, // do not mark type as referenced (referenced_types)
1105 TS_MASK = 0xE000000, // all high bits
1106};
1107
1108
1115
1116bool hexapi get_type(uval_t id, tinfo_t *tif, type_source_t guess);
1117
1118
1126
1127bool hexapi set_type(uval_t id, const tinfo_t &tif, type_source_t source, bool force=false);
1128
1130
1131//-------------------------------------------------------------------------
1132// We use our own class to store argument and variable locations.
1133// It is called vdloc_t that stands for 'vd location'.
1134// 'vd' is the internal name of the decompiler, it stands for 'visual decompiler'.
1135// The main differences between vdloc and argloc_t:
1136// ALOC_REG1: the offset is always 0, so it is not used. the register number
1137// uses the whole ~VLOC_MASK field.
1138// ALOC_STACK: stack offsets are always positive because they are based on
1139// the lowest value of sp in the function.
1140class vdloc_t : public argloc_t
1141{
1142 int regoff(); // inaccessible & undefined: regoff() should not be used
1143public:
1144 // Get the register number.
1145 // This function works only for ALOC_REG1 and ALOC_REG2 location types.
1146 // It uses all available bits for register number for ALOC_REG1
1147 int reg1() const { return atype() == ALOC_REG2 ? argloc_t::reg1() : get_reginfo(); }
1148
1149 // Set vdloc to point to the specified register without cleaning it up.
1150 // This is a dangerous function, use set_reg1() instead unless you understand
1151 // what it means to cleanup an argloc.
1152 void _set_reg1(int r1) { argloc_t::_set_reg1(r1, r1>>16); }
1153
1154 // Set vdloc to point to the specified register.
1155 void set_reg1(int r1) { cleanup_argloc(this); _set_reg1(r1); }
1156
1157 // Use member functions of argloc_t for other location types.
1158
1159 // Return textual representation.
1160 // Note: this and all other dstr() functions can be used from a debugger.
1161 // It is much easier than to inspect the memory contents byte by byte.
1162 const char *hexapi dstr(int width=0) const;
1164 bool hexapi is_aliasable(const mba_t *mb, size_t size) const;
1165};
1166
1169void hexapi print_vdloc(qstring *vout, const vdloc_t &loc, int nbytes);
1170
1171//-------------------------------------------------------------------------
1173bool hexapi arglocs_overlap(const vdloc_t &loc1, size_t w1, const vdloc_t &loc2, size_t w2);
1174
1179{
1181 ea_t defea = BADADDR;
1184
1186 lvar_locator_t(const vdloc_t &loc, ea_t ea) : location(loc), defea(ea) {}
1193 {
1194 return location.is_stkoff() ? location.stkoff() : -1;
1195 }
1196
1197 bool is_reg1() const { return location.is_reg1(); }
1199 bool is_reg2() const { return location.is_reg2(); }
1201 bool is_reg_var() const { return location.is_reg(); }
1203 bool is_stk_var() const { return location.is_stkoff(); }
1205 bool is_scattered() const { return location.is_scattered(); }
1207 mreg_t get_reg1() const { return location.reg1(); }
1209 mreg_t get_reg2() const { return location.reg2(); }
1211 const scattered_aloc_t &get_scattered() const { return location.scattered(); }
1212 scattered_aloc_t &get_scattered() { return location.scattered(); }
1215 // Debugging: get textual representation of a lvar locator.
1216 const char *hexapi dstr() const;
1217};
1220
1223{
1224 friend class mba_t;
1225 int flags;
1229#define CVAR_USED 0x00000001
1230#define CVAR_TYPE 0x00000002
1231#define CVAR_NAME 0x00000004
1232#define CVAR_MREG 0x00000008
1233#define CVAR_NOWD 0x00000010
1234#define CVAR_UNAME 0x00000020
1235#define CVAR_UTYPE 0x00000040
1236#define CVAR_RESULT 0x00000080
1237#define CVAR_ARG 0x00000100
1238#define CVAR_FAKE 0x00000200
1239#define CVAR_OVER 0x00000400
1240#define CVAR_FLOAT 0x00000800
1241#define CVAR_SPOILED 0x00001000
1242#define CVAR_MAPDST 0x00002000
1243#define CVAR_PARTIAL 0x00004000
1244#define CVAR_THISARG 0x00008000
1245#define CVAR_SPLIT 0x00010000
1247#define CVAR_REGNAME 0x00020000
1249#define CVAR_NOPTR 0x00040000
1250#define CVAR_DUMMY 0x00080000
1252#define CVAR_NOTARG 0x00100000
1253#define CVAR_AUTOMAP 0x00200000
1254#define CVAR_BYREF 0x00400000
1255#define CVAR_INASM 0x00800000
1257#define CVAR_UNUSED 0x01000000
1259#define CVAR_SHARED 0x02000000
1260#define CVAR_SCARG 0x04000000
1262#define CVAR_NOPROP 0x08000000
1263#define CVAR_CATCH 0x10000000
1265
1266public:
1272 int width = 0;
1273 int defblk = -1;
1276
1277 lvar_t() : flags(CVAR_USED) {}
1278 lvar_t(const qstring &n, const vdloc_t &l, ea_t e, const tinfo_t &t, int w, int db)
1279 : lvar_locator_t(l, e), flags(CVAR_USED), name(n), tif(t), width(w), defblk(db)
1280 {
1281 }
1282 // Debugging: get textual representation of a local variable.
1283 const char *hexapi dstr() const;
1284
1286 bool used() const { return (flags & CVAR_USED) != 0; }
1288 bool typed() const { return (flags & CVAR_TYPE) != 0; }
1290 bool mreg_done() const { return (flags & CVAR_MREG) != 0; }
1292 bool has_nice_name() const { return (flags & CVAR_NAME) != 0; }
1294 bool is_unknown_width() const { return (flags & CVAR_NOWD) != 0; }
1296 bool has_user_info() const
1297 {
1298 return (flags & (CVAR_UNAME|CVAR_UTYPE|CVAR_NOPTR|CVAR_UNUSED|CVAR_NOPROP)) != 0
1299 || !cmt.empty();
1300 }
1301
1302 bool has_user_name() const { return (flags & CVAR_UNAME) != 0; }
1304 bool has_user_type() const { return (flags & CVAR_UTYPE) != 0; }
1306 bool is_result_var() const { return (flags & CVAR_RESULT) != 0; }
1308 bool is_arg_var() const { return (flags & CVAR_ARG) != 0; }
1310 bool hexapi is_promoted_arg() const;
1312 bool is_fake_var() const { return (flags & CVAR_FAKE) != 0; }
1314 bool is_overlapped_var() const { return (flags & CVAR_OVER) != 0; }
1316 bool is_floating_var() const { return (flags & CVAR_FLOAT) != 0; }
1318 bool is_spoiled_var() const { return (flags & CVAR_SPOILED) != 0; }
1320 bool is_partialy_typed() const { return (flags & CVAR_PARTIAL) != 0; }
1322 bool is_noptr_var() const { return (flags & CVAR_NOPTR) != 0; }
1324 bool is_mapdst_var() const { return (flags & CVAR_MAPDST) != 0; }
1326 bool is_thisarg() const { return (flags & CVAR_THISARG) != 0; }
1328 bool is_split_var() const { return (flags & CVAR_SPLIT) != 0; }
1330 bool has_regname() const { return (flags & CVAR_REGNAME) != 0; }
1332 bool in_asm() const { return (flags & CVAR_INASM) != 0; }
1334 bool is_dummy_arg() const { return (flags & CVAR_DUMMY) != 0; }
1336 bool is_notarg() const { return (flags & CVAR_NOTARG) != 0; }
1338 bool is_automapped() const { return (flags & CVAR_AUTOMAP) != 0; }
1340 bool is_used_byref() const { return (flags & CVAR_BYREF) != 0; }
1342 bool is_decl_unused() const { return (flags & CVAR_UNUSED) != 0; }
1344 bool is_shared() const { return (flags & CVAR_SHARED) != 0; }
1346 bool was_scattered_arg() const { return (flags & CVAR_SCARG) != 0; }
1348 bool is_noprop() const { return (flags & CVAR_NOPROP) != 0; }
1349 void set_used() { flags |= CVAR_USED; }
1350 void clear_used() { flags &= ~CVAR_USED; }
1351 void set_typed() { flags |= CVAR_TYPE; clr_noptr_var(); }
1352 void set_non_typed() { flags &= ~CVAR_TYPE; }
1353 void clr_user_info() { flags &= ~(CVAR_UNAME|CVAR_UTYPE|CVAR_NOPTR); }
1354 void set_user_name() { flags |= CVAR_NAME|CVAR_UNAME; }
1355 void set_user_type() { flags |= CVAR_TYPE|CVAR_UTYPE; }
1356 void clr_user_type() { flags &= ~CVAR_UTYPE; }
1357 void clr_user_name() { flags &= ~CVAR_UNAME; }
1358 void set_mreg_done() { flags |= CVAR_MREG; }
1359 void clr_mreg_done() { flags &= ~CVAR_MREG; }
1360 void set_unknown_width() { flags |= CVAR_NOWD; }
1361 void clr_unknown_width() { flags &= ~CVAR_NOWD; }
1362 void set_arg_var() { flags |= CVAR_ARG; }
1363 void clr_arg_var() { flags &= ~(CVAR_ARG|CVAR_THISARG); }
1364 void set_fake_var() { flags |= CVAR_FAKE; }
1365 void clr_fake_var() { flags &= ~CVAR_FAKE; }
1366 void set_overlapped_var() { flags |= CVAR_OVER; }
1367 void clr_overlapped_var() { flags &= ~CVAR_OVER; }
1368 void set_floating_var() { flags |= CVAR_FLOAT; }
1369 void clr_floating_var() { flags &= ~CVAR_FLOAT; }
1370 void set_spoiled_var() { flags |= CVAR_SPOILED; }
1371 void clr_spoiled_var() { flags &= ~CVAR_SPOILED; }
1372 void set_mapdst_var() { flags |= CVAR_MAPDST; }
1373 void clr_mapdst_var() { flags &= ~CVAR_MAPDST; }
1374 void set_partialy_typed() { flags |= CVAR_PARTIAL; }
1375 void clr_partialy_typed() { flags &= ~CVAR_PARTIAL; }
1376 void set_noptr_var() { flags |= CVAR_NOPTR; }
1377 void clr_noptr_var() { flags &= ~CVAR_NOPTR; }
1378 void set_thisarg() { flags |= CVAR_THISARG; }
1379 void clr_thisarg() { flags &= ~CVAR_THISARG; }
1380 void set_split_var() { flags |= CVAR_SPLIT; }
1381 void clr_split_var() { flags &= ~CVAR_SPLIT; }
1382 void set_dummy_arg() { flags |= CVAR_DUMMY; }
1383 void clr_dummy_arg() { flags &= ~CVAR_DUMMY; }
1384 void set_notarg() { clr_arg_var(); flags |= CVAR_NOTARG; }
1385 void clr_notarg() { flags &= ~CVAR_NOTARG; }
1386 void set_automapped() { flags |= CVAR_AUTOMAP; }
1387 void clr_automapped() { flags &= ~CVAR_AUTOMAP; }
1388 void set_used_byref() { flags |= CVAR_BYREF; }
1389 void clr_used_byref() { flags &= ~CVAR_BYREF; }
1390 void set_decl_unused() { flags |= CVAR_UNUSED; }
1391 void clr_decl_unused() { flags &= ~CVAR_UNUSED; }
1392 void set_shared() { flags |= CVAR_SHARED; }
1393 void clr_shared() { flags &= ~CVAR_SHARED; }
1394 void set_scattered_arg() { flags |= CVAR_SCARG; }
1395 void clr_scattered_arg() { flags &= ~CVAR_SCARG; }
1396 void set_noprop() { flags |= CVAR_NOPROP; }
1397 void clr_noprop() { flags &= ~CVAR_NOPROP; }
1398
1400 bool has_common(const lvar_t &v) const
1401 {
1403 }
1404
1405 bool has_common_bit(const vdloc_t &loc, asize_t width2) const
1406 {
1407 return arglocs_overlap(location, width, loc, width2);
1408 }
1409
1410 const tinfo_t &type() const { return tif; }
1411 tinfo_t &type() { return tif; }
1412
1415 bool hexapi accepts_type(const tinfo_t &t, bool may_change_thisarg=false);
1426 bool hexapi set_lvar_type(const tinfo_t &t, bool may_fail=false);
1427
1430 {
1432 set_typed();
1433 }
1434
1441 bool hexapi set_width(int w, int svw_flags=0);
1442#define SVW_INT 0x00 // integer value
1443#define SVW_FLOAT 0x01 // floating point value
1444#define SVW_SOFT 0x02 // may fail and return false;
1445 // if this bit is not set and the type is bad, interr
1446
1451 void hexapi append_list(const mba_t *mba, mlist_t *lst, bool pad_if_scattered=false) const;
1452
1456 bool is_aliasable(const mba_t *mba) const
1457 {
1458 return location.is_aliasable(mba, width);
1459 }
1460
1461};
1463
1465class lvars_t : public qvector<lvar_t>
1466{
1467public:
1472 int find_input_lvar(const vdloc_t &argloc, size_t _size) { return find_lvar(argloc, _size, 0); }
1473
1474
1479 int find_input_reg(int reg, size_t _size=1)
1480 {
1481 vdloc_t rloc;
1482 rloc._set_reg1(reg);
1483 return find_input_lvar(rloc, _size);
1484 }
1485
1486
1491 int hexapi find_stkvar(sval_t spoff, int width);
1492
1493
1497 lvar_t *hexapi find(const lvar_locator_t &ll);
1498
1499
1505 int hexapi find_lvar(const vdloc_t &location, size_t width, int defblk=-1) const;
1506};
1507
1510{
1520#define LVINF_KEEP 0x0001
1526#define LVINF_SPLIT 0x0002
1529#define LVINF_NOPTR 0x0004
1530#define LVINF_NOMAP 0x0008
1531#define LVINF_UNUSED 0x0010
1532#define LVINF_NOPROP 0x0020
1534 bool has_info() const
1535 {
1536 return !name.empty()
1537 || !type.empty()
1538 || !cmt.empty()
1539 || is_split_lvar()
1540 || is_noptr_lvar()
1541 || is_nomap_lvar()
1542 || is_noprop_lvar();
1543 }
1544 bool operator==(const lvar_saved_info_t &r) const
1545 {
1546 return name == r.name
1547 && cmt == r.cmt
1548 && ll == r.ll
1549 && type == r.type;
1550 }
1551 bool operator!=(const lvar_saved_info_t &r) const { return !(*this == r); }
1552 bool is_kept() const { return (flags & LVINF_KEEP) != 0; }
1553 void clear_keep() { flags &= ~LVINF_KEEP; }
1554 void set_keep() { flags |= LVINF_KEEP; }
1555 bool is_split_lvar() const { return (flags & LVINF_SPLIT) != 0; }
1556 void set_split_lvar() { flags |= LVINF_SPLIT; }
1557 void clr_split_lvar() { flags &= ~LVINF_SPLIT; }
1558 bool is_noptr_lvar() const { return (flags & LVINF_NOPTR) != 0; }
1559 void set_noptr_lvar() { flags |= LVINF_NOPTR; }
1560 void clr_noptr_lvar() { flags &= ~LVINF_NOPTR; }
1561 bool is_nomap_lvar() const { return (flags & LVINF_NOMAP) != 0; }
1562 void set_nomap_lvar() { flags |= LVINF_NOMAP; }
1563 void clr_nomap_lvar() { flags &= ~LVINF_NOMAP; }
1564 bool is_unused_lvar() const { return (flags & LVINF_UNUSED) != 0; }
1565 void set_unused_lvar() { flags |= LVINF_UNUSED; }
1566 void clr_unused_lvar() { flags &= ~LVINF_UNUSED; }
1567 bool is_noprop_lvar() const { return (flags & LVINF_NOPROP) != 0; }
1568 void set_noprop_lvar() { flags |= LVINF_NOPROP; }
1569 void clr_noprop_lvar() { flags &= ~LVINF_NOPROP; }
1570};
1573
1576
1579{
1583
1586
1590
1594#define ULV_PRECISE_DEFEA 0x0001
1597 int ulv_flags = ULV_PRECISE_DEFEA;
1598
1600 {
1601 lvvec.swap(r.lvvec);
1602 lmaps.swap(r.lmaps);
1603 std::swap(stkoff_delta, r.stkoff_delta);
1604 std::swap(ulv_flags, r.ulv_flags);
1605 }
1606 void clear()
1607 {
1608 lvvec.clear();
1609 lmaps.clear();
1610 stkoff_delta = 0;
1611 ulv_flags = ULV_PRECISE_DEFEA;
1612 }
1613 bool empty() const
1614 {
1615 return lvvec.empty()
1616 && lmaps.empty()
1617 && stkoff_delta == 0
1618 && ulv_flags == ULV_PRECISE_DEFEA;
1619 }
1620
1623 {
1624 for ( lvar_saved_infos_t::iterator p=lvvec.begin(); p != lvvec.end(); ++p )
1625 {
1626 if ( p->ll == vloc )
1627 return p;
1628 }
1629 return nullptr;
1630 }
1631
1633 void keep_info(const lvar_t &v)
1634 {
1636 if ( p != nullptr )
1637 p->set_keep();
1638 }
1639};
1640
1645
1646bool hexapi restore_user_lvar_settings(lvar_uservec_t *lvinf, ea_t func_ea);
1647
1648
1652
1653void hexapi save_user_lvar_settings(ea_t func_ea, const lvar_uservec_t &lvinf);
1654
1655
1658{
1662 virtual bool idaapi modify_lvars(lvar_uservec_t *lvinf) = 0;
1663};
1664
1669
1670bool hexapi modify_user_lvars(ea_t entry_ea, user_lvar_modifier_t &mlv);
1671
1672
1678
1679bool hexapi modify_user_lvar_info(
1680 ea_t func_ea,
1681 uint mli_flags,
1682 const lvar_saved_info_t &info);
1683
1686#define MLI_NAME 0x01
1687#define MLI_TYPE 0x02
1688#define MLI_CMT 0x04
1689#define MLI_SET_FLAGS 0x08
1690#define MLI_CLR_FLAGS 0x10
1692
1693
1701
1702bool hexapi locate_lvar(
1703 lvar_locator_t *out,
1704 ea_t func_ea,
1705 const char *varname);
1706
1707
1715
1716inline bool rename_lvar(
1717 ea_t func_ea,
1718 const char *oldname,
1719 const char *newname)
1720{
1721 lvar_saved_info_t info;
1722 if ( !locate_lvar(&info.ll, func_ea, oldname) )
1723 return false;
1724 info.name = newname;
1725 return modify_user_lvar_info(func_ea, MLI_NAME, info);
1726}
1727
1728//-------------------------------------------------------------------------
1731{
1732 qstring name; // name of the function
1733 tinfo_t tif; // function prototype
1735 {
1736 int code = ::compare(name, r.name);
1737 if ( code == 0 )
1738 code = ::compare(tif, r.tif);
1739 return code;
1740 }
1741
1742 bool empty() const { return name.empty() && tif.empty(); }
1743};
1744
1745// All user-defined function calls
1747
1752
1753bool hexapi restore_user_defined_calls(udcall_map_t *udcalls, ea_t func_ea);
1754
1755
1759
1760void hexapi save_user_defined_calls(ea_t func_ea, const udcall_map_t &udcalls);
1761
1762
1768
1769bool hexapi parse_user_call(udcall_t *udc, const char *decl, bool silent);
1770
1771
1776
1777merror_t hexapi convert_to_user_call(const udcall_t &udc, codegen_t &cdg);
1778
1779
1780//-------------------------------------------------------------------------
1790{
1794 virtual bool match(codegen_t &cdg) = 0;
1795
1801 virtual merror_t apply(codegen_t &cdg) = 0;
1802};
1803
1808bool hexapi install_microcode_filter(microcode_filter_t *filter, bool install=true);
1809
1810//-------------------------------------------------------------------------
1814{
1815 udcall_t udc;
1816
1817public:
1819
1822 void hexapi cleanup();
1823
1825 virtual bool match(codegen_t &cdg) override = 0;
1826
1827 bool hexapi init(const char *decl);
1828 virtual merror_t hexapi apply(codegen_t &cdg) override;
1829
1830 bool empty() const { return udc.empty(); }
1831};
1832
1833//-------------------------------------------------------------------------
1834typedef size_t mbitmap_t;
1835const size_t bitset_width = sizeof(mbitmap_t) * CHAR_BIT;
1836const size_t bitset_align = bitset_width - 1;
1837const size_t bitset_shift = 6;
1838
1841{
1842 mbitmap_t *bitmap = nullptr;
1843 size_t high = 0;
1844
1845public:
1847 hexapi bitset_t(const bitset_t &m); // copy constructor
1849 {
1850 qfree(bitmap);
1851 bitmap = nullptr;
1852 }
1854 {
1855 std::swap(bitmap, r.bitmap);
1856 std::swap(high, r.high);
1857 }
1858 bitset_t &operator=(const bitset_t &m) { return copy(m); }
1859 bitset_t &hexapi copy(const bitset_t &m); // assignment operator
1860 bool hexapi add(int bit); // add a bit
1861 bool hexapi add(int bit, int width); // add bits
1862 bool hexapi add(const bitset_t &ml); // add another bitset
1863 bool hexapi sub(int bit); // delete a bit
1864 bool hexapi sub(int bit, int width); // delete bits
1865 bool hexapi sub(const bitset_t &ml); // delete another bitset
1866 bool hexapi cut_at(int maxbit); // delete bits >= maxbit
1867 void hexapi shift_down(int shift); // shift bits down
1868 bool hexapi has(int bit) const; // test presence of a bit
1869 bool hexapi has_all(int bit, int width) const; // test presence of bits
1870 bool hexapi has_any(int bit, int width) const; // test presence of bits
1871 void print(
1872 qstring *vout,
1873 int (*get_bit_name)(qstring *out, int bit, int width, void *ud)=nullptr,
1874 void *ud=nullptr) const;
1875 const char *hexapi dstr() const;
1876 bool hexapi empty() const; // is empty?
1877 int hexapi count() const; // number of set bits
1878 int hexapi count(int bit) const; // get number set bits starting from 'bit'
1879 int hexapi last() const; // get the number of the last bit (-1-no bits)
1880 void clear() { high = 0; } // make empty
1881 void hexapi fill_with_ones(int maxbit);
1882 bool hexapi fill_gaps(int total_nbits);
1883 bool hexapi has_common(const bitset_t &ml) const; // has common elements?
1884 bool hexapi intersect(const bitset_t &ml); // intersect sets. returns true if changed
1885 bool hexapi is_subset_of(const bitset_t &ml) const; // is subset of?
1886 bool includes(const bitset_t &ml) const { return ml.is_subset_of(*this); }
1887 void extract(intvec_t &out) const;
1890 class iterator
1891 {
1892 friend class bitset_t;
1893 int i;
1894 public:
1895 iterator(int n=-1) : i(n) {}
1896 bool operator==(const iterator &n) const { return i == n.i; }
1897 bool operator!=(const iterator &n) const { return i != n.i; }
1898 int operator*() const { return i; }
1899 };
1900 typedef iterator const_iterator;
1901 iterator itat(int n) const { return iterator(goup(n)); }
1902 iterator begin() const { return itat(0); }
1903 iterator end() const { return iterator(high); }
1904 int front() const { return *begin(); }
1905 int back() const { return *end(); }
1906 void inc(iterator &p, int n=1) const { p.i = goup(p.i+n); }
1907private:
1908 int hexapi goup(int reg) const;
1909};
1912
1913//-------------------------------------------------------------------------
1914// set of graph nodes as a bitset
1916{
1917public:
1919 node_bitset_t(int node) { add(node); }
1920};
1922
1923class array_of_node_bitset_t : public qvector<node_bitset_t> {};
1924
1925//-------------------------------------------------------------------------
1926struct ivl_t // an interval
1927{
1928public:
1931
1932 ivl_t(uint64 _off=0, uint64 _size=0) : off(_off), size(_size) {}
1933 bool empty() const { return size == 0; }
1934 bool valid() const { return last() >= off; }
1935 uint64 end() const { return off + size; }
1936 uint64 last() const { return off + size - 1; }
1937 void clear() { size = 0; }
1938 void print(qstring *vout) const;
1939 const char *hexapi dstr() const;
1940
1941 bool extend_to_cover(const ivl_t &r) // extend interval to cover 'r'
1942 {
1943 uint64 new_end = end();
1944 bool changed = false;
1945 if ( off > r.off )
1946 {
1947 off = r.off;
1948 changed = true;
1949 }
1950 if ( new_end < r.end() )
1951 {
1952 new_end = r.end();
1953 changed = true;
1954 }
1955 if ( changed )
1956 size = new_end - off;
1957 return changed;
1958 }
1959 void intersect(const ivl_t &r)
1960 {
1961 uint64 new_off = qmax(off, r.off);
1962 uint64 new_end = end();
1963 if ( new_end > r.end() )
1964 new_end = r.end();
1965 if ( new_off < new_end )
1966 {
1967 off = new_off;
1968 size = new_end - off;
1969 }
1970 else
1971 {
1972 size = 0;
1973 }
1974 }
1975
1976 // do *this and ivl overlap?
1977 bool overlap(const ivl_t &ivl) const
1978 {
1979 return interval::overlap(off, size, ivl.off, ivl.size);
1980 }
1981 // does *this include ivl?
1982 bool includes(const ivl_t &ivl) const
1983 {
1984 return interval::includes(off, size, ivl.off, ivl.size);
1985 }
1986 // does *this contain off2?
1987 bool contains(uint64 off2) const
1988 {
1989 return interval::contains(off, size, off2);
1990 }
1991
1994 static ivl_t allmem() { return ivl_t(0, BADADDR); }
1995#define ALLMEM ivl_t::allmem()
1996};
1998
1999//-------------------------------------------------------------------------
2001{
2003 const char *whole; // name of the whole interval
2004 const char *part; // prefix to use for parts of the interval (e.g. sp+4)
2005 ivl_with_name_t(): ivl(0, BADADDR), whole("<unnamed inteval>"), part(nullptr) {}
2006 DEFINE_MEMORY_ALLOCATION_FUNCS()
2007};
2008
2009//-------------------------------------------------------------------------
2011{
2012 virtual int visit_ivl(const ivl_t &ivl) = 0;
2013};
2014
2015//-------------------------------------------------------------------------
2021{
2022public:
2024
2025protected:
2027 bool verify() const;
2028 // we do not store the empty intervals in bag so size == 0 denotes
2029 // MAX_VALUE<uint64>+1, e.g. 0x1'00000000'00000000
2030 static bool ivl_all_values(const ivl_t &ivl) { return ivl.off == 0 && ivl.size == 0; }
2031
2032public:
2034 ivlset_t(const ivl_t &ivl) { if ( ivl.valid() ) bag.push_back(ivl); }
2036
2037 void swap(ivlset_t &r) { bag.swap(r.bag); }
2038 const ivl_t &getivl(int idx) const { return bag[idx]; }
2039 const ivl_t &lastivl() const { return bag.back(); }
2040 size_t nivls() const { return bag.size(); }
2041 bool empty() const { return bag.empty(); }
2042 void clear() { bag.clear(); }
2043 void qclear() { bag.qclear(); }
2044 bool all_values() const { return nivls() == 1 && ivl_all_values(bag[0]); }
2045 void set_all_values() { clear(); bag.push_back(ivl_t(0, 0)); }
2046 bool single_value() const { return nivls() == 1 && bag[0].size == 1; }
2047 bool single_value(uint64 v) const { return single_value() && bag[0].off == v; }
2048
2049 bool hexapi add(const ivl_t &ivl);
2050 bool add(ea_t ea, asize_t size) { return add(ivl_t(ea, size)); }
2051 bool hexapi add(const ivlset_t &ivs);
2052 bool hexapi addmasked(const ivlset_t &ivs, const ivl_t &mask);
2053 bool hexapi sub(const ivl_t &ivl);
2054 bool sub(ea_t ea, asize_t size) { return sub(ivl_t(ea, size)); }
2055 bool hexapi sub(const ivlset_t &ivs);
2056 asize_t hexapi count() const; // sum of the interval sizes
2057 bool hexapi has_common(const ivlset_t &ivs) const;
2058 bool hexapi has_common(const ivl_t &ivl, bool strict=false) const;
2059 bool hexapi contains(uint64 off) const;
2060 bool hexapi includes(const ivlset_t &ivs) const;
2061 bool hexapi intersect(const ivlset_t &ivs);
2062 bool is_subset_of(const ivlset_t &ivs) const { return ivs.includes(*this); }
2064 bool operator==(const ivl_t &v) const { return nivls() == 1 && bag[0] == v; }
2065 bool operator!=(const ivl_t &v) const { return !(*this == v); }
2066
2067 typedef typename bag_t::iterator iterator;
2069 const_iterator begin() const { return bag.begin(); }
2070 const_iterator end() const { return bag.end(); }
2071 iterator begin() { return bag.begin(); }
2072 iterator end() { return bag.end(); }
2073
2074 void hexapi print(qstring *vout) const;
2075 const char *hexapi dstr() const;
2076
2077};
2079
2081//-------------------------------------------------------------------------
2082// We use bitset_t to keep list of registers.
2083// This is the most optimal storage for them.
2084// Note: the inherited count(mreg_t) method returns the number of consecutive
2085// bits set starting from mreg_t, which may be any value (not just powers of 2).
2086class rlist_t : public bitset_t
2087{
2088public:
2090 rlist_t(const rlist_t &m) : bitset_t(m) {}
2091 rlist_t(mreg_t reg, int width) { add(reg, width); }
2093 rlist_t &operator=(const rlist_t &) = default;
2094 void hexapi print(qstring *vout) const;
2095 const char *hexapi dstr() const;
2096};
2098
2099//-------------------------------------------------------------------------
2100// Microlist: list of register and memory locations
2102{
2103 rlist_t reg; // registers
2104 ivlset_t mem; // memory locations
2105
2107 mlist_t(const ivl_t &ivl) : mem(ivl) {}
2108 mlist_t(mreg_t r, int size) : reg(r, size) {}
2109
2110 void swap(mlist_t &r) { reg.swap(r.reg); mem.swap(r.mem); }
2111 bool hexapi addmem(ea_t ea, asize_t size);
2112 bool add(mreg_t r, int size) { return add(mlist_t(r, size)); } // also see append_def_list()
2113 bool add(const rlist_t &r) { return reg.add(r); }
2114 bool add(const ivl_t &ivl) { return add(mlist_t(ivl)); }
2115 bool add(const mlist_t &lst)
2116 {
2117 bool changed = reg.add(lst.reg);
2118 if ( mem.add(lst.mem) )
2119 changed = true;
2120 return changed;
2121 }
2122 bool sub(mreg_t r, int size) { return sub(mlist_t(r, size)); }
2123 bool sub(const ivl_t &ivl) { return sub(mlist_t(ivl)); }
2124 bool sub(const mlist_t &lst)
2125 {
2126 bool changed = reg.sub(lst.reg);
2127 if ( mem.sub(lst.mem) )
2128 changed = true;
2129 return changed;
2130 }
2131 asize_t count() const { return reg.count() + mem.count(); }
2132 void hexapi print(qstring *vout) const;
2133 const char *hexapi dstr() const;
2134 bool empty() const { return reg.empty() && mem.empty(); }
2135 void clear() { reg.clear(); mem.clear(); }
2136 bool has(mreg_t r) const { return reg.has(r); }
2137 bool has_all(mreg_t r, int size) const { return reg.has_all(r, size); }
2138 bool has_any(mreg_t r, int size) const { return reg.has_any(r, size); }
2139 bool has_memory() const { return !mem.empty(); }
2140 bool has_allmem() const { return mem == ALLMEM; }
2141 bool has_common(const mlist_t &lst) const { return reg.has_common(lst.reg) || mem.has_common(lst.mem); }
2142 bool includes(const mlist_t &lst) const { return reg.includes(lst.reg) && mem.includes(lst.mem); }
2143 bool intersect(const mlist_t &lst)
2144 {
2145 bool changed = reg.intersect(lst.reg);
2146 if ( mem.intersect(lst.mem) )
2147 changed = true;
2148 return changed;
2149 }
2150 bool is_subset_of(const mlist_t &lst) const { return lst.includes(*this); }
2151
2153 HEXRAYS_MEMORY_ALLOCATION_FUNCS()
2154};
2158
2159//-------------------------------------------------------------------------
2166const mlist_t &hexapi get_temp_regs();
2167
2173bool hexapi is_kreg(mreg_t r);
2174
2178mreg_t hexapi reg2mreg(int reg);
2179
2184int hexapi mreg2reg(mreg_t reg, size_t width);
2185
2194
2195int hexapi get_mreg_name(qstring *out, mreg_t reg, int width, void *ud=nullptr);
2196
2197//-------------------------------------------------------------------------
2200{
2201 virtual ~optinsn_t() {}
2219 virtual int idaapi func(mblock_t *blk, minsn_t *ins, int optflags) = 0;
2220};
2221
2225void hexapi install_optinsn_handler(optinsn_t *opt);
2226
2228bool hexapi remove_optinsn_handler(optinsn_t *opt);
2229
2232{
2233 virtual ~optblock_t() {}
2246 virtual int idaapi func(mblock_t *blk) = 0;
2247};
2248
2252void hexapi install_optblock_handler(optblock_t *opt);
2253
2255bool hexapi remove_optblock_handler(optblock_t *opt);
2256
2257
2258//-------------------------------------------------------------------------
2259// abstract graph interface
2261{
2262 // does a path from 'm' to 'n' exist?
2263 bool path_exists(node_bitset_t &visited, int m, int n) const;
2264protected:
2265 void calc_outgoing_edges(const intvec_t &sub, edgevec_t &el) const;
2266 void compute_dominator_info(struct dominator_info_t &di);
2267 bool is_connected_without(const edge_t &forbidden_edge, const intvec_t &dead_nodes) const;
2268public:
2270 bool colored_gdl_edges = false;
2271
2273 // this call is used to exclude edges in worklist_iterate... functions()
2274 virtual bool ignore_edge(int /*src*/, int /*dst*/ ) const newapi { return false; }
2275
2276 void hexapi compute_dominators(array_of_node_bitset_t &domin, bool post=false) const;
2277 void hexapi compute_immediate_dominators(
2278 const array_of_node_bitset_t &domin,
2279 intvec_t &idomin,
2280 bool post=false) const;
2281 int hexapi depth_first_preorder(node_ordering_t *pre) const; // returns number of visited nodes
2282 int hexapi depth_first_postorder(node_ordering_t *post) const; // returns number of visited nodes
2283#ifndef SWIG
2284 void depth_first_postorder(node_ordering_t *post, edge_mapper_t *et) const;
2287
2288 // find nodes reaching 'n'
2289 void find_reaching_nodes(int n, node_bitset_t &reaching) const;
2290
2291 // does a path from 'm' to 'n' exist?
2292 bool path_exists(int m, int n) const;
2293
2294 // is there a path from M to N which terminates with a back edge to N?
2295 bool path_back(const array_of_node_bitset_t &domin, int m, int n) const;
2296 bool path_back(const edge_mapper_t &et, int m, int n) const;
2297#endif
2298
2299 class iterator
2300 {
2301 friend class simple_graph_t;
2302 int i;
2303 iterator(int n) : i(n) {}
2304 public:
2305 bool operator==(const iterator &n) const { return i == n.i; }
2306 bool operator!=(const iterator &n) const { return i != n.i; }
2307 int operator*() const { return i; }
2308 };
2310 iterator begin() const { return iterator(goup(0)); }
2311 iterator end() const { return iterator(size()); }
2312 int front() const { return *begin(); }
2313 void inc(iterator &p, int n=1) const { p.i = goup(p.i+n); }
2314 virtual int hexapi goup(int node) const newapi;
2315};
2316
2317//-------------------------------------------------------------------------
2318// Since our data structures are quite complex, we use the visitor pattern
2319// in many of our algorthims. This functionality is available for plugins too.
2320// https://en.wikipedia.org/wiki/Visitor_pattern
2321
2322// All our visitor callbacks return an integer value.
2323// Visiting is interrupted as soon an the return value is non-zero.
2324// This non-zero value is returned as the result of the for_all_... function.
2325// If for_all_... returns 0, it means that it successfully visited all items.
2326
2329{
2330 mba_t *mba; // current microcode
2331 mblock_t *blk; // current block
2332 minsn_t *topins; // top level instruction (parent of curins or curins itself)
2333 minsn_t *curins; // currently visited instruction
2334
2336 mba_t *_mba=nullptr,
2337 mblock_t *_blk=nullptr,
2338 minsn_t *_topins=nullptr)
2339 : mba(_mba), blk(_blk), topins(_topins), curins(nullptr) {}
2342 bool really_alloc() const;
2343};
2344
2349{
2351 mba_t *_mba=nullptr,
2352 mblock_t *_blk=nullptr,
2353 minsn_t *_topins=nullptr)
2354 : op_parent_info_t(_mba, _blk, _topins) {}
2355 virtual int idaapi visit_minsn() = 0;
2356};
2357
2362{
2365 bool prune = false;
2366
2368 mba_t *_mba=nullptr,
2369 mblock_t *_blk=nullptr,
2370 minsn_t *_topins=nullptr)
2371 : op_parent_info_t(_mba, _blk, _topins) {}
2372 virtual int idaapi visit_mop(mop_t *op, const tinfo_t *type, bool is_target) = 0;
2373};
2374
2378{
2381 virtual int idaapi visit_scif_mop(const mop_t &r, int off) = 0;
2382};
2383
2384// Used operand visitor.
2385// See mblock_t::for_all_uses
2387{
2388 minsn_t *topins = nullptr;
2389 minsn_t *curins = nullptr;
2390 bool changed = false;
2391 mlist_t *list = nullptr;
2394 bool prune = false;
2395
2398 virtual int idaapi visit_mop(mop_t *op) = 0;
2399};
2400
2401//-------------------------------------------------------------------------
2403
2405const mopt_t
2406 mop_z = 0,
2407 mop_r = 1,
2408 mop_n = 2,
2410 mop_d = 4,
2411 mop_S = 5,
2412 mop_v = 6,
2413 mop_b = 7,
2414 mop_f = 8,
2415 mop_l = 9,
2416 mop_a = 10,
2417 mop_h = 11,
2418 mop_c = 12,
2419 mop_fn = 13,
2420 mop_p = 14,
2421 mop_sc = 15;
2422
2423const int NOSIZE = -1;
2424
2425//-------------------------------------------------------------------------
2428{
2436 mba_t *const mba;
2438 int idx;
2439 lvar_ref_t(mba_t *m, int i, sval_t o=0) : mba(m), off(o), idx(i) {}
2440 lvar_ref_t(const lvar_ref_t &r) : mba(r.mba), off(r.off), idx(r.idx) {}
2442 {
2443 off = r.off;
2444 idx = r.idx;
2445 return *this;
2446 }
2449 void swap(lvar_ref_t &r)
2450 {
2451 std::swap(off, r.off);
2452 std::swap(idx, r.idx);
2453 }
2454 lvar_t &hexapi var() const;
2455};
2456
2457//-------------------------------------------------------------------------
2460{
2464 mba_t *const mba;
2465
2470
2471 stkvar_ref_t(mba_t *m, sval_t o) : mba(m), off(o) {}
2475 {
2476 std::swap(off, r.off);
2477 }
2478
2482 ssize_t hexapi get_stkvar(udm_t *udm=nullptr, uval_t *p_idaoff=nullptr) const;
2483};
2484
2485//-------------------------------------------------------------------------
2487struct scif_t : public vdloc_t
2488{
2495
2500
2504
2505 scif_t(mba_t *_mba, tinfo_t *tif, qstring *n=nullptr) : mba(_mba)
2506 {
2507 if ( n != nullptr )
2508 n->swap(name);
2509 tif->swap(type);
2510 }
2511 scif_t &operator =(const vdloc_t &loc)
2512 {
2513 *(vdloc_t *)this = loc;
2514 return *this;
2515 }
2516};
2517
2518//-------------------------------------------------------------------------
2521struct mnumber_t : public operand_locator_t
2522{
2524 uint64 org_value; // original value before changing the operand size
2525 mnumber_t(uint64 v, ea_t _ea=BADADDR, int n=0)
2526 : operand_locator_t(_ea, n), value(v), org_value(v) {}
2529 {
2530 if ( value < r.value )
2531 return -1;
2532 if ( value > r.value )
2533 return -1;
2534 return 0;
2535 }
2536 // always use this function instead of manually modifying the 'value' field
2538 {
2539 value = val64;
2540 org_value = val64;
2541 }
2542};
2543
2544//-------------------------------------------------------------------------
2548{
2551 operator uint16 *() { return fnum.w; }
2552 operator const uint16 *() const { return fnum.w; }
2553 void hexapi print(qstring *vout) const;
2554 const char *hexapi dstr() const;
2556 DECLARE_COMPARISONS(fnumber_t)
2557 {
2558 return ecmp(fnum, r.fnum);
2559 }
2560 int calc_max_exp() const
2561 {
2562 return nbytes <= 4 ? MAXEXP_FLOAT
2563 : nbytes <= 8 ? MAXEXP_DOUBLE
2564 : MAXEXP_LNGDBL;
2565 }
2566 bool is_nan() const
2567 {
2569 }
2570};
2571
2572//-------------------------------------------------------------------------
2575#define SHINS_NUMADDR 0x01
2576#define SHINS_VALNUM 0x02
2577#define SHINS_SHORT 0x04
2578#define SHINS_LDXEA 0x08
2579#define SHINS_NOEA 0x10
2581
2582//-------------------------------------------------------------------------
2597
2598//-------------------------------------------------------------------------
2604{
2605 void hexapi copy(const mop_t &rop);
2606public:
2609
2612#define OPROP_IMPDONE 0x01
2613#define OPROP_UDT 0x02
2614#define OPROP_FLOAT 0x04
2615#define OPROP_CCFLAGS 0x08
2618#define OPROP_UDEFVAL 0x10
2619#define OPROP_LOWADDR 0x20
2620#define OPROP_ABI 0x40
2623
2628
2631 int size;
2632
2637 union
2638 {
2639 mreg_t r; // mop_r register number
2640 mnumber_t *nnn; // mop_n immediate value
2641 minsn_t *d; // mop_d result (destination) of another instruction
2642 stkvar_ref_t *s; // mop_S stack variable
2643 ea_t g; // mop_v global variable (its linear address)
2644 int b; // mop_b block number (used in jmp,call instructions)
2645 mcallinfo_t *f; // mop_f function call information
2646 lvar_ref_t *l; // mop_l local variable
2647 mop_addr_t *a; // mop_a variable whose address is taken
2648 char *helper; // mop_h helper function name
2649 char *cstr; // mop_str utf8 string constant, user representation
2650 mcases_t *c; // mop_c cases
2651 fnumber_t *fpc; // mop_fn floating point constant
2652 mop_pair_t *pair; // mop_p operand pair
2653 scif_t *scif; // mop_sc scattered operand info
2654 };
2655 // -- End of data fields, member function declarations follow:
2656
2657 void set_impptr_done() { oprops |= OPROP_IMPDONE; }
2658 void set_udt() { oprops |= OPROP_UDT; }
2659 void set_undef_val() { oprops |= OPROP_UDEFVAL; }
2660 void set_lowaddr() { oprops |= OPROP_LOWADDR; }
2661 void set_for_abi() { oprops |= OPROP_ABI; }
2662 bool is_impptr_done() const { return (oprops & OPROP_IMPDONE) != 0; }
2663 bool is_udt() const { return (oprops & OPROP_UDT) != 0; }
2664 bool probably_floating() const { return (oprops & OPROP_FLOAT) != 0; }
2665 bool is_undef_val() const { return (oprops & OPROP_UDEFVAL) != 0; }
2666 bool is_lowaddr() const { return (oprops & OPROP_LOWADDR) != 0; }
2667 bool is_for_abi() const { return (oprops & OPROP_ABI) != 0; }
2668 bool is_ccflags() const
2669 {
2670 return (oprops & OPROP_CCFLAGS) != 0
2671 && (t == mop_l || t == mop_v || t == mop_S || t == mop_r);
2672 }
2673 bool is_pcval() const
2674 {
2675 return t == mop_n && (oprops & OPROP_CCFLAGS) != 0;
2676 }
2678 {
2679 return is_glbaddr() && (oprops & OPROP_CCFLAGS) != 0;
2680 }
2681
2682 mop_t() { zero(); }
2683 mop_t(const mop_t &rop) { copy(rop); }
2684 mop_t(mreg_t _r, int _s) : t(mop_r), oprops(0), valnum(0), size(_s), r(_r) {}
2685 mop_t &operator=(const mop_t &rop) { return assign(rop); }
2686 mop_t &hexapi assign(const mop_t &rop);
2688 {
2689 erase();
2690 }
2692 void zero() { t = mop_z; oprops = 0; valnum = 0; size = NOSIZE; nnn = nullptr; }
2693 void hexapi swap(mop_t &rop);
2694 void hexapi erase();
2695 void erase_but_keep_size() { int s2 = size; erase(); size = s2; }
2696
2697 void hexapi print(qstring *vout, int shins_flags=SHINS_SHORT|SHINS_VALNUM) const;
2698 const char *hexapi dstr() const; // use this function for debugging
2699
2700 //-----------------------------------------------------------------------
2701 // Operand creation
2702 //-----------------------------------------------------------------------
2710 bool hexapi create_from_mlist(mba_t *mba, const mlist_t &lst, sval_t fullsize);
2711
2719 bool hexapi create_from_ivlset(mba_t *mba, const ivlset_t &ivs, sval_t fullsize);
2720
2729 void hexapi create_from_vdloc(mba_t *mba, const vdloc_t &loc, int _size);
2730
2740 void hexapi create_from_scattered_vdloc(
2741 mba_t *mba,
2742 const char *name,
2743 tinfo_t type,
2744 const vdloc_t &loc);
2745
2751 void hexapi create_from_insn(const minsn_t *m);
2752
2758 void hexapi make_number(uint64 _value, int _size, ea_t _ea=BADADDR, int opnum=0);
2759
2765 bool hexapi make_fpnum(const void *bytes, size_t _size);
2766
2772 {
2773 t = mop_r;
2774 r = reg;
2775 }
2776 void _make_reg(mreg_t reg, int _size)
2777 {
2778 t = mop_r;
2779 r = reg;
2780 size = _size;
2781 }
2782
2783 void make_reg(mreg_t reg) { erase(); _make_reg(reg); }
2784 void make_reg(mreg_t reg, int _size) { erase(); _make_reg(reg, _size); }
2785
2792 void _make_lvar(mba_t *mba, int idx, sval_t off=0)
2793 {
2794 t = mop_l;
2795 l = new lvar_ref_t(mba, idx, off);
2796 }
2797
2802 void hexapi _make_gvar(ea_t ea);
2804 void hexapi make_gvar(ea_t ea);
2805
2811 void _make_stkvar(mba_t *mba, sval_t off)
2812 {
2813 t = mop_S;
2814 s = new stkvar_ref_t(mba, off);
2815 }
2816 void make_stkvar(mba_t *mba, sval_t off) { erase(); _make_stkvar(mba, off); }
2817
2822 void hexapi make_reg_pair(int loreg, int hireg, int halfsize);
2823
2829 void _make_insn(minsn_t *ins);
2831 void make_insn(minsn_t *ins) { erase(); _make_insn(ins); }
2832
2837 void _make_blkref(int blknum)
2838 {
2839 t = mop_b;
2840 b = blknum;
2841 }
2842
2843 void make_blkref(int blknum) { erase(); _make_blkref(blknum); }
2844
2848 void hexapi make_helper(const char *name);
2849
2851 void _make_strlit(const char *str)
2852 {
2853 t = mop_str;
2854 cstr = ::qstrdup(str);
2855 }
2856 void _make_strlit(qstring *str) // str is consumed
2857 {
2858 t = mop_str;
2859 cstr = str->extract();
2860 }
2861
2867 {
2868 t = mop_f;
2869 f = fi;
2870 }
2871
2875 void _make_cases(mcases_t *_cases)
2876 {
2877 t = mop_c;
2878 c = _cases;
2879 }
2880
2885 {
2886 t = mop_p;
2887 pair = _pair;
2888 }
2889
2890 //-----------------------------------------------------------------------
2891 // Various operand tests
2892 //-----------------------------------------------------------------------
2893 bool empty() const { return t == mop_z; }
2895 bool is_glbvar() const { return t == mop_v; }
2897 bool is_stkvar() const { return t == mop_S; }
2900 bool is_reg() const { return t == mop_r; }
2902 bool is_reg(mreg_t _r) const { return t == mop_r && r == _r; }
2904 bool is_reg(mreg_t _r, int _size) const { return t == mop_r && r == _r && size == _size; }
2906 bool is_arglist() const { return t == mop_f; }
2908 bool is_cc() const { return is_reg() && r >= mr_cf && r < mr_first; }
2911 static bool hexapi is_bit_reg(mreg_t reg);
2912 bool is_bit_reg() const { return is_reg() && is_bit_reg(r); }
2914 bool is_kreg() const;
2916 bool is_mblock() const { return t == mop_b; }
2918 bool is_mblock(int serial) const { return is_mblock() && b == serial; }
2920 bool is_scattered() const { return t == mop_sc; }
2922 bool is_glbaddr() const;
2924 bool is_glbaddr(ea_t ea) const;
2926 bool is_stkaddr() const;
2928 bool is_insn() const { return t == mop_d; }
2930 bool is_insn(mcode_t code) const;
2933 bool has_side_effects(bool include_ldx_and_divs=false) const;
2935 bool hexapi may_use_aliased_memory() const;
2936
2940 bool hexapi is01() const;
2941
2948 int hexapi get_bitwidth(
2949 const mblock_t *blk,
2950 const minsn_t *top) const;
2951
2957 bool hexapi is_sign_extended_from(int nbytes) const;
2958
2964 bool hexapi is_zero_extended_from(int nbytes) const;
2965
2967 bool is_extended_from(int nbytes, bool is_signed) const
2968 {
2969 if ( is_signed )
2971 else
2973 }
2974
2975 //-----------------------------------------------------------------------
2976 // Comparisons
2977 //-----------------------------------------------------------------------
2982 bool hexapi equal_mops(const mop_t &rop, int eqflags) const;
2983 bool operator==(const mop_t &rop) const { return equal_mops(rop, 0); }
2984 bool operator!=(const mop_t &rop) const { return !equal_mops(rop, 0); }
2985
2988 bool operator <(const mop_t &rop) const { return lexcompare(rop) < 0; }
2989 friend int lexcompare(const mop_t &a, const mop_t &b) { return a.lexcompare(b); }
2990 int hexapi lexcompare(const mop_t &rop) const;
2991
2992 //-----------------------------------------------------------------------
2993 // Visiting operand parts
2994 //-----------------------------------------------------------------------
3000 int hexapi for_all_ops(
3001 mop_visitor_t &mv,
3002 const tinfo_t *type=nullptr,
3003 bool is_target=false);
3004
3010 int hexapi for_all_scattered_submops(scif_visitor_t &sv) const;
3011
3012 //-----------------------------------------------------------------------
3013 // Working with mop_n operands
3014 //-----------------------------------------------------------------------
3018 uint64 value(bool is_signed) const { return extend_sign(nnn->value, size, is_signed); }
3019 int64 signed_value() const { return value(true); }
3020 uint64 unsigned_value() const { return value(false); }
3022 {
3023 nnn->update_value(extend_sign(val, size, false));
3024 }
3025
3030 bool hexapi is_constant(uint64 *out=nullptr, bool is_signed=true) const;
3031
3032 bool is_equal_to(uint64 n, bool is_signed=true) const
3033 {
3034 uint64 v;
3035 return is_constant(&v, is_signed) && v == n;
3036 }
3037 bool is_zero() const { return is_equal_to(0, false); }
3038 bool is_one() const { return is_equal_to(1, false); }
3040 {
3041 uint64 v;
3042 return is_constant(&v, true) && int64(v) > 0;
3043 }
3045 {
3046 uint64 v;
3047 return is_constant(&v, true) && int64(v) < 0;
3048 }
3049
3050 //-----------------------------------------------------------------------
3051 // Working with mop_S operands
3052 //-----------------------------------------------------------------------
3057 ssize_t get_stkvar(udm_t *udm=nullptr, uval_t *p_idaoff=nullptr) const
3058 {
3059 return s->get_stkvar(udm, p_idaoff);
3060 }
3061
3067 bool hexapi get_stkoff(sval_t *p_vdoff) const;
3068
3069 //-----------------------------------------------------------------------
3070 // Working with mop_d operands
3071 //-----------------------------------------------------------------------
3076 const minsn_t *get_insn(mcode_t code) const;
3077 minsn_t *get_insn(mcode_t code);
3078
3079 //-----------------------------------------------------------------------
3080 // Transforming operands
3081 //-----------------------------------------------------------------------
3086 bool hexapi make_low_half(int width);
3087
3092 bool hexapi make_high_half(int width);
3093
3098 bool hexapi make_first_half(int width);
3099
3104 bool hexapi make_second_half(int width);
3105
3115 bool hexapi shift_mop(int offset);
3116
3125 bool hexapi change_size(int nsize, side_effect_t sideff=WITH_SIDEFF);
3126 bool double_size(side_effect_t sideff=WITH_SIDEFF) { return change_size(size*2, sideff); }
3127
3141 bool hexapi preserve_side_effects(
3142 mblock_t *blk,
3143 minsn_t *top,
3144 bool *moved_calls=nullptr);
3145
3152 void hexapi apply_ld_mcode(mcode_t mcode, ea_t ea, int newsize);
3153 void apply_xdu(ea_t ea, int newsize) { apply_ld_mcode(m_xdu, ea, newsize); }
3154 void apply_xds(ea_t ea, int newsize) { apply_ld_mcode(m_xds, ea, newsize); }
3155};
3157
3160{
3161public:
3164 HEXRAYS_MEMORY_ALLOCATION_FUNCS()
3165};
3166
3168class mop_addr_t : public mop_t
3169{
3170public:
3171 int insize = NOSIZE; // how many bytes of the pointed operand can be read
3172 int outsize = NOSIZE; // how many bytes of the pointed operand can be written
3173
3176 : mop_t(ra), insize(ra.insize), outsize(ra.outsize) {}
3177 mop_addr_t(const mop_t &ra, int isz, int osz)
3178 : mop_t(ra), insize(isz), outsize(osz) {}
3179
3181 {
3182 *(mop_t *)this = mop_t(rop);
3183 insize = rop.insize;
3184 outsize = rop.outsize;
3185 return *this;
3186 }
3187 int lexcompare(const mop_addr_t &ra) const
3188 {
3189 int code = mop_t::lexcompare(ra);
3190 return code != 0 ? code
3191 : insize != ra.insize ? (insize-ra.insize)
3192 : outsize != ra.outsize ? (outsize-ra.outsize)
3193 : 0;
3194 }
3195};
3196
3198class mcallarg_t : public mop_t // #callarg
3199{
3200public:
3201 ea_t ea = BADADDR;
3207
3209 mcallarg_t(const mop_t &rarg) : mop_t(rarg) {}
3210 void copy_mop(const mop_t &op) { *(mop_t *)this = op; }
3211 void hexapi print(qstring *vout, int shins_flags=SHINS_SHORT|SHINS_VALNUM) const;
3212 const char *hexapi dstr() const;
3213 void hexapi set_regarg(mreg_t mr, int sz, const tinfo_t &tif);
3214 void set_regarg(mreg_t mr, const tinfo_t &tif)
3215 {
3216 set_regarg(mr, tif.get_size(), tif);
3217 }
3218 void set_regarg(mreg_t mr, char dt, type_sign_t sign = type_unsigned)
3219 {
3220 int sz = get_dtype_size(dt);
3221 set_regarg(mr, sz, get_int_type_by_width_and_sign(sz, sign));
3222 }
3223 void make_int(int val, ea_t val_ea, int opno = 0)
3224 {
3225 type = tinfo_t(BTF_INT);
3226 make_number(val, inf_get_cc_size_i(), val_ea, opno);
3227 }
3228 void make_uint(int val, ea_t val_ea, int opno = 0)
3229 {
3231 make_number(val, inf_get_cc_size_i(), val_ea, opno);
3232 }
3233};
3236
3241{
3283 // EH exception handling helper roles
3308 // Dalvik/Java helper function roles
3333};
3334
3337{
3338 return r >= ROLE_EH_TRY && r <= ROLE_EH_CATCH_ABSENT;
3339}
3340
3343#define FUNC_NAME_MEMCPY "memcpy"
3344#define FUNC_NAME_WMEMCPY "wmemcpy"
3345#define FUNC_NAME_MEMSET "memset"
3346#define FUNC_NAME_WMEMSET "wmemset"
3347#define FUNC_NAME_MEMSET32 "memset32"
3348#define FUNC_NAME_MEMSET64 "memset64"
3349#define FUNC_NAME_STRCPY "strcpy"
3350#define FUNC_NAME_WCSCPY "wcscpy"
3351#define FUNC_NAME_STRLEN "strlen"
3352#define FUNC_NAME_WCSLEN "wcslen"
3353#define FUNC_NAME_STRCAT "strcat"
3354#define FUNC_NAME_WCSCAT "wcscat"
3355#define FUNC_NAME_TAIL "tail"
3356#define FUNC_NAME_VA_ARG "va_arg"
3357#define FUNC_NAME_EMPTY "$empty"
3358#define FUNC_NAME_PRESENT "$present"
3359#define FUNC_NAME_CONTAINING_RECORD "CONTAINING_RECORD"
3360#define FUNC_NAME_MORESTACK "runtime_morestack"
3362
3363
3364// the default 256 function arguments is too big, we use a lower value
3365#undef MAX_FUNC_ARGS
3366#define MAX_FUNC_ARGS 64
3367
3369class mcallinfo_t // #callinfo
3370{
3371public:
3375 int call_spd = 0;
3376 int stkargs_top = 0;
3383
3396 int flags = 0;
3399#define FCI_PROP 0x001
3400#define FCI_DEAD 0x002
3401#define FCI_FINAL 0x004
3402#define FCI_NORET 0x008
3403#define FCI_PURE 0x010
3404#define FCI_NOSIDE 0x020
3405#define FCI_SPLOK 0x040
3410#define FCI_HASCALL 0x080
3413#define FCI_HASFMT 0x100
3415#define FCI_EXPLOCS 0x400
3419
3420 mcallinfo_t(ea_t _callee=BADADDR, int _sargs=0)
3421 : callee(_callee), solid_args(_sargs)
3422 {
3423 }
3425 int hexapi lexcompare(const mcallinfo_t &f) const;
3426 bool hexapi set_type(const tinfo_t &type);
3427 tinfo_t hexapi get_type() const;
3428 bool is_vararg() const { return is_vararg_cc(cc); }
3429 void hexapi print(qstring *vout, int size=-1, int shins_flags=SHINS_SHORT|SHINS_VALNUM) const;
3430 const char *hexapi dstr() const;
3431};
3432
3434class mcases_t // #cases
3435{
3436public:
3439
3440 void swap(mcases_t &r) { values.swap(r.values); targets.swap(r.targets); }
3443 bool empty() const { return targets.empty(); }
3444 size_t size() const { return targets.size(); }
3445 void resize(int s) { values.resize(s); targets.resize(s); }
3446 void hexapi print(qstring *vout) const;
3447 const char *hexapi dstr() const;
3448};
3449
3450//-------------------------------------------------------------------------
3453{
3456
3458 voff_t(mopt_t _type, sval_t _off) : off(_off), type(_type) {}
3459 voff_t(const mop_t &op)
3460 {
3461 if ( op.is_reg() || op.is_stkvar() )
3462 set(op.t, op.is_reg() ? op.r : op.s->off);
3463 }
3464
3465 void set(mopt_t _type, sval_t _off) { type = _type; off = _off; }
3466 void set_stkoff(sval_t stkoff) { set(mop_S, stkoff); }
3467 void set_reg(mreg_t mreg) { set(mop_r, mreg); }
3468 void undef() { set(mop_z, -1); }
3469
3470 bool defined() const { return type != mop_z; }
3471 bool is_reg() const { return type == mop_r; }
3472 bool is_stkoff() const { return type == mop_S; }
3473 mreg_t get_reg() const { QASSERT(51892, is_reg()); return off; }
3474 sval_t get_stkoff() const { QASSERT(51893, is_stkoff()); return off; }
3475
3476 void inc(sval_t delta) { off += delta; }
3477 voff_t add(int width) const { return voff_t(type, off+width); }
3478 sval_t diff(const voff_t &r) const { QASSERT(51894, type == r.type); return off - r.off; }
3479
3481 {
3482 int code = ::compare(type, r.type);
3483 return code != 0 ? code : ::compare(off, r.off);
3484 }
3485};
3486
3487//-------------------------------------------------------------------------
3490{
3491 int size;
3492
3493 vivl_t(mopt_t _type = mop_z, sval_t _off = -1, int _size = 0)
3494 : voff_t(_type, _off), size(_size) {}
3495 vivl_t(const class chain_t &ch);
3496 vivl_t(const mop_t &op) : voff_t(op), size(op.size) {}
3497
3498 // Make a value interval
3499 void set(mopt_t _type, sval_t _off, int _size = 0)
3500 { voff_t::set(_type, _off); size = _size; }
3501 void set(const voff_t &voff, int _size)
3502 { set(voff.type, voff.off, _size); }
3503 void set_stkoff(sval_t stkoff, int sz = 0) { set(mop_S, stkoff, sz); }
3504 void set_reg (mreg_t mreg, int sz = 0) { set(mop_r, mreg, sz); }
3505
3508 bool hexapi extend_to_cover(const vivl_t &r);
3509
3512 uval_t hexapi intersect(const vivl_t &r);
3513
3515 bool overlap(const vivl_t &r) const
3516 {
3517 return type == r.type
3518 && interval::overlap(off, size, r.off, r.size);
3519 }
3520
3521 bool includes(const vivl_t &r) const
3522 {
3523 return type == r.type
3524 && interval::includes(off, size, r.off, r.size);
3525 }
3526
3528 bool contains(const voff_t &voff2) const
3529 {
3530 return type == voff2.type
3531 && interval::contains(off, size, voff2.off);
3532 }
3533
3534 // Comparisons
3536 {
3537 int code = voff_t::compare(r);
3538 return code; //return code != 0 ? code : ::compare(size, r.size);
3539 }
3540 bool operator==(const mop_t &mop) const
3541 {
3542 return type == mop.t && off == (mop.is_reg() ? mop.r : mop.s->off);
3543 }
3544 void hexapi print(qstring *vout) const;
3545 const char *hexapi dstr() const;
3546};
3547
3548//-------------------------------------------------------------------------
3552class chain_t : public intvec_t // sequence of block numbers
3553{
3554 voff_t k;
3556
3557public:
3558 int width = 0;
3559 int varnum = -1;
3563#define CHF_INITED 0x01
3564#define CHF_REPLACED 0x02
3565#define CHF_OVER 0x04
3566#define CHF_FAKE 0x08
3567#define CHF_PASSTHRU 0x10
3568#define CHF_TERM 0x20
3570 chain_t() : flags(CHF_INITED) {}
3571 chain_t(mopt_t t, sval_t off, int w=1, int v=-1)
3572 : k(t, off), width(w), varnum(v), flags(CHF_INITED) {}
3573 chain_t(const voff_t &_k, int w=1)
3574 : k(_k), width(w), varnum(-1), flags(CHF_INITED) {}
3575 void set_value(const chain_t &r)
3576 { width = r.width; varnum = r.varnum; flags = r.flags; *(intvec_t *)this = (intvec_t &)r; }
3577 const voff_t &key() const { return k; }
3578 bool is_inited() const { return (flags & CHF_INITED) != 0; }
3579 bool is_reg() const { return k.is_reg(); }
3580 bool is_stkoff() const { return k.is_stkoff(); }
3581 bool is_replaced() const { return (flags & CHF_REPLACED) != 0; }
3582 bool is_overlapped() const { return (flags & CHF_OVER) != 0; }
3583 bool is_fake() const { return (flags & CHF_FAKE) != 0; }
3584 bool is_passreg() const { return (flags & CHF_PASSTHRU) != 0; }
3585 bool is_term() const { return (flags & CHF_TERM) != 0; }
3586 void set_inited(bool b) { setflag(flags, CHF_INITED, b); }
3587 void set_replaced(bool b) { setflag(flags, CHF_REPLACED, b); }
3588 void set_overlapped(bool b) { setflag(flags, CHF_OVER, b); }
3589 void set_term(bool b) { setflag(flags, CHF_TERM, b); }
3590 mreg_t get_reg() const { return k.get_reg(); }
3591 sval_t get_stkoff() const { return k.get_stkoff(); }
3592 bool overlap(const chain_t &r) const
3593 { return k.type == r.k.type && interval::overlap(k.off, width, r.k.off, r.width); }
3594 bool includes(const chain_t &r) const
3595 { return k.type == r.k.type && interval::includes(k.off, width, r.k.off, r.width); }
3596 const voff_t endoff() const { return k.add(width); }
3597
3598 bool operator<(const chain_t &r) const { return key() < r.key(); }
3599
3600 void hexapi print(qstring *vout) const;
3601 const char *hexapi dstr() const;
3603 void hexapi append_list(const mba_t *mba, mlist_t *list) const;
3604 void clear_varnum() { varnum = -1; set_replaced(false); }
3605};
3606
3607//-------------------------------------------------------------------------
3609class block_chains_t : public qset<chain_t>
3610{
3611 int serial = -1;
3612public:
3614 using typename base_t::iterator;
3615 using typename base_t::const_iterator;
3616 using typename base_t::reverse_iterator;
3617 using typename base_t::const_reverse_iterator;
3618
3622 const chain_t *get_reg_chain(mreg_t reg, int width=1) const
3623 { return get_chain((chain_t(mop_r, reg, width))); }
3624 chain_t *get_reg_chain(mreg_t reg, int width=1)
3625 { return get_chain((chain_t(mop_r, reg, width))); }
3626
3630 const chain_t *get_stk_chain(sval_t off, int width=1) const
3631 { return get_chain(chain_t(mop_S, off, width)); }
3632 chain_t *get_stk_chain(sval_t off, int width=1)
3633 { return get_chain(chain_t(mop_S, off, width)); }
3634
3638 const chain_t *get_chain(const voff_t &k, int width=1) const
3639 { return get_chain(chain_t(k, width)); }
3640 chain_t *get_chain(const voff_t &k, int width=1)
3641 { return (chain_t*)((const block_chains_t *)this)->get_chain(k, width); }
3642
3645 const chain_t *hexapi get_chain(const chain_t &ch) const;
3647 { return (chain_t*)((const block_chains_t *)this)->get_chain(ch); }
3648
3649 void hexapi print(qstring *vout) const;
3650 const char *hexapi dstr() const;
3651 HEXRAYS_MEMORY_ALLOCATION_FUNCS()
3652};
3653//-------------------------------------------------------------------------
3656{
3658 virtual ~chain_visitor_t() {}
3659 virtual int idaapi visit_chain(int nblock, chain_t &ch) = 0;
3660};
3661
3662//-------------------------------------------------------------------------
3667{
3668 int lock = 0;
3669public:
3670 ~graph_chains_t() { QASSERT(50444, !lock); }
3674 int hexapi for_all_chains(chain_visitor_t &cv, int gca_flags);
3676
3677#define GCA_EMPTY 0x01
3678#define GCA_SPEC 0x02
3679#define GCA_ALLOC 0x04
3680#define GCA_NALLOC 0x08
3681#define GCA_OFIRST 0x10
3682#define GCA_OLAST 0x20
3684
3688 bool is_locked() const { return lock != 0; }
3690 void acquire() { lock++; }
3692 void hexapi release();
3694 {
3696 std::swap(lock, r.lock);
3697 }
3698};
3699//-------------------------------------------------------------------------
3702{
3703 void hexapi init(ea_t _ea);
3704 void hexapi copy(const minsn_t &m);
3705public:
3714
3716
3717 // bits to be used in patterns:
3718#define IPROP_OPTIONAL 0x0001
3719#define IPROP_PERSIST 0x0002
3720#define IPROP_WILDMATCH 0x0004
3721
3722 // instruction attributes:
3723#define IPROP_CLNPOP 0x0008
3725#define IPROP_FPINSN 0x0010
3726#define IPROP_FARCALL 0x0020
3727#define IPROP_TAILCALL 0x0040
3728#define IPROP_ASSERT 0x0080
3731
3732 // instruction history:
3733#define IPROP_SPLIT 0x0700
3734#define IPROP_SPLIT1 0x0100
3735#define IPROP_SPLIT2 0x0200
3736#define IPROP_SPLIT4 0x0300
3737#define IPROP_SPLIT8 0x0400
3738#define IPROP_COMBINED 0x0800
3739#define IPROP_EXTSTX 0x1000
3740#define IPROP_IGNLOWSRC 0x2000
3743#define IPROP_INV_JX 0x4000
3744#define IPROP_WAS_NORET 0x8000
3745#define IPROP_MULTI_MOV 0x10000
3747
3749#define IPROP_DONT_PROP 0x20000
3750#define IPROP_DONT_COMB 0x40000
3751#define IPROP_MBARRIER 0x80000
3753#define IPROP_UNMERGED 0x100000
3754#define IPROP_UNPAIRED 0x200000
3755#define IPROP_WAS_FUNC 0x400000
3757
3758 bool is_optional() const { return (iprops & IPROP_OPTIONAL) != 0; }
3759 bool is_combined() const { return (iprops & IPROP_COMBINED) != 0; }
3760 bool is_farcall() const { return (iprops & IPROP_FARCALL) != 0; }
3761 bool is_cleaning_pop() const { return (iprops & IPROP_CLNPOP) != 0; }
3762 bool is_extstx() const { return (iprops & IPROP_EXTSTX) != 0; }
3763 bool is_tailcall() const { return (iprops & IPROP_TAILCALL) != 0; }
3764 bool is_fpinsn() const { return (iprops & IPROP_FPINSN) != 0; }
3765 bool is_assert() const { return (iprops & IPROP_ASSERT) != 0; }
3766 bool is_persistent() const { return (iprops & IPROP_PERSIST) != 0; }
3767 bool is_wild_match() const { return (iprops & IPROP_WILDMATCH) != 0; }
3768 bool is_propagatable() const { return (iprops & IPROP_DONT_PROP) == 0; }
3769 bool is_ignlowsrc() const { return (iprops & IPROP_IGNLOWSRC) != 0; }
3770 bool is_inverted_jx() const { return (iprops & IPROP_INV_JX) != 0; }
3771 bool was_noret_icall() const { return (iprops & IPROP_WAS_NORET) != 0; }
3772 bool is_multimov() const { return (iprops & IPROP_MULTI_MOV) != 0; }
3773 bool is_combinable() const { return (iprops & IPROP_DONT_COMB) == 0; }
3774 bool was_split() const { return (iprops & IPROP_SPLIT) != 0; }
3775 bool is_mbarrier() const { return (iprops & IPROP_MBARRIER) != 0; }
3776 bool was_unmerged() const { return (iprops & IPROP_UNMERGED) != 0; }
3777 bool was_unpaired() const { return (iprops & IPROP_UNPAIRED) != 0; }
3778 bool was_memfunc() const { return (iprops & IPROP_WAS_FUNC) != 0; }
3779
3780 void set_optional() { iprops |= IPROP_OPTIONAL; }
3781 void hexapi set_combined();
3782 void clr_combined() { iprops &= ~IPROP_COMBINED; }
3783 void set_farcall() { iprops |= IPROP_FARCALL; }
3784 void set_cleaning_pop() { iprops |= IPROP_CLNPOP; }
3785 void set_extstx() { iprops |= IPROP_EXTSTX; }
3786 void set_tailcall() { iprops |= IPROP_TAILCALL; }
3787 void clr_tailcall() { iprops &= ~IPROP_TAILCALL; }
3788 void set_fpinsn() { iprops |= IPROP_FPINSN; }
3789 void clr_fpinsn() { iprops &= ~IPROP_FPINSN; }
3790 void set_assert() { iprops |= IPROP_ASSERT; }
3791 void clr_assert() { iprops &= ~IPROP_ASSERT; }
3792 void set_persistent() { iprops |= IPROP_PERSIST; }
3793 void set_wild_match() { iprops |= IPROP_WILDMATCH; }
3794 void clr_propagatable() { iprops |= IPROP_DONT_PROP; }
3795 void set_ignlowsrc() { iprops |= IPROP_IGNLOWSRC; }
3796 void clr_ignlowsrc() { iprops &= ~IPROP_IGNLOWSRC; }
3797 void set_inverted_jx() { iprops |= IPROP_INV_JX; }
3798 void set_noret_icall() { iprops |= IPROP_WAS_NORET; }
3799 void clr_noret_icall() { iprops &= ~IPROP_WAS_NORET; }
3800 void set_multimov() { iprops |= IPROP_MULTI_MOV; }
3801 void clr_multimov() { iprops &= ~IPROP_MULTI_MOV; }
3802 void set_combinable() { iprops &= ~IPROP_DONT_COMB; }
3803 void clr_combinable() { iprops |= IPROP_DONT_COMB; }
3804 void set_mbarrier() { iprops |= IPROP_MBARRIER; }
3805 void set_unmerged() { iprops |= IPROP_UNMERGED; }
3806 void set_split_size(int s)
3807 { // s may be only 1,2,4,8. other values are ignored
3808 iprops &= ~IPROP_SPLIT;
3809 iprops |= (s == 1 ? IPROP_SPLIT1
3810 : s == 2 ? IPROP_SPLIT2
3811 : s == 4 ? IPROP_SPLIT4
3812 : s == 8 ? IPROP_SPLIT8 : 0);
3813 }
3814 int get_split_size() const
3815 {
3816 int cnt = (iprops & IPROP_SPLIT) >> 8;
3817 return cnt == 0 ? 0 : 1 << (cnt-1);
3818 }
3819
3821 minsn_t(ea_t _ea) { init(_ea); }
3822 minsn_t(const minsn_t &m) { next = prev = nullptr; copy(m); }
3824
3825
3826 minsn_t &operator=(const minsn_t &m) { copy(m); return *this; }
3827
3831 void hexapi swap(minsn_t &m);
3832
3833
3835 void hexapi print(qstring *vout, int shins_flags=SHINS_SHORT|SHINS_VALNUM) const;
3836
3838 const char *hexapi dstr() const;
3839
3842 void hexapi setaddr(ea_t new_ea);
3843
3851 int optimize_solo(int optflags=0) { return optimize_subtree(nullptr, nullptr, nullptr, nullptr, optflags); }
3853
3854#define OPTI_ADDREXPRS 0x0001
3855#define OPTI_MINSTKREF 0x0002
3856#define OPTI_COMBINSNS 0x0004
3857#define OPTI_NO_LDXOPT 0x0008
3860#define OPTI_NO_VALRNG 0x0010
3862
3865 int hexapi optimize_subtree(
3866 mblock_t *blk,
3867 minsn_t *top,
3868 minsn_t *parent,
3869 ea_t *converted_call,
3870 int optflags=OPTI_MINSTKREF);
3871
3876 int hexapi for_all_ops(mop_visitor_t &mv);
3877
3882 int hexapi for_all_insns(minsn_visitor_t &mv);
3883
3888 void hexapi _make_nop();
3889
3894 bool hexapi equal_insns(const minsn_t &m, int eqflags) const; // intelligent comparison
3896
3897#define EQ_IGNSIZE 0x0001
3898#define EQ_IGNCODE 0x0002
3899#define EQ_CMPDEST 0x0004
3900#define EQ_OPTINSN 0x0008
3902
3905 bool operator <(const minsn_t &ri) const { return lexcompare(ri) < 0; }
3906 int hexapi lexcompare(const minsn_t &ri) const;
3907
3908 //-----------------------------------------------------------------------
3909 // Call instructions
3910 //-----------------------------------------------------------------------
3913 bool hexapi is_noret_call(int flags=0);
3914#define NORET_IGNORE_WAS_NORET_ICALL 0x01 // ignore was_noret_icall() bit
3915#define NORET_FORBID_ANALYSIS 0x02 // forbid additional analysis
3916
3922 bool is_unknown_call() const { return is_mcode_call(opcode) && d.empty(); }
3923
3928 bool hexapi is_helper(const char *name) const;
3929
3933 minsn_t *hexapi find_call(bool with_helpers=false) const;
3934
3936 bool contains_call(bool with_helpers=false) const { return find_call(with_helpers) != nullptr; }
3937
3942 bool hexapi has_side_effects(bool include_ldx_and_divs=false) const;
3943
3945 funcrole_t get_role() const { return d.is_arglist() ? d.f->role : ROLE_UNK; }
3946 bool is_memcpy() const { return get_role() == ROLE_MEMCPY; }
3947 bool is_memset() const { return get_role() == ROLE_MEMSET; }
3948 bool is_alloca() const { return get_role() == ROLE_ALLOCA; }
3949 bool is_bswap () const { return get_role() == ROLE_BSWAP; }
3950 bool is_readflags () const { return get_role() == ROLE_READFLAGS; }
3951
3952 //-----------------------------------------------------------------------
3953 // Misc
3954 //-----------------------------------------------------------------------
3958 bool contains_opcode(mcode_t mcode) const { return find_opcode(mcode) != nullptr; }
3959
3962 const minsn_t *find_opcode(mcode_t mcode) const { return (CONST_CAST(minsn_t*)(this))->find_opcode(mcode); }
3963 minsn_t *hexapi find_opcode(mcode_t mcode);
3964
3983 const minsn_t *hexapi find_ins_op(const mop_t **other, mcode_t op=m_nop) const;
3984 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)); }
3985
4003 const mop_t *hexapi find_num_op(const mop_t **other) const;
4004 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)); }
4005
4006 bool is_mov() const { return opcode == m_mov || (opcode == m_f2f && l.size == d.size); }
4007 bool is_like_move() const { return is_mov() || is_mcode_xdsu(opcode) || opcode == m_low; }
4008
4011 bool hexapi modifies_d() const;
4012 bool modifies_pair_mop() const { return d.t == mop_p && modifies_d(); }
4013
4019 bool hexapi is_between(const minsn_t *m1, const minsn_t *m2) const;
4020
4023 bool is_after(const minsn_t *m) const { return m != nullptr && is_between(m->next, nullptr); }
4024
4026 bool hexapi may_use_aliased_memory() const;
4027
4031 int hexapi serialize(bytevec_t *b) const;
4032
4038 bool hexapi deserialize(const uchar *bytes, size_t nbytes, int format_version);
4039
4040};
4041
4043const minsn_t *hexapi getf_reginsn(const minsn_t *ins);
4045const minsn_t *hexapi getb_reginsn(const minsn_t *ins);
4046inline minsn_t *getf_reginsn(minsn_t *ins) { return CONST_CAST(minsn_t*)(getf_reginsn(CONST_CAST(const minsn_t *)(ins))); }
4047inline minsn_t *getb_reginsn(minsn_t *ins) { return CONST_CAST(minsn_t*)(getb_reginsn(CONST_CAST(const minsn_t *)(ins))); }
4048
4049//-------------------------------------------------------------------------
4051{
4052public:
4054 int size; // in bytes
4055
4056 intval64_t(uint64 v=0, int _s=1) : val(trunc(v, _s)), size(_s) {}
4057 int64 sval() const { return extend_sign(val, size, true); }
4058 uint64 uval() const { return val; }
4059 void print(qstring *vout) const { vout->sprnt("0x%" FMT_64 "X.%d", val, size); }
4060
4061 //------------------------------------------------------------------------
4062 bool operator==(const intval64_t &o) const
4063 {
4064 return size == o.size && val == o.val;
4065 }
4066
4067 //------------------------------------------------------------------------
4068 bool operator!=(const intval64_t &o) const
4069 {
4070 return !(*this == o);
4071 }
4072
4073 //------------------------------------------------------------------------
4074 bool operator<(const intval64_t &o) const
4075 {
4076 QASSERT(52898, size == o.size);
4077 return val < o.val;
4078 }
4079
4080 //------------------------------------------------------------------------
4081 intval64_t sext(int target_sz) const
4082 {
4083 QASSERT(52899, target_sz >= size);
4084 return intval64_t(sval(), target_sz);
4085 }
4086
4087 //------------------------------------------------------------------------
4088 intval64_t zext(int target_sz) const
4089 {
4090 QASSERT(52900, target_sz >= size);
4091 return intval64_t(val, target_sz);
4092 }
4093
4094 //------------------------------------------------------------------------
4095 intval64_t low(int target_sz) const
4096 {
4097 QASSERT(52901, target_sz <= size);
4098 return intval64_t(val, target_sz);
4099 }
4100
4101 //------------------------------------------------------------------------
4102 intval64_t high(int target_sz) const
4103 {
4104 QASSERT(52902, target_sz <= size);
4105 int bytes_to_remove = size - target_sz;
4106 return intval64_t(right_ushift<uint64>(val, 8 * bytes_to_remove), target_sz);
4107 }
4108
4109 //------------------------------------------------------------------------
4111 {
4112 check_size_equal(o);
4113 return intval64_t(val + o.val, size);
4114 }
4115
4116 //------------------------------------------------------------------------
4118 {
4119 check_size_equal(o);
4120 return intval64_t(val - o.val, size);
4121 }
4122
4123 //-------------------------------------------------------------------------
4125 {
4126 check_size_equal(o);
4127 return intval64_t(val * o.val, size);
4128 }
4129
4130 //------------------------------------------------------------------------
4132 {
4133 check_size_equal(o);
4134 if ( o.val == 0 )
4135 throw "division by zero occurred when emulating instruction";
4136 return intval64_t(val / o.val, size);
4137 }
4138
4139 //------------------------------------------------------------------------
4141 {
4142 check_size_equal(o);
4143 if ( o.val == 0 )
4144 throw "division by zero occurred when emulating instruction";
4145 int64 res;
4146 uint64 l = val;
4147 uint64 r = o.val;
4148 switch ( size )
4149 {
4150 case 1: res = int8(l) / int8(r); break;
4151 case 2: res = int16(l) / int16(r); break;
4152 case 4: res = int32(l) / int32(r); break;
4153 case 8: res = int64(l) / int64(r); break;
4154 default: INTERR(30666);
4155 }
4156
4157 return intval64_t(res, size);
4158 }
4159
4160 //------------------------------------------------------------------------
4162 {
4163 check_size_equal(o);
4164 if ( o.val == 0 )
4165 throw "division by zero occurred when emulating instruction";
4166 return intval64_t(val % o.val, size);
4167 }
4168 //------------------------------------------------------------------------
4170 {
4171 check_size_equal(o);
4172 if ( o.val == 0 )
4173 throw "division by zero occurred when emulating instruction";
4174 int64 res = -1;
4175 uint64 l = val;
4176 uint64 r = o.val;
4177 switch ( size )
4178 {
4179 case 1: res = int8(l) % int8(r); break;
4180 case 2: res = int16(l) % int16(r); break;
4181 case 4: res = int32(l) % int32(r); break;
4182 case 8: res = int64(l) % int64(r); break;
4183 default: INTERR(52903);
4184 }
4185
4186 return intval64_t(res, size);
4187 }
4188
4189 //------------------------------------------------------------------------
4191 {
4193 }
4194
4195 //------------------------------------------------------------------------
4197 {
4199 }
4200
4201 //------------------------------------------------------------------------
4202 intval64_t sar(const intval64_t &o) const
4203 {
4205 }
4206
4207 //------------------------------------------------------------------------
4209 {
4210 check_size_equal(o);
4211 return intval64_t(val | o.val, size);
4212 }
4213
4214 //------------------------------------------------------------------------
4216 {
4217 check_size_equal(o);
4218 return intval64_t(val & o.val, size);
4219 }
4220
4221 //------------------------------------------------------------------------
4223 {
4224 check_size_equal(o);
4225 return intval64_t(val ^ o.val, size);
4226 }
4227
4228 //------------------------------------------------------------------------
4230 {
4231 return intval64_t(0-val, size);
4232 }
4233
4234 //------------------------------------------------------------------------
4236 {
4237 return intval64_t(!val, size);
4238 }
4239
4240 //------------------------------------------------------------------------
4242 {
4243 return intval64_t(~val, size);
4244 }
4245
4246private:
4247 //------------------------------------------------------------------------
4248 static uint64 trunc(uint64 v, int w) // truncate v to w bytes
4249 {
4250 QASSERT(52904, w == 1 || w == 2 || w == 4 || w == 8);
4251 return v & make_mask<uint64>(w * 8);
4252 }
4253
4254 void check_size_equal(const intval64_t &o) const
4255 {
4256 QASSERT(52905, size == o.size);
4257 }
4258};
4259
4260//-------------------------------------------------------------------------
4261// A simple 64bit emulator that can handle integer microcode instructions.
4262// This does not include control transfer instructions (except conditional jumps)
4263// and nop/ldx/stx/setp/...
4264// If the value cannot be calculated, an exception will be thrown:
4265// vd_failure_t(MERR_EMULATOR, ea_if_known, error_message);
4267{
4268public:
4270
4271 // Retrieve the value assigned to an operand.
4272 // This function is called for mop_r, mop_S, mop_v, mop_l
4273 virtual intval64_t get_mop_value(const mop_t &mop) = 0;
4274
4275 // Handle memory reads and writes
4276 virtual intval64_t read_glbmem(ea_t, int) { return {}; }
4277 virtual void write_glbmem(ea_t, int, const intval64_t &) {}
4278
4279 // Calculate the operand value.
4280 // For register/stack/memory/lvar operands get_mop_value() will be called.
4281 bool hexapi _mop_value(intval64_t *out, const mop_t &mop, vd_failure_t *vf=nullptr);
4283 {
4284 intval64_t v;
4285 vd_failure_t vf;
4286 if ( !_mop_value(&v, mop, &vf) )
4287 throw vf;
4288 return v;
4289 }
4290
4291
4292 // Calculate the result of applying the instruction opcode to its source
4293 // operands. This function does not store the result to the destination operand.
4294 // For example: "add r0, #2, ..." will return 3 if r0 contains 1.
4295 bool hexapi _minsn_value(intval64_t *out, const minsn_t &insn, vd_failure_t *vf=nullptr);
4297 {
4298 intval64_t v;
4299 vd_failure_t vf;
4300 if ( !_minsn_value(&v, insn, &vf) )
4301 throw vf;
4302 return v;
4303 }
4304};
4305
4306//-------------------------------------------------------------------------
4318
4319// Maximal bit range
4320#define MAXRANGE bitrange_t(0, USHRT_MAX)
4321
4322//-------------------------------------------------------------------------
4329{
4330 friend class codegen_t;
4331 DECLARE_UNCOPYABLE(mblock_t)
4332 void hexapi init();
4333public:
4338
4339#define MBL_PRIV 0x0001
4341#define MBL_NONFAKE 0x0000
4342#define MBL_FAKE 0x0002
4343#define MBL_GOTO 0x0004
4344#define MBL_TCAL 0x0008
4345#define MBL_PUSH 0x0010
4346#define MBL_DMT64 0x0020
4347#define MBL_COMB 0x0040
4348#define MBL_PROP 0x0080
4349#define MBL_DEAD 0x0100
4350#define MBL_LIST 0x0200
4351#define MBL_INCONST 0x0400
4352#define MBL_CALL 0x0800
4353#define MBL_BACKPROP 0x1000
4354#define MBL_NORET 0x2000
4355#define MBL_DSLOT 0x4000
4356#define MBL_VALRANGES 0x8000
4357#define MBL_KEEP 0x10000
4358#define MBL_INLINED 0x20000
4359#define MBL_EXTFRAME 0x40000
4361 ea_t start;
4371
4378
4384
4389
4390 // the exact size of this class is not documented, there may be more fields
4391 char reserved[];
4392
4393 void mark_lists_dirty() { flags &= ~MBL_LIST; request_propagation(); }
4394 void request_propagation() { flags |= MBL_PROP; }
4395 bool needs_propagation() const { return (flags & MBL_PROP) != 0; }
4396 void request_demote64() { flags |= MBL_DMT64; }
4397 bool lists_dirty() const { return (flags & MBL_LIST) == 0; }
4398 bool lists_ready() const { return (flags & (MBL_LIST|MBL_INCONST)) == MBL_LIST; }
4399 int make_lists_ready() // returns number of changes
4400 {
4401 if ( lists_ready() )
4402 return 0;
4403 return build_lists(false);
4404 }
4405
4407 int npred() const { return predset.size(); } // number of xrefs to the block
4409 int nsucc() const { return succset.size(); } // number of xrefs from the block
4410 // Get predecessor number N
4411 int pred(int n) const { return predset[n]; }
4412 // Get successor number N
4413 int succ(int n) const { return succset[n]; }
4414
4415 mblock_t() = delete;
4416 virtual ~mblock_t();
4418 bool empty() const { return head == nullptr; }
4419
4420
4424 void hexapi print(vd_printer_t &vp) const;
4425
4428 void hexapi dump() const;
4429 AS_PRINTF(2, 0) void hexapi vdump_block(const char *title, va_list va) const;
4430 AS_PRINTF(2, 3) void dump_block(const char *title, ...) const
4431 {
4432 va_list va;
4433 va_start(va, title);
4436 }
4437
4441 void hexapi verify_insn(const minsn_t *m) const;
4442
4443 //-----------------------------------------------------------------------
4444 // Functions to insert/remove insns during the microcode optimization phase.
4445 // See codegen_t, microcode_filter_t, udcall_t classes for the initial
4446 // microcode generation.
4447 //-----------------------------------------------------------------------
4456
4461 minsn_t *hexapi remove_from_block(minsn_t *m);
4462
4463 //-----------------------------------------------------------------------
4464 // Iterator over instructions and operands
4465 //-----------------------------------------------------------------------
4471 int hexapi for_all_insns(minsn_visitor_t &mv);
4472
4477 int hexapi for_all_ops(mop_visitor_t &mv);
4478
4487 int hexapi for_all_uses(
4488 mlist_t *list,
4489 minsn_t *i1,
4490 minsn_t *i2,
4491 mlist_mop_visitor_t &mmv);
4492
4493 //-----------------------------------------------------------------------
4494 // Optimization functions
4495 //-----------------------------------------------------------------------
4504 int hexapi optimize_insn(minsn_t *m, int optflags=OPTI_MINSTKREF|OPTI_COMBINSNS);
4505
4511 int hexapi optimize_block();
4512
4517 int hexapi build_lists(bool kill_deads);
4518
4525 int hexapi optimize_useless_jump();
4526
4527 //-----------------------------------------------------------------------
4528 // Functions that build with use/def lists. These lists are used to
4529 // reprsent list of registers and stack locations that are either modified
4530 // or accessed by microinstructions.
4531 //-----------------------------------------------------------------------
4542 void hexapi append_use_list(
4543 mlist_t *list,
4544 const mop_t &op,
4545 maymust_t maymust,
4546 bitrange_t mask=MAXRANGE) const;
4547
4555 void hexapi append_def_list(
4556 mlist_t *list,
4557 const mop_t &op,
4558 maymust_t maymust) const;
4559
4572 mlist_t hexapi build_use_list(const minsn_t &ins, maymust_t maymust) const;
4573
4586 mlist_t hexapi build_def_list(const minsn_t &ins, maymust_t maymust) const;
4587
4588 //-----------------------------------------------------------------------
4589 // The use/def lists can be used to search for interesting instructions
4590 //-----------------------------------------------------------------------
4599 bool is_used(mlist_t *list, const minsn_t *i1, const minsn_t *i2, maymust_t maymust=MAY_ACCESS) const
4600 { return find_first_use(list, i1, i2, maymust) != nullptr; }
4601
4613 const minsn_t *hexapi find_first_use(mlist_t *list, const minsn_t *i1, const minsn_t *i2, maymust_t maymust=MAY_ACCESS) const;
4614 minsn_t *find_first_use(mlist_t *list, minsn_t *i1, const minsn_t *i2, maymust_t maymust=MAY_ACCESS) const
4615 {
4616 return CONST_CAST(minsn_t*)(find_first_use(list,
4617 CONST_CAST(const minsn_t*)(i1),
4618 i2,
4619 maymust));
4620 }
4621
4630 const mlist_t &list,
4631 const minsn_t *i1,
4632 const minsn_t *i2,
4633 maymust_t maymust=MAY_ACCESS) const
4634 {
4635 return find_redefinition(list, i1, i2, maymust) != nullptr;
4636 }
4637
4646 const minsn_t *hexapi find_redefinition(
4647 const mlist_t &list,
4648 const minsn_t *i1,
4649 const minsn_t *i2,
4650 maymust_t maymust=MAY_ACCESS) const;
4652 const mlist_t &list,
4653 minsn_t *i1,
4654 const minsn_t *i2,
4655 maymust_t maymust=MAY_ACCESS) const
4656 {
4657 return CONST_CAST(minsn_t*)(find_redefinition(list,
4658 CONST_CAST(const minsn_t*)(i1),
4659 i2,
4660 maymust));
4661 }
4662
4670 bool hexapi is_rhs_redefined(const minsn_t *ins, const minsn_t *i1, const minsn_t *i2) const;
4671
4686 minsn_t *hexapi find_access(
4687 const mop_t &op,
4688 minsn_t **parent,
4689 const minsn_t *mend,
4690 int fdflags) const;
4692
4693#define FD_BACKWARD 0x0000
4694#define FD_FORWARD 0x0001
4695#define FD_USE 0x0000
4696#define FD_DEF 0x0002
4697#define FD_DIRTY 0x0004
4699
4700
4701 // Convenience functions:
4703 const mop_t &op,
4704 minsn_t **p_i1,
4705 const minsn_t *i2,
4706 int fdflags)
4707 {
4708 return find_access(op, p_i1, i2, fdflags|FD_DEF);
4709 }
4711 const mop_t &op,
4712 minsn_t **p_i1,
4713 const minsn_t *i2,
4714 int fdflags)
4715 {
4716 return find_access(op, p_i1, i2, fdflags|FD_USE);
4717 }
4718
4723 bool hexapi get_valranges(
4724 valrng_t *res,
4725 const vivl_t &vivl,
4726 int vrflags) const;
4727
4733 bool hexapi get_valranges(
4734 valrng_t *res,
4735 const vivl_t &vivl,
4736 const minsn_t *m,
4737 int vrflags) const;
4738
4740
4741#define VR_AT_START 0x0000
4743#define VR_AT_END 0x0001
4746#define VR_EXACT 0x0002
4748
4749
4754
4758 size_t hexapi get_reginsn_qty() const;
4759
4760 bool is_call_block() const { return tail != nullptr && is_mcode_call(tail->opcode); }
4761 bool is_unknown_call() const { return tail != nullptr && tail->is_unknown_call(); }
4762 bool is_nway() const { return type == BLT_NWAY; }
4763 bool is_branch() const { return type == BLT_2WAY && tail->d.is_mblock(); }
4765 {
4766 return get_reginsn_qty() == 1
4767 && tail->opcode == m_goto
4768 && tail->l.is_mblock();
4769 }
4771 {
4772 return is_branch()
4773 && npred() == 1
4774 && get_reginsn_qty() == 1
4776 }
4777
4780 void hexapi undef_spoiled_regs(minsn_t *m);
4781
4782};
4783//-------------------------------------------------------------------------
4851
4854{
4859 {
4860 if ( ea < r.ea )
4861 return -1;
4862 if ( ea > r.ea )
4863 return 1;
4864 if ( id < r.id )
4865 return -1;
4866 if ( id > r.id )
4867 return 1;
4868 return strcmp(text.c_str(), r.text.c_str());
4869 }
4870};
4873
4874//-------------------------------------------------------------------------
4889
4893{
4894public:
4899 minsn_locator_t(ea_t _ea=BADADDR, mcode_t _mcode=m_nop, int _serial=0, int _blknum=-1)
4900 : ea(_ea), mcode(_mcode), serial(_serial), blknum(_blknum) {}
4902 {
4903 COMPARE_FIELDS(ea);
4904 COMPARE_FIELDS(mcode);
4905 COMPARE_FIELDS(serial);
4906 COMPARE_FIELDS(blknum);
4907 return 0;
4908 }
4909 HEXRAYS_MEMORY_ALLOCATION_FUNCS()
4910};
4912
4921
4935
4936//-------------------------------------------------------------------------
4943void hexapi add_user_minsn(ea_t entry_ea, const user_minsn_t &uins, mba_maturity_t mmat);
4944
4953bool hexapi del_user_minsn(
4954 ea_t entry_ea,
4955 const minsn_locator_t &loc,
4956 user_minsn_action_t action,
4957 mba_maturity_t mmat);
4958
4959//-------------------------------------------------------------------------
4969
4970//-------------------------------------------------------------------------
4974{
4975 func_t *pfn = nullptr;
4978 mba_ranges_t(func_t *_pfn=nullptr) : pfn(_pfn) {}
4980 ea_t start() const { return (pfn != nullptr ? *pfn : ranges[0]).start_ea; }
4981 bool empty() const { return pfn == nullptr && ranges.empty(); }
4982 void clear() { pfn = nullptr; ranges.clear(); }
4983 bool is_snippet() const { return pfn == nullptr; }
4984 bool hexapi range_contains(ea_t ea) const;
4985 bool is_fragmented() const
4986 {
4987 size_t n_frags = ranges.size();
4988 if ( pfn != nullptr )
4989 n_frags += pfn->tailqty + 1;
4990 return n_frags > 1;
4991 }
4992};
4993
4994//-------------------------------------------------------------------------
4997{
4998 ea_t func_ea = BADADDR;
5001 decomp_ranges_t(ea_t _func_ea=BADADDR) : func_ea(get_func_start(_func_ea)) {}
5003 ea_t start() const { return (func_ea != BADADDR ? func_ea : ranges[0]).start_ea; }
5004 bool empty() const { return func_ea == BADADDR && ranges.empty(); }
5005 void clear() { func_ea = BADADDR; ranges.clear(); }
5006 bool is_snippet() const { return func_ea == BADADDR; }
5007 bool hexapi range_contains(ea_t ea) const;
5008 bool is_fragmented() const
5009 {
5010 size_t n_frags = ranges.size();
5011 if ( func_ea != BADADDR )
5012 n_frags += get_func_tail_qty(func_ea) + 1;
5013 return n_frags > 1;
5014 }
5015};
5016
5019{
5020 const rangevec_t *ranges = nullptr;
5021 const range_t *rptr = nullptr; // pointer into ranges
5022 ea_t cur = BADADDR; // current address
5023 bool set(const rangevec_t &r);
5025 ea_t current() const { return cur; }
5026};
5027
5030GCC_DIAG_OFF(deprecated-declarations)
5031MSC_DIAG_OFF(4996) // uses deprecated func_item_iterator_t
5032struct mba_item_iterator_t
5033{
5036 bool func_items_done = true;
5037 bool set(const mba_ranges_t &mbr)
5038 {
5039 bool ok = false;
5040 if ( mbr.pfn != nullptr )
5041 {
5042 ok = fii.set(mbr.pfn);
5043 if ( ok )
5044 func_items_done = false;
5045 }
5046 if ( rii.set(mbr.ranges) )
5047 ok = true;
5048 return ok;
5049 }
5050 bool next_code()
5051 {
5052 bool ok = false;
5053 if ( !func_items_done )
5054 {
5055 ok = fii.next_code();
5056 if ( !ok )
5057 func_items_done = true;
5058 }
5059 if ( !ok )
5060 ok = rii.next_code();
5061 return ok;
5062 }
5063 ea_t current() const
5064 {
5065 return func_items_done ? rii.current() : fii.current();
5066 }
5067};
5069GCC_DIAG_ON(deprecated-declarations)
5070
5072struct decomp_item_iterator_t
5073{
5076 bool func_items_done = true;
5077 bool set(const decomp_ranges_t &dcr)
5078 {
5079 bool ok = false;
5080 if ( dcr.func_ea != BADADDR )
5081 {
5082 ok = fii.set(dcr.func_ea);
5083 if ( ok )
5084 func_items_done = false;
5085 }
5086 if ( rii.set(dcr.ranges) )
5087 ok = true;
5088 return ok;
5089 }
5090 bool next_code()
5091 {
5092 bool ok = false;
5093 if ( !func_items_done )
5094 {
5095 ok = fii.next_code();
5096 if ( !ok )
5097 func_items_done = true;
5098 }
5099 if ( !ok )
5100 ok = rii.next_code();
5101 return ok;
5102 }
5103 ea_t current() const
5104 {
5105 return func_items_done ? rii.current() : fii.current();
5106 }
5107};
5108
5111{
5112 const range_t *rptr = nullptr; // pointer into ranges
5113 const range_t *rend = nullptr;
5114 bool set(const rangevec_t &r) { rptr = r.begin(); rend = r.end(); return rptr != rend; }
5115 bool next() { return ++rptr != rend; }
5116 const range_t &chunk() const { return *rptr; }
5117};
5118
5121GCC_DIAG_OFF(deprecated-declarations)
5122MSC_DIAG_OFF(4996) // uses deprecated func_tail_iterator_t
5123struct mba_range_iterator_t
5124{
5125 range_chunk_iterator_t rii;
5126 func_tail_iterator_t fii; // this is used if rii.rptr==nullptr
5127 bool is_snippet() const { return rii.rptr != nullptr; }
5128 bool set(const mba_ranges_t &mbr)
5129 {
5130 if ( mbr.is_snippet() )
5131 return rii.set(mbr.ranges);
5132 else
5133 return fii.set(mbr.pfn);
5134 }
5135 bool next()
5136 {
5137 if ( is_snippet() )
5138 return rii.next();
5139 else
5140 return fii.next();
5141 }
5142 const range_t &chunk() const
5143 {
5144 return is_snippet() ? rii.chunk() : fii.chunk();
5145 }
5146};
5147MSC_DIAG_ON(4996)
5148GCC_DIAG_ON(deprecated-declarations)
5149
5151struct decomp_range_iterator_t
5152{
5153 range_chunk_iterator_t rii;
5154 function_tail_iterator_t fii; // this is used if rii.rptr==nullptr
5155 bool is_snippet() const { return rii.rptr != nullptr; }
5156 bool set(const decomp_ranges_t &dcr)
5157 {
5158 if ( dcr.is_snippet() )
5159 return rii.set(dcr.ranges);
5160 else
5161 return fii.set(dcr.func_ea);
5162 }
5163 bool next()
5164 {
5165 if ( is_snippet() )
5166 return rii.next();
5167 else
5168 return fii.next();
5169 }
5170 void chunk(range_t *out) const
5171 {
5172 if ( is_snippet() )
5173 *out = rii.chunk();
5174 else
5175 fii.chunk(out);
5176 }
5177};
5178
5179//-------------------------------------------------------------------------
5185{
5186 DECLARE_UNCOPYABLE(mba_t)
5187 uint32 flags;
5188 uint32 flags2;
5189
5190public:
5191 // bits to describe the microcode, set by the decompiler
5192#define MBA_PRCDEFS 0x00000001
5193#define MBA_NOFUNC 0x00000002
5194#define MBA_PATTERN 0x00000004
5195#define MBA_LOADED 0x00000008
5196#define MBA_RETFP 0x00000010
5197#define MBA_SPLINFO 0x00000020
5198#define MBA_PASSREGS 0x00000040
5199#define MBA_THUNK 0x00000080
5200#define MBA_CMNSTK 0x00000100
5201
5202 // bits to describe analysis stages and requests
5203#define MBA_PREOPT 0x00000200
5204#define MBA_CMBBLK 0x00000400
5205#define MBA_ASRTOK 0x00000800
5206#define MBA_CALLS 0x00001000
5207#define MBA_ASRPROP 0x00002000
5208#define MBA_SAVRST 0x00004000
5209#define MBA_RETREF 0x00008000
5210#define MBA_GLBOPT 0x00010000
5211#define MBA_LVARS0 0x00040000
5212#define MBA_LVARS1 0x00080000
5213#define MBA_DELPAIRS 0x00100000
5214#define MBA_CHVARS 0x00200000
5215
5216 // bits that can be set by the caller:
5217#define MBA_SHORT 0x00400000
5218#define MBA_COLGDL 0x00800000
5219#define MBA_INSGDL 0x01000000
5220#define MBA_NICE 0x02000000
5221#define MBA_REFINE 0x04000000
5222#define MBA_WINGR32 0x10000000
5223#define MBA_NUMADDR 0x20000000
5224#define MBA_VALNUM 0x40000000
5225#define MBA_SHOWEA 0x80000000
5226
5227#define MBA_INITIAL_FLAGS (MBA_INSGDL|MBA_NICE|MBA_CMBBLK|MBA_REFINE\
5228 |MBA_PRCDEFS|MBA_VALNUM)
5229
5230#define MBA2_LVARNAMES_OK 0x00000001
5231#define MBA2_LVARS_RENAMED 0x00000002
5232#define MBA2_OVER_CHAINS 0x00000004
5233#define MBA2_VALRNG_DONE 0x00000008
5234#define MBA2_IS_CTR 0x00000010
5235#define MBA2_IS_DTR 0x00000020
5236#define MBA2_ARGIDX_OK 0x00000040
5237#define MBA2_NO_DUP_CALLS 0x00000080
5238#define MBA2_NO_DUP_LVARS 0x00000100
5239#define MBA2_UNDEF_RETVAR 0x00000200
5240#define MBA2_ARGIDX_SORTED 0x00000400
5242#define MBA2_CODE16_BIT 0x00000800
5243#define MBA2_STACK_RETVAL 0x00001000
5244#define MBA2_HAS_OUTLINES 0x00002000
5245#define MBA2_NO_FRAME 0x00004000
5246#define MBA2_PROP_COMPLEX 0x00008000
5247
5248#define MBA2_DONT_VERIFY 0x80000000
5251
5252#define MBA2_INITIAL_FLAGS (MBA2_LVARNAMES_OK|MBA2_LVARS_RENAMED)
5253
5254#define MBA2_ALL_FLAGS 0x0001FFFF
5255
5256 bool precise_defeas() const { return (flags & MBA_PRCDEFS) != 0; }
5257 bool optimized() const { return (flags & MBA_GLBOPT) != 0; }
5258 bool short_display() const { return (flags & MBA_SHORT ) != 0; }
5259 bool show_reduction() const { return (flags & MBA_COLGDL) != 0; }
5260 bool graph_insns() const { return (flags & MBA_INSGDL) != 0; }
5261 bool loaded_gdl() const { return (flags & MBA_LOADED) != 0; }
5262 bool should_beautify()const { return (flags & MBA_NICE ) != 0; }
5263 bool rtype_refined() const { return (flags & MBA_RETREF) != 0; }
5264 bool may_refine_rettype() const { return (flags & MBA_REFINE) != 0; }
5265 bool display_numaddrs() const { return (flags & MBA_NUMADDR) != 0; }
5266 bool display_valnums() const { return (flags & MBA_VALNUM) != 0; }
5267 bool display_ea() const { return (flags & MBA_SHOWEA) != 0; }
5268 bool is_pattern() const { return (flags & MBA_PATTERN) != 0; }
5269 bool is_thunk() const { return (flags & MBA_THUNK) != 0; }
5270 bool saverest_done() const { return (flags & MBA_SAVRST) != 0; }
5271 bool callinfo_built() const { return (flags & MBA_CALLS) != 0; }
5272 bool really_alloc() const { return (flags & MBA_LVARS0) != 0; }
5273 bool lvars_allocated()const { return (flags & MBA_LVARS1) != 0; }
5274 bool chain_varnums_ok()const { return (flags & MBA_CHVARS) != 0; }
5275 bool returns_fpval() const { return (flags & MBA_RETFP) != 0; }
5276 bool has_passregs() const { return (flags & MBA_PASSREGS) != 0; }
5277 bool generated_asserts() const { return (flags & MBA_ASRTOK) != 0; }
5278 bool propagated_asserts() const { return (flags & MBA_ASRPROP) != 0; }
5279 bool deleted_pairs() const { return (flags & MBA_DELPAIRS) != 0; }
5280 bool common_stkvars_stkargs() const { return (flags & MBA_CMNSTK) != 0; }
5281 bool lvar_names_ok() const { return (flags2 & MBA2_LVARNAMES_OK) != 0; }
5282 bool lvars_renamed() const { return (flags2 & MBA2_LVARS_RENAMED) != 0; }
5283 bool has_over_chains() const { return (flags2 & MBA2_OVER_CHAINS) != 0; }
5284 bool valranges_done() const { return (flags2 & MBA2_VALRNG_DONE) != 0; }
5285 bool argidx_ok() const { return (flags2 & MBA2_ARGIDX_OK) != 0; }
5286 bool argidx_sorted() const { return (flags2 & MBA2_ARGIDX_SORTED) != 0; }
5287 bool code16_bit_removed() const { return (flags2 & MBA2_CODE16_BIT) != 0; }
5288 bool has_stack_retval() const { return (flags2 & MBA2_STACK_RETVAL) != 0; }
5289 bool has_outlines() const { return (flags2 & MBA2_HAS_OUTLINES) != 0; }
5290 bool is_ctr() const { return (flags2 & MBA2_IS_CTR) != 0; }
5291 bool is_dtr() const { return (flags2 & MBA2_IS_DTR) != 0; }
5292 bool is_cdtr() const { return (flags2 & (MBA2_IS_CTR|MBA2_IS_DTR)) != 0; }
5293 bool prop_complex() const { return (flags2 & MBA2_PROP_COMPLEX) != 0; }
5294 int get_mba_flags() const { return flags; }
5295 int get_mba_flags2() const { return flags2; }
5296 void set_mba_flags(int f) { flags |= f; }
5297 void clr_mba_flags(int f) { flags &= ~f; }
5298 void set_mba_flags2(int f) { flags2 |= f; }
5299 void clr_mba_flags2(int f) { flags2 &= ~f; }
5300 void clr_cdtr() { flags2 &= ~(MBA2_IS_CTR|MBA2_IS_DTR); }
5302 {
5303 int shins_flags = 0;
5304 if ( short_display() )
5305 shins_flags |= SHINS_SHORT;
5306 if ( display_valnums() )
5307 shins_flags |= SHINS_VALNUM;
5308 if ( display_numaddrs() )
5309 shins_flags |= SHINS_NUMADDR;
5310 return shins_flags;
5311 }
5312
5313/*
5314 +-----------+ <- inargtop
5315 | prmN |
5316 | ... | <- minargref
5317 | prm0 |
5318 +-----------+ <- inargoff
5319 |shadow_args|
5320 +-----------+
5321 | retaddr |
5322 frsize+frregs +-----------+ <- initial esp |
5323 | frregs | |
5324 +frsize +-----------+ <- typical ebp |
5325 | | | |
5326 | | | fpd |
5327 | | | |
5328 | frsize | <- current ebp |
5329 | | |
5330 | | |
5331 | | | stacksize
5332 | | |
5333 | | |
5334 | | <- minstkref |
5335 stkvar base off 0 +---.. | | | current
5336 | | | | stack
5337 | | | | pointer
5338 | | | | range
5339 |tmpstk_size| | | (what getspd() returns)
5340 | | | |
5341 | | | |
5342 +-----------+ <- minimal sp | | offset 0 for the decompiler (vd)
5343
5344 There is a detail that may add confusion when working with stack variables.
5345 The decompiler does not use the same stack offsets as IDA.
5346 The picture above should explain the difference:
5347 - IDA stkoffs are displayed on the left, decompiler stkoffs - on the right
5348 - Decompiler stkoffs are always >= 0
5349 - IDA stkoff==0 corresponds to stkoff==tmpstk_size in the decompiler
5350 - See stkoff_vd2ida and stkoff_ida2vd below to convert IDA stkoffs to vd stkoff
5351
5352*/
5353
5354 // convert a stack offset used in vd to a stack offset used in ida stack frame
5355 sval_t hexapi stkoff_vd2ida(sval_t off) const;
5356 // convert a ida stack frame offset to a stack offset used in vd
5357 sval_t hexapi stkoff_ida2vd(sval_t off) const;
5359 {
5360 return retsize + stacksize;
5361 }
5362 static vdloc_t hexapi idaloc2vd(const argloc_t &loc, int width, sval_t spd);
5363 vdloc_t hexapi idaloc2vd(const argloc_t &loc, int width) const;
5364
5365 static argloc_t hexapi vd2idaloc(const vdloc_t &loc, size_t width, sval_t spd);
5366 argloc_t hexapi vd2idaloc(const vdloc_t &loc, size_t width) const;
5367
5368 bool is_stkarg(const lvar_t &v) const
5369 {
5370 return v.is_stk_var() && v.get_stkoff() >= inargoff;
5371 }
5373 udm_t *udm,
5374 sval_t vd_stkoff,
5375 uval_t *p_idaoff=nullptr,
5376 tinfo_t *p_frame=nullptr) const;
5377 // get lvar location
5379 {
5380 return vd2idaloc(v.location, v.width);
5381 }
5383 ea_t entry_ea = BADADDR;
5386 int qty = 0;
5387 int npurged = -1;
5394 int pfn_flags = 0;
5395 int retsize = 0;
5396 int shadow_args = 0;
5405 ea_t minstkref_ea = BADADDR;
5415
5418
5419 bool final_type = false;
5423 int fti_flags = 0;
5424
5425#define NALT_VD 2
5426
5430 int retvaridx = -1;
5432
5433 ea_t error_ea = BADADDR;
5435
5436 mblock_t *blocks = nullptr;
5437 mblock_t **natural = nullptr;
5438
5441
5443 mutable uchar occurred_warns[32]; // occurred warning messages
5444 // (even disabled warnings are taken into account)
5446 {
5448 }
5450 {
5452 }
5454 {
5456 }
5457 bool has_bad_sp() const
5458 {
5460 }
5461
5462 // the exact size of this class is not documented, there may be more fields
5463 char reserved[];
5464 mba_t(); // use gen_microcode() or create_empty_mba() to create microcode objects
5465 ~mba_t() { term(); }
5467 void hexapi term();
5469 func_t *hexapi get_curfunc() const;
5471 bool use_frame() const { return get_curfunc() != nullptr; }
5472 bool range_contains(ea_t ea) const { return get_decomp_ranges().range_contains(map_fict_ea(ea)); }
5473 bool is_snippet() const { return get_decomp_ranges().is_snippet(); }
5474
5480 merror_t hexapi set_maturity(mba_maturity_t mat);
5481
5487 int hexapi optimize_local(int locopt_bits);
5489
5490#define LOCOPT_ALL 0x0001
5492#define LOCOPT_REFINE 0x0002
5493#define LOCOPT_REFINE2 0x0004
5495
5501 merror_t hexapi build_graph();
5502
5505 mbl_graph_t *hexapi get_graph();
5506
5511 int hexapi analyze_calls(int acflags);
5513
5514#define ACFL_LOCOPT 0x01
5515#define ACFL_BLKOPT 0x02
5516#define ACFL_GLBPROP 0x04
5517#define ACFL_GLBDEL 0x08
5518#define ACFL_GUESS 0x10
5520
5525 merror_t hexapi optimize_global();
5526
5533 void hexapi alloc_lvars();
5534
5538 void hexapi dump() const;
5539 AS_PRINTF(3, 0) void hexapi vdump_mba(bool _verify, const char *title, va_list va) const;
5540 AS_PRINTF(3, 4) void dump_mba(bool _verify, const char *title, ...) const
5541 {
5542 va_list va;
5544 vdump_mba(_verify, title, va);
5546 }
5547
5550 void hexapi print(vd_printer_t &vp) const;
5551
5561 void hexapi verify(bool always) const;
5562
5567 void hexapi mark_chains_dirty();
5568
5570 const mblock_t *get_mblock(uint n) const { QASSERT(52719, n < qty); return natural[n]; }
5571 mblock_t *get_mblock(uint n) { return CONST_CAST(mblock_t*)((CONST_CAST(const mba_t *)(this))->get_mblock(n)); }
5572
5580 mblock_t *hexapi insert_block(int bblk);
5581
5587 mblock_t *hexapi split_block(mblock_t *blk, minsn_t *start_insn);
5588
5592 bool hexapi remove_block(mblock_t *blk);
5593 bool hexapi remove_blocks(int start_blk, int end_blk); // end_blk is excluded
5594
5602 mblock_t *hexapi copy_block(mblock_t *blk, int new_serial, int cpblk_flags=3);
5605#define CPBLK_FAST 0x0000
5606#define CPBLK_MINREF 0x0001
5607#define CPBLK_OPTJMP 0x0002
5610
5613 bool hexapi remove_empty_and_unreachable_blocks();
5614
5619 bool hexapi merge_blocks();
5620
5624 int hexapi for_all_ops(mop_visitor_t &mv);
5625
5630 int hexapi for_all_insns(minsn_visitor_t &mv);
5631
5635 int hexapi for_all_topinsns(minsn_visitor_t &mv);
5636
5646 mop_t *hexapi find_mop(op_parent_info_t *ctx, ea_t ea, bool is_dest, const mlist_t &list);
5647
5659 minsn_t *hexapi create_helper_call(
5660 ea_t ea,
5661 const char *helper,
5662 const tinfo_t *rettype=nullptr,
5663 const mcallargs_t *callargs=nullptr,
5664 const mop_t *out=nullptr);
5665
5673 void hexapi get_func_output_lists(
5674 mlist_t *return_regs,
5675 mlist_t *spoiled,
5676 const tinfo_t &type,
5677 ea_t call_ea=BADADDR,
5678 bool tail_call=false);
5679
5682 lvar_t &hexapi arg(size_t n);
5683 const lvar_t &arg(size_t n) const { return CONST_CAST(mba_t*)(this)->arg(n); }
5684
5706 ea_t hexapi alloc_fict_ea(ea_t real_ea);
5707
5712 ea_t hexapi map_fict_ea(ea_t fict_ea) const;
5713
5716 const ivl_t &get_std_region(memreg_index_t idx) const;
5717 const ivl_t &get_lvars_region() const;
5718 const ivl_t &get_shadow_region() const;
5719 const ivl_t &get_args_region() const;
5720 ivl_t get_stack_region() const; // get entire stack region
5721
5726 bool hexapi get_numform(number_format_t *nf, const operand_locator_t &loc) const;
5727
5731 void hexapi set_numform(const operand_locator_t &loc, const number_format_t &nf);
5732
5736 bool hexapi clr_numform(const operand_locator_t &loc);
5737
5739 void hexapi serialize(bytevec_t *vout) const;
5740
5745 WARN_UNUSED_RESULT static mba_t *hexapi deserialize(const uchar *bytes, size_t nbytes);
5746
5748 void hexapi save_snapshot(const char *description);
5749
5755 mreg_t hexapi alloc_kreg(size_t size, bool check_size=true);
5756
5761 void hexapi free_kreg(mreg_t reg, size_t size);
5762
5765#define INLINE_EXTFRAME 0x0001
5766#define INLINE_DONTCOPY 0x0002
5767#define INLINE_NORETADDR 0x0004
5784 DEPRECATED merror_t hexapi inline_func(
5785 codegen_t &cdg,
5786 int blknum,
5787 mba_ranges_t &ranges,
5788 int decomp_flags=0,
5789 int inline_flags=0);
5790
5803 merror_t hexapi inline_function(
5804 codegen_t &cdg,
5805 int blknum,
5806 decomp_ranges_t &ranges,
5807 int decomp_flags=0,
5808 int inline_flags=0);
5809
5810 // Find a sp change point.
5811 // returns stkpnt p, where p->ea <= ea
5812 const stkpnt_t *hexapi locate_stkpnt(ea_t ea) const;
5813
5817 void hexapi add_user_minsn(const user_minsn_t &uins, mba_maturity_t mmat);
5818
5824 bool hexapi del_user_minsn(
5825 const minsn_locator_t &loc,
5826 user_minsn_action_t action,
5827 mba_maturity_t mmat);
5828
5829 bool hexapi set_lvar_name(lvar_t &v, const char *name, int flagbits);
5830 bool set_nice_lvar_name(lvar_t &v, const char *name) { return set_lvar_name(v, name, CVAR_NAME); }
5831 bool set_user_lvar_name(lvar_t &v, const char *name) { return set_lvar_name(v, name, CVAR_NAME|CVAR_UNAME); }
5832};
5834//-------------------------------------------------------------------------
5838{
5839 graph_chains_t *gc;
5840 chain_keeper_t &operator=(const chain_keeper_t &); // not defined
5841public:
5842 chain_keeper_t(graph_chains_t *_gc) : gc(_gc) { QASSERT(50446, gc != nullptr); gc->acquire(); }
5844 {
5845 gc->release();
5846 }
5847 block_chains_t &operator[](size_t idx) { return (*gc)[idx]; }
5848 block_chains_t &front() { return gc->front(); }
5849 block_chains_t &back() { return gc->back(); }
5850 operator graph_chains_t &() { return *gc; }
5851 int for_all_chains(chain_visitor_t &cv, int gca) { return gc->for_all_chains(cv, gca); }
5852 HEXRAYS_MEMORY_ALLOCATION_FUNCS()
5853};
5854
5855//-------------------------------------------------------------------------
5865
5866//-------------------------------------------------------------------------
5869{
5870 mba_t *mba;
5871 int dirty = GC_DIRTY_ALL;
5872 int chain_stamp = 0;
5873 graph_chains_t gcs[2*GC_END];
5874
5881 bool exclude_never_jumping_edges = true;
5882
5898 bool hexapi is_accessed_globally(
5899 const mlist_t &list, // list to verify
5900 int b1, // starting block
5901 int b2, // ending block
5902 const minsn_t *m1, // starting instruction (in b1)
5903 const minsn_t *m2, // ending instruction (in b2)
5904 access_type_t access_type,
5905 maymust_t maymust) const;
5906 int get_ud_gc_idx(gctype_t gctype) const { return (gctype << 1); }
5907 int get_du_gc_idx(gctype_t gctype) const { return (gctype << 1)+1; }
5908 int get_ud_dirty_bit(gctype_t gctype) { return 1 << get_ud_gc_idx(gctype); }
5909 int get_du_dirty_bit(gctype_t gctype) { return 1 << get_du_gc_idx(gctype); }
5910
5911public:
5914 {
5915 int bit = get_ud_dirty_bit(gctype);
5916 return (dirty & bit) != 0;
5917 }
5918
5921 {
5922 int bit = get_du_dirty_bit(gctype);
5923 return (dirty & bit) != 0;
5924 }
5925 int get_chain_stamp() const { return chain_stamp; }
5926
5928 graph_chains_t *hexapi get_ud(gctype_t gctype);
5929
5931 graph_chains_t *hexapi get_du(gctype_t gctype);
5932
5934 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
5935 { return is_accessed_globally(list, b1, b2, m1, m2, WRITE_ACCESS, maymust); }
5936
5938 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
5939 { return is_accessed_globally(list, b1, b2, m1, m2, READ_ACCESS, maymust); }
5940
5941 mblock_t *get_mblock(int n) const { return mba->get_mblock(n); }
5942};
5943
5944//-------------------------------------------------------------------------
5945// Helper for codegen_t. It takes into account delay slots
5947{
5948 const mba_t *mba; // to check range
5949 ea_t ea = BADADDR; // next insn to decode
5950 ea_t end = BADADDR; // end of the block
5951 ea_t dslot = BADADDR; // address of the insn in the delay slot
5952 insn_t dslot_insn; // instruction in the delay slot
5953 ea_t severed_branch = BADADDR; // address of the severed branch insn
5954 // (when this branch insn ends the previous block)
5955 bool is_likely_dslot = false; // execute delay slot only when jumping
5956
5957 cdg_insn_iterator_t(const mba_t *mba_) : mba(mba_) {}
5960
5961 bool ok() const { return ea < end; }
5962 bool has_dslot() const { return dslot != BADADDR; }
5963 bool dslot_with_xrefs() const { return dslot >= end; }
5964 // the current insn is the severed delayed insn (when this starts a block)
5965 bool is_severed_dslot() const { return severed_branch != BADADDR; }
5966 void start(const range_t &rng)
5967 {
5968 ea = rng.start_ea;
5969 end = rng.end_ea;
5970 }
5971 merror_t hexapi next(insn_t *ins);
5972};
5973
5974//-------------------------------------------------------------------------
5977{
5978public:
5979 mba_t *mba; // ptr to mbl array
5980 mblock_t *mb = nullptr; // current basic block
5981 insn_t insn; // instruction to generate microcode for
5982 char ignore_micro = IM_NONE; // value of get_ignore_micro() for the insn
5983 cdg_insn_iterator_t ii; // instruction iterator
5984 size_t reserved[4];
5985
5986 codegen_t() = delete;
5987 virtual ~codegen_t()
5988 {
5989 clear();
5990 }
5991 void hexapi clear(); // does not clear everything yet
5992
5998 virtual merror_t idaapi analyze_prolog(
5999 const class qflow_chart_ea_t &fc,
6000 const class bitset_t &reachable) = 0;
6001
6008 virtual merror_t idaapi gen_micro() = 0;
6009
6014 virtual mreg_t idaapi load_operand(int opnum, int flags=0) = 0;
6015
6017 virtual void idaapi microgen_completed() {}
6018
6026 virtual merror_t idaapi prepare_gen_micro() { return MERR_OK; }
6027
6033 virtual mreg_t idaapi load_effective_address(int n, int flags=0) = 0;
6034
6042 // (nullptr if no instruction was generated)
6044 virtual bool idaapi store_operand(int n, const mop_t &mop, int flags=0, minsn_t **outins=nullptr);
6045
6048 virtual bool idaapi should_handle_switch(
6049 [[maybe_unused]] ea_t ea,
6050 [[maybe_unused]] const switch_info_t &si) const
6051 {
6052 return true;
6053 }
6054
6071 minsn_t *hexapi emit(mcode_t code, int width, uval_t l, uval_t r, uval_t d, int offsize);
6072
6076 mcode_t code,
6077 op_dtype_t dtype,
6078 uval_t l,
6079 uval_t r,
6080 uval_t d,
6081 int offsize)
6082 {
6083 return emit(code, get_dtype_size(dtype), l, r, d, offsize);
6084 }
6085
6091 minsn_t *hexapi emit(mcode_t code, const mop_t *l, const mop_t *r, const mop_t *d);
6092
6093};
6094
6095//-------------------------------------------------------------------------
6098bool hexapi change_hexrays_config(const char *directive);
6099
6100//-------------------------------------------------------------------------
6102{
6103 t = mop_d;
6104 d = ins;
6105}
6106
6107inline bool mop_t::has_side_effects(bool include_ldx_and_divs) const
6108{
6109 return is_insn() && d->has_side_effects(include_ldx_and_divs);
6110}
6111
6112inline bool mop_t::is_kreg() const
6113{
6114 return is_reg() && ::is_kreg(r);
6115}
6116
6118{
6119 return is_insn(code) ? d : nullptr;
6120}
6122{
6123 return is_insn(code) ? d : nullptr;
6124}
6125
6126inline bool mop_t::is_insn(mcode_t code) const
6127{
6128 return is_insn() && d->opcode == code;
6129}
6130
6131inline bool mop_t::is_glbaddr() const
6132{
6133 return t == mop_a && a->is_glbvar();
6134}
6135
6136inline bool mop_t::is_glbaddr(ea_t ea) const
6137{
6138 return is_glbaddr() && a->g == ea;
6139}
6140
6141inline bool mop_t::is_stkaddr() const
6142{
6143 return t == mop_a && a->is_stkvar();
6144}
6145
6146inline vivl_t::vivl_t(const chain_t &ch)
6147 : voff_t(ch.key().type, ch.is_reg() ? ch.get_reg() : ch.get_stkoff()),
6148 size(ch.width)
6149{
6150}
6151
6152// The following memory regions exist
6153// start length
6154// ------------------------ ---------
6155// lvars spbase stacksize
6156// retaddr spbase+stacksize retsize
6157// shadow spbase+stacksize+retsize shadow_args
6158// args inargoff MAX_FUNC_ARGS*sp_width-shadow_args
6159// globals data_segment sizeof_data_segment
6160// heap everything else?
6161
6163{
6164 return std_ivls[idx].ivl;
6165}
6166
6167inline const ivl_t &mba_t::get_lvars_region() const
6168{
6170}
6171
6172inline const ivl_t &mba_t::get_shadow_region() const
6173{
6175}
6176
6177inline const ivl_t &mba_t::get_args_region() const
6178{
6179 return get_std_region(MMIDX_ARGS);
6180}
6181
6183{
6184 return ivl_t(std_ivls[MMIDX_LVARS].ivl.off, fullsize);
6185}
6186
6187//-------------------------------------------------------------------------
6191
6192const char *hexapi get_hexrays_version();
6193
6197#define OPF_REUSE 0x00
6198#define OPF_NEW_WINDOW 0x01
6199#define OPF_REUSE_ACTIVE 0x02
6201#define OPF_NO_WAIT 0x08
6203
6204#define OPF_WINDOW_MGMT_MASK 0x07
6205
6206
6212
6213vdui_t *hexapi open_pseudocode(ea_t ea, int flags);
6214
6215
6219
6220bool hexapi close_pseudocode(TWidget *f);
6221
6222
6226
6227vdui_t *hexapi get_widget_vdui(TWidget *f);
6228
6229
6232#define VDRUN_NEWFILE 0x00000000
6233#define VDRUN_APPEND 0x00000001
6234#define VDRUN_ONLYNEW 0x00000002
6235#define VDRUN_SILENT 0x00000004
6236#define VDRUN_SENDIDB 0x00000008
6237#define VDRUN_MAYSTOP 0x00000010
6238#define VDRUN_CMDLINE 0x00000020
6239#define VDRUN_STATS 0x00000040
6240#define VDRUN_LUMINA 0x00000080
6241#define VDRUN_PERF 0x00200000
6243
6251
6252bool hexapi decompile_many(const char *outfile, const eavec_t *funcaddrs, int flags);
6253
6254
6261
6262void hexapi send_database(const hexrays_failure_t &err, bool silent);
6263
6266{
6268 union
6269 {
6272 };
6273 int size;
6275#define GCO_STK 0x0000
6276#define GCO_REG 0x0001
6277#define GCO_USE 0x0002
6278#define GCO_DEF 0x0004
6279 bool is_reg() const { return (flags & GCO_REG) != 0; }
6280 bool is_use() const { return (flags & GCO_USE) != 0; }
6281 bool is_def() const { return (flags & GCO_DEF) != 0; }
6282
6288 bool hexapi append_to_list(mlist_t *list, const mba_t *mba) const;
6289
6294 {
6295 vivl_t ret;
6296 if ( is_reg() )
6297 ret.set_reg(regnum, size);
6298 else
6299 ret.set_stkoff(stkoff, size);
6300 return ret;
6301 }
6302};
6303
6309bool hexapi get_current_operand(gco_info_t *out);
6310
6311void hexapi remitem(const citem_t *e);
6312//-------------------------------------------------------------------------
6316{
6334 cot_lor = 17,
6336 cot_bor = 19,
6337 cot_xor = 20,
6339 cot_eq = 22,
6340 cot_ne = 23,
6341 cot_sge = 24,
6342 cot_uge = 25,
6343 cot_sle = 26,
6344 cot_ule = 27,
6345 cot_sgt = 28,
6346 cot_ugt = 29,
6347 cot_slt = 30,
6348 cot_ult = 31,
6351 cot_shl = 34,
6352 cot_add = 35,
6353 cot_sub = 36,
6354 cot_mul = 37,
6364 cot_neg = 47,
6368 cot_ptr = 51,
6369 cot_ref = 52,
6375 cot_idx = 58,
6378 cot_num = 61,
6380 cot_str = 63,
6381 cot_obj = 64,
6382 cot_var = 65,
6391 cit_if = 73,
6392 cit_for = 74,
6394 cit_do = 76,
6400 cit_asm = 82,
6401 cit_try = 83,
6404};
6405
6413ctype_t hexapi asgop(ctype_t cop);
6416ctype_t hexapi asgop_revert(ctype_t cop);
6418inline bool op_uses_x(ctype_t op) { return (op >= cot_comma && op <= cot_memptr) || op == cot_sizeof; }
6420inline bool op_uses_y(ctype_t op) { return (op >= cot_comma && op <= cot_fdiv) || op == cot_idx; }
6422inline bool op_uses_z(ctype_t op) { return op == cot_tern; }
6424inline bool is_binary(ctype_t op) { return op_uses_y(op) && op != cot_tern; } // x,y
6426inline bool is_unary(ctype_t op) { return op >= cot_fneg && op <= cot_predec; }
6428inline bool is_relational(ctype_t op) { return op >= cot_eq && op <= cot_ult; }
6430inline bool is_assignment(ctype_t op) { return op >= cot_asg && op <= cot_asgumod; }
6431// Can operate on UDTs?
6432inline bool accepts_udts(ctype_t op) { return op == cot_asg || op == cot_comma || op > cot_last; }
6434inline bool is_prepost(ctype_t op) { return op >= cot_postinc && op <= cot_predec; }
6437{
6438 return op == cot_bor
6439 || op == cot_xor
6440 || op == cot_band
6441 || op == cot_add
6442 || op == cot_mul
6443 || op == cot_fadd
6444 || op == cot_fmul
6445 || op == cot_ne
6446 || op == cot_eq;
6447}
6448
6449inline bool is_additive(ctype_t op)
6450{
6451 return op == cot_add
6452 || op == cot_sub
6453 || op == cot_fadd
6454 || op == cot_fsub;
6455}
6456
6458{
6459 return op == cot_mul
6460 || op == cot_sdiv
6461 || op == cot_udiv
6462 || op == cot_fmul
6463 || op == cot_fdiv;
6464}
6465
6467inline bool is_bitop(ctype_t op)
6468{
6469 return op == cot_bor
6470 || op == cot_xor
6471 || op == cot_band
6472 || op == cot_bnot;
6473}
6474
6476inline bool is_logical(ctype_t op)
6477{
6478 return op == cot_lor
6479 || op == cot_land
6480 || op == cot_lnot;
6481}
6482
6484inline bool is_loop(ctype_t op)
6485{
6486 return op == cit_for
6487 || op == cit_while
6488 || op == cit_do;
6489}
6490
6492{
6493 return is_loop(op) || op == cit_switch;
6494}
6495
6497inline bool is_lvalue(ctype_t op)
6498{
6499 return op == cot_ptr // *x
6500 || op == cot_idx // x[y]
6501 || op == cot_memref // x.m
6502 || op == cot_memptr // x->m
6503 || op == cot_obj // v
6504 || op == cot_var; // l
6505}
6506
6509{
6510 return op == cot_asg
6511 || op == cot_eq
6512 || op == cot_ne
6513 || op == cot_comma
6514 || op == cot_tern
6515 || (op > cot_last && op < cit_end); // any insn
6516}
6517
6520{
6523 cnumber_t(int _opnum=0) : nf(_opnum) {}
6524
6530 void hexapi print(
6531 qstring *vout,
6532 const tinfo_t &type,
6533 const citem_t *parent=nullptr,
6534 bool *nice_stroff=nullptr) const;
6535
6539 uint64 hexapi value(const tinfo_t &type) const;
6540
6545 void hexapi assign(uint64 v, size_t nbytes, type_sign_t sign);
6546
6548 DECLARE_COMPARISONS(cnumber_t);
6549};
6550
6553{
6555 int idx;
6556 lvar_t &getv() const { return mba->vars[idx]; }
6558 DECLARE_COMPARISONS(var_ref_t);
6559};
6560
6564
6579
6580//--------------------------------------------------------------------------
6594{
6595 // inner comments (comments within an expression)
6601 // outer comments
6614 ITP_CASE = 0x40000000,
6615 ITP_SIGN = 0x20000000,
6616 // this is a hack, we better introduce special indexes for case values
6617 // case value >= ITP_CASE will be processed incorrectly
6618};
6619
6621{
6624 bool operator < (const treeloc_t &r) const
6625 {
6626 return ea < r.ea
6627 || (ea == r.ea && itp < r.itp);
6628 }
6629 bool operator == (const treeloc_t &r) const
6630 {
6631 return ea == r.ea && itp == r.itp;
6632 }
6633 HEXRAYS_MEMORY_ALLOCATION_FUNCS()
6634};
6635
6647
6650struct citem_cmt_t : public qstring
6651{
6652 mutable bool used = false;
6654 citem_cmt_t(const char *s) : qstring(s) {}
6655};
6656
6657// Comments are attached to tree locations:
6659
6663{
6667public:
6668 citem_locator_t(ea_t _ea, ctype_t _op) : ea(_ea), op(_op) {}
6669 citem_locator_t(const citem_t *i);
6671 HEXRAYS_MEMORY_ALLOCATION_FUNCS()
6672};
6673
6674// citem_t::iflags are attached to (ea,op) pairs
6676
6677// user-defined casts
6679
6680// union field selections
6681// they are represented as a vector of integers. each integer represents the
6682// number of union field (0 means the first union field, etc)
6683// the size of this vector is equal to the number of nested unions in the selection.
6685
6686//--------------------------------------------------------------------------
6688{
6689 int16 nbits; // total number of non-zero bits. we cannot guarantee that
6690 // they are zero. example: a random "int var" has nbits==32
6691 int16 sbits; // number of sign bits (they can be either 0 or 1, all of them)
6692 // if bits are known to be zeroes, they are not taken into account here
6693 // (in this case nbits should be reduced)
6694 // if bits are unknown and can be anything, they cannot be included
6695 // in sbits.
6696 // sbits==1 is a special case and should not be used
6697 bit_bound_t(int n=0, int s=0) : nbits(n), sbits(s) {}
6698};
6699
6700//--------------------------------------------------------------------------
6706{
6707 ea_t ea = BADADDR;
6709 int label_num = -1;
6714 mutable int index = -1;
6718 void swap(citem_t &r)
6719 {
6720 std::swap(ea, r.ea);
6721 std::swap(op, r.op);
6722 std::swap(label_num, r.label_num);
6723 }
6724
6725 bool is_expr() const { return op <= cot_last; }
6727 bool hexapi contains_expr(const cexpr_t *e) const;
6729 bool hexapi contains_label() const;
6734 const citem_t *hexapi find_parent_of(const citem_t *item) const;
6736 { return CONST_CAST(citem_t*)((CONST_CAST(const citem_t*)(this))->find_parent_of(item)); }
6737 citem_t *hexapi find_closest_addr(ea_t _ea);
6738 void print1(qstring *vout, const cfunc_t *func) const;
6740 {
6741 remitem(this);
6742 }
6743 HEXRAYS_MEMORY_ALLOCATION_FUNCS()
6744};
6746
6749struct cexpr_t : public citem_t
6750{
6751 union
6752 {
6755 struct
6756 {
6757 union
6758 {
6761 };
6763 };
6764 struct
6765 {
6767 union
6768 {
6773 };
6774 union
6775 {
6778 };
6779 };
6782 char *helper;
6783 char *string;
6784 };
6790#define EXFL_CPADONE 0x0001
6791#define EXFL_LVALUE 0x0002
6792#define EXFL_FPOP 0x0004
6793#define EXFL_ALONE 0x0008
6794#define EXFL_CSTR 0x0010
6795#define EXFL_PARTIAL 0x0020
6796#define EXFL_UNDEF 0x0040
6797#define EXFL_JUMPOUT 0x0080
6798#define EXFL_VFTABLE 0x0100
6799#define EXFL_UCAST 0x0200
6800#define EXFL_ALL 0x03FF
6803 bool cpadone() const { return (exflags & EXFL_CPADONE) != 0; }
6804 bool is_odd_lvalue() const { return (exflags & EXFL_LVALUE) != 0; }
6805 bool is_fpop() const { return (exflags & EXFL_FPOP) != 0; }
6806 bool is_cstr() const { return (exflags & EXFL_CSTR) != 0; }
6807 bool is_type_partial() const { return (exflags & EXFL_PARTIAL) != 0; }
6808 bool is_undef_val() const { return (exflags & EXFL_UNDEF) != 0; }
6809 bool is_jumpout() const { return (exflags & EXFL_JUMPOUT) != 0; }
6810 bool is_vftable() const { return (exflags & EXFL_VFTABLE) != 0; }
6811 bool is_user_cast() const { return (exflags & EXFL_UCAST) != 0; }
6812
6813
6814 void set_cpadone() { exflags |= EXFL_CPADONE; }
6815 void set_vftable() { exflags |= EXFL_VFTABLE; }
6816 void set_user_cast() { exflags |= EXFL_UCAST; }
6817 void set_type_partial(bool val = true)
6818 {
6819 if ( val )
6820 exflags |= EXFL_PARTIAL;
6821 else
6822 exflags &= ~EXFL_PARTIAL;
6823 }
6824
6825 cexpr_t() : x(nullptr), y(nullptr), z(nullptr) {}
6826 cexpr_t(ctype_t cexpr_op, cexpr_t *_x, cexpr_t *_y=nullptr, cexpr_t *_z=nullptr)
6827 : citem_t(cexpr_op), x(_x), y(_y), z(_z) {}
6828 cexpr_t(mba_t *mba, const lvar_t &v);
6829 cexpr_t(const cexpr_t &r) : citem_t() { *this = r; }
6830 void swap(cexpr_t &r)
6831 {
6832 citem_t &ci = *this;
6833 ci.swap(r);
6834 std::swap(x, r.x);
6835 std::swap(y, r.y);
6836 std::swap(z, r.z);
6837 type.swap(r.type);
6838 std::swap(exflags, r.exflags);
6839 }
6840 cexpr_t &operator=(const cexpr_t &r) { return assign(r); }
6841 cexpr_t &hexapi assign(const cexpr_t &r);
6844
6849 void hexapi replace_by(cexpr_t *r);
6850
6853 void hexapi cleanup();
6854
6860 void hexapi put_number(cfunc_t *func, uint64 value, size_t nbytes, type_sign_t sign=no_sign);
6861
6865 void hexapi print1(qstring *vout, const cfunc_t *func) const;
6866
6871 void hexapi calc_type(bool recursive);
6872
6878 bool hexapi equal_effect(const cexpr_t &r) const;
6879
6883 bool hexapi is_child_of(const citem_t *parent) const;
6884
6889 bool hexapi contains_operator(ctype_t needed_op, int times=1) const;
6890
6892 bool contains_comma(int times=1) const { return contains_operator(cot_comma, times); }
6894 bool contains_insn(int times=1) const { return contains_operator(cot_insn, times); }
6898 bool contains_comma_or_insn_or_label(int maxcommas=1) const { return contains_comma(maxcommas) || contains_insn_or_label(); }
6904 bool is_nice_cond() const { return is_nice_expr() && type.is_bool(); }
6907 bool is_call_object_of(const citem_t *parent) const { return parent != nullptr && parent->op == cot_call && ((cexpr_t*)parent)->x == this; }
6910 bool is_call_arg_of(const citem_t *parent) const { return parent != nullptr && parent->op == cot_call && ((cexpr_t*)parent)->x != this; }
6912 type_sign_t get_type_sign() const { return type.get_sign(); }
6914 bool is_type_unsigned() const { return type.is_unsigned(); }
6916 bool is_type_signed() const { return type.is_signed(); }
6919 bit_bound_t hexapi get_high_nbit_bound() const;
6922 int hexapi get_low_nbit_bound() const;
6926 bool hexapi requires_lvalue(const cexpr_t *child) const;
6929 bool hexapi has_side_effects() const;
6932 bool like_boolean() const;
6935 bool is_aliasable() const;
6939 {
6940 QASSERT(50071, op == cot_num);
6941 return n->value(type);
6942 }
6943
6944 bool is_const_value(uint64 _v) const
6945 {
6946 return op == cot_num && numval() == _v;
6947 }
6948
6950 {
6951 return op == cot_num && int64(numval()) < 0;
6952 }
6953
6955 {
6956 return op == cot_num && int64(numval()) >= 0;
6957 }
6958
6960 {
6961 return op == cot_num && numval() != 0;
6962 }
6963
6964 bool is_zero_const() const { return is_const_value(0); }
6966 bool is_value_used(const citem_t *parent) const;
6970 bool get_const_value(uint64 *out) const
6971 {
6972 if ( op == cot_num )
6973 {
6974 if ( out != nullptr )
6975 *out = numval();
6976 return true;
6977 }
6978 return false;
6979 }
6980
6981 bool hexapi maybe_ptr() const;
6982
6985 {
6986 if ( x->type.is_ptr_or_array() )
6987 return x;
6988 if ( y->type.is_ptr_or_array() )
6989 return y;
6990 return nullptr;
6991 }
6992
6993 const cexpr_t *find_op(ctype_t _op) const
6994 {
6995 if ( x->op == _op )
6996 return x;
6997 if ( y->op == _op )
6998 return y;
6999 return nullptr;
7000 }
7002 {
7003 return (cexpr_t *)((const cexpr_t *)this)->find_op(_op);
7004 }
7005
7007 const cexpr_t *find_num_op() const { return find_op(cot_num); }
7011 const cexpr_t *find_ptr_or_array(bool remove_eqsize_casts) const;
7015 const cexpr_t *theother(const cexpr_t *what) const { return what == x ? y : x; }
7016 cexpr_t *theother(const cexpr_t *what) { return what == x ? y : x; }
7017
7018 // these are inline functions, see below
7019 bool get_1num_op(cexpr_t **o1, cexpr_t **o2);
7020 bool get_1num_op(const cexpr_t **o1, const cexpr_t **o2) const;
7021
7022 const char *hexapi dstr() const;
7023};
7025
7029{
7031 HEXRAYS_MEMORY_ALLOCATION_FUNCS()
7032};
7034
7042
7044struct cif_t : public ceinsn_t
7045{
7046 cinsn_t *ithen = nullptr;
7047 cinsn_t *ielse = nullptr;
7049 cif_t(const cif_t &r) : ceinsn_t(), ithen(nullptr), ielse(nullptr) { *this = r; }
7050 cif_t &operator=(const cif_t &r) { return assign(r); }
7051 cif_t &hexapi assign(const cif_t &r);
7054 void cleanup();
7055};
7056
7058struct cloop_t : public ceinsn_t
7059{
7060 cinsn_t *body = nullptr;
7061 cloop_t(cinsn_t *b=nullptr) : body(b) {}
7062 cloop_t(const cloop_t &r) : ceinsn_t() { *this = r; }
7063 cloop_t &operator=(const cloop_t &r) { return assign(r); }
7064 cloop_t &hexapi assign(const cloop_t &r);
7066 void cleanup();
7067};
7068
7076
7078struct cwhile_t : public cloop_t
7079{
7081};
7082
7084struct cdo_t : public cloop_t
7085{
7087};
7088
7094
7097{
7099 void print(const citem_t *parent, int indent, vc_printer_t &vp) const;
7101 HEXRAYS_MEMORY_ALLOCATION_FUNCS()
7102};
7103
7105struct casm_t : public eavec_t
7106{
7107 casm_t(ea_t ea) { push_back(ea); }
7108 casm_t(const casm_t &r) : eavec_t(eavec_t(r)) {}
7110 void print(const citem_t *parent, int indent, vc_printer_t &vp) const;
7111 bool one_insn() const { return size() == 1; }
7112 void genasm(qstring *buf, ea_t ea) const;
7113};
7114
7117
7120struct cinsn_t : public citem_t
7121{
7122 union
7123 {
7136 };
7137
7138 cinsn_t() { zero(); }
7139 cinsn_t(const cinsn_t &r) : citem_t(cit_empty) { *this = r; }
7140 void swap(cinsn_t &r) { citem_t::swap(r); std::swap(cblock, r.cblock); }
7141 cinsn_t &operator=(const cinsn_t &r) { return assign(r); }
7142 cinsn_t &hexapi assign(const cinsn_t &r);
7145
7150 void hexapi replace_by(cinsn_t *r);
7151
7154 void hexapi cleanup();
7155
7157 void zero() { op = cit_empty; cblock = nullptr; }
7158
7162 cinsn_t &hexapi new_insn(ea_t insn_ea);
7163
7167 cif_t &hexapi create_if(cexpr_t *cnd);
7168
7173 void hexapi print(int indent, vc_printer_t &vp, use_curly_t use_curly=CALC_CURLY_BRACES) const;
7174
7179 void hexapi print1(qstring *vout, const cfunc_t *func) const;
7180
7183 bool hexapi is_ordinary_flow() const;
7184
7189 bool hexapi contains_insn(ctype_t type, int times=1) const;
7190
7198 bool hexapi collect_free_breaks(cinsnptrvec_t *breaks);
7199
7207 bool hexapi collect_free_continues(cinsnptrvec_t *continues);
7208
7210 bool contains_free_break() const { return CONST_CAST(cinsn_t*)(this)->collect_free_breaks(nullptr); }
7212 bool contains_free_continue() const { return CONST_CAST(cinsn_t*)(this)->collect_free_continues(nullptr); }
7213
7214 const char *hexapi dstr() const;
7215};
7217
7219
7221struct cblock_t : public cinsn_list_t // we need list to be able to manipulate
7222{ // its elements freely
7224 bool is_ordinary_flow() const;
7225};
7226
7228struct carg_t : public cexpr_t
7229{
7230 bool is_vararg = false;
7233 {
7234 e->swap(*this);
7235 delete e;
7236 }
7238 {
7239 return cexpr_t::compare(r);
7240 }
7241};
7243
7245struct carglist_t : public qvector<carg_t>
7246{
7248 int flags = 0;
7249#define CFL_FINAL 0x0001
7250#define CFL_HELPER 0x0002
7251#define CFL_NORET 0x0004
7254 carglist_t(const tinfo_t &ftype, int fl = 0) : functype(ftype), flags(fl) {}
7256 void print(qstring *vout, const cfunc_t *func) const;
7257 int print(int curpos, vc_printer_t &vp) const;
7258};
7259
7261struct ccase_t : public cinsn_t
7262{
7266 void set_insn(cinsn_t *i); // deletes 'i'
7267 size_t size() const { return values.size(); }
7268 const uint64 &value(int i) const { return values[i]; }
7269};
7271
7273struct ccases_t : public qvector<ccase_t>
7274{
7276 int find_value(uint64 v) const;
7277};
7278
7286
7289{
7297 {
7298 obj.swap(r.obj);
7299 fake_type.swap(r.fake_type);
7300 }
7301 bool is_finally() const { return obj.op == cot_empty && fake_type.empty(); }
7302 bool is_catch_all() const { return fake_type == "..."; }
7303 void convert_to_catch_all() { obj.cleanup(); fake_type = "..."; }
7304 void convert_to_finally() { obj.cleanup(); fake_type.clear(); }
7305};
7308
7310struct ccatch_t : public cblock_t
7311{
7314 bool is_catch_all() const { return exprs.size() == 1 && exprs.front().is_catch_all(); }
7315 bool is_finally() const { return exprs.size() == 1 && exprs.front().is_finally(); }
7316 void convert_to_catch_all() { exprs.resize(1); exprs.front().convert_to_catch_all(); }
7317 void convert_to_finally() { exprs.resize(1); exprs.front().convert_to_finally(); }
7319 {
7320 exprs.swap(r.exprs);
7321 cblock_t *cb = this;
7322 cb->swap(r);
7323 }
7324};
7326
7329struct ctry_t : public cblock_t
7330{
7333 size_t old_state = 0;
7334 size_t new_state = 0;
7335
7336 int flags = 0;
7337#define CTRY_WIND 0x0001 // is a wind statement? otherwise try/catch
7338#define CTRY_SYNC 0x0002 // is a synchronized block (dalvik)
7339
7358 bool is_wind() const { return (flags & CTRY_WIND) != 0; }
7359
7371 bool is_synchronized_block() const { return (flags & CTRY_SYNC) != 0; }
7372
7374 void print(const citem_t *parent, int indent, vc_printer_t &vp) const;
7375};
7376
7382
7383//---------------------------------------------------------------------------
7386{
7387 cblock_t *blk; // cinsn_t::cblock or cinsn_t::ctry or cinsn_t::ctry->catchs[x]
7388 cblock_t::iterator p; // iterator pointing to the current item
7389 bool is_first_insn() const { return p == blk->begin(); }
7390 cinsn_t *insn() const { return &*p; }
7391 cinsn_t *prev_insn() { --p; return insn(); }
7392};
7395
7402{
7407#define CV_FAST 0x0000
7408#define CV_PRUNE 0x0001
7409#define CV_PARENTS 0x0002
7410#define CV_POST 0x0004
7411#define CV_RESTART 0x0008
7412#define CV_INSNS 0x0010
7419 bool maintain_parents() const { return (cv_flags & CV_PARENTS) != 0; }
7421 bool must_prune() const { return (cv_flags & CV_PRUNE) != 0; }
7423 bool must_restart() const { return (cv_flags & CV_RESTART) != 0; }
7425 bool is_postorder() const { return (cv_flags & CV_POST) != 0; }
7427 bool only_insns() const { return (cv_flags & CV_INSNS) != 0; }
7430 void prune_now() { cv_flags |= CV_PRUNE; }
7432 void clr_prune() { cv_flags &= ~CV_PRUNE; }
7434 void set_restart() { cv_flags |= CV_RESTART; }
7436 void clr_restart() { cv_flags &= ~CV_RESTART; }
7437
7442
7446 ctree_visitor_t(int _flags) : cv_flags(_flags) {}
7447
7448 virtual ~ctree_visitor_t() {}
7455 int hexapi apply_to(citem_t *item, citem_t *parent);
7456
7463 int hexapi apply_to_exprs(citem_t *item, citem_t *parent);
7464
7467 {
7468 return !parents.empty() ? parents.back() : nullptr;
7469 }
7470
7473 {
7474 citem_t *item = parent_item();
7475 return item != nullptr && item->is_expr() ? (cexpr_t *)item : nullptr;
7476 }
7477
7480 {
7481 citem_t *item = parent_item();
7482 return item != nullptr && !item->is_expr() ? (cinsn_t *)item : nullptr;
7483 }
7484
7485 // the following functions are redefined by the derived class
7486 // in order to perform the desired actions during the traversal
7487
7494 virtual int idaapi visit_insn(cinsn_t *) { return 0; }
7495
7502 virtual int idaapi visit_expr(cexpr_t *) { return 0; }
7503
7510 virtual int idaapi leave_insn(cinsn_t *) { return 0; }
7511
7518 virtual int idaapi leave_expr(cexpr_t *) { return 0; }
7519
7520 HEXRAYS_MEMORY_ALLOCATION_FUNCS()
7521};
7522
7525{
7526 ctree_parentee_t(bool post=false)
7527 : ctree_visitor_t((post ? CV_POST : 0)|CV_PARENTS) {}
7528
7536 bool hexapi recalc_parent_types();
7537};
7538
7541{
7543 cfunc_parentee_t(cfunc_t *f, bool post=false)
7544 : ctree_parentee_t(post), func(f) {}
7545
7555 bool hexapi calc_rvalue_type(tinfo_t *target, const cexpr_t *e);
7556};
7557
7558//---------------------------------------------------------------------------
7561{
7562 uval_t value = BADADDR;
7563#define ANCHOR_INDEX 0x1FFFFFFF
7564#define ANCHOR_MASK 0xC0000000
7565#define ANCHOR_CITEM 0x00000000
7566#define ANCHOR_LVAR 0x40000000
7567#define ANCHOR_ITP 0x80000000
7568#define ANCHOR_BLKCMT 0x20000000
7569 int get_index() const { return value & ANCHOR_INDEX; }
7570 item_preciser_t get_itp() const { return item_preciser_t(value & ~ANCHOR_ITP); }
7571 bool is_valid_anchor() const { return value != BADADDR; }
7572 bool is_citem_anchor() const { return (value & ANCHOR_MASK) == ANCHOR_CITEM; }
7573 bool is_lvar_anchor() const { return (value & ANCHOR_MASK) == ANCHOR_LVAR; }
7574 bool is_itp_anchor() const { return (value & ANCHOR_ITP) != 0; }
7575 bool is_blkcmt_anchor() const { return (value & ANCHOR_BLKCMT) != 0; }
7576};
7577
7587
7591{
7593 union
7594 {
7601 };
7602
7603 void verify(const mba_t *mba) const;
7604
7613
7614 int hexapi get_udm(
7615 udm_t *udm=nullptr,
7616 tinfo_t *parent=nullptr,
7617 uint64 *p_offset=nullptr) const;
7618
7624
7625 int hexapi get_edm(tinfo_t *parent) const;
7626
7631
7632 lvar_t *hexapi get_lvar() const;
7633
7634
7638
7639 ea_t hexapi get_ea() const;
7640
7641
7645
7646 int hexapi get_label_num(int gln_flags) const;
7649#define GLN_CURRENT 0x01
7650#define GLN_GOTO_TARGET 0x02
7651#define GLN_ALL 0x03
7653
7655 bool is_citem() const { return citype == VDI_EXPR; }
7656
7657 void hexapi print(qstring *vout) const;
7658 const char *hexapi dstr() const;
7659 HEXRAYS_MEMORY_ALLOCATION_FUNCS()
7660};
7661
7668
7670
7678
7679cexpr_t *hexapi lnot(cexpr_t *e);
7680
7681
7683
7684cinsn_t *hexapi new_block();
7685
7686
7697
7698AS_PRINTF(3, 0) cexpr_t *hexapi vcreate_helper(bool standalone, const tinfo_t &type, const char *format, va_list va);
7699
7701AS_PRINTF(3, 4) inline cexpr_t *create_helper(bool standalone, const tinfo_t &type, const char *format, ...)
7702{
7703 va_list va;
7705 cexpr_t *e = vcreate_helper(standalone, type, format, va);
7707 return e;
7708}
7709
7710
7719
7720AS_PRINTF(3, 0) cexpr_t *hexapi vcall_helper(const tinfo_t &rettype, carglist_t *args, const char *format, va_list va);
7721
7723AS_PRINTF(3, 4) inline cexpr_t *call_helper(
7724 const tinfo_t &rettype,
7726 const char *format, ...)
7727{
7728 va_list va;
7729 va_start(va, format);
7730 cexpr_t *e = vcall_helper(rettype, args, format, va);
7731 va_end(va);
7732 return e;
7733}
7734
7735
7746
7747cexpr_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);
7748
7749
7753
7754cexpr_t *hexapi make_ref(cexpr_t *e);
7755
7756
7765
7766cexpr_t *hexapi dereference(cexpr_t *e, size_t ptrsize, bool is_flt=false);
7767
7768
7777
7778void hexapi save_user_labels(ea_t func_ea, const user_labels_t *user_labels, const cfunc_t *func=nullptr);
7779
7780
7784
7785void hexapi save_user_cmts(ea_t func_ea, const user_cmts_t *user_cmts);
7786
7790
7791void hexapi save_user_numforms(ea_t func_ea, const user_numforms_t *numforms);
7792
7793
7797
7798void hexapi save_user_iflags(ea_t func_ea, const user_iflags_t *iflags);
7799
7800
7804
7805void hexapi save_user_unions(ea_t func_ea, const user_unions_t *unions);
7806
7807
7811
7812void hexapi save_user_casts(ea_t func_ea, const user_casts_t *casts);
7813
7814
7819
7820user_casts_t *hexapi restore_user_casts(ea_t func_ea);
7821
7822
7829
7830user_labels_t *hexapi restore_user_labels(ea_t func_ea, const cfunc_t *func=nullptr);
7831
7832
7837
7838user_cmts_t *hexapi restore_user_cmts(ea_t func_ea);
7839
7840
7845
7847
7848
7853
7854user_iflags_t *hexapi restore_user_iflags(ea_t func_ea);
7855
7856
7861
7862user_unions_t *hexapi restore_user_unions(ea_t func_ea);
7863
7864
7866// map of instruction boundaries. may contain INS_EPILOG for the epilog instructions
7868#define INS_EPILOG ((cinsn_t *)1)
7869
7870// Tags to find this location quickly: #cfunc_t #func_t
7871//-------------------------------------------------------------------------
7874{
7880 // The following maps must be accessed using helper functions.
7881 // Example: for user_labels_t, see functions starting with "user_labels_".
7889#define CIT_COLLAPSED 0x0001
7890#define CIT_INVERTED 0x0002
7891#define CIT_THEN_COLLAPSED 0x0004
7892#define CIT_ELSE_COLLAPSED 0x0008
7897#define CFS_BOUNDS 0x0001
7898#define CFS_TEXT 0x0002
7899#define CFS_LVARS_HIDDEN 0x0004
7900#define CFS_LOCKED 0x0008
7907
7908 // the exact size of this class is not documented, there may be more fields
7909 char reserved[];
7910
7911public:
7912 cfunc_t(mba_t *mba); // use create_cfunc()
7913 ~cfunc_t() { cleanup(); }
7914 void release() { delete this; }
7916
7917
7919 void hexapi build_c_tree();
7920
7926 void hexapi verify(allow_unused_labels_t aul, bool even_without_debugger) const;
7927
7930 void hexapi print_dcl(qstring *vout) const;
7931
7934 void hexapi print_func(vc_printer_t &vp) const;
7935
7939 bool hexapi get_func_type(tinfo_t *type) const;
7940
7947 lvars_t *hexapi get_lvars();
7948
7954 sval_t hexapi get_stkoff_delta();
7955
7958 citem_t *hexapi find_label(int label);
7959
7963 void hexapi remove_unused_labels();
7964
7970 void hexapi redirect_gotos(int from, int to);
7971
7976 const char *hexapi get_user_cmt(const treeloc_t &loc, cmt_retrieval_type_t rt) const;
7977
7983 void hexapi set_user_cmt(const treeloc_t &loc, const char *cmt);
7984
7988 int32 hexapi get_user_iflags(const citem_locator_t &loc) const;
7989
7993 void hexapi set_user_iflags(const citem_locator_t &loc, int32 iflags);
7994
7996 bool hexapi has_orphan_cmts() const;
7997
8000 int hexapi del_orphan_cmts();
8001
8006 bool hexapi get_user_union_selection(ea_t ea, intvec_t *path);
8007
8012 void hexapi set_user_union_selection(ea_t ea, const intvec_t &path);
8013
8015 void hexapi save_user_labels() const;
8017 void hexapi save_user_cmts() const;
8019 void hexapi save_user_numforms() const;
8021 void hexapi save_user_iflags() const;
8023 void hexapi save_user_unions() const;
8025 void hexapi save_user_casts() const;
8026
8028 tinfo_t hexapi get_user_cast(const citem_locator_t &loc) const;
8030 void hexapi set_user_cast(const citem_locator_t &loc, const tinfo_t &type);
8031
8041 bool hexapi get_line_item(
8042 const char *line,
8043 int x,
8044 bool is_ctree_line,
8045 ctree_item_t *phead,
8046 ctree_item_t *pitem,
8047 ctree_item_t *ptail);
8048
8051 hexwarns_t &hexapi get_warnings();
8052
8055 eamap_t &hexapi get_eamap();
8056
8059 boundaries_t &hexapi get_boundaries();
8060
8063 const strvec_t &hexapi get_pseudocode();
8064
8069 void hexapi refresh_func_ctext();
8070
8075 void hexapi recalc_item_addresses();
8076
8081 const citem_t *hexapi find_addressable_item(const citem_t *i) const;
8082
8083 bool hexapi gather_derefs(const ctree_item_t &ci, udt_type_data_t *udm=nullptr) const;
8084 bool hexapi find_item_coords(const citem_t *item, int *px, int *py);
8085 bool locked() const { return (statebits & CFS_LOCKED) != 0; }
8087 bool hexapi serialize(bytevec_t *vout);
8088
8094 WARN_UNUSED_RESULT static cfunc_t *hexapi deserialize(
8095 mba_t *mba,
8096 const uchar *bytes,
8097 size_t nbytes);
8098
8099private:
8102 void hexapi cleanup();
8103 DECLARE_UNCOPYABLE(cfunc_t)
8104};
8106
8109#define DECOMP_NO_WAIT 0x0001
8110#define DECOMP_NO_CACHE 0x0002
8111#define DECOMP_NO_FRAME 0x0004
8112#define DECOMP_WARNINGS 0x0008
8113#define DECOMP_ALL_BLKS 0x0010
8114#define DECOMP_NO_HIDE 0x0020
8115#define DECOMP_GXREFS_DEFLT 0x0000
8119#define DECOMP_GXREFS_NOUPD 0x0040
8120#define DECOMP_GXREFS_FORCE 0x0080
8121#define DECOMP_VOID_MBA 0x0100
8122#define DECOMP_OUTLINE 0x80000000
8124
8127
8128void hexapi close_hexrays_waitbox();
8129
8130
8138
8139DEPRECATED cfuncptr_t hexapi decompile(
8140 const mba_ranges_t &mbr,
8141 hexrays_failure_t *hf=nullptr,
8142 int decomp_flags=0);
8143
8144
8152
8153cfuncptr_t hexapi decompile(
8154 const decomp_ranges_t &dcr,
8155 hexrays_failure_t *hf=nullptr,
8156 int decomp_flags=0);
8157
8158
8167
8168DEPRECATED inline cfuncptr_t decompile_func(
8169 func_t *pfn,
8170 hexrays_failure_t *hf=nullptr,
8171 int decomp_flags=0)
8172{
8173 GCC_DIAG_OFF(deprecated-declarations)
8174 MSC_DIAG_OFF(4996) // was declared deprecated
8175 mba_ranges_t mbr(pfn);
8176 return decompile(mbr, hf, decomp_flags);
8177 MSC_DIAG_ON(4996)
8178 GCC_DIAG_ON(deprecated-declarations)
8179}
8180
8181
8188
8190 const rangevec_t &ranges,
8191 hexrays_failure_t *hf=nullptr,
8192 int decomp_flags=0)
8193{
8194 decomp_ranges_t dcr(ranges);
8195 return decompile(dcr, hf, decomp_flags);
8196}
8197
8198
8199
8200
8209
8211 ea_t func_ea,
8212 hexrays_failure_t *hf=nullptr,
8213 int decomp_flags=0)
8214{
8215 decomp_ranges_t dcr(func_ea);
8216 return decompile(dcr, hf, decomp_flags);
8217}
8218
8219
8228
8229DEPRECATED mba_t *hexapi gen_microcode(
8230 const mba_ranges_t &mbr,
8231 hexrays_failure_t *hf=nullptr,
8232 const mlist_t *retlist=nullptr,
8233 int decomp_flags=0,
8235
8244
8245mba_t *hexapi gen_microcode(
8246 const decomp_ranges_t &dcr,
8247 hexrays_failure_t *hf=nullptr,
8248 const mlist_t *retlist=nullptr,
8249 int decomp_flags=0,
8251
8254DEPRECATED inline mba_t *create_empty_mba(
8255 const mba_ranges_t &mbr,
8256 hexrays_failure_t *hf=nullptr)
8257{
8258 GCC_DIAG_OFF(deprecated-declarations)
8259 MSC_DIAG_OFF(4996) // was declared deprecated
8260 return gen_microcode(mbr, hf, nullptr, DECOMP_VOID_MBA);
8261 MSC_DIAG_ON(4996)
8262 GCC_DIAG_ON(deprecated-declarations)
8263}
8264
8268 const decomp_ranges_t &dcr,
8269 hexrays_failure_t *hf=nullptr)
8270{
8271 return gen_microcode(dcr, hf, nullptr, DECOMP_VOID_MBA);
8272}
8273
8274
8278
8279cfuncptr_t hexapi create_cfunc(mba_t *mba);
8280
8281
8287
8288bool hexapi mark_cfunc_dirty(ea_t ea, bool close_views=false);
8289
8290
8292
8293void hexapi clear_cached_cfuncs();
8294
8295
8297
8298bool hexapi has_cached_cfunc(ea_t ea);
8299
8300
8303
8304void hexapi get_cached_cfunc_eas(eavec_t *out);
8305
8306//--------------------------------------------------------------------------
8307// Now cinsn_t class is defined, define the cleanup functions:
8308inline void cif_t::cleanup() { delete ithen; delete ielse; }
8309inline void cloop_t::cleanup() { delete body; }
8310
8315
8316inline void citem_t::print1(qstring *vout, const cfunc_t *func) const
8317{
8318 if ( is_expr() )
8319 ((cexpr_t*)this)->print1(vout, func);
8320 else
8321 ((cinsn_t*)this)->print1(vout, func);
8322}
8323
8326
8327inline bool cexpr_t::get_1num_op(cexpr_t **o1, cexpr_t **o2)
8328{
8329 if ( x->op == cot_num )
8330 {
8331 *o1 = x;
8332 *o2 = y;
8333 }
8334 else
8335 {
8336 if ( y->op != cot_num )
8337 return false;
8338 *o1 = y;
8339 *o2 = x;
8340 }
8341 return true;
8342}
8343
8344inline bool cexpr_t::get_1num_op(const cexpr_t **o1, const cexpr_t **o2) const
8345{
8346 return CONST_CAST(cexpr_t*)(this)->get_1num_op(
8347 CONST_CAST(cexpr_t**)(o1),
8348 CONST_CAST(cexpr_t**)(o2));
8349}
8350
8352 : ea(i != nullptr ? i->ea : BADADDR),
8353 op(i != nullptr ? i->op : cot_empty)
8354{
8355}
8356
8358{
8359 return empty() || back().is_ordinary_flow();
8360}
8361
8362const char *hexapi get_ctype_name(ctype_t op);
8363qstring hexapi create_field_name(const tinfo_t &type, uval_t offset=BADADDR);
8364typedef void *hexdsp_t(int code, ...);
8365const int64 HEXRAYS_API_MAGIC = 0x00DEC0DE00000005LL;
8366
8371enum hexrays_event_t ENUM_SIZE(int)
8372{
8373 // When a function is decompiled, the following events occur:
8374
8375 hxe_flowchart,
8382
8383 hxe_stkpnts,
8388
8389 hxe_prolog,
8397
8398 hxe_microcode,
8401
8402 hxe_preoptimized,
8405
8406 hxe_locopt,
8409
8410 hxe_prealloc,
8415
8416 hxe_glbopt,
8421
8422 hxe_pre_structural,
8427
8428 hxe_structural,
8430
8431 hxe_maturity,
8434
8435 hxe_interr,
8437
8438 hxe_combine,
8444
8445 hxe_print_func,
8450
8451 hxe_func_printed,
8457
8458 hxe_resolve_stkaddrs,
8460
8461 hxe_build_callinfo,
8467
8468 hxe_callinfo_built,
8470
8471 hxe_calls_done,
8476
8477 hxe_begin_inlining,
8482
8483 hxe_inlining_func,
8488
8489 hxe_inlined_func,
8496
8497 hxe_collect_warnings,
8502
8503 hxe_flowchart_ea,
8511
8512 hxe_prolog_ea,
8521
8522 hxe_inlining_function,
8528
8529 hxe_inlined_function,
8537
8538 // User interface related events:
8539
8540 hxe_open_pseudocode=100,
8543
8544 hxe_switch_pseudocode,
8548
8549 hxe_refresh_pseudocode,
8553
8554 hxe_close_pseudocode,
8556
8557 hxe_keyboard,
8562
8563 hxe_right_click,
8567
8568 hxe_double_click,
8572
8573 hxe_curpos,
8576
8577 hxe_create_hint,
8584
8585 hxe_text_ready,
8589
8590 hxe_populating_popup,
8594
8595 lxe_lvar_name_changed,
8602
8603 lxe_lvar_type_changed,
8609
8610 lxe_lvar_cmt_changed,
8616
8617 lxe_lvar_mapping_changed,
8623
8624 hxe_cmt_changed,
8628
8629 hxe_mba_maturity,
8633};
8634
8642
8643typedef ssize_t idaapi hexrays_cb_t(void *ud, hexrays_event_t event, va_list va);
8644
8645
8650
8651bool hexapi install_hexrays_callback(hexrays_cb_t *callback, void *ud);
8652
8658
8659int hexapi remove_hexrays_callback(hexrays_cb_t *callback, void *ud);
8660
8661
8662//---------------------------------------------------------------------------
8665
8673
8674
8675//---------------------------------------------------------------------------
8678{
8679 int lnnum;
8680 int x;
8681 int y;
8684 bool in_ctree(int hdrlines) const { return lnnum >= hdrlines; }
8687 {
8688 if ( lnnum < r.lnnum ) return -1;
8689 if ( lnnum > r.lnnum ) return 1;
8690 if ( x < r.x ) return -1;
8691 if ( x > r.x ) return 1;
8692 return 0;
8693 }
8694 ctext_position_t(int _lnnum=-1, int _x=0, int _y=0)
8695 : lnnum(_lnnum), x(_x), y(_y) {}
8696};
8697
8702{
8705 ea_t end = BADADDR;
8706 history_item_t(ea_t fea=BADADDR, ea_t cea=BADADDR, int _lnnum=-1, int _x=0, int _y=0)
8707 : ctext_position_t(_lnnum, _x, _y), func_ea(fea), curr_ea(cea) {}
8709 : ctext_position_t(p), func_ea(fea), curr_ea(cea) {}
8710};
8711
8714
8716typedef int cmt_type_t;
8717const cmt_type_t
8718 CMT_NONE = 0x0000,
8719 CMT_TAIL = 0x0001,
8720 CMT_BLOCK1 = 0x0002,
8721 CMT_BLOCK2 = 0x0004,
8722 CMT_LVAR = 0x0008,
8723 CMT_FUNC = 0x0010,
8724 CMT_ALL = 0x001F;
8725
8726//---------------------------------------------------------------------------
8729{
8730 int flags = 0;
8734#define VDUI_VISIBLE 0x0001
8735#define VDUI_VALID 0x0002
8737
8740 bool visible() const { return (flags & VDUI_VISIBLE) != 0; }
8743 bool valid() const { return (flags & VDUI_VALID) != 0; }
8748 bool locked() const { return cfunc != nullptr && cfunc->locked(); }
8749 void set_visible(bool v) { setflag(flags, VDUI_VISIBLE, v); }
8750 void set_valid(bool v) { setflag(flags, VDUI_VALID, v); }
8751 bool hexapi set_locked(bool v); // returns true-redecompiled
8752
8754 TWidget *ct = nullptr;
8755 TWidget *toplevel = nullptr;
8756
8760
8761 // The following fields are valid after get_current_item():
8766
8767 vdui_t(); // do not create your own vdui_t objects
8768
8777 void hexapi refresh_view(bool redo_mba);
8778
8784 void hexapi refresh_ctext(bool activate=true); // deprecated
8785
8791 void hexapi switch_to(cfuncptr_t f, bool activate);
8792
8796 bool in_ctree() const { return cpos.in_ctree(cfunc->hdrlines); }
8797
8803 cnumber_t *hexapi get_number();
8804
8809 int hexapi get_current_label();
8810
8813 void hexapi clear();
8814
8819 bool hexapi refresh_cpos(input_device_t idv);
8820
8826 bool hexapi get_current_item(input_device_t idv);
8827
8832 bool hexapi ui_rename_lvar(lvar_t *v);
8833
8842 bool hexapi rename_lvar(lvar_t *v, const char *name, bool is_user_name);
8843
8849 bool hexapi ui_set_call_type(const cexpr_t *e);
8850
8856 bool hexapi ui_set_lvar_type(lvar_t *v);
8857
8864 bool hexapi set_lvar_type(lvar_t *v, const tinfo_t &type);
8865
8871 bool hexapi set_noptr_lvar(lvar_t *v);
8872
8878 bool hexapi ui_edit_lvar_cmt(lvar_t *v);
8879
8885 bool hexapi set_lvar_cmt(lvar_t *v, const char *cmt);
8886
8891 bool hexapi ui_map_lvar(lvar_t *v);
8892
8898 bool hexapi ui_unmap_lvar(lvar_t *v);
8899
8904 bool hexapi ui_add_cast(cexpr_t *e);
8905
8909 bool hexapi ui_noprop_lvar(lvar_t *v);
8910
8917 bool hexapi map_lvar(lvar_t *from, lvar_t *to);
8918
8925 bool hexapi set_udm_type(const tinfo_t &udt_type, int udm_idx);
8926
8933 bool hexapi rename_udm(const tinfo_t &udt_type, int udm_idx);
8934
8940 bool hexapi set_global_type(ea_t ea);
8941
8947 bool hexapi rename_global(ea_t ea);
8948
8954 bool hexapi rename_label(int label);
8955
8963 bool hexapi jump_enter(input_device_t idv, int omflags);
8964
8970 bool hexapi ctree_to_disasm();
8971
8980 cmt_type_t hexapi calc_cmt_type(size_t lnnum, cmt_type_t cmttype) const;
8981
8987 bool hexapi edit_cmt(const treeloc_t &loc);
8988
8993 bool hexapi edit_func_cmt();
8994
8998 bool hexapi del_orphan_cmts();
8999
9005 bool hexapi set_num_radix(int base);
9006
9011 bool hexapi set_num_enum();
9012
9016 bool hexapi set_num_stroff();
9017
9021 bool hexapi invert_sign();
9022
9026 bool hexapi invert_bits();
9027
9031 bool hexapi collapse_item(bool hide);
9032
9035 bool hexapi collapse_lvars(bool hide);
9036
9040 bool hexapi split_item(bool split);
9041
9042};
9043
9044//---------------------------------------------------------------------------
9046
9049{
9052 bool operator==(const ui_stroff_op_t &r) const
9053 {
9054 return text == r.text && offset == r.offset;
9055 }
9056 bool operator!=(const ui_stroff_op_t &r) const { return !(*this == r); }
9057};
9060
9064{
9070 virtual bool idaapi apply(size_t opnum, const intvec_t &path, const tinfo_t &top_tif, const char *spath) = 0;
9071};
9072
9078int hexapi select_udt_by_offset(
9079 const qvector<tinfo_t> *udts,
9080 const ui_stroff_ops_t &ops,
9081 ui_stroff_applicator_t &applicator);
9082
9083
9084
9085
9086//--------------------------------------------------------------------------
9087// PUBLIC HEX-RAYS API
9088//--------------------------------------------------------------------------
9089
9092typedef void *hexdsp_t(int code, ...);
9093
9096{
9762};
9763
9764typedef size_t iterator_word;
9765
9766//--------------------------------------------------------------------------
9771inline bool init_hexrays_plugin(int flags=0)
9772{
9773 hexdsp_t *dummy;
9774 return callui(ui_broadcast, HEXRAYS_API_MAGIC, &dummy, flags).i == (HEXRAYS_API_MAGIC >> 32);
9775}
9776
9777//--------------------------------------------------------------------------
9780{
9781}
9782
9783
9784//-------------------------------------------------------------------------
9786{
9788 bool operator==(const user_numforms_iterator_t &p) const { return x == p.x; }
9789 bool operator!=(const user_numforms_iterator_t &p) const { return x != p.x; }
9790};
9791
9792//-------------------------------------------------------------------------
9798
9799//-------------------------------------------------------------------------
9805
9806//-------------------------------------------------------------------------
9809{
9811 HEXDSP(hx_user_numforms_find, &p, map, &key);
9812 return p;
9813}
9814
9815//-------------------------------------------------------------------------
9818{
9820 HEXDSP(hx_user_numforms_insert, &p, map, &key, &val);
9821 return p;
9822}
9823
9824//-------------------------------------------------------------------------
9827{
9829 HEXDSP(hx_user_numforms_begin, &p, map);
9830 return p;
9831}
9832
9833//-------------------------------------------------------------------------
9836{
9838 HEXDSP(hx_user_numforms_end, &p, map);
9839 return p;
9840}
9841
9842//-------------------------------------------------------------------------
9849
9850//-------------------------------------------------------------------------
9857
9858//-------------------------------------------------------------------------
9861{
9862 HEXDSP(hx_user_numforms_erase, map, &p);
9863}
9864
9865//-------------------------------------------------------------------------
9868{
9869 HEXDSP(hx_user_numforms_clear, map);
9870}
9871
9872//-------------------------------------------------------------------------
9875{
9876 return (size_t)HEXDSP(hx_user_numforms_size, map);
9877}
9878
9879//-------------------------------------------------------------------------
9882{
9883 HEXDSP(hx_user_numforms_free, map);
9884}
9885
9886//-------------------------------------------------------------------------
9889{
9890 return (user_numforms_t *)HEXDSP(hx_user_numforms_new);
9891}
9892
9893//-------------------------------------------------------------------------
9895{
9897 bool operator==(const lvar_mapping_iterator_t &p) const { return x == p.x; }
9898 bool operator!=(const lvar_mapping_iterator_t &p) const { return x != p.x; }
9899};
9900
9901//-------------------------------------------------------------------------
9907
9908//-------------------------------------------------------------------------
9914
9915//-------------------------------------------------------------------------
9918{
9920 HEXDSP(hx_lvar_mapping_find, &p, map, &key);
9921 return p;
9922}
9923
9924//-------------------------------------------------------------------------
9927{
9929 HEXDSP(hx_lvar_mapping_insert, &p, map, &key, &val);
9930 return p;
9931}
9932
9933//-------------------------------------------------------------------------
9936{
9938 HEXDSP(hx_lvar_mapping_begin, &p, map);
9939 return p;
9940}
9941
9942//-------------------------------------------------------------------------
9945{
9947 HEXDSP(hx_lvar_mapping_end, &p, map);
9948 return p;
9949}
9950
9951//-------------------------------------------------------------------------
9954{
9955 HEXDSP(hx_lvar_mapping_next, &p);
9956 return p;
9957}
9958
9959//-------------------------------------------------------------------------
9962{
9963 HEXDSP(hx_lvar_mapping_prev, &p);
9964 return p;
9965}
9966
9967//-------------------------------------------------------------------------
9970{
9971 HEXDSP(hx_lvar_mapping_erase, map, &p);
9972}
9973
9974//-------------------------------------------------------------------------
9977{
9978 HEXDSP(hx_lvar_mapping_clear, map);
9979}
9980
9981//-------------------------------------------------------------------------
9984{
9985 return (size_t)HEXDSP(hx_lvar_mapping_size, map);
9986}
9987
9988//-------------------------------------------------------------------------
9991{
9992 HEXDSP(hx_lvar_mapping_free, map);
9993}
9994
9995//-------------------------------------------------------------------------
9998{
9999 return (lvar_mapping_t *)HEXDSP(hx_lvar_mapping_new);
10000}
10001
10002//-------------------------------------------------------------------------
10004{
10006 bool operator==(const udcall_map_iterator_t &p) const { return x == p.x; }
10007 bool operator!=(const udcall_map_iterator_t &p) const { return x != p.x; }
10008};
10009
10010//-------------------------------------------------------------------------
10013{
10014 return *(ea_t *)HEXDSP(hx_udcall_map_first, &p);
10015}
10016
10017//-------------------------------------------------------------------------
10020{
10021 return *(udcall_t *)HEXDSP(hx_udcall_map_second, &p);
10022}
10023
10024//-------------------------------------------------------------------------
10027{
10029 HEXDSP(hx_udcall_map_find, &p, map, &key);
10030 return p;
10031}
10032
10033//-------------------------------------------------------------------------
10036{
10038 HEXDSP(hx_udcall_map_insert, &p, map, &key, &val);
10039 return p;
10040}
10041
10042//-------------------------------------------------------------------------
10045{
10047 HEXDSP(hx_udcall_map_begin, &p, map);
10048 return p;
10049}
10050
10051//-------------------------------------------------------------------------
10054{
10056 HEXDSP(hx_udcall_map_end, &p, map);
10057 return p;
10058}
10059
10060//-------------------------------------------------------------------------
10063{
10064 HEXDSP(hx_udcall_map_next, &p);
10065 return p;
10066}
10067
10068//-------------------------------------------------------------------------
10071{
10072 HEXDSP(hx_udcall_map_prev, &p);
10073 return p;
10074}
10075
10076//-------------------------------------------------------------------------
10079{
10080 HEXDSP(hx_udcall_map_erase, map, &p);
10081}
10082
10083//-------------------------------------------------------------------------
10086{
10087 HEXDSP(hx_udcall_map_clear, map);
10088}
10089
10090//-------------------------------------------------------------------------
10093{
10094 return (size_t)HEXDSP(hx_udcall_map_size, map);
10095}
10096
10097//-------------------------------------------------------------------------
10100{
10101 HEXDSP(hx_udcall_map_free, map);
10102}
10103
10104//-------------------------------------------------------------------------
10107{
10108 return (udcall_map_t *)HEXDSP(hx_udcall_map_new);
10109}
10110
10111//-------------------------------------------------------------------------
10113{
10115 bool operator==(const user_cmts_iterator_t &p) const { return x == p.x; }
10116 bool operator!=(const user_cmts_iterator_t &p) const { return x != p.x; }
10117};
10118
10119//-------------------------------------------------------------------------
10122{
10123 return *(treeloc_t *)HEXDSP(hx_user_cmts_first, &p);
10124}
10125
10126//-------------------------------------------------------------------------
10129{
10130 return *(citem_cmt_t *)HEXDSP(hx_user_cmts_second, &p);
10131}
10132
10133//-------------------------------------------------------------------------
10136{
10138 HEXDSP(hx_user_cmts_find, &p, map, &key);
10139 return p;
10140}
10141
10142//-------------------------------------------------------------------------
10145{
10147 HEXDSP(hx_user_cmts_insert, &p, map, &key, &val);
10148 return p;
10149}
10150
10151//-------------------------------------------------------------------------
10154{
10156 HEXDSP(hx_user_cmts_begin, &p, map);
10157 return p;
10158}
10159
10160//-------------------------------------------------------------------------
10163{
10165 HEXDSP(hx_user_cmts_end, &p, map);
10166 return p;
10167}
10168
10169//-------------------------------------------------------------------------
10172{
10173 HEXDSP(hx_user_cmts_next, &p);
10174 return p;
10175}
10176
10177//-------------------------------------------------------------------------
10180{
10181 HEXDSP(hx_user_cmts_prev, &p);
10182 return p;
10183}
10184
10185//-------------------------------------------------------------------------
10188{
10189 HEXDSP(hx_user_cmts_erase, map, &p);
10190}
10191
10192//-------------------------------------------------------------------------
10195{
10196 HEXDSP(hx_user_cmts_clear, map);
10197}
10198
10199//-------------------------------------------------------------------------
10201inline size_t user_cmts_size(user_cmts_t *map)
10202{
10203 return (size_t)HEXDSP(hx_user_cmts_size, map);
10204}
10205
10206//-------------------------------------------------------------------------
10209{
10210 HEXDSP(hx_user_cmts_free, map);
10211}
10212
10213//-------------------------------------------------------------------------
10216{
10217 return (user_cmts_t *)HEXDSP(hx_user_cmts_new);
10218}
10219
10220//-------------------------------------------------------------------------
10222{
10224 bool operator==(const user_iflags_iterator_t &p) const { return x == p.x; }
10225 bool operator!=(const user_iflags_iterator_t &p) const { return x != p.x; }
10226};
10227
10228//-------------------------------------------------------------------------
10231{
10232 return *(citem_locator_t *)HEXDSP(hx_user_iflags_first, &p);
10233}
10234
10235//-------------------------------------------------------------------------
10238{
10239 return *(int32 *)HEXDSP(hx_user_iflags_second, &p);
10240}
10241
10242//-------------------------------------------------------------------------
10245{
10247 HEXDSP(hx_user_iflags_find, &p, map, &key);
10248 return p;
10249}
10250
10251//-------------------------------------------------------------------------
10254{
10256 HEXDSP(hx_user_iflags_insert, &p, map, &key, &val);
10257 return p;
10258}
10259
10260//-------------------------------------------------------------------------
10263{
10265 HEXDSP(hx_user_iflags_begin, &p, map);
10266 return p;
10267}
10268
10269//-------------------------------------------------------------------------
10272{
10274 HEXDSP(hx_user_iflags_end, &p, map);
10275 return p;
10276}
10277
10278//-------------------------------------------------------------------------
10281{
10282 HEXDSP(hx_user_iflags_next, &p);
10283 return p;
10284}
10285
10286//-------------------------------------------------------------------------
10289{
10290 HEXDSP(hx_user_iflags_prev, &p);
10291 return p;
10292}
10293
10294//-------------------------------------------------------------------------
10297{
10298 HEXDSP(hx_user_iflags_erase, map, &p);
10299}
10300
10301//-------------------------------------------------------------------------
10304{
10305 HEXDSP(hx_user_iflags_clear, map);
10306}
10307
10308//-------------------------------------------------------------------------
10311{
10312 return (size_t)HEXDSP(hx_user_iflags_size, map);
10313}
10314
10315//-------------------------------------------------------------------------
10318{
10319 HEXDSP(hx_user_iflags_free, map);
10320}
10321
10322//-------------------------------------------------------------------------
10325{
10326 return (user_iflags_t *)HEXDSP(hx_user_iflags_new);
10327}
10328
10329//-------------------------------------------------------------------------
10331{
10333 bool operator==(const user_casts_iterator_t &p) const { return x == p.x; }
10334 bool operator!=(const user_casts_iterator_t &p) const { return x != p.x; }
10335};
10336
10337//-------------------------------------------------------------------------
10340{
10341 return *(citem_locator_t *)HEXDSP(hx_user_casts_first, &p);
10342}
10343
10344//-------------------------------------------------------------------------
10347{
10348 return *(tinfo_t *)HEXDSP(hx_user_casts_second, &p);
10349}
10350
10351//-------------------------------------------------------------------------
10354{
10356 HEXDSP(hx_user_casts_find, &p, map, &key);
10357 return p;
10358}
10359
10360//-------------------------------------------------------------------------
10363{
10365 HEXDSP(hx_user_casts_insert, &p, map, &key, &val);
10366 return p;
10367}
10368
10369//-------------------------------------------------------------------------
10372{
10374 HEXDSP(hx_user_casts_begin, &p, map);
10375 return p;
10376}
10377
10378//-------------------------------------------------------------------------
10381{
10383 HEXDSP(hx_user_casts_end, &p, map);
10384 return p;
10385}
10386
10387//-------------------------------------------------------------------------
10390{
10391 HEXDSP(hx_user_casts_next, &p);
10392 return p;
10393}
10394
10395//-------------------------------------------------------------------------
10398{
10399 HEXDSP(hx_user_casts_prev, &p);
10400 return p;
10401}
10402
10403//-------------------------------------------------------------------------
10406{
10407 HEXDSP(hx_user_casts_erase, map, &p);
10408}
10409
10410//-------------------------------------------------------------------------
10413{
10414 HEXDSP(hx_user_casts_clear, map);
10415}
10416
10417//-------------------------------------------------------------------------
10420{
10421 return (size_t)HEXDSP(hx_user_casts_size, map);
10422}
10423
10424//-------------------------------------------------------------------------
10427{
10428 HEXDSP(hx_user_casts_free, map);
10429}
10430
10431//-------------------------------------------------------------------------
10434{
10435 return (user_casts_t *)HEXDSP(hx_user_casts_new);
10436}
10437
10438//-------------------------------------------------------------------------
10440{
10442 bool operator==(const user_unions_iterator_t &p) const { return x == p.x; }
10443 bool operator!=(const user_unions_iterator_t &p) const { return x != p.x; }
10444};
10445
10446//-------------------------------------------------------------------------
10449{
10450 return *(ea_t *)HEXDSP(hx_user_unions_first, &p);
10451}
10452
10453//-------------------------------------------------------------------------
10456{
10457 return *(intvec_t *)HEXDSP(hx_user_unions_second, &p);
10458}
10459
10460//-------------------------------------------------------------------------
10463{
10465 HEXDSP(hx_user_unions_find, &p, map, &key);
10466 return p;
10467}
10468
10469//-------------------------------------------------------------------------
10472{
10474 HEXDSP(hx_user_unions_insert, &p, map, &key, &val);
10475 return p;
10476}
10477
10478//-------------------------------------------------------------------------
10481{
10483 HEXDSP(hx_user_unions_begin, &p, map);
10484 return p;
10485}
10486
10487//-------------------------------------------------------------------------
10490{
10492 HEXDSP(hx_user_unions_end, &p, map);
10493 return p;
10494}
10495
10496//-------------------------------------------------------------------------
10499{
10500 HEXDSP(hx_user_unions_next, &p);
10501 return p;
10502}
10503
10504//-------------------------------------------------------------------------
10507{
10508 HEXDSP(hx_user_unions_prev, &p);
10509 return p;
10510}
10511
10512//-------------------------------------------------------------------------
10515{
10516 HEXDSP(hx_user_unions_erase, map, &p);
10517}
10518
10519//-------------------------------------------------------------------------
10522{
10523 HEXDSP(hx_user_unions_clear, map);
10524}
10525
10526//-------------------------------------------------------------------------
10529{
10530 return (size_t)HEXDSP(hx_user_unions_size, map);
10531}
10532
10533//-------------------------------------------------------------------------
10536{
10537 HEXDSP(hx_user_unions_free, map);
10538}
10539
10540//-------------------------------------------------------------------------
10543{
10544 return (user_unions_t *)HEXDSP(hx_user_unions_new);
10545}
10546
10547//-------------------------------------------------------------------------
10549{
10551 bool operator==(const user_labels_iterator_t &p) const { return x == p.x; }
10552 bool operator!=(const user_labels_iterator_t &p) const { return x != p.x; }
10553};
10554
10555//-------------------------------------------------------------------------
10558{
10559 return *(int *)HEXDSP(hx_user_labels_first, &p);
10560}
10561
10562//-------------------------------------------------------------------------
10565{
10566 return *(qstring *)HEXDSP(hx_user_labels_second, &p);
10567}
10568
10569//-------------------------------------------------------------------------
10572{
10574 HEXDSP(hx_user_labels_find, &p, map, &key);
10575 return p;
10576}
10577
10578//-------------------------------------------------------------------------
10580inline user_labels_iterator_t user_labels_insert(user_labels_t *map, const int &key, const qstring &val)
10581{
10583 HEXDSP(hx_user_labels_insert, &p, map, &key, &val);
10584 return p;
10585}
10586
10587//-------------------------------------------------------------------------
10590{
10592 HEXDSP(hx_user_labels_begin, &p, map);
10593 return p;
10594}
10595
10596//-------------------------------------------------------------------------
10599{
10601 HEXDSP(hx_user_labels_end, &p, map);
10602 return p;
10603}
10604
10605//-------------------------------------------------------------------------
10608{
10609 HEXDSP(hx_user_labels_next, &p);
10610 return p;
10611}
10612
10613//-------------------------------------------------------------------------
10616{
10617 HEXDSP(hx_user_labels_prev, &p);
10618 return p;
10619}
10620
10621//-------------------------------------------------------------------------
10624{
10625 HEXDSP(hx_user_labels_erase, map, &p);
10626}
10627
10628//-------------------------------------------------------------------------
10631{
10632 HEXDSP(hx_user_labels_clear, map);
10633}
10634
10635//-------------------------------------------------------------------------
10638{
10639 return (size_t)HEXDSP(hx_user_labels_size, map);
10640}
10641
10642//-------------------------------------------------------------------------
10645{
10646 HEXDSP(hx_user_labels_free, map);
10647}
10648
10649//-------------------------------------------------------------------------
10652{
10653 return (user_labels_t *)HEXDSP(hx_user_labels_new);
10654}
10655
10656//-------------------------------------------------------------------------
10658{
10660 bool operator==(const eamap_iterator_t &p) const { return x == p.x; }
10661 bool operator!=(const eamap_iterator_t &p) const { return x != p.x; }
10662};
10663
10664//-------------------------------------------------------------------------
10667{
10668 return *(ea_t *)HEXDSP(hx_eamap_first, &p);
10669}
10670
10671//-------------------------------------------------------------------------
10674{
10675 return *(cinsnptrvec_t *)HEXDSP(hx_eamap_second, &p);
10676}
10677
10678//-------------------------------------------------------------------------
10680inline eamap_iterator_t eamap_find(const eamap_t *map, const ea_t &key)
10681{
10683 HEXDSP(hx_eamap_find, &p, map, &key);
10684 return p;
10685}
10686
10687//-------------------------------------------------------------------------
10689inline eamap_iterator_t eamap_insert(eamap_t *map, const ea_t &key, const cinsnptrvec_t &val)
10690{
10692 HEXDSP(hx_eamap_insert, &p, map, &key, &val);
10693 return p;
10694}
10695
10696//-------------------------------------------------------------------------
10699{
10701 HEXDSP(hx_eamap_begin, &p, map);
10702 return p;
10703}
10704
10705//-------------------------------------------------------------------------
10708{
10710 HEXDSP(hx_eamap_end, &p, map);
10711 return p;
10712}
10713
10714//-------------------------------------------------------------------------
10717{
10718 HEXDSP(hx_eamap_next, &p);
10719 return p;
10720}
10721
10722//-------------------------------------------------------------------------
10725{
10726 HEXDSP(hx_eamap_prev, &p);
10727 return p;
10728}
10729
10730//-------------------------------------------------------------------------
10733{
10734 HEXDSP(hx_eamap_erase, map, &p);
10735}
10736
10737//-------------------------------------------------------------------------
10739inline void eamap_clear(eamap_t *map)
10740{
10741 HEXDSP(hx_eamap_clear, map);
10742}
10743
10744//-------------------------------------------------------------------------
10746inline size_t eamap_size(eamap_t *map)
10747{
10748 return (size_t)HEXDSP(hx_eamap_size, map);
10749}
10750
10751//-------------------------------------------------------------------------
10753inline void eamap_free(eamap_t *map)
10754{
10755 HEXDSP(hx_eamap_free, map);
10756}
10757
10758//-------------------------------------------------------------------------
10761{
10762 return (eamap_t *)HEXDSP(hx_eamap_new);
10763}
10764
10765//-------------------------------------------------------------------------
10767{
10769 bool operator==(const boundaries_iterator_t &p) const { return x == p.x; }
10770 bool operator!=(const boundaries_iterator_t &p) const { return x != p.x; }
10771};
10772
10773//-------------------------------------------------------------------------
10776{
10777 return *(cinsn_t * *)HEXDSP(hx_boundaries_first, &p);
10778}
10779
10780//-------------------------------------------------------------------------
10783{
10784 return *(rangeset_t *)HEXDSP(hx_boundaries_second, &p);
10785}
10786
10787//-------------------------------------------------------------------------
10790{
10792 HEXDSP(hx_boundaries_find, &p, map, &key);
10793 return p;
10794}
10795
10796//-------------------------------------------------------------------------
10798inline boundaries_iterator_t boundaries_insert(boundaries_t *map, const cinsn_t * &key, const rangeset_t &val)
10799{
10801 HEXDSP(hx_boundaries_insert, &p, map, &key, &val);
10802 return p;
10803}
10804
10805//-------------------------------------------------------------------------
10808{
10810 HEXDSP(hx_boundaries_begin, &p, map);
10811 return p;
10812}
10813
10814//-------------------------------------------------------------------------
10817{
10819 HEXDSP(hx_boundaries_end, &p, map);
10820 return p;
10821}
10822
10823//-------------------------------------------------------------------------
10826{
10827 HEXDSP(hx_boundaries_next, &p);
10828 return p;
10829}
10830
10831//-------------------------------------------------------------------------
10834{
10835 HEXDSP(hx_boundaries_prev, &p);
10836 return p;
10837}
10838
10839//-------------------------------------------------------------------------
10842{
10843 HEXDSP(hx_boundaries_erase, map, &p);
10844}
10845
10846//-------------------------------------------------------------------------
10849{
10850 HEXDSP(hx_boundaries_clear, map);
10851}
10852
10853//-------------------------------------------------------------------------
10856{
10857 return (size_t)HEXDSP(hx_boundaries_size, map);
10858}
10859
10860//-------------------------------------------------------------------------
10863{
10864 HEXDSP(hx_boundaries_free, map);
10865}
10866
10867//-------------------------------------------------------------------------
10870{
10871 return (boundaries_t *)HEXDSP(hx_boundaries_new);
10872}
10873
10874//-------------------------------------------------------------------------
10876{
10878 bool operator==(const block_chains_iterator_t &p) const { return x == p.x; }
10879 bool operator!=(const block_chains_iterator_t &p) const { return x != p.x; }
10880};
10881
10882//-------------------------------------------------------------------------
10885{
10886 return *(chain_t *)HEXDSP(hx_block_chains_get, &p);
10887}
10888
10889//-------------------------------------------------------------------------
10892{
10894 HEXDSP(hx_block_chains_find, &p, set, &val);
10895 return p;
10896}
10897
10898//-------------------------------------------------------------------------
10901{
10903 HEXDSP(hx_block_chains_insert, &p, set, &val);
10904 return p;
10905}
10906
10907//-------------------------------------------------------------------------
10910{
10912 HEXDSP(hx_block_chains_begin, &p, set);
10913 return p;
10914}
10915
10916//-------------------------------------------------------------------------
10919{
10921 HEXDSP(hx_block_chains_end, &p, set);
10922 return p;
10923}
10924
10925//-------------------------------------------------------------------------
10928{
10929 HEXDSP(hx_block_chains_next, &p);
10930 return p;
10931}
10932
10933//-------------------------------------------------------------------------
10936{
10937 HEXDSP(hx_block_chains_prev, &p);
10938 return p;
10939}
10940
10941//-------------------------------------------------------------------------
10944{
10945 HEXDSP(hx_block_chains_erase, set, &p);
10946}
10947
10948//-------------------------------------------------------------------------
10951{
10952 HEXDSP(hx_block_chains_clear, set);
10953}
10954
10955//-------------------------------------------------------------------------
10958{
10959 return (size_t)HEXDSP(hx_block_chains_size, set);
10960}
10961
10962//-------------------------------------------------------------------------
10965{
10966 HEXDSP(hx_block_chains_free, set);
10967}
10968
10969//-------------------------------------------------------------------------
10972{
10973 return (block_chains_t *)HEXDSP(hx_block_chains_new);
10974}
10975
10976//--------------------------------------------------------------------------
10977inline void *hexrays_alloc(size_t size)
10978{
10979 return HEXDSP(hx_hexrays_alloc, size);
10980}
10981
10982//--------------------------------------------------------------------------
10983inline void hexrays_free(void *ptr)
10984{
10985 HEXDSP(hx_hexrays_free, ptr);
10986}
10987
10988//--------------------------------------------------------------------------
10989inline void valrng_t::clear()
10990{
10991 HEXDSP(hx_valrng_t_clear, this);
10992}
10993
10994//--------------------------------------------------------------------------
10995inline void valrng_t::copy(const valrng_t &r)
10996{
10997 HEXDSP(hx_valrng_t_copy, this, &r);
10998}
10999
11000//--------------------------------------------------------------------------
11002{
11003 return *(valrng_t *)HEXDSP(hx_valrng_t_assign, this, &r);
11004}
11005
11006//--------------------------------------------------------------------------
11007inline int valrng_t::compare(const valrng_t &r) const
11008{
11009 return (int)(size_t)HEXDSP(hx_valrng_t_compare, this, &r);
11010}
11011
11012//--------------------------------------------------------------------------
11014{
11015 HEXDSP(hx_valrng_t_set_eq, this, v);
11016}
11017
11018//--------------------------------------------------------------------------
11019inline void valrng_t::set_cmp(cmpop_t cmp, uvlr_t _value)
11020{
11021 HEXDSP(hx_valrng_t_set_cmp, this, cmp, _value);
11022}
11023
11024//--------------------------------------------------------------------------
11025inline bool valrng_t::reduce_size(int new_size)
11026{
11027 return (uchar)(size_t)HEXDSP(hx_valrng_t_reduce_size, this, new_size) != 0;
11028}
11029
11030//--------------------------------------------------------------------------
11032{
11033 return (uchar)(size_t)HEXDSP(hx_valrng_t_intersect_with, this, &r) != 0;
11034}
11035
11036//--------------------------------------------------------------------------
11037inline bool valrng_t::unite_with(const valrng_t &r)
11038{
11039 return (uchar)(size_t)HEXDSP(hx_valrng_t_unite_with, this, &r) != 0;
11040}
11041
11042//--------------------------------------------------------------------------
11044{
11045 HEXDSP(hx_valrng_t_inverse, this);
11046}
11047
11048//--------------------------------------------------------------------------
11049inline bool valrng_t::has(uvlr_t v) const
11050{
11051 return (uchar)(size_t)HEXDSP(hx_valrng_t_has, this, v) != 0;
11052}
11053
11054//--------------------------------------------------------------------------
11055inline void valrng_t::print(qstring *vout) const
11056{
11057 HEXDSP(hx_valrng_t_print, this, vout);
11058}
11059
11060//--------------------------------------------------------------------------
11061inline const char *valrng_t::dstr() const
11062{
11063 return (const char *)HEXDSP(hx_valrng_t_dstr, this);
11064}
11065
11066//--------------------------------------------------------------------------
11068{
11069 return (uchar)(size_t)HEXDSP(hx_valrng_t_cvt_to_single_value, this, v) != 0;
11070}
11071
11072//--------------------------------------------------------------------------
11073inline bool valrng_t::cvt_to_cmp(cmpop_t *cmp, uvlr_t *val) const
11074{
11075 return (uchar)(size_t)HEXDSP(hx_valrng_t_cvt_to_cmp, this, cmp, val) != 0;
11076}
11077
11078//--------------------------------------------------------------------------
11080{
11081 ea_t retval;
11082 HEXDSP(hx_get_merror_desc, &retval, out, code, mba);
11083 return retval;
11084}
11085
11086//--------------------------------------------------------------------------
11088{
11089 qstring retval;
11090 HEXDSP(hx_hexrays_failure_t_desc, &retval, this);
11091 return retval;
11092}
11093
11094//--------------------------------------------------------------------------
11095inline THREAD_SAFE bool must_mcode_close_block(mcode_t mcode, bool including_calls)
11096{
11097 return (uchar)(size_t)HEXDSP(hx_must_mcode_close_block, mcode, including_calls) != 0;
11098}
11099
11100//--------------------------------------------------------------------------
11101inline THREAD_SAFE bool is_mcode_propagatable(mcode_t mcode)
11102{
11103 return (uchar)(size_t)HEXDSP(hx_is_mcode_propagatable, mcode) != 0;
11104}
11105
11106//--------------------------------------------------------------------------
11108{
11109 return (mcode_t)(size_t)HEXDSP(hx_negate_mcode_relation, code);
11110}
11111
11112//--------------------------------------------------------------------------
11114{
11115 return (mcode_t)(size_t)HEXDSP(hx_swap_mcode_relation, code);
11116}
11117
11118//--------------------------------------------------------------------------
11120{
11121 return (mcode_t)(size_t)HEXDSP(hx_get_signed_mcode, code);
11122}
11123
11124//--------------------------------------------------------------------------
11126{
11127 return (mcode_t)(size_t)HEXDSP(hx_get_unsigned_mcode, code);
11128}
11129
11130//--------------------------------------------------------------------------
11131inline THREAD_SAFE bool mcode_modifies_d(mcode_t mcode)
11132{
11133 return (uchar)(size_t)HEXDSP(hx_mcode_modifies_d, mcode) != 0;
11134}
11135
11136//--------------------------------------------------------------------------
11137inline int operand_locator_t::compare(const operand_locator_t &r) const
11138{
11139 return (int)(size_t)HEXDSP(hx_operand_locator_t_compare, this, &r);
11140}
11141
11142//--------------------------------------------------------------------------
11143inline AS_PRINTF(3, 4) int vd_printer_t::print(int indent, const char *format, ...)
11144{
11145 va_list va;
11146 va_start(va, format);
11147 int retval = (int)(size_t)HEXDSP(hx_vd_printer_t_print, this, indent, format, va);
11148 va_end(va);
11149 return retval;
11150}
11151
11152//--------------------------------------------------------------------------
11153inline AS_PRINTF(3, 4) int file_printer_t::print(int indent, const char *format, ...)
11154{
11155 va_list va;
11156 va_start(va, format);
11157 int retval = (int)(size_t)HEXDSP(hx_file_printer_t_print, this, indent, format, va);
11158 va_end(va);
11159 return retval;
11160}
11161
11162//--------------------------------------------------------------------------
11163inline AS_PRINTF(3, 4) int qstring_printer_t::print(int indent, const char *format, ...)
11164{
11165 va_list va;
11166 va_start(va, format);
11167 int retval = (int)(size_t)HEXDSP(hx_qstring_printer_t_print, this, indent, format, va);
11168 va_end(va);
11169 return retval;
11170}
11171
11172//--------------------------------------------------------------------------
11173inline const char *dstr(const tinfo_t *tif)
11174{
11175 return (const char *)HEXDSP(hx_dstr, tif);
11176}
11177
11178//--------------------------------------------------------------------------
11179inline bool is_type_correct(const type_t *ptr)
11180{
11181 return (uchar)(size_t)HEXDSP(hx_is_type_correct, ptr) != 0;
11182}
11183
11184//--------------------------------------------------------------------------
11185inline bool is_small_udt(const tinfo_t &tif)
11186{
11187 return (uchar)(size_t)HEXDSP(hx_is_small_udt, &tif) != 0;
11188}
11189
11190//--------------------------------------------------------------------------
11191inline bool is_nonbool_type(const tinfo_t &type)
11192{
11193 return (uchar)(size_t)HEXDSP(hx_is_nonbool_type, &type) != 0;
11194}
11195
11196//--------------------------------------------------------------------------
11197inline bool is_bool_type(const tinfo_t &type)
11198{
11199 return (uchar)(size_t)HEXDSP(hx_is_bool_type, &type) != 0;
11200}
11201
11202//--------------------------------------------------------------------------
11204{
11205 return (int)(size_t)HEXDSP(hx_partial_type_num, &type);
11206}
11207
11208//--------------------------------------------------------------------------
11209inline tinfo_t get_float_type(size_t width)
11210{
11211 tinfo_t retval;
11212 HEXDSP(hx_get_float_type, &retval, width);
11213 return retval;
11214}
11215
11216//--------------------------------------------------------------------------
11218{
11219 tinfo_t retval;
11220 HEXDSP(hx_get_int_type_by_width_and_sign, &retval, srcwidth, sign);
11221 return retval;
11222}
11223
11224//--------------------------------------------------------------------------
11226{
11227 tinfo_t retval;
11228 HEXDSP(hx_get_unk_type, &retval, size);
11229 return retval;
11230}
11231
11232//--------------------------------------------------------------------------
11233inline tinfo_t dummy_ptrtype(size_t ptrsize, bool isfp)
11234{
11235 tinfo_t retval;
11236 HEXDSP(hx_dummy_ptrtype, &retval, ptrsize, isfp);
11237 return retval;
11238}
11239
11240//--------------------------------------------------------------------------
11242{
11243 tinfo_t retval;
11244 HEXDSP(hx_make_pointer, &retval, &type);
11245 return retval;
11246}
11247
11248//--------------------------------------------------------------------------
11249inline tinfo_t create_typedef(const char *name)
11250{
11251 tinfo_t retval;
11252 HEXDSP(hx_create_typedef, &retval, name);
11253 return retval;
11254}
11255
11256//--------------------------------------------------------------------------
11257inline bool get_type(uval_t id, tinfo_t *tif, type_source_t guess)
11258{
11259 return (uchar)(size_t)HEXDSP(hx_get_type, id, tif, guess) != 0;
11260}
11261
11262//--------------------------------------------------------------------------
11263inline bool set_type(uval_t id, const tinfo_t &tif, type_source_t source, bool force)
11264{
11265 return (uchar)(size_t)HEXDSP(hx_set_type, id, &tif, source, force) != 0;
11266}
11267
11268//--------------------------------------------------------------------------
11269inline const char *vdloc_t::dstr(int width) const
11270{
11271 return (const char *)HEXDSP(hx_vdloc_t_dstr, this, width);
11272}
11273
11274//--------------------------------------------------------------------------
11275inline int vdloc_t::compare(const vdloc_t &r) const
11276{
11277 return (int)(size_t)HEXDSP(hx_vdloc_t_compare, this, &r);
11278}
11279
11280//--------------------------------------------------------------------------
11281inline bool vdloc_t::is_aliasable(const mba_t *mb, size_t size) const
11282{
11283 return (uchar)(size_t)HEXDSP(hx_vdloc_t_is_aliasable, this, mb, size) != 0;
11284}
11285
11286//--------------------------------------------------------------------------
11287inline void print_vdloc(qstring *vout, const vdloc_t &loc, int nbytes)
11288{
11289 HEXDSP(hx_print_vdloc, vout, &loc, nbytes);
11290}
11291
11292//--------------------------------------------------------------------------
11293inline bool arglocs_overlap(const vdloc_t &loc1, size_t w1, const vdloc_t &loc2, size_t w2)
11294{
11295 return (uchar)(size_t)HEXDSP(hx_arglocs_overlap, &loc1, w1, &loc2, w2) != 0;
11296}
11297
11298//--------------------------------------------------------------------------
11299inline int lvar_locator_t::compare(const lvar_locator_t &r) const
11300{
11301 return (int)(size_t)HEXDSP(hx_lvar_locator_t_compare, this, &r);
11302}
11303
11304//--------------------------------------------------------------------------
11305inline const char *lvar_locator_t::dstr() const
11306{
11307 return (const char *)HEXDSP(hx_lvar_locator_t_dstr, this);
11308}
11309
11310//--------------------------------------------------------------------------
11311inline const char *lvar_t::dstr() const
11312{
11313 return (const char *)HEXDSP(hx_lvar_t_dstr, this);
11314}
11315
11316//--------------------------------------------------------------------------
11317inline bool lvar_t::is_promoted_arg() const
11318{
11319 return (uchar)(size_t)HEXDSP(hx_lvar_t_is_promoted_arg, this) != 0;
11320}
11321
11322//--------------------------------------------------------------------------
11323inline bool lvar_t::accepts_type(const tinfo_t &t, bool may_change_thisarg)
11324{
11325 return (uchar)(size_t)HEXDSP(hx_lvar_t_accepts_type, this, &t, may_change_thisarg) != 0;
11326}
11327
11328//--------------------------------------------------------------------------
11329inline bool lvar_t::set_lvar_type(const tinfo_t &t, bool may_fail)
11330{
11331 return (uchar)(size_t)HEXDSP(hx_lvar_t_set_lvar_type, this, &t, may_fail) != 0;
11332}
11333
11334//--------------------------------------------------------------------------
11335inline bool lvar_t::set_width(int w, int svw_flags)
11336{
11337 return (uchar)(size_t)HEXDSP(hx_lvar_t_set_width, this, w, svw_flags) != 0;
11338}
11339
11340//--------------------------------------------------------------------------
11341inline void lvar_t::append_list(const mba_t *mba, mlist_t *lst, bool pad_if_scattered) const
11342{
11343 HEXDSP(hx_lvar_t_append_list, this, mba, lst, pad_if_scattered);
11344}
11345
11346//--------------------------------------------------------------------------
11347inline int lvars_t::find_stkvar(sval_t spoff, int width)
11348{
11349 return (int)(size_t)HEXDSP(hx_lvars_t_find_stkvar, this, spoff, width);
11350}
11351
11352//--------------------------------------------------------------------------
11354{
11355 return (lvar_t *)HEXDSP(hx_lvars_t_find, this, &ll);
11356}
11357
11358//--------------------------------------------------------------------------
11359inline int lvars_t::find_lvar(const vdloc_t &location, size_t width, int defblk) const
11360{
11361 return (int)(size_t)HEXDSP(hx_lvars_t_find_lvar, this, &location, width, defblk);
11362}
11363
11364//--------------------------------------------------------------------------
11366{
11367 return (uchar)(size_t)HEXDSP(hx_restore_user_lvar_settings, lvinf, func_ea) != 0;
11368}
11369
11370//--------------------------------------------------------------------------
11371inline void save_user_lvar_settings(ea_t func_ea, const lvar_uservec_t &lvinf)
11372{
11373 HEXDSP(hx_save_user_lvar_settings, func_ea, &lvinf);
11374}
11375
11376//--------------------------------------------------------------------------
11378{
11379 return (uchar)(size_t)HEXDSP(hx_modify_user_lvars, entry_ea, &mlv) != 0;
11380}
11381
11382//--------------------------------------------------------------------------
11383inline bool modify_user_lvar_info(ea_t func_ea, uint mli_flags, const lvar_saved_info_t &info)
11384{
11385 return (uchar)(size_t)HEXDSP(hx_modify_user_lvar_info, func_ea, mli_flags, &info) != 0;
11386}
11387
11388//--------------------------------------------------------------------------
11389inline bool locate_lvar(lvar_locator_t *out, ea_t func_ea, const char *varname)
11390{
11391 return (uchar)(size_t)HEXDSP(hx_locate_lvar, out, func_ea, varname) != 0;
11392}
11393
11394//--------------------------------------------------------------------------
11395inline bool restore_user_defined_calls(udcall_map_t *udcalls, ea_t func_ea)
11396{
11397 return (uchar)(size_t)HEXDSP(hx_restore_user_defined_calls, udcalls, func_ea) != 0;
11398}
11399
11400//--------------------------------------------------------------------------
11401inline void save_user_defined_calls(ea_t func_ea, const udcall_map_t &udcalls)
11402{
11403 HEXDSP(hx_save_user_defined_calls, func_ea, &udcalls);
11404}
11405
11406//--------------------------------------------------------------------------
11407inline bool parse_user_call(udcall_t *udc, const char *decl, bool silent)
11408{
11409 return (uchar)(size_t)HEXDSP(hx_parse_user_call, udc, decl, silent) != 0;
11410}
11411
11412//--------------------------------------------------------------------------
11414{
11415 return (merror_t)(size_t)HEXDSP(hx_convert_to_user_call, &udc, &cdg);
11416}
11417
11418//--------------------------------------------------------------------------
11419inline bool install_microcode_filter(microcode_filter_t *filter, bool install)
11420{
11421 auto hrdsp = HEXDSP;
11422 return hrdsp != nullptr && (uchar)(size_t)hrdsp(hx_install_microcode_filter, filter, install) != 0;
11423}
11424
11425//--------------------------------------------------------------------------
11427{
11428 HEXDSP(hx_udc_filter_t_cleanup, this);
11429}
11430
11431//--------------------------------------------------------------------------
11432inline bool udc_filter_t::init(const char *decl)
11433{
11434 return (uchar)(size_t)HEXDSP(hx_udc_filter_t_init, this, decl) != 0;
11435}
11436
11437//--------------------------------------------------------------------------
11439{
11440 return (merror_t)(size_t)HEXDSP(hx_udc_filter_t_apply, this, &cdg);
11441}
11442
11443//--------------------------------------------------------------------------
11445{
11446 HEXDSP(hx_bitset_t_bitset_t, this, &m);
11447}
11448
11449//--------------------------------------------------------------------------
11451{
11452 return *(bitset_t *)HEXDSP(hx_bitset_t_copy, this, &m);
11453}
11454
11455//--------------------------------------------------------------------------
11456inline bool bitset_t::add(int bit)
11457{
11458 return (uchar)(size_t)HEXDSP(hx_bitset_t_add, this, bit) != 0;
11459}
11460
11461//--------------------------------------------------------------------------
11462inline bool bitset_t::add(int bit, int width)
11463{
11464 return (uchar)(size_t)HEXDSP(hx_bitset_t_add_, this, bit, width) != 0;
11465}
11466
11467//--------------------------------------------------------------------------
11468inline bool bitset_t::add(const bitset_t &ml)
11469{
11470 return (uchar)(size_t)HEXDSP(hx_bitset_t_add__, this, &ml) != 0;
11471}
11472
11473//--------------------------------------------------------------------------
11474inline bool bitset_t::sub(int bit)
11475{
11476 return (uchar)(size_t)HEXDSP(hx_bitset_t_sub, this, bit) != 0;
11477}
11478
11479//--------------------------------------------------------------------------
11480inline bool bitset_t::sub(int bit, int width)
11481{
11482 return (uchar)(size_t)HEXDSP(hx_bitset_t_sub_, this, bit, width) != 0;
11483}
11484
11485//--------------------------------------------------------------------------
11486inline bool bitset_t::sub(const bitset_t &ml)
11487{
11488 return (uchar)(size_t)HEXDSP(hx_bitset_t_sub__, this, &ml) != 0;
11489}
11490
11491//--------------------------------------------------------------------------
11492inline bool bitset_t::cut_at(int maxbit)
11493{
11494 return (uchar)(size_t)HEXDSP(hx_bitset_t_cut_at, this, maxbit) != 0;
11495}
11496
11497//--------------------------------------------------------------------------
11498inline void bitset_t::shift_down(int shift)
11499{
11500 HEXDSP(hx_bitset_t_shift_down, this, shift);
11501}
11502
11503//--------------------------------------------------------------------------
11504inline bool bitset_t::has(int bit) const
11505{
11506 return (uchar)(size_t)HEXDSP(hx_bitset_t_has, this, bit) != 0;
11507}
11508
11509//--------------------------------------------------------------------------
11510inline bool bitset_t::has_all(int bit, int width) const
11511{
11512 return (uchar)(size_t)HEXDSP(hx_bitset_t_has_all, this, bit, width) != 0;
11513}
11514
11515//--------------------------------------------------------------------------
11516inline bool bitset_t::has_any(int bit, int width) const
11517{
11518 return (uchar)(size_t)HEXDSP(hx_bitset_t_has_any, this, bit, width) != 0;
11519}
11520
11521//--------------------------------------------------------------------------
11522inline const char *bitset_t::dstr() const
11523{
11524 return (const char *)HEXDSP(hx_bitset_t_dstr, this);
11525}
11526
11527//--------------------------------------------------------------------------
11528inline bool bitset_t::empty() const
11529{
11530 return (uchar)(size_t)HEXDSP(hx_bitset_t_empty, this) != 0;
11531}
11532
11533//--------------------------------------------------------------------------
11534inline int bitset_t::count() const
11535{
11536 return (int)(size_t)HEXDSP(hx_bitset_t_count, this);
11537}
11538
11539//--------------------------------------------------------------------------
11540inline int bitset_t::count(int bit) const
11541{
11542 return (int)(size_t)HEXDSP(hx_bitset_t_count_, this, bit);
11543}
11544
11545//--------------------------------------------------------------------------
11546inline int bitset_t::last() const
11547{
11548 return (int)(size_t)HEXDSP(hx_bitset_t_last, this);
11549}
11550
11551//--------------------------------------------------------------------------
11552inline void bitset_t::fill_with_ones(int maxbit)
11553{
11554 HEXDSP(hx_bitset_t_fill_with_ones, this, maxbit);
11555}
11556
11557//--------------------------------------------------------------------------
11558inline bool bitset_t::fill_gaps(int total_nbits)
11559{
11560 return (uchar)(size_t)HEXDSP(hx_bitset_t_fill_gaps, this, total_nbits) != 0;
11561}
11562
11563//--------------------------------------------------------------------------
11564inline bool bitset_t::has_common(const bitset_t &ml) const
11565{
11566 return (uchar)(size_t)HEXDSP(hx_bitset_t_has_common, this, &ml) != 0;
11567}
11568
11569//--------------------------------------------------------------------------
11570inline bool bitset_t::intersect(const bitset_t &ml)
11571{
11572 return (uchar)(size_t)HEXDSP(hx_bitset_t_intersect, this, &ml) != 0;
11573}
11574
11575//--------------------------------------------------------------------------
11576inline bool bitset_t::is_subset_of(const bitset_t &ml) const
11577{
11578 return (uchar)(size_t)HEXDSP(hx_bitset_t_is_subset_of, this, &ml) != 0;
11579}
11580
11581//--------------------------------------------------------------------------
11582inline int bitset_t::compare(const bitset_t &r) const
11583{
11584 return (int)(size_t)HEXDSP(hx_bitset_t_compare, this, &r);
11585}
11586
11587//--------------------------------------------------------------------------
11588inline int bitset_t::goup(int reg) const
11589{
11590 return (int)(size_t)HEXDSP(hx_bitset_t_goup, this, reg);
11591}
11592
11593//--------------------------------------------------------------------------
11594inline const char *ivl_t::dstr() const
11595{
11596 return (const char *)HEXDSP(hx_ivl_t_dstr, this);
11597}
11598
11599//--------------------------------------------------------------------------
11600inline int ivl_t::compare(const ivl_t &r) const
11601{
11602 return (int)(size_t)HEXDSP(hx_ivl_t_compare, this, &r);
11603}
11604
11605//--------------------------------------------------------------------------
11606inline bool ivlset_t::add(const ivl_t &ivl)
11607{
11608 return (uchar)(size_t)HEXDSP(hx_ivlset_t_add, this, &ivl) != 0;
11609}
11610
11611//--------------------------------------------------------------------------
11612inline bool ivlset_t::add(const ivlset_t &ivs)
11613{
11614 return (uchar)(size_t)HEXDSP(hx_ivlset_t_add_, this, &ivs) != 0;
11615}
11616
11617//--------------------------------------------------------------------------
11618inline bool ivlset_t::addmasked(const ivlset_t &ivs, const ivl_t &mask)
11619{
11620 return (uchar)(size_t)HEXDSP(hx_ivlset_t_addmasked, this, &ivs, &mask) != 0;
11621}
11622
11623//--------------------------------------------------------------------------
11624inline bool ivlset_t::sub(const ivl_t &ivl)
11625{
11626 return (uchar)(size_t)HEXDSP(hx_ivlset_t_sub, this, &ivl) != 0;
11627}
11628
11629//--------------------------------------------------------------------------
11630inline bool ivlset_t::sub(const ivlset_t &ivs)
11631{
11632 return (uchar)(size_t)HEXDSP(hx_ivlset_t_sub_, this, &ivs) != 0;
11633}
11634
11635//--------------------------------------------------------------------------
11637{
11638 asize_t retval;
11639 HEXDSP(hx_ivlset_t_count, &retval, this);
11640 return retval;
11641}
11642
11643//--------------------------------------------------------------------------
11644inline bool ivlset_t::has_common(const ivlset_t &ivs) const
11645{
11646 return (uchar)(size_t)HEXDSP(hx_ivlset_t_has_common, this, &ivs) != 0;
11647}
11648
11649//--------------------------------------------------------------------------
11650inline bool ivlset_t::has_common(const ivl_t &ivl, bool strict) const
11651{
11652 return (uchar)(size_t)HEXDSP(hx_ivlset_t_has_common_, this, &ivl, strict) != 0;
11653}
11654
11655//--------------------------------------------------------------------------
11656inline bool ivlset_t::contains(uint64 off) const
11657{
11658 return (uchar)(size_t)HEXDSP(hx_ivlset_t_contains, this, off) != 0;
11659}
11660
11661//--------------------------------------------------------------------------
11662inline bool ivlset_t::includes(const ivlset_t &ivs) const
11663{
11664 return (uchar)(size_t)HEXDSP(hx_ivlset_t_includes, this, &ivs) != 0;
11665}
11666
11667//--------------------------------------------------------------------------
11668inline bool ivlset_t::intersect(const ivlset_t &ivs)
11669{
11670 return (uchar)(size_t)HEXDSP(hx_ivlset_t_intersect, this, &ivs) != 0;
11671}
11672
11673//--------------------------------------------------------------------------
11674inline int ivlset_t::compare(const ivlset_t &r) const
11675{
11676 return (int)(size_t)HEXDSP(hx_ivlset_t_compare, this, &r);
11677}
11678
11679//--------------------------------------------------------------------------
11680inline void ivlset_t::print(qstring *vout) const
11681{
11682 HEXDSP(hx_ivlset_t_print, this, vout);
11683}
11684
11685//--------------------------------------------------------------------------
11686inline const char *ivlset_t::dstr() const
11687{
11688 return (const char *)HEXDSP(hx_ivlset_t_dstr, this);
11689}
11690
11691//--------------------------------------------------------------------------
11692inline void rlist_t::print(qstring *vout) const
11693{
11694 HEXDSP(hx_rlist_t_print, this, vout);
11695}
11696
11697//--------------------------------------------------------------------------
11698inline const char *rlist_t::dstr() const
11699{
11700 return (const char *)HEXDSP(hx_rlist_t_dstr, this);
11701}
11702
11703//--------------------------------------------------------------------------
11705{
11706 return (uchar)(size_t)HEXDSP(hx_mlist_t_addmem, this, ea, size) != 0;
11707}
11708
11709//--------------------------------------------------------------------------
11710inline void mlist_t::print(qstring *vout) const
11711{
11712 HEXDSP(hx_mlist_t_print, this, vout);
11713}
11714
11715//--------------------------------------------------------------------------
11716inline const char *mlist_t::dstr() const
11717{
11718 return (const char *)HEXDSP(hx_mlist_t_dstr, this);
11719}
11720
11721//--------------------------------------------------------------------------
11722inline int mlist_t::compare(const mlist_t &r) const
11723{
11724 return (int)(size_t)HEXDSP(hx_mlist_t_compare, this, &r);
11725}
11726
11727//--------------------------------------------------------------------------
11728inline const mlist_t &get_temp_regs()
11729{
11730 return *(const mlist_t *)HEXDSP(hx_get_temp_regs);
11731}
11732
11733//--------------------------------------------------------------------------
11734inline bool is_kreg(mreg_t r)
11735{
11736 return (uchar)(size_t)HEXDSP(hx_is_kreg, r) != 0;
11737}
11738
11739//--------------------------------------------------------------------------
11740inline mreg_t reg2mreg(int reg)
11741{
11742 return (mreg_t)(size_t)HEXDSP(hx_reg2mreg, reg);
11743}
11744
11745//--------------------------------------------------------------------------
11746inline int mreg2reg(mreg_t reg, size_t width)
11747{
11748 return (int)(size_t)HEXDSP(hx_mreg2reg, reg, width);
11749}
11750
11751//--------------------------------------------------------------------------
11752inline int get_mreg_name(qstring *out, mreg_t reg, int width, void *ud)
11753{
11754 return (int)(size_t)HEXDSP(hx_get_mreg_name, out, reg, width, ud);
11755}
11756
11757//--------------------------------------------------------------------------
11759{
11760 HEXDSP(hx_install_optinsn_handler, opt);
11761}
11762
11763//--------------------------------------------------------------------------
11765{
11766 auto hrdsp = HEXDSP;
11767 return hrdsp != nullptr && (uchar)(size_t)hrdsp(hx_remove_optinsn_handler, opt) != 0;
11768}
11769
11770//--------------------------------------------------------------------------
11772{
11773 HEXDSP(hx_install_optblock_handler, opt);
11774}
11775
11776//--------------------------------------------------------------------------
11778{
11779 auto hrdsp = HEXDSP;
11780 return hrdsp != nullptr && (uchar)(size_t)hrdsp(hx_remove_optblock_handler, opt) != 0;
11781}
11782
11783//--------------------------------------------------------------------------
11785{
11786 HEXDSP(hx_simple_graph_t_compute_dominators, this, &domin, post);
11787}
11788
11789//--------------------------------------------------------------------------
11790inline void simple_graph_t::compute_immediate_dominators(const array_of_node_bitset_t &domin, intvec_t &idomin, bool post) const
11791{
11792 HEXDSP(hx_simple_graph_t_compute_immediate_dominators, this, &domin, &idomin, post);
11793}
11794
11795//--------------------------------------------------------------------------
11797{
11798 return (int)(size_t)HEXDSP(hx_simple_graph_t_depth_first_preorder, this, pre);
11799}
11800
11801//--------------------------------------------------------------------------
11803{
11804 return (int)(size_t)HEXDSP(hx_simple_graph_t_depth_first_postorder, this, post);
11805}
11806
11807//--------------------------------------------------------------------------
11808inline int simple_graph_t::goup(int node) const
11809{
11810 return (int)(size_t)HEXDSP(hx_simple_graph_t_goup, this, node);
11811}
11812
11813//--------------------------------------------------------------------------
11814inline int lvar_ref_t::compare(const lvar_ref_t &r) const
11815{
11816 return (int)(size_t)HEXDSP(hx_lvar_ref_t_compare, this, &r);
11817}
11818
11819//--------------------------------------------------------------------------
11821{
11822 return *(lvar_t *)HEXDSP(hx_lvar_ref_t_var, this);
11823}
11824
11825//--------------------------------------------------------------------------
11826inline int stkvar_ref_t::compare(const stkvar_ref_t &r) const
11827{
11828 return (int)(size_t)HEXDSP(hx_stkvar_ref_t_compare, this, &r);
11829}
11830
11831//--------------------------------------------------------------------------
11832inline ssize_t stkvar_ref_t::get_stkvar(udm_t *udm, uval_t *p_idaoff) const
11833{
11834 return (ssize_t)HEXDSP(hx_stkvar_ref_t_get_stkvar, this, udm, p_idaoff);
11835}
11836
11837//--------------------------------------------------------------------------
11838inline void fnumber_t::print(qstring *vout) const
11839{
11840 HEXDSP(hx_fnumber_t_print, this, vout);
11841}
11842
11843//--------------------------------------------------------------------------
11844inline const char *fnumber_t::dstr() const
11845{
11846 return (const char *)HEXDSP(hx_fnumber_t_dstr, this);
11847}
11848
11849//--------------------------------------------------------------------------
11850inline void mop_t::copy(const mop_t &rop)
11851{
11852 HEXDSP(hx_mop_t_copy, this, &rop);
11853}
11854
11855//--------------------------------------------------------------------------
11856inline mop_t &mop_t::assign(const mop_t &rop)
11857{
11858 return *(mop_t *)HEXDSP(hx_mop_t_assign, this, &rop);
11859}
11860
11861//--------------------------------------------------------------------------
11862inline void mop_t::swap(mop_t &rop)
11863{
11864 HEXDSP(hx_mop_t_swap, this, &rop);
11865}
11866
11867//--------------------------------------------------------------------------
11868inline void mop_t::erase()
11869{
11870 HEXDSP(hx_mop_t_erase, this);
11871}
11872
11873//--------------------------------------------------------------------------
11874inline void mop_t::print(qstring *vout, int shins_flags) const
11875{
11876 HEXDSP(hx_mop_t_print, this, vout, shins_flags);
11877}
11878
11879//--------------------------------------------------------------------------
11880inline const char *mop_t::dstr() const
11881{
11882 return (const char *)HEXDSP(hx_mop_t_dstr, this);
11883}
11884
11885//--------------------------------------------------------------------------
11886inline bool mop_t::create_from_mlist(mba_t *mba, const mlist_t &lst, sval_t fullsize)
11887{
11888 return (uchar)(size_t)HEXDSP(hx_mop_t_create_from_mlist, this, mba, &lst, fullsize) != 0;
11889}
11890
11891//--------------------------------------------------------------------------
11892inline bool mop_t::create_from_ivlset(mba_t *mba, const ivlset_t &ivs, sval_t fullsize)
11893{
11894 return (uchar)(size_t)HEXDSP(hx_mop_t_create_from_ivlset, this, mba, &ivs, fullsize) != 0;
11895}
11896
11897//--------------------------------------------------------------------------
11898inline void mop_t::create_from_vdloc(mba_t *mba, const vdloc_t &loc, int _size)
11899{
11900 HEXDSP(hx_mop_t_create_from_vdloc, this, mba, &loc, _size);
11901}
11902
11903//--------------------------------------------------------------------------
11904inline void mop_t::create_from_scattered_vdloc(mba_t *mba, const char *name, tinfo_t type, const vdloc_t &loc)
11905{
11906 HEXDSP(hx_mop_t_create_from_scattered_vdloc, this, mba, name, &type, &loc);
11907}
11908
11909//--------------------------------------------------------------------------
11911{
11912 HEXDSP(hx_mop_t_create_from_insn, this, m);
11913}
11914
11915//--------------------------------------------------------------------------
11916inline void mop_t::make_number(uint64 _value, int _size, ea_t _ea, int opnum)
11917{
11918 HEXDSP(hx_mop_t_make_number, this, _value, _size, _ea, opnum);
11919}
11920
11921//--------------------------------------------------------------------------
11922inline bool mop_t::make_fpnum(const void *bytes, size_t _size)
11923{
11924 return (uchar)(size_t)HEXDSP(hx_mop_t_make_fpnum, this, bytes, _size) != 0;
11925}
11926
11927//--------------------------------------------------------------------------
11929{
11930 HEXDSP(hx_mop_t__make_gvar, this, ea);
11931}
11932
11933//--------------------------------------------------------------------------
11934inline void mop_t::make_gvar(ea_t ea)
11935{
11936 HEXDSP(hx_mop_t_make_gvar, this, ea);
11937}
11938
11939//--------------------------------------------------------------------------
11940inline void mop_t::make_reg_pair(int loreg, int hireg, int halfsize)
11941{
11942 HEXDSP(hx_mop_t_make_reg_pair, this, loreg, hireg, halfsize);
11943}
11944
11945//--------------------------------------------------------------------------
11946inline void mop_t::make_helper(const char *name)
11947{
11948 HEXDSP(hx_mop_t_make_helper, this, name);
11949}
11950
11951//--------------------------------------------------------------------------
11953{
11954 return (uchar)(size_t)HEXDSP(hx_mop_t_is_bit_reg, reg) != 0;
11955}
11956
11957//--------------------------------------------------------------------------
11959{
11960 return (uchar)(size_t)HEXDSP(hx_mop_t_may_use_aliased_memory, this) != 0;
11961}
11962
11963//--------------------------------------------------------------------------
11964inline bool mop_t::is01() const
11965{
11966 return (uchar)(size_t)HEXDSP(hx_mop_t_is01, this) != 0;
11967}
11968
11969//--------------------------------------------------------------------------
11970inline int mop_t::get_bitwidth(const mblock_t *blk, const minsn_t *top) const
11971{
11972 return (int)(size_t)HEXDSP(hx_mop_t_get_bitwidth, this, blk, top);
11973}
11974
11975//--------------------------------------------------------------------------
11977{
11978 return (uchar)(size_t)HEXDSP(hx_mop_t_is_sign_extended_from, this, nbytes) != 0;
11979}
11980
11981//--------------------------------------------------------------------------
11983{
11984 return (uchar)(size_t)HEXDSP(hx_mop_t_is_zero_extended_from, this, nbytes) != 0;
11985}
11986
11987//--------------------------------------------------------------------------
11988inline bool mop_t::equal_mops(const mop_t &rop, int eqflags) const
11989{
11990 return (uchar)(size_t)HEXDSP(hx_mop_t_equal_mops, this, &rop, eqflags) != 0;
11991}
11992
11993//--------------------------------------------------------------------------
11994inline int mop_t::lexcompare(const mop_t &rop) const
11995{
11996 return (int)(size_t)HEXDSP(hx_mop_t_lexcompare, this, &rop);
11997}
11998
11999//--------------------------------------------------------------------------
12000inline int mop_t::for_all_ops(mop_visitor_t &mv, const tinfo_t *type, bool is_target)
12001{
12002 return (int)(size_t)HEXDSP(hx_mop_t_for_all_ops, this, &mv, type, is_target);
12003}
12004
12005//--------------------------------------------------------------------------
12007{
12008 return (int)(size_t)HEXDSP(hx_mop_t_for_all_scattered_submops, this, &sv);
12009}
12010
12011//--------------------------------------------------------------------------
12012inline bool mop_t::is_constant(uint64 *out, bool is_signed) const
12013{
12014 return (uchar)(size_t)HEXDSP(hx_mop_t_is_constant, this, out, is_signed) != 0;
12015}
12016
12017//--------------------------------------------------------------------------
12018inline bool mop_t::get_stkoff(sval_t *p_vdoff) const
12019{
12020 return (uchar)(size_t)HEXDSP(hx_mop_t_get_stkoff, this, p_vdoff) != 0;
12021}
12022
12023//--------------------------------------------------------------------------
12024inline bool mop_t::make_low_half(int width)
12025{
12026 return (uchar)(size_t)HEXDSP(hx_mop_t_make_low_half, this, width) != 0;
12027}
12028
12029//--------------------------------------------------------------------------
12030inline bool mop_t::make_high_half(int width)
12031{
12032 return (uchar)(size_t)HEXDSP(hx_mop_t_make_high_half, this, width) != 0;
12033}
12034
12035//--------------------------------------------------------------------------
12036inline bool mop_t::make_first_half(int width)
12037{
12038 return (uchar)(size_t)HEXDSP(hx_mop_t_make_first_half, this, width) != 0;
12039}
12040
12041//--------------------------------------------------------------------------
12042inline bool mop_t::make_second_half(int width)
12043{
12044 return (uchar)(size_t)HEXDSP(hx_mop_t_make_second_half, this, width) != 0;
12045}
12046
12047//--------------------------------------------------------------------------
12048inline bool mop_t::shift_mop(int offset)
12049{
12050 return (uchar)(size_t)HEXDSP(hx_mop_t_shift_mop, this, offset) != 0;
12051}
12052
12053//--------------------------------------------------------------------------
12054inline bool mop_t::change_size(int nsize, side_effect_t sideff)
12055{
12056 return (uchar)(size_t)HEXDSP(hx_mop_t_change_size, this, nsize, sideff) != 0;
12057}
12058
12059//--------------------------------------------------------------------------
12060inline bool mop_t::preserve_side_effects(mblock_t *blk, minsn_t *top, bool *moved_calls)
12061{
12062 return (uchar)(size_t)HEXDSP(hx_mop_t_preserve_side_effects, this, blk, top, moved_calls) != 0;
12063}
12064
12065//--------------------------------------------------------------------------
12066inline void mop_t::apply_ld_mcode(mcode_t mcode, ea_t ea, int newsize)
12067{
12068 HEXDSP(hx_mop_t_apply_ld_mcode, this, mcode, ea, newsize);
12069}
12070
12071//--------------------------------------------------------------------------
12072inline void mcallarg_t::print(qstring *vout, int shins_flags) const
12073{
12074 HEXDSP(hx_mcallarg_t_print, this, vout, shins_flags);
12075}
12076
12077//--------------------------------------------------------------------------
12078inline const char *mcallarg_t::dstr() const
12079{
12080 return (const char *)HEXDSP(hx_mcallarg_t_dstr, this);
12081}
12082
12083//--------------------------------------------------------------------------
12084inline void mcallarg_t::set_regarg(mreg_t mr, int sz, const tinfo_t &tif)
12085{
12086 HEXDSP(hx_mcallarg_t_set_regarg, this, mr, sz, &tif);
12087}
12088
12089//--------------------------------------------------------------------------
12090inline int mcallinfo_t::lexcompare(const mcallinfo_t &f) const
12091{
12092 return (int)(size_t)HEXDSP(hx_mcallinfo_t_lexcompare, this, &f);
12093}
12094
12095//--------------------------------------------------------------------------
12097{
12098 return (uchar)(size_t)HEXDSP(hx_mcallinfo_t_set_type, this, &type) != 0;
12099}
12100
12101//--------------------------------------------------------------------------
12103{
12104 tinfo_t retval;
12105 HEXDSP(hx_mcallinfo_t_get_type, &retval, this);
12106 return retval;
12107}
12108
12109//--------------------------------------------------------------------------
12110inline void mcallinfo_t::print(qstring *vout, int size, int shins_flags) const
12111{
12112 HEXDSP(hx_mcallinfo_t_print, this, vout, size, shins_flags);
12113}
12114
12115//--------------------------------------------------------------------------
12116inline const char *mcallinfo_t::dstr() const
12117{
12118 return (const char *)HEXDSP(hx_mcallinfo_t_dstr, this);
12119}
12120
12121//--------------------------------------------------------------------------
12122inline int mcases_t::compare(const mcases_t &r) const
12123{
12124 return (int)(size_t)HEXDSP(hx_mcases_t_compare, this, &r);
12125}
12126
12127//--------------------------------------------------------------------------
12128inline void mcases_t::print(qstring *vout) const
12129{
12130 HEXDSP(hx_mcases_t_print, this, vout);
12131}
12132
12133//--------------------------------------------------------------------------
12134inline const char *mcases_t::dstr() const
12135{
12136 return (const char *)HEXDSP(hx_mcases_t_dstr, this);
12137}
12138
12139//--------------------------------------------------------------------------
12140inline bool vivl_t::extend_to_cover(const vivl_t &r)
12141{
12142 return (uchar)(size_t)HEXDSP(hx_vivl_t_extend_to_cover, this, &r) != 0;
12143}
12144
12145//--------------------------------------------------------------------------
12147{
12148 uval_t retval;
12149 HEXDSP(hx_vivl_t_intersect, &retval, this, &r);
12150 return retval;
12151}
12152
12153//--------------------------------------------------------------------------
12154inline void vivl_t::print(qstring *vout) const
12155{
12156 HEXDSP(hx_vivl_t_print, this, vout);
12157}
12158
12159//--------------------------------------------------------------------------
12160inline const char *vivl_t::dstr() const
12161{
12162 return (const char *)HEXDSP(hx_vivl_t_dstr, this);
12163}
12164
12165//--------------------------------------------------------------------------
12166inline void chain_t::print(qstring *vout) const
12167{
12168 HEXDSP(hx_chain_t_print, this, vout);
12169}
12170
12171//--------------------------------------------------------------------------
12172inline const char *chain_t::dstr() const
12173{
12174 return (const char *)HEXDSP(hx_chain_t_dstr, this);
12175}
12176
12177//--------------------------------------------------------------------------
12178inline void chain_t::append_list(const mba_t *mba, mlist_t *list) const
12179{
12180 HEXDSP(hx_chain_t_append_list, this, mba, list);
12181}
12182
12183//--------------------------------------------------------------------------
12184inline const chain_t *block_chains_t::get_chain(const chain_t &ch) const
12185{
12186 return (const chain_t *)HEXDSP(hx_block_chains_t_get_chain, this, &ch);
12187}
12188
12189//--------------------------------------------------------------------------
12190inline void block_chains_t::print(qstring *vout) const
12191{
12192 HEXDSP(hx_block_chains_t_print, this, vout);
12193}
12194
12195//--------------------------------------------------------------------------
12196inline const char *block_chains_t::dstr() const
12197{
12198 return (const char *)HEXDSP(hx_block_chains_t_dstr, this);
12199}
12200
12201//--------------------------------------------------------------------------
12203{
12204 return (int)(size_t)HEXDSP(hx_graph_chains_t_for_all_chains, this, &cv, gca_flags);
12205}
12206
12207//--------------------------------------------------------------------------
12209{
12210 HEXDSP(hx_graph_chains_t_release, this);
12211}
12212
12213//--------------------------------------------------------------------------
12214inline void minsn_t::init(ea_t _ea)
12215{
12216 HEXDSP(hx_minsn_t_init, this, _ea);
12217}
12218
12219//--------------------------------------------------------------------------
12220inline void minsn_t::copy(const minsn_t &m)
12221{
12222 HEXDSP(hx_minsn_t_copy, this, &m);
12223}
12224
12225//--------------------------------------------------------------------------
12227{
12228 HEXDSP(hx_minsn_t_set_combined, this);
12229}
12230
12231//--------------------------------------------------------------------------
12232inline void minsn_t::swap(minsn_t &m)
12233{
12234 HEXDSP(hx_minsn_t_swap, this, &m);
12235}
12236
12237//--------------------------------------------------------------------------
12238inline void minsn_t::print(qstring *vout, int shins_flags) const
12239{
12240 HEXDSP(hx_minsn_t_print, this, vout, shins_flags);
12241}
12242
12243//--------------------------------------------------------------------------
12244inline const char *minsn_t::dstr() const
12245{
12246 return (const char *)HEXDSP(hx_minsn_t_dstr, this);
12247}
12248
12249//--------------------------------------------------------------------------
12250inline void minsn_t::setaddr(ea_t new_ea)
12251{
12252 HEXDSP(hx_minsn_t_setaddr, this, new_ea);
12253}
12254
12255//--------------------------------------------------------------------------
12256inline int minsn_t::optimize_subtree(mblock_t *blk, minsn_t *top, minsn_t *parent, ea_t *converted_call, int optflags)
12257{
12258 return (int)(size_t)HEXDSP(hx_minsn_t_optimize_subtree, this, blk, top, parent, converted_call, optflags);
12259}
12260
12261//--------------------------------------------------------------------------
12263{
12264 return (int)(size_t)HEXDSP(hx_minsn_t_for_all_ops, this, &mv);
12265}
12266
12267//--------------------------------------------------------------------------
12269{
12270 return (int)(size_t)HEXDSP(hx_minsn_t_for_all_insns, this, &mv);
12271}
12272
12273//--------------------------------------------------------------------------
12275{
12276 HEXDSP(hx_minsn_t__make_nop, this);
12277}
12278
12279//--------------------------------------------------------------------------
12280inline bool minsn_t::equal_insns(const minsn_t &m, int eqflags) const
12281{
12282 return (uchar)(size_t)HEXDSP(hx_minsn_t_equal_insns, this, &m, eqflags) != 0;
12283}
12284
12285//--------------------------------------------------------------------------
12286inline int minsn_t::lexcompare(const minsn_t &ri) const
12287{
12288 return (int)(size_t)HEXDSP(hx_minsn_t_lexcompare, this, &ri);
12289}
12290
12291//--------------------------------------------------------------------------
12292inline bool minsn_t::is_noret_call(int flags)
12293{
12294 return (uchar)(size_t)HEXDSP(hx_minsn_t_is_noret_call, this, flags) != 0;
12295}
12296
12297//--------------------------------------------------------------------------
12298inline bool minsn_t::is_helper(const char *name) const
12299{
12300 return (uchar)(size_t)HEXDSP(hx_minsn_t_is_helper, this, name) != 0;
12301}
12302
12303//--------------------------------------------------------------------------
12304inline minsn_t *minsn_t::find_call(bool with_helpers) const
12305{
12306 return (minsn_t *)HEXDSP(hx_minsn_t_find_call, this, with_helpers);
12307}
12308
12309//--------------------------------------------------------------------------
12310inline bool minsn_t::has_side_effects(bool include_ldx_and_divs) const
12311{
12312 return (uchar)(size_t)HEXDSP(hx_minsn_t_has_side_effects, this, include_ldx_and_divs) != 0;
12313}
12314
12315//--------------------------------------------------------------------------
12317{
12318 return (minsn_t *)HEXDSP(hx_minsn_t_find_opcode, this, mcode);
12319}
12320
12321//--------------------------------------------------------------------------
12322inline const minsn_t *minsn_t::find_ins_op(const mop_t **other, mcode_t op) const
12323{
12324 return (const minsn_t *)HEXDSP(hx_minsn_t_find_ins_op, this, other, op);
12325}
12326
12327//--------------------------------------------------------------------------
12328inline const mop_t *minsn_t::find_num_op(const mop_t **other) const
12329{
12330 return (const mop_t *)HEXDSP(hx_minsn_t_find_num_op, this, other);
12331}
12332
12333//--------------------------------------------------------------------------
12334inline bool minsn_t::modifies_d() const
12335{
12336 return (uchar)(size_t)HEXDSP(hx_minsn_t_modifies_d, this) != 0;
12337}
12338
12339//--------------------------------------------------------------------------
12340inline bool minsn_t::is_between(const minsn_t *m1, const minsn_t *m2) const
12341{
12342 return (uchar)(size_t)HEXDSP(hx_minsn_t_is_between, this, m1, m2) != 0;
12343}
12344
12345//--------------------------------------------------------------------------
12347{
12348 return (uchar)(size_t)HEXDSP(hx_minsn_t_may_use_aliased_memory, this) != 0;
12349}
12350
12351//--------------------------------------------------------------------------
12352inline int minsn_t::serialize(bytevec_t *b) const
12353{
12354 return (int)(size_t)HEXDSP(hx_minsn_t_serialize, this, b);
12355}
12356
12357//--------------------------------------------------------------------------
12358inline bool minsn_t::deserialize(const uchar *bytes, size_t nbytes, int format_version)
12359{
12360 return (uchar)(size_t)HEXDSP(hx_minsn_t_deserialize, this, bytes, nbytes, format_version) != 0;
12361}
12362
12363//--------------------------------------------------------------------------
12364inline const minsn_t *getf_reginsn(const minsn_t *ins)
12365{
12366 return (const minsn_t *)HEXDSP(hx_getf_reginsn, ins);
12367}
12368
12369//--------------------------------------------------------------------------
12370inline const minsn_t *getb_reginsn(const minsn_t *ins)
12371{
12372 return (const minsn_t *)HEXDSP(hx_getb_reginsn, ins);
12373}
12374
12375//--------------------------------------------------------------------------
12377{
12378 return (uchar)(size_t)HEXDSP(hx_int64_emulator_t__mop_value, this, out, &mop, vf) != 0;
12379}
12380
12381//--------------------------------------------------------------------------
12383{
12384 return (uchar)(size_t)HEXDSP(hx_int64_emulator_t__minsn_value, this, out, &insn, vf) != 0;
12385}
12386
12387//--------------------------------------------------------------------------
12388inline void mblock_t::init()
12389{
12390 HEXDSP(hx_mblock_t_init, this);
12391}
12392
12393//--------------------------------------------------------------------------
12394inline void mblock_t::print(vd_printer_t &vp) const
12395{
12396 HEXDSP(hx_mblock_t_print, this, &vp);
12397}
12398
12399//--------------------------------------------------------------------------
12400inline void mblock_t::dump() const
12401{
12402 HEXDSP(hx_mblock_t_dump, this);
12403}
12404
12405//--------------------------------------------------------------------------
12406inline AS_PRINTF(2, 0) void mblock_t::vdump_block(const char *title, va_list va) const
12407{
12408 HEXDSP(hx_mblock_t_vdump_block, this, title, va);
12409}
12410
12411//--------------------------------------------------------------------------
12412inline void mblock_t::verify_insn(const minsn_t *m) const
12413{
12414 HEXDSP(hx_mblock_t_verify_insn, this, m);
12415}
12416
12417//--------------------------------------------------------------------------
12419{
12420 return (minsn_t *)HEXDSP(hx_mblock_t_insert_into_block, this, nm, om);
12421}
12422
12423//--------------------------------------------------------------------------
12425{
12426 return (minsn_t *)HEXDSP(hx_mblock_t_remove_from_block, this, m);
12427}
12428
12429//--------------------------------------------------------------------------
12431{
12432 return (int)(size_t)HEXDSP(hx_mblock_t_for_all_insns, this, &mv);
12433}
12434
12435//--------------------------------------------------------------------------
12437{
12438 return (int)(size_t)HEXDSP(hx_mblock_t_for_all_ops, this, &mv);
12439}
12440
12441//--------------------------------------------------------------------------
12443{
12444 return (int)(size_t)HEXDSP(hx_mblock_t_for_all_uses, this, list, i1, i2, &mmv);
12445}
12446
12447//--------------------------------------------------------------------------
12448inline int mblock_t::optimize_insn(minsn_t *m, int optflags)
12449{
12450 return (int)(size_t)HEXDSP(hx_mblock_t_optimize_insn, this, m, optflags);
12451}
12452
12453//--------------------------------------------------------------------------
12455{
12456 return (int)(size_t)HEXDSP(hx_mblock_t_optimize_block, this);
12457}
12458
12459//--------------------------------------------------------------------------
12460inline int mblock_t::build_lists(bool kill_deads)
12461{
12462 return (int)(size_t)HEXDSP(hx_mblock_t_build_lists, this, kill_deads);
12463}
12464
12465//--------------------------------------------------------------------------
12467{
12468 return (int)(size_t)HEXDSP(hx_mblock_t_optimize_useless_jump, this);
12469}
12470
12471//--------------------------------------------------------------------------
12472inline void mblock_t::append_use_list(mlist_t *list, const mop_t &op, maymust_t maymust, bitrange_t mask) const
12473{
12474 HEXDSP(hx_mblock_t_append_use_list, this, list, &op, maymust, &mask);
12475}
12476
12477//--------------------------------------------------------------------------
12478inline void mblock_t::append_def_list(mlist_t *list, const mop_t &op, maymust_t maymust) const
12479{
12480 HEXDSP(hx_mblock_t_append_def_list, this, list, &op, maymust);
12481}
12482
12483//--------------------------------------------------------------------------
12484inline mlist_t mblock_t::build_use_list(const minsn_t &ins, maymust_t maymust) const
12485{
12486 mlist_t retval;
12487 HEXDSP(hx_mblock_t_build_use_list, &retval, this, &ins, maymust);
12488 return retval;
12489}
12490
12491//--------------------------------------------------------------------------
12492inline mlist_t mblock_t::build_def_list(const minsn_t &ins, maymust_t maymust) const
12493{
12494 mlist_t retval;
12495 HEXDSP(hx_mblock_t_build_def_list, &retval, this, &ins, maymust);
12496 return retval;
12497}
12498
12499//--------------------------------------------------------------------------
12500inline const minsn_t *mblock_t::find_first_use(mlist_t *list, const minsn_t *i1, const minsn_t *i2, maymust_t maymust) const
12501{
12502 return (const minsn_t *)HEXDSP(hx_mblock_t_find_first_use, this, list, i1, i2, maymust);
12503}
12504
12505//--------------------------------------------------------------------------
12506inline const minsn_t *mblock_t::find_redefinition(const mlist_t &list, const minsn_t *i1, const minsn_t *i2, maymust_t maymust) const
12507{
12508 return (const minsn_t *)HEXDSP(hx_mblock_t_find_redefinition, this, &list, i1, i2, maymust);
12509}
12510
12511//--------------------------------------------------------------------------
12512inline bool mblock_t::is_rhs_redefined(const minsn_t *ins, const minsn_t *i1, const minsn_t *i2) const
12513{
12514 return (uchar)(size_t)HEXDSP(hx_mblock_t_is_rhs_redefined, this, ins, i1, i2) != 0;
12515}
12516
12517//--------------------------------------------------------------------------
12518inline minsn_t *mblock_t::find_access(const mop_t &op, minsn_t **parent, const minsn_t *mend, int fdflags) const
12519{
12520 return (minsn_t *)HEXDSP(hx_mblock_t_find_access, this, &op, parent, mend, fdflags);
12521}
12522
12523//--------------------------------------------------------------------------
12524inline bool mblock_t::get_valranges(valrng_t *res, const vivl_t &vivl, int vrflags) const
12525{
12526 return (uchar)(size_t)HEXDSP(hx_mblock_t_get_valranges, this, res, &vivl, vrflags) != 0;
12527}
12528
12529//--------------------------------------------------------------------------
12530inline bool mblock_t::get_valranges(valrng_t *res, const vivl_t &vivl, const minsn_t *m, int vrflags) const
12531{
12532 return (uchar)(size_t)HEXDSP(hx_mblock_t_get_valranges_, this, res, &vivl, m, vrflags) != 0;
12533}
12534
12535//--------------------------------------------------------------------------
12536inline size_t mblock_t::get_reginsn_qty() const
12537{
12538 return (size_t)HEXDSP(hx_mblock_t_get_reginsn_qty, this);
12539}
12540
12541//--------------------------------------------------------------------------
12543{
12544 HEXDSP(hx_mblock_t_undef_spoiled_regs, this, m);
12545}
12546
12547//--------------------------------------------------------------------------
12548inline int user_minsn_t::compare(const user_minsn_t &r) const
12549{
12550 return (int)(size_t)HEXDSP(hx_user_minsn_t_compare, this, &r);
12551}
12552
12553//--------------------------------------------------------------------------
12554inline void add_user_minsn(ea_t entry_ea, const user_minsn_t &uins, mba_maturity_t mmat)
12555{
12556 HEXDSP(hx_add_user_minsn, entry_ea, &uins, mmat);
12557}
12558
12559//--------------------------------------------------------------------------
12560inline bool del_user_minsn(ea_t entry_ea, const minsn_locator_t &loc, user_minsn_action_t action, mba_maturity_t mmat)
12561{
12562 return (uchar)(size_t)HEXDSP(hx_del_user_minsn, entry_ea, &loc, action, mmat) != 0;
12563}
12564
12565//--------------------------------------------------------------------------
12567{
12568 return (uchar)(size_t)HEXDSP(hx_mba_ranges_t_range_contains, this, ea) != 0;
12569}
12570
12571//--------------------------------------------------------------------------
12573{
12574 return (uchar)(size_t)HEXDSP(hx_decomp_ranges_t_range_contains, this, ea) != 0;
12575}
12576
12577//--------------------------------------------------------------------------
12579{
12580 sval_t retval;
12581 HEXDSP(hx_mba_t_stkoff_vd2ida, &retval, this, off);
12582 return retval;
12583}
12584
12585//--------------------------------------------------------------------------
12587{
12588 sval_t retval;
12589 HEXDSP(hx_mba_t_stkoff_ida2vd, &retval, this, off);
12590 return retval;
12591}
12592
12593//--------------------------------------------------------------------------
12594inline vdloc_t mba_t::idaloc2vd(const argloc_t &loc, int width, sval_t spd)
12595{
12596 vdloc_t retval;
12597 HEXDSP(hx_mba_t_idaloc2vd, &retval, &loc, width, spd);
12598 return retval;
12599}
12600
12601//--------------------------------------------------------------------------
12602inline vdloc_t mba_t::idaloc2vd(const argloc_t &loc, int width) const
12603{
12604 vdloc_t retval;
12605 HEXDSP(hx_mba_t_idaloc2vd_, &retval, this, &loc, width);
12606 return retval;
12607}
12608
12609//--------------------------------------------------------------------------
12610inline argloc_t mba_t::vd2idaloc(const vdloc_t &loc, size_t width, sval_t spd)
12611{
12612 argloc_t retval;
12613 HEXDSP(hx_mba_t_vd2idaloc, &retval, &loc, width, spd);
12614 return retval;
12615}
12616
12617//--------------------------------------------------------------------------
12618inline argloc_t mba_t::vd2idaloc(const vdloc_t &loc, size_t width) const
12619{
12620 argloc_t retval;
12621 HEXDSP(hx_mba_t_vd2idaloc_, &retval, this, &loc, width);
12622 return retval;
12623}
12624
12625//--------------------------------------------------------------------------
12626inline void mba_t::term()
12627{
12628 HEXDSP(hx_mba_t_term, this);
12629}
12630
12631//--------------------------------------------------------------------------
12633{
12634 return (func_t *)HEXDSP(hx_mba_t_get_curfunc, this);
12635}
12636
12637//--------------------------------------------------------------------------
12639{
12640 return *(const decomp_ranges_t *)HEXDSP(hx_mba_t_get_decomp_ranges, this);
12641}
12642
12643//--------------------------------------------------------------------------
12645{
12646 return (merror_t)(size_t)HEXDSP(hx_mba_t_set_maturity, this, mat);
12647}
12648
12649//--------------------------------------------------------------------------
12650inline int mba_t::optimize_local(int locopt_bits)
12651{
12652 return (int)(size_t)HEXDSP(hx_mba_t_optimize_local, this, locopt_bits);
12653}
12654
12655//--------------------------------------------------------------------------
12657{
12658 return (merror_t)(size_t)HEXDSP(hx_mba_t_build_graph, this);
12659}
12660
12661//--------------------------------------------------------------------------
12663{
12664 return (mbl_graph_t *)HEXDSP(hx_mba_t_get_graph, this);
12665}
12666
12667//--------------------------------------------------------------------------
12668inline int mba_t::analyze_calls(int acflags)
12669{
12670 return (int)(size_t)HEXDSP(hx_mba_t_analyze_calls, this, acflags);
12671}
12672
12673//--------------------------------------------------------------------------
12675{
12676 return (merror_t)(size_t)HEXDSP(hx_mba_t_optimize_global, this);
12677}
12678
12679//--------------------------------------------------------------------------
12681{
12682 HEXDSP(hx_mba_t_alloc_lvars, this);
12683}
12684
12685//--------------------------------------------------------------------------
12686inline void mba_t::dump() const
12687{
12688 HEXDSP(hx_mba_t_dump, this);
12689}
12690
12691//--------------------------------------------------------------------------
12692inline AS_PRINTF(3, 0) void mba_t::vdump_mba(bool _verify, const char *title, va_list va) const
12693{
12694 HEXDSP(hx_mba_t_vdump_mba, this, _verify, title, va);
12695}
12696
12697//--------------------------------------------------------------------------
12698inline void mba_t::print(vd_printer_t &vp) const
12699{
12700 HEXDSP(hx_mba_t_print, this, &vp);
12701}
12702
12703//--------------------------------------------------------------------------
12704inline void mba_t::verify(bool always) const
12705{
12706 HEXDSP(hx_mba_t_verify, this, always);
12707}
12708
12709//--------------------------------------------------------------------------
12710inline void mba_t::mark_chains_dirty()
12711{
12712 HEXDSP(hx_mba_t_mark_chains_dirty, this);
12713}
12714
12715//--------------------------------------------------------------------------
12717{
12718 return (mblock_t *)HEXDSP(hx_mba_t_insert_block, this, bblk);
12719}
12720
12721//--------------------------------------------------------------------------
12723{
12724 return (mblock_t *)HEXDSP(hx_mba_t_split_block, this, blk, start_insn);
12725}
12726
12727//--------------------------------------------------------------------------
12729{
12730 return (uchar)(size_t)HEXDSP(hx_mba_t_remove_block, this, blk) != 0;
12731}
12732
12733//--------------------------------------------------------------------------
12734inline bool mba_t::remove_blocks(int start_blk, int end_blk)
12735{
12736 return (uchar)(size_t)HEXDSP(hx_mba_t_remove_blocks, this, start_blk, end_blk) != 0;
12737}
12738
12739//--------------------------------------------------------------------------
12740inline mblock_t *mba_t::copy_block(mblock_t *blk, int new_serial, int cpblk_flags)
12741{
12742 return (mblock_t *)HEXDSP(hx_mba_t_copy_block, this, blk, new_serial, cpblk_flags);
12743}
12744
12745//--------------------------------------------------------------------------
12747{
12748 return (uchar)(size_t)HEXDSP(hx_mba_t_remove_empty_and_unreachable_blocks, this) != 0;
12749}
12750
12751//--------------------------------------------------------------------------
12753{
12754 return (uchar)(size_t)HEXDSP(hx_mba_t_merge_blocks, this) != 0;
12755}
12756
12757//--------------------------------------------------------------------------
12759{
12760 return (int)(size_t)HEXDSP(hx_mba_t_for_all_ops, this, &mv);
12761}
12762
12763//--------------------------------------------------------------------------
12765{
12766 return (int)(size_t)HEXDSP(hx_mba_t_for_all_insns, this, &mv);
12767}
12768
12769//--------------------------------------------------------------------------
12771{
12772 return (int)(size_t)HEXDSP(hx_mba_t_for_all_topinsns, this, &mv);
12773}
12774
12775//--------------------------------------------------------------------------
12776inline mop_t *mba_t::find_mop(op_parent_info_t *ctx, ea_t ea, bool is_dest, const mlist_t &list)
12777{
12778 return (mop_t *)HEXDSP(hx_mba_t_find_mop, this, ctx, ea, is_dest, &list);
12779}
12780
12781//--------------------------------------------------------------------------
12782inline 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)
12783{
12784 return (minsn_t *)HEXDSP(hx_mba_t_create_helper_call, this, ea, helper, rettype, callargs, out);
12785}
12786
12787//--------------------------------------------------------------------------
12788inline 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)
12789{
12790 HEXDSP(hx_mba_t_get_func_output_lists, this, return_regs, spoiled, &type, call_ea, tail_call);
12791}
12792
12793//--------------------------------------------------------------------------
12794inline lvar_t &mba_t::arg(size_t n)
12795{
12796 return *(lvar_t *)HEXDSP(hx_mba_t_arg, this, n);
12797}
12798
12799//--------------------------------------------------------------------------
12801{
12802 ea_t retval;
12803 HEXDSP(hx_mba_t_alloc_fict_ea, &retval, this, real_ea);
12804 return retval;
12805}
12806
12807//--------------------------------------------------------------------------
12808inline ea_t mba_t::map_fict_ea(ea_t fict_ea) const
12809{
12810 ea_t retval;
12811 HEXDSP(hx_mba_t_map_fict_ea, &retval, this, fict_ea);
12812 return retval;
12813}
12814
12815//--------------------------------------------------------------------------
12816inline bool mba_t::get_numform(number_format_t *nf, const operand_locator_t &loc) const
12817{
12818 return (uchar)(size_t)HEXDSP(hx_mba_t_get_numform, this, nf, &loc) != 0;
12819}
12820
12821//--------------------------------------------------------------------------
12822inline void mba_t::set_numform(const operand_locator_t &loc, const number_format_t &nf)
12823{
12824 HEXDSP(hx_mba_t_set_numform, this, &loc, &nf);
12825}
12826
12827//--------------------------------------------------------------------------
12829{
12830 return (uchar)(size_t)HEXDSP(hx_mba_t_clr_numform, this, &loc) != 0;
12831}
12832
12833//--------------------------------------------------------------------------
12834inline void mba_t::serialize(bytevec_t *vout) const
12835{
12836 HEXDSP(hx_mba_t_serialize, this, vout);
12837}
12838
12839//--------------------------------------------------------------------------
12840inline WARN_UNUSED_RESULT mba_t *mba_t::deserialize(const uchar *bytes, size_t nbytes)
12841{
12842 return (mba_t *)HEXDSP(hx_mba_t_deserialize, bytes, nbytes);
12843}
12844
12845//--------------------------------------------------------------------------
12846inline void mba_t::save_snapshot(const char *description)
12847{
12848 HEXDSP(hx_mba_t_save_snapshot, this, description);
12849}
12850
12851//--------------------------------------------------------------------------
12852inline mreg_t mba_t::alloc_kreg(size_t size, bool check_size)
12853{
12854 return (mreg_t)(size_t)HEXDSP(hx_mba_t_alloc_kreg, this, size, check_size);
12855}
12856
12857//--------------------------------------------------------------------------
12858inline void mba_t::free_kreg(mreg_t reg, size_t size)
12859{
12860 HEXDSP(hx_mba_t_free_kreg, this, reg, size);
12861}
12862
12863//--------------------------------------------------------------------------
12864inline merror_t mba_t::inline_func(codegen_t &cdg, int blknum, mba_ranges_t &ranges, int decomp_flags, int inline_flags)
12865{
12866 return (merror_t)(size_t)HEXDSP(hx_mba_t_inline_func, this, &cdg, blknum, &ranges, decomp_flags, inline_flags);
12867}
12868
12869//--------------------------------------------------------------------------
12870inline merror_t mba_t::inline_function(codegen_t &cdg, int blknum, decomp_ranges_t &ranges, int decomp_flags, int inline_flags)
12871{
12872 return (merror_t)(size_t)HEXDSP(hx_mba_t_inline_function, this, &cdg, blknum, &ranges, decomp_flags, inline_flags);
12873}
12874
12875//--------------------------------------------------------------------------
12876inline const stkpnt_t *mba_t::locate_stkpnt(ea_t ea) const
12877{
12878 return (const stkpnt_t *)HEXDSP(hx_mba_t_locate_stkpnt, this, ea);
12879}
12880
12881//--------------------------------------------------------------------------
12883{
12884 HEXDSP(hx_mba_t_add_user_minsn, this, &uins, mmat);
12885}
12886
12887//--------------------------------------------------------------------------
12889{
12890 return (uchar)(size_t)HEXDSP(hx_mba_t_del_user_minsn, this, &loc, action, mmat) != 0;
12891}
12892
12893//--------------------------------------------------------------------------
12894inline bool mba_t::set_lvar_name(lvar_t &v, const char *name, int flagbits)
12895{
12896 return (uchar)(size_t)HEXDSP(hx_mba_t_set_lvar_name, this, &v, name, flagbits) != 0;
12897}
12898
12899//--------------------------------------------------------------------------
12900inline 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
12901{
12902 return (uchar)(size_t)HEXDSP(hx_mbl_graph_t_is_accessed_globally, this, &list, b1, b2, m1, m2, access_type, maymust) != 0;
12903}
12904
12905//--------------------------------------------------------------------------
12907{
12908 return (graph_chains_t *)HEXDSP(hx_mbl_graph_t_get_ud, this, gctype);
12909}
12910
12911//--------------------------------------------------------------------------
12913{
12914 return (graph_chains_t *)HEXDSP(hx_mbl_graph_t_get_du, this, gctype);
12915}
12916
12917//--------------------------------------------------------------------------
12919{
12920 return (merror_t)(size_t)HEXDSP(hx_cdg_insn_iterator_t_next, this, ins);
12921}
12922
12923//--------------------------------------------------------------------------
12924inline void codegen_t::clear()
12925{
12926 HEXDSP(hx_codegen_t_clear, this);
12927}
12928
12929//--------------------------------------------------------------------------
12930inline minsn_t *codegen_t::emit(mcode_t code, int width, uval_t l, uval_t r, uval_t d, int offsize)
12931{
12932 return (minsn_t *)HEXDSP(hx_codegen_t_emit, this, code, width, l, r, d, offsize);
12933}
12934
12935//--------------------------------------------------------------------------
12936inline minsn_t *codegen_t::emit(mcode_t code, const mop_t *l, const mop_t *r, const mop_t *d)
12937{
12938 return (minsn_t *)HEXDSP(hx_codegen_t_emit_, this, code, l, r, d);
12939}
12940
12941//--------------------------------------------------------------------------
12942inline bool change_hexrays_config(const char *directive)
12943{
12944 return (uchar)(size_t)HEXDSP(hx_change_hexrays_config, directive) != 0;
12945}
12946
12947//--------------------------------------------------------------------------
12948inline const char *get_hexrays_version()
12949{
12950 return (const char *)HEXDSP(hx_get_hexrays_version);
12951}
12952
12953//--------------------------------------------------------------------------
12954inline vdui_t *open_pseudocode(ea_t ea, int flags)
12955{
12956 return (vdui_t *)HEXDSP(hx_open_pseudocode, ea, flags);
12957}
12958
12959//--------------------------------------------------------------------------
12961{
12962 return (uchar)(size_t)HEXDSP(hx_close_pseudocode, f) != 0;
12963}
12964
12965//--------------------------------------------------------------------------
12967{
12968 return (vdui_t *)HEXDSP(hx_get_widget_vdui, f);
12969}
12970
12971//--------------------------------------------------------------------------
12972inline bool decompile_many(const char *outfile, const eavec_t *funcaddrs, int flags)
12973{
12974 return (uchar)(size_t)HEXDSP(hx_decompile_many, outfile, funcaddrs, flags) != 0;
12975}
12976
12977//--------------------------------------------------------------------------
12978inline void send_database(const hexrays_failure_t &err, bool silent)
12979{
12980 HEXDSP(hx_send_database, &err, silent);
12981}
12982
12983//--------------------------------------------------------------------------
12984inline bool gco_info_t::append_to_list(mlist_t *list, const mba_t *mba) const
12985{
12986 return (uchar)(size_t)HEXDSP(hx_gco_info_t_append_to_list, this, list, mba) != 0;
12987}
12988
12989//--------------------------------------------------------------------------
12991{
12992 return (uchar)(size_t)HEXDSP(hx_get_current_operand, out) != 0;
12993}
12994
12995//--------------------------------------------------------------------------
12996inline void remitem(const citem_t *e)
12997{
12998 HEXDSP(hx_remitem, e);
12999}
13000
13001//--------------------------------------------------------------------------
13003{
13004 return (ctype_t)(size_t)HEXDSP(hx_negated_relation, op);
13005}
13006
13007//--------------------------------------------------------------------------
13009{
13010 return (ctype_t)(size_t)HEXDSP(hx_swapped_relation, op);
13011}
13012
13013//--------------------------------------------------------------------------
13015{
13016 return (type_sign_t)(size_t)HEXDSP(hx_get_op_signness, op);
13017}
13018
13019//--------------------------------------------------------------------------
13021{
13022 return (ctype_t)(size_t)HEXDSP(hx_asgop, cop);
13023}
13024
13025//--------------------------------------------------------------------------
13027{
13028 return (ctype_t)(size_t)HEXDSP(hx_asgop_revert, cop);
13029}
13030
13031//--------------------------------------------------------------------------
13032inline void cnumber_t::print(qstring *vout, const tinfo_t &type, const citem_t *parent, bool *nice_stroff) const
13033{
13034 HEXDSP(hx_cnumber_t_print, this, vout, &type, parent, nice_stroff);
13035}
13036
13037//--------------------------------------------------------------------------
13039{
13040 uint64 retval;
13041 HEXDSP(hx_cnumber_t_value, &retval, this, &type);
13042 return retval;
13043}
13044
13045//--------------------------------------------------------------------------
13046inline void cnumber_t::assign(uint64 v, size_t nbytes, type_sign_t sign)
13047{
13048 HEXDSP(hx_cnumber_t_assign, this, v, nbytes, sign);
13049}
13050
13051//--------------------------------------------------------------------------
13052inline int cnumber_t::compare(const cnumber_t &r) const
13053{
13054 return (int)(size_t)HEXDSP(hx_cnumber_t_compare, this, &r);
13055}
13056
13057//--------------------------------------------------------------------------
13058inline int var_ref_t::compare(const var_ref_t &r) const
13059{
13060 return (int)(size_t)HEXDSP(hx_var_ref_t_compare, this, &r);
13061}
13062
13063//--------------------------------------------------------------------------
13064inline int citem_locator_t::compare(const citem_locator_t &r) const
13065{
13066 return (int)(size_t)HEXDSP(hx_citem_locator_t_compare, this, &r);
13067}
13068
13069//--------------------------------------------------------------------------
13070inline bool citem_t::contains_expr(const cexpr_t *e) const
13071{
13072 return (uchar)(size_t)HEXDSP(hx_citem_t_contains_expr, this, e) != 0;
13073}
13074
13075//--------------------------------------------------------------------------
13076inline bool citem_t::contains_label() const
13077{
13078 return (uchar)(size_t)HEXDSP(hx_citem_t_contains_label, this) != 0;
13079}
13080
13081//--------------------------------------------------------------------------
13082inline const citem_t *citem_t::find_parent_of(const citem_t *item) const
13083{
13084 return (const citem_t *)HEXDSP(hx_citem_t_find_parent_of, this, item);
13085}
13086
13087//--------------------------------------------------------------------------
13089{
13090 return (citem_t *)HEXDSP(hx_citem_t_find_closest_addr, this, _ea);
13091}
13092
13093//--------------------------------------------------------------------------
13095{
13096 return *(cexpr_t *)HEXDSP(hx_cexpr_t_assign, this, &r);
13097}
13098
13099//--------------------------------------------------------------------------
13100inline int cexpr_t::compare(const cexpr_t &r) const
13101{
13102 return (int)(size_t)HEXDSP(hx_cexpr_t_compare, this, &r);
13103}
13104
13105//--------------------------------------------------------------------------
13107{
13108 HEXDSP(hx_cexpr_t_replace_by, this, r);
13109}
13110
13111//--------------------------------------------------------------------------
13112inline void cexpr_t::cleanup()
13113{
13114 HEXDSP(hx_cexpr_t_cleanup, this);
13115}
13116
13117//--------------------------------------------------------------------------
13118inline void cexpr_t::put_number(cfunc_t *func, uint64 value, size_t nbytes, type_sign_t sign)
13119{
13120 HEXDSP(hx_cexpr_t_put_number, this, func, value, nbytes, sign);
13121}
13122
13123//--------------------------------------------------------------------------
13124inline void cexpr_t::print1(qstring *vout, const cfunc_t *func) const
13125{
13126 HEXDSP(hx_cexpr_t_print1, this, vout, func);
13127}
13128
13129//--------------------------------------------------------------------------
13130inline void cexpr_t::calc_type(bool recursive)
13131{
13132 HEXDSP(hx_cexpr_t_calc_type, this, recursive);
13133}
13134
13135//--------------------------------------------------------------------------
13136inline bool cexpr_t::equal_effect(const cexpr_t &r) const
13137{
13138 return (uchar)(size_t)HEXDSP(hx_cexpr_t_equal_effect, this, &r) != 0;
13139}
13140
13141//--------------------------------------------------------------------------
13142inline bool cexpr_t::is_child_of(const citem_t *parent) const
13143{
13144 return (uchar)(size_t)HEXDSP(hx_cexpr_t_is_child_of, this, parent) != 0;
13145}
13146
13147//--------------------------------------------------------------------------
13148inline bool cexpr_t::contains_operator(ctype_t needed_op, int times) const
13149{
13150 return (uchar)(size_t)HEXDSP(hx_cexpr_t_contains_operator, this, needed_op, times) != 0;
13151}
13152
13153//--------------------------------------------------------------------------
13155{
13156 bit_bound_t retval;
13157 HEXDSP(hx_cexpr_t_get_high_nbit_bound, &retval, this);
13158 return retval;
13159}
13160
13161//--------------------------------------------------------------------------
13163{
13164 return (int)(size_t)HEXDSP(hx_cexpr_t_get_low_nbit_bound, this);
13165}
13166
13167//--------------------------------------------------------------------------
13168inline bool cexpr_t::requires_lvalue(const cexpr_t *child) const
13169{
13170 return (uchar)(size_t)HEXDSP(hx_cexpr_t_requires_lvalue, this, child) != 0;
13171}
13172
13173//--------------------------------------------------------------------------
13174inline bool cexpr_t::has_side_effects() const
13175{
13176 return (uchar)(size_t)HEXDSP(hx_cexpr_t_has_side_effects, this) != 0;
13177}
13178
13179//--------------------------------------------------------------------------
13180inline bool cexpr_t::maybe_ptr() const
13181{
13182 return (uchar)(size_t)HEXDSP(hx_cexpr_t_maybe_ptr, this) != 0;
13183}
13184
13185//--------------------------------------------------------------------------
13186inline const char *cexpr_t::dstr() const
13187{
13188 return (const char *)HEXDSP(hx_cexpr_t_dstr, this);
13189}
13190
13191//--------------------------------------------------------------------------
13192inline cif_t &cif_t::assign(const cif_t &r)
13193{
13194 return *(cif_t *)HEXDSP(hx_cif_t_assign, this, &r);
13195}
13196
13197//--------------------------------------------------------------------------
13198inline int cif_t::compare(const cif_t &r) const
13199{
13200 return (int)(size_t)HEXDSP(hx_cif_t_compare, this, &r);
13201}
13202
13203//--------------------------------------------------------------------------
13205{
13206 return *(cloop_t *)HEXDSP(hx_cloop_t_assign, this, &r);
13207}
13208
13209//--------------------------------------------------------------------------
13210inline int cfor_t::compare(const cfor_t &r) const
13211{
13212 return (int)(size_t)HEXDSP(hx_cfor_t_compare, this, &r);
13213}
13214
13215//--------------------------------------------------------------------------
13216inline int cwhile_t::compare(const cwhile_t &r) const
13217{
13218 return (int)(size_t)HEXDSP(hx_cwhile_t_compare, this, &r);
13219}
13220
13221//--------------------------------------------------------------------------
13222inline int cdo_t::compare(const cdo_t &r) const
13223{
13224 return (int)(size_t)HEXDSP(hx_cdo_t_compare, this, &r);
13225}
13226
13227//--------------------------------------------------------------------------
13228inline int creturn_t::compare(const creturn_t &r) const
13229{
13230 return (int)(size_t)HEXDSP(hx_creturn_t_compare, this, &r);
13231}
13232
13233//--------------------------------------------------------------------------
13234inline int cgoto_t::compare(const cgoto_t &r) const
13235{
13236 return (int)(size_t)HEXDSP(hx_cgoto_t_compare, this, &r);
13237}
13238
13239//--------------------------------------------------------------------------
13240inline int casm_t::compare(const casm_t &r) const
13241{
13242 return (int)(size_t)HEXDSP(hx_casm_t_compare, this, &r);
13243}
13244
13245//--------------------------------------------------------------------------
13247{
13248 return *(cinsn_t *)HEXDSP(hx_cinsn_t_assign, this, &r);
13249}
13250
13251//--------------------------------------------------------------------------
13252inline int cinsn_t::compare(const cinsn_t &r) const
13253{
13254 return (int)(size_t)HEXDSP(hx_cinsn_t_compare, this, &r);
13255}
13256
13257//--------------------------------------------------------------------------
13259{
13260 HEXDSP(hx_cinsn_t_replace_by, this, r);
13261}
13262
13263//--------------------------------------------------------------------------
13264inline void cinsn_t::cleanup()
13265{
13266 HEXDSP(hx_cinsn_t_cleanup, this);
13267}
13268
13269//--------------------------------------------------------------------------
13271{
13272 return *(cinsn_t *)HEXDSP(hx_cinsn_t_new_insn, this, insn_ea);
13273}
13274
13275//--------------------------------------------------------------------------
13277{
13278 return *(cif_t *)HEXDSP(hx_cinsn_t_create_if, this, cnd);
13279}
13280
13281//--------------------------------------------------------------------------
13282inline void cinsn_t::print(int indent, vc_printer_t &vp, use_curly_t use_curly) const
13283{
13284 HEXDSP(hx_cinsn_t_print, this, indent, &vp, use_curly);
13285}
13286
13287//--------------------------------------------------------------------------
13288inline void cinsn_t::print1(qstring *vout, const cfunc_t *func) const
13289{
13290 HEXDSP(hx_cinsn_t_print1, this, vout, func);
13291}
13292
13293//--------------------------------------------------------------------------
13294inline bool cinsn_t::is_ordinary_flow() const
13295{
13296 return (uchar)(size_t)HEXDSP(hx_cinsn_t_is_ordinary_flow, this) != 0;
13297}
13298
13299//--------------------------------------------------------------------------
13300inline bool cinsn_t::contains_insn(ctype_t type, int times) const
13301{
13302 return (uchar)(size_t)HEXDSP(hx_cinsn_t_contains_insn, this, type, times) != 0;
13303}
13304
13305//--------------------------------------------------------------------------
13307{
13308 return (uchar)(size_t)HEXDSP(hx_cinsn_t_collect_free_breaks, this, breaks) != 0;
13309}
13310
13311//--------------------------------------------------------------------------
13313{
13314 return (uchar)(size_t)HEXDSP(hx_cinsn_t_collect_free_continues, this, continues) != 0;
13315}
13316
13317//--------------------------------------------------------------------------
13318inline const char *cinsn_t::dstr() const
13319{
13320 return (const char *)HEXDSP(hx_cinsn_t_dstr, this);
13321}
13322
13323//--------------------------------------------------------------------------
13324inline int cblock_t::compare(const cblock_t &r) const
13325{
13326 return (int)(size_t)HEXDSP(hx_cblock_t_compare, this, &r);
13327}
13328
13329//--------------------------------------------------------------------------
13330inline int carglist_t::compare(const carglist_t &r) const
13331{
13332 return (int)(size_t)HEXDSP(hx_carglist_t_compare, this, &r);
13333}
13334
13335//--------------------------------------------------------------------------
13336inline int ccase_t::compare(const ccase_t &r) const
13337{
13338 return (int)(size_t)HEXDSP(hx_ccase_t_compare, this, &r);
13339}
13340
13341//--------------------------------------------------------------------------
13342inline int ccases_t::compare(const ccases_t &r) const
13343{
13344 return (int)(size_t)HEXDSP(hx_ccases_t_compare, this, &r);
13345}
13346
13347//--------------------------------------------------------------------------
13348inline int cswitch_t::compare(const cswitch_t &r) const
13349{
13350 return (int)(size_t)HEXDSP(hx_cswitch_t_compare, this, &r);
13351}
13352
13353//--------------------------------------------------------------------------
13354inline int catchexpr_t::compare(const catchexpr_t &r) const
13355{
13356 return (int)(size_t)HEXDSP(hx_catchexpr_t_compare, this, &r);
13357}
13358
13359//--------------------------------------------------------------------------
13360inline int ccatch_t::compare(const ccatch_t &r) const
13361{
13362 return (int)(size_t)HEXDSP(hx_ccatch_t_compare, this, &r);
13363}
13364
13365//--------------------------------------------------------------------------
13366inline int ctry_t::compare(const ctry_t &r) const
13367{
13368 return (int)(size_t)HEXDSP(hx_ctry_t_compare, this, &r);
13369}
13370
13371//--------------------------------------------------------------------------
13372inline int cthrow_t::compare(const cthrow_t &r) const
13373{
13374 return (int)(size_t)HEXDSP(hx_cthrow_t_compare, this, &r);
13375}
13376
13377//--------------------------------------------------------------------------
13379{
13380 return (int)(size_t)HEXDSP(hx_ctree_visitor_t_apply_to, this, item, parent);
13381}
13382
13383//--------------------------------------------------------------------------
13385{
13386 return (int)(size_t)HEXDSP(hx_ctree_visitor_t_apply_to_exprs, this, item, parent);
13387}
13388
13389//--------------------------------------------------------------------------
13391{
13392 return (uchar)(size_t)HEXDSP(hx_ctree_parentee_t_recalc_parent_types, this) != 0;
13393}
13394
13395//--------------------------------------------------------------------------
13397{
13398 return (uchar)(size_t)HEXDSP(hx_cfunc_parentee_t_calc_rvalue_type, this, target, e) != 0;
13399}
13400
13401//--------------------------------------------------------------------------
13402inline int ctree_item_t::get_udm(udm_t *udm, tinfo_t *parent, uint64 *p_offset) const
13403{
13404 return (int)(size_t)HEXDSP(hx_ctree_item_t_get_udm, this, udm, parent, p_offset);
13405}
13406
13407//--------------------------------------------------------------------------
13408inline int ctree_item_t::get_edm(tinfo_t *parent) const
13409{
13410 return (int)(size_t)HEXDSP(hx_ctree_item_t_get_edm, this, parent);
13411}
13412
13413//--------------------------------------------------------------------------
13415{
13416 return (lvar_t *)HEXDSP(hx_ctree_item_t_get_lvar, this);
13417}
13418
13419//--------------------------------------------------------------------------
13421{
13422 ea_t retval;
13423 HEXDSP(hx_ctree_item_t_get_ea, &retval, this);
13424 return retval;
13425}
13426
13427//--------------------------------------------------------------------------
13428inline int ctree_item_t::get_label_num(int gln_flags) const
13429{
13430 return (int)(size_t)HEXDSP(hx_ctree_item_t_get_label_num, this, gln_flags);
13431}
13432
13433//--------------------------------------------------------------------------
13434inline void ctree_item_t::print(qstring *vout) const
13435{
13436 HEXDSP(hx_ctree_item_t_print, this, vout);
13437}
13438
13439//--------------------------------------------------------------------------
13440inline const char *ctree_item_t::dstr() const
13441{
13442 return (const char *)HEXDSP(hx_ctree_item_t_dstr, this);
13443}
13444
13445//--------------------------------------------------------------------------
13447{
13448 return (cexpr_t *)HEXDSP(hx_lnot, e);
13449}
13450
13451//--------------------------------------------------------------------------
13453{
13454 return (cinsn_t *)HEXDSP(hx_new_block);
13455}
13456
13457//--------------------------------------------------------------------------
13458inline AS_PRINTF(3, 0) cexpr_t *vcreate_helper(bool standalone, const tinfo_t &type, const char *format, va_list va)
13459{
13460 return (cexpr_t *)HEXDSP(hx_vcreate_helper, standalone, &type, format, va);
13461}
13462
13463//--------------------------------------------------------------------------
13464inline AS_PRINTF(3, 0) cexpr_t *vcall_helper(const tinfo_t &rettype, carglist_t *args, const char *format, va_list va)
13465{
13466 return (cexpr_t *)HEXDSP(hx_vcall_helper, &rettype, args, format, va);
13467}
13468
13469//--------------------------------------------------------------------------
13470inline cexpr_t *make_num(uint64 n, cfunc_t *func, ea_t ea, int opnum, type_sign_t sign, int size)
13471{
13472 return (cexpr_t *)HEXDSP(hx_make_num, n, func, ea, opnum, sign, size);
13473}
13474
13475//--------------------------------------------------------------------------
13477{
13478 return (cexpr_t *)HEXDSP(hx_make_ref, e);
13479}
13480
13481//--------------------------------------------------------------------------
13482inline cexpr_t *dereference(cexpr_t *e, size_t ptrsize, bool is_flt)
13483{
13484 return (cexpr_t *)HEXDSP(hx_dereference, e, ptrsize, is_flt);
13485}
13486
13487//--------------------------------------------------------------------------
13488inline void save_user_labels(ea_t func_ea, const user_labels_t *user_labels, const cfunc_t *func)
13489{
13490 HEXDSP(hx_save_user_labels, func_ea, user_labels, func);
13491}
13492
13493//--------------------------------------------------------------------------
13494inline void save_user_cmts(ea_t func_ea, const user_cmts_t *user_cmts)
13495{
13496 HEXDSP(hx_save_user_cmts, func_ea, user_cmts);
13497}
13498
13499//--------------------------------------------------------------------------
13500inline void save_user_numforms(ea_t func_ea, const user_numforms_t *numforms)
13501{
13502 HEXDSP(hx_save_user_numforms, func_ea, numforms);
13503}
13504
13505//--------------------------------------------------------------------------
13506inline void save_user_iflags(ea_t func_ea, const user_iflags_t *iflags)
13507{
13508 HEXDSP(hx_save_user_iflags, func_ea, iflags);
13509}
13510
13511//--------------------------------------------------------------------------
13512inline void save_user_unions(ea_t func_ea, const user_unions_t *unions)
13513{
13514 HEXDSP(hx_save_user_unions, func_ea, unions);
13515}
13516
13517//--------------------------------------------------------------------------
13518inline void save_user_casts(ea_t func_ea, const user_casts_t *casts)
13519{
13520 HEXDSP(hx_save_user_casts, func_ea, casts);
13521}
13522
13523//--------------------------------------------------------------------------
13525{
13526 return (user_casts_t *)HEXDSP(hx_restore_user_casts, func_ea);
13527}
13528
13529//--------------------------------------------------------------------------
13530inline user_labels_t *restore_user_labels(ea_t func_ea, const cfunc_t *func)
13531{
13532 return (user_labels_t *)HEXDSP(hx_restore_user_labels, func_ea, func);
13533}
13534
13535//--------------------------------------------------------------------------
13537{
13538 return (user_cmts_t *)HEXDSP(hx_restore_user_cmts, func_ea);
13539}
13540
13541//--------------------------------------------------------------------------
13543{
13544 return (user_numforms_t *)HEXDSP(hx_restore_user_numforms, func_ea);
13545}
13546
13547//--------------------------------------------------------------------------
13549{
13550 return (user_iflags_t *)HEXDSP(hx_restore_user_iflags, func_ea);
13551}
13552
13553//--------------------------------------------------------------------------
13555{
13556 return (user_unions_t *)HEXDSP(hx_restore_user_unions, func_ea);
13557}
13558
13559//--------------------------------------------------------------------------
13560inline void cfunc_t::build_c_tree()
13561{
13562 HEXDSP(hx_cfunc_t_build_c_tree, this);
13563}
13564
13565//--------------------------------------------------------------------------
13566inline void cfunc_t::verify(allow_unused_labels_t aul, bool even_without_debugger) const
13567{
13568 HEXDSP(hx_cfunc_t_verify, this, aul, even_without_debugger);
13569}
13570
13571//--------------------------------------------------------------------------
13572inline void cfunc_t::print_dcl(qstring *vout) const
13573{
13574 HEXDSP(hx_cfunc_t_print_dcl, this, vout);
13575}
13576
13577//--------------------------------------------------------------------------
13578inline void cfunc_t::print_func(vc_printer_t &vp) const
13579{
13580 HEXDSP(hx_cfunc_t_print_func, this, &vp);
13581}
13582
13583//--------------------------------------------------------------------------
13585{
13586 return (uchar)(size_t)HEXDSP(hx_cfunc_t_get_func_type, this, type) != 0;
13587}
13588
13589//--------------------------------------------------------------------------
13591{
13592 return (lvars_t *)HEXDSP(hx_cfunc_t_get_lvars, this);
13593}
13594
13595//--------------------------------------------------------------------------
13597{
13598 sval_t retval;
13599 HEXDSP(hx_cfunc_t_get_stkoff_delta, &retval, this);
13600 return retval;
13601}
13602
13603//--------------------------------------------------------------------------
13605{
13606 return (citem_t *)HEXDSP(hx_cfunc_t_find_label, this, label);
13607}
13608
13609//--------------------------------------------------------------------------
13611{
13612 HEXDSP(hx_cfunc_t_remove_unused_labels, this);
13613}
13614
13615//--------------------------------------------------------------------------
13616inline void cfunc_t::redirect_gotos(int from, int to)
13617{
13618 HEXDSP(hx_cfunc_t_redirect_gotos, this, from, to);
13619}
13620
13621//--------------------------------------------------------------------------
13622inline const char *cfunc_t::get_user_cmt(const treeloc_t &loc, cmt_retrieval_type_t rt) const
13623{
13624 return (const char *)HEXDSP(hx_cfunc_t_get_user_cmt, this, &loc, rt);
13625}
13626
13627//--------------------------------------------------------------------------
13628inline void cfunc_t::set_user_cmt(const treeloc_t &loc, const char *cmt)
13629{
13630 HEXDSP(hx_cfunc_t_set_user_cmt, this, &loc, cmt);
13631}
13632
13633//--------------------------------------------------------------------------
13635{
13636 return (int32)(size_t)HEXDSP(hx_cfunc_t_get_user_iflags, this, &loc);
13637}
13638
13639//--------------------------------------------------------------------------
13640inline void cfunc_t::set_user_iflags(const citem_locator_t &loc, int32 iflags)
13641{
13642 HEXDSP(hx_cfunc_t_set_user_iflags, this, &loc, iflags);
13643}
13644
13645//--------------------------------------------------------------------------
13646inline bool cfunc_t::has_orphan_cmts() const
13647{
13648 return (uchar)(size_t)HEXDSP(hx_cfunc_t_has_orphan_cmts, this) != 0;
13649}
13650
13651//--------------------------------------------------------------------------
13653{
13654 return (int)(size_t)HEXDSP(hx_cfunc_t_del_orphan_cmts, this);
13655}
13656
13657//--------------------------------------------------------------------------
13659{
13660 return (uchar)(size_t)HEXDSP(hx_cfunc_t_get_user_union_selection, this, ea, path) != 0;
13661}
13662
13663//--------------------------------------------------------------------------
13665{
13666 HEXDSP(hx_cfunc_t_set_user_union_selection, this, ea, &path);
13667}
13668
13669//--------------------------------------------------------------------------
13670inline void cfunc_t::save_user_labels() const
13671{
13672 HEXDSP(hx_cfunc_t_save_user_labels, this);
13673}
13674
13675//--------------------------------------------------------------------------
13676inline void cfunc_t::save_user_cmts() const
13677{
13678 HEXDSP(hx_cfunc_t_save_user_cmts, this);
13679}
13680
13681//--------------------------------------------------------------------------
13683{
13684 HEXDSP(hx_cfunc_t_save_user_numforms, this);
13685}
13686
13687//--------------------------------------------------------------------------
13688inline void cfunc_t::save_user_iflags() const
13689{
13690 HEXDSP(hx_cfunc_t_save_user_iflags, this);
13691}
13692
13693//--------------------------------------------------------------------------
13694inline void cfunc_t::save_user_unions() const
13695{
13696 HEXDSP(hx_cfunc_t_save_user_unions, this);
13697}
13698
13699//--------------------------------------------------------------------------
13700inline void cfunc_t::save_user_casts() const
13701{
13702 HEXDSP(hx_cfunc_t_save_user_casts, this);
13703}
13704
13705//--------------------------------------------------------------------------
13707{
13708 tinfo_t retval;
13709 HEXDSP(hx_cfunc_t_get_user_cast, &retval, this, &loc);
13710 return retval;
13711}
13712
13713//--------------------------------------------------------------------------
13715{
13716 HEXDSP(hx_cfunc_t_set_user_cast, this, &loc, &type);
13717}
13718
13719//--------------------------------------------------------------------------
13720inline 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)
13721{
13722 return (uchar)(size_t)HEXDSP(hx_cfunc_t_get_line_item, this, line, x, is_ctree_line, phead, pitem, ptail) != 0;
13723}
13724
13725//--------------------------------------------------------------------------
13727{
13728 return *(hexwarns_t *)HEXDSP(hx_cfunc_t_get_warnings, this);
13729}
13730
13731//--------------------------------------------------------------------------
13733{
13734 return *(eamap_t *)HEXDSP(hx_cfunc_t_get_eamap, this);
13735}
13736
13737//--------------------------------------------------------------------------
13739{
13740 return *(boundaries_t *)HEXDSP(hx_cfunc_t_get_boundaries, this);
13741}
13742
13743//--------------------------------------------------------------------------
13745{
13746 return *(const strvec_t *)HEXDSP(hx_cfunc_t_get_pseudocode, this);
13747}
13748
13749//--------------------------------------------------------------------------
13751{
13752 HEXDSP(hx_cfunc_t_refresh_func_ctext, this);
13753}
13754
13755//--------------------------------------------------------------------------
13757{
13759}
13760
13761//--------------------------------------------------------------------------
13763{
13764 return (const citem_t *)HEXDSP(hx_cfunc_t_find_addressable_item, this, i);
13765}
13766
13767//--------------------------------------------------------------------------
13768inline bool cfunc_t::gather_derefs(const ctree_item_t &ci, udt_type_data_t *udm) const
13769{
13770 return (uchar)(size_t)HEXDSP(hx_cfunc_t_gather_derefs, this, &ci, udm) != 0;
13771}
13772
13773//--------------------------------------------------------------------------
13774inline bool cfunc_t::find_item_coords(const citem_t *item, int *px, int *py)
13775{
13776 return (uchar)(size_t)HEXDSP(hx_cfunc_t_find_item_coords, this, item, px, py) != 0;
13777}
13778
13779//--------------------------------------------------------------------------
13781{
13782 return (uchar)(size_t)HEXDSP(hx_cfunc_t_serialize, this, vout) != 0;
13783}
13784
13785//--------------------------------------------------------------------------
13786inline WARN_UNUSED_RESULT cfunc_t *cfunc_t::deserialize(mba_t *mba, const uchar *bytes, size_t nbytes)
13787{
13788 return (cfunc_t *)HEXDSP(hx_cfunc_t_deserialize, mba, bytes, nbytes);
13789}
13790
13791//--------------------------------------------------------------------------
13792inline void cfunc_t::cleanup()
13793{
13794 HEXDSP(hx_cfunc_t_cleanup, this);
13795}
13796
13797//--------------------------------------------------------------------------
13799{
13801}
13802
13803//--------------------------------------------------------------------------
13804inline cfuncptr_t decompile(const mba_ranges_t &mbr, hexrays_failure_t *hf, int decomp_flags)
13805{
13806 return cfuncptr_t((cfunc_t *)HEXDSP(hx_decompile, &mbr, hf, decomp_flags));
13807}
13808
13809//--------------------------------------------------------------------------
13810inline cfuncptr_t decompile(const decomp_ranges_t &dcr, hexrays_failure_t *hf, int decomp_flags)
13811{
13812 return cfuncptr_t((cfunc_t *)HEXDSP(hx_decompile_, &dcr, hf, decomp_flags));
13813}
13814
13815//--------------------------------------------------------------------------
13816inline mba_t *gen_microcode(const mba_ranges_t &mbr, hexrays_failure_t *hf, const mlist_t *retlist, int decomp_flags, mba_maturity_t reqmat)
13817{
13818 return (mba_t *)HEXDSP(hx_gen_microcode, &mbr, hf, retlist, decomp_flags, reqmat);
13819}
13820
13821//--------------------------------------------------------------------------
13822inline mba_t *gen_microcode(const decomp_ranges_t &dcr, hexrays_failure_t *hf, const mlist_t *retlist, int decomp_flags, mba_maturity_t reqmat)
13823{
13824 return (mba_t *)HEXDSP(hx_gen_microcode_, &dcr, hf, retlist, decomp_flags, reqmat);
13825}
13826
13827//--------------------------------------------------------------------------
13829{
13830 return cfuncptr_t((cfunc_t *)HEXDSP(hx_create_cfunc, mba));
13831}
13832
13833//--------------------------------------------------------------------------
13834inline bool mark_cfunc_dirty(ea_t ea, bool close_views)
13835{
13836 return (uchar)(size_t)HEXDSP(hx_mark_cfunc_dirty, ea, close_views) != 0;
13837}
13838
13839//--------------------------------------------------------------------------
13841{
13842 HEXDSP(hx_clear_cached_cfuncs);
13843}
13844
13845//--------------------------------------------------------------------------
13846inline bool has_cached_cfunc(ea_t ea)
13847{
13848 return (uchar)(size_t)HEXDSP(hx_has_cached_cfunc, ea) != 0;
13849}
13850
13851//--------------------------------------------------------------------------
13853{
13854 HEXDSP(hx_get_cached_cfunc_eas, out);
13855}
13856
13857//--------------------------------------------------------------------------
13858inline const char *get_ctype_name(ctype_t op)
13859{
13860 return (const char *)HEXDSP(hx_get_ctype_name, op);
13861}
13862
13863//--------------------------------------------------------------------------
13865{
13866 qstring retval;
13867 HEXDSP(hx_create_field_name, &retval, &type, offset);
13868 return retval;
13869}
13870
13871//--------------------------------------------------------------------------
13872inline bool install_hexrays_callback(hexrays_cb_t *callback, void *ud)
13873{
13874 return (uchar)(size_t)HEXDSP(hx_install_hexrays_callback, callback, ud) != 0;
13875}
13876
13877//--------------------------------------------------------------------------
13878inline int remove_hexrays_callback(hexrays_cb_t *callback, void *ud)
13879{
13880 auto hrdsp = HEXDSP;
13881 return hrdsp == nullptr ? 0 : (int)(size_t)hrdsp(hx_remove_hexrays_callback, callback, ud);
13882}
13883
13884//--------------------------------------------------------------------------
13885inline bool vdui_t::set_locked(bool v)
13886{
13887 return (uchar)(size_t)HEXDSP(hx_vdui_t_set_locked, this, v) != 0;
13888}
13889
13890//--------------------------------------------------------------------------
13891inline void vdui_t::refresh_view(bool redo_mba)
13892{
13893 HEXDSP(hx_vdui_t_refresh_view, this, redo_mba);
13894}
13895
13896//--------------------------------------------------------------------------
13897inline void vdui_t::refresh_ctext(bool activate)
13898{
13899 HEXDSP(hx_vdui_t_refresh_ctext, this, activate);
13900}
13901
13902//--------------------------------------------------------------------------
13903inline void vdui_t::switch_to(cfuncptr_t f, bool activate)
13904{
13905 HEXDSP(hx_vdui_t_switch_to, this, &f, activate);
13906}
13907
13908//--------------------------------------------------------------------------
13910{
13911 return (cnumber_t *)HEXDSP(hx_vdui_t_get_number, this);
13912}
13913
13914//--------------------------------------------------------------------------
13916{
13917 return (int)(size_t)HEXDSP(hx_vdui_t_get_current_label, this);
13918}
13919
13920//--------------------------------------------------------------------------
13921inline void vdui_t::clear()
13922{
13923 HEXDSP(hx_vdui_t_clear, this);
13924}
13925
13926//--------------------------------------------------------------------------
13928{
13929 return (uchar)(size_t)HEXDSP(hx_vdui_t_refresh_cpos, this, idv) != 0;
13930}
13931
13932//--------------------------------------------------------------------------
13934{
13935 return (uchar)(size_t)HEXDSP(hx_vdui_t_get_current_item, this, idv) != 0;
13936}
13937
13938//--------------------------------------------------------------------------
13940{
13941 return (uchar)(size_t)HEXDSP(hx_vdui_t_ui_rename_lvar, this, v) != 0;
13942}
13943
13944//--------------------------------------------------------------------------
13945inline bool vdui_t::rename_lvar(lvar_t *v, const char *name, bool is_user_name)
13946{
13947 return (uchar)(size_t)HEXDSP(hx_vdui_t_rename_lvar, this, v, name, is_user_name) != 0;
13948}
13949
13950//--------------------------------------------------------------------------
13952{
13953 return (uchar)(size_t)HEXDSP(hx_vdui_t_ui_set_call_type, this, e) != 0;
13954}
13955
13956//--------------------------------------------------------------------------
13958{
13959 return (uchar)(size_t)HEXDSP(hx_vdui_t_ui_set_lvar_type, this, v) != 0;
13960}
13961
13962//--------------------------------------------------------------------------
13964{
13965 return (uchar)(size_t)HEXDSP(hx_vdui_t_set_lvar_type, this, v, &type) != 0;
13966}
13967
13968//--------------------------------------------------------------------------
13970{
13971 return (uchar)(size_t)HEXDSP(hx_vdui_t_set_noptr_lvar, this, v) != 0;
13972}
13973
13974//--------------------------------------------------------------------------
13976{
13977 return (uchar)(size_t)HEXDSP(hx_vdui_t_ui_edit_lvar_cmt, this, v) != 0;
13978}
13979
13980//--------------------------------------------------------------------------
13981inline bool vdui_t::set_lvar_cmt(lvar_t *v, const char *cmt)
13982{
13983 return (uchar)(size_t)HEXDSP(hx_vdui_t_set_lvar_cmt, this, v, cmt) != 0;
13984}
13985
13986//--------------------------------------------------------------------------
13988{
13989 return (uchar)(size_t)HEXDSP(hx_vdui_t_ui_map_lvar, this, v) != 0;
13990}
13991
13992//--------------------------------------------------------------------------
13994{
13995 return (uchar)(size_t)HEXDSP(hx_vdui_t_ui_unmap_lvar, this, v) != 0;
13996}
13997
13998//--------------------------------------------------------------------------
14000{
14001 return (uchar)(size_t)HEXDSP(hx_vdui_t_ui_add_cast, this, e) != 0;
14002}
14003
14004//--------------------------------------------------------------------------
14006{
14007 return (uchar)(size_t)HEXDSP(hx_vdui_t_ui_noprop_lvar, this, v) != 0;
14008}
14009
14010//--------------------------------------------------------------------------
14011inline bool vdui_t::map_lvar(lvar_t *from, lvar_t *to)
14012{
14013 return (uchar)(size_t)HEXDSP(hx_vdui_t_map_lvar, this, from, to) != 0;
14014}
14015
14016//--------------------------------------------------------------------------
14017inline bool vdui_t::set_udm_type(const tinfo_t &udt_type, int udm_idx)
14018{
14019 return (uchar)(size_t)HEXDSP(hx_vdui_t_set_udm_type, this, &udt_type, udm_idx) != 0;
14020}
14021
14022//--------------------------------------------------------------------------
14023inline bool vdui_t::rename_udm(const tinfo_t &udt_type, int udm_idx)
14024{
14025 return (uchar)(size_t)HEXDSP(hx_vdui_t_rename_udm, this, &udt_type, udm_idx) != 0;
14026}
14027
14028//--------------------------------------------------------------------------
14030{
14031 return (uchar)(size_t)HEXDSP(hx_vdui_t_set_global_type, this, ea) != 0;
14032}
14033
14034//--------------------------------------------------------------------------
14036{
14037 return (uchar)(size_t)HEXDSP(hx_vdui_t_rename_global, this, ea) != 0;
14038}
14039
14040//--------------------------------------------------------------------------
14041inline bool vdui_t::rename_label(int label)
14042{
14043 return (uchar)(size_t)HEXDSP(hx_vdui_t_rename_label, this, label) != 0;
14044}
14045
14046//--------------------------------------------------------------------------
14047inline bool vdui_t::jump_enter(input_device_t idv, int omflags)
14048{
14049 return (uchar)(size_t)HEXDSP(hx_vdui_t_jump_enter, this, idv, omflags) != 0;
14050}
14051
14052//--------------------------------------------------------------------------
14054{
14055 return (uchar)(size_t)HEXDSP(hx_vdui_t_ctree_to_disasm, this) != 0;
14056}
14057
14058//--------------------------------------------------------------------------
14059inline cmt_type_t vdui_t::calc_cmt_type(size_t lnnum, cmt_type_t cmttype) const
14060{
14061 return (cmt_type_t)(size_t)HEXDSP(hx_vdui_t_calc_cmt_type, this, lnnum, cmttype);
14062}
14063
14064//--------------------------------------------------------------------------
14065inline bool vdui_t::edit_cmt(const treeloc_t &loc)
14066{
14067 return (uchar)(size_t)HEXDSP(hx_vdui_t_edit_cmt, this, &loc) != 0;
14068}
14069
14070//--------------------------------------------------------------------------
14072{
14073 return (uchar)(size_t)HEXDSP(hx_vdui_t_edit_func_cmt, this) != 0;
14074}
14075
14076//--------------------------------------------------------------------------
14078{
14079 return (uchar)(size_t)HEXDSP(hx_vdui_t_del_orphan_cmts, this) != 0;
14080}
14081
14082//--------------------------------------------------------------------------
14083inline bool vdui_t::set_num_radix(int base)
14084{
14085 return (uchar)(size_t)HEXDSP(hx_vdui_t_set_num_radix, this, base) != 0;
14086}
14087
14088//--------------------------------------------------------------------------
14090{
14091 return (uchar)(size_t)HEXDSP(hx_vdui_t_set_num_enum, this) != 0;
14092}
14093
14094//--------------------------------------------------------------------------
14096{
14097 return (uchar)(size_t)HEXDSP(hx_vdui_t_set_num_stroff, this) != 0;
14098}
14099
14100//--------------------------------------------------------------------------
14102{
14103 return (uchar)(size_t)HEXDSP(hx_vdui_t_invert_sign, this) != 0;
14104}
14105
14106//--------------------------------------------------------------------------
14108{
14109 return (uchar)(size_t)HEXDSP(hx_vdui_t_invert_bits, this) != 0;
14110}
14111
14112//--------------------------------------------------------------------------
14113inline bool vdui_t::collapse_item(bool hide)
14114{
14115 return (uchar)(size_t)HEXDSP(hx_vdui_t_collapse_item, this, hide) != 0;
14116}
14117
14118//--------------------------------------------------------------------------
14119inline bool vdui_t::collapse_lvars(bool hide)
14120{
14121 return (uchar)(size_t)HEXDSP(hx_vdui_t_collapse_lvars, this, hide) != 0;
14122}
14123
14124//--------------------------------------------------------------------------
14125inline bool vdui_t::split_item(bool split)
14126{
14127 return (uchar)(size_t)HEXDSP(hx_vdui_t_split_item, this, split) != 0;
14128}
14129
14130//--------------------------------------------------------------------------
14131inline int select_udt_by_offset(const qvector<tinfo_t> *udts, const ui_stroff_ops_t &ops, ui_stroff_applicator_t &applicator)
14132{
14133 return (int)(size_t)HEXDSP(hx_select_udt_by_offset, udts, &ops, &applicator);
14134}
14135
14136#ifdef __NT__
14137#pragma warning(pop)
14138#endif
DECLARE_TYPE_AS_MOVABLE(compiled_binpat_t)
qchar * extract(void)
Extract C string from _qstring. Must qfree() it.
Definition pro.h:3373
Describes an argument location.
Definition typeinf.hpp:1105
Definition hexrays.hpp:1923
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:1841
bool hexapi empty() const
Definition hexrays.hpp:11528
DECLARE_COMPARISONS(bitset_t)
int hexapi count() const
Definition hexrays.hpp:11534
bool includes(const bitset_t &ml) const
Definition hexrays.hpp:1886
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:11474
void hexapi shift_down(int shift)
Definition hexrays.hpp:11498
bool hexapi fill_gaps(int total_nbits)
Definition hexrays.hpp:11558
bool hexapi add(int bit)
Definition hexrays.hpp:11456
void inc(iterator &p, int n=1) const
Definition hexrays.hpp:1906
bool hexapi has_any(int bit, int width) const
Definition hexrays.hpp:11516
bool hexapi has_all(int bit, int width) const
Definition hexrays.hpp:11510
bitset_t()
Definition hexrays.hpp:1846
iterator end() const
Definition hexrays.hpp:1903
int front() const
Definition hexrays.hpp:1904
iterator const_iterator
Definition hexrays.hpp:1900
int back() const
Definition hexrays.hpp:1905
HEXRAYS_MEMORY_ALLOCATION_FUNCS() class iterator
Definition hexrays.hpp:1889
bool hexapi has(int bit) const
Definition hexrays.hpp:11504
~bitset_t()
Definition hexrays.hpp:1848
void swap(bitset_t &r)
Definition hexrays.hpp:1853
void hexapi fill_with_ones(int maxbit)
Definition hexrays.hpp:11552
bool hexapi cut_at(int maxbit)
Definition hexrays.hpp:11492
int hexapi last() const
Definition hexrays.hpp:11546
void clear()
Definition hexrays.hpp:1880
iterator begin() const
Definition hexrays.hpp:1902
bitset_t & operator=(const bitset_t &m)
Definition hexrays.hpp:1858
const char *hexapi dstr() const
Definition hexrays.hpp:11522
bool hexapi is_subset_of(const bitset_t &ml) const
Definition hexrays.hpp:11576
void extract(intvec_t &out) const
bool hexapi has_common(const bitset_t &ml) const
Definition hexrays.hpp:11564
bool hexapi intersect(const bitset_t &ml)
Definition hexrays.hpp:11570
bitset_t &hexapi copy(const bitset_t &m)
Definition hexrays.hpp:11450
iterator itat(int n) const
Definition hexrays.hpp:1901
Chains of one block.
Definition hexrays.hpp:3610
const chain_t * get_stk_chain(sval_t off, int width=1) const
Get chain for the specified stack offset.
Definition hexrays.hpp:3630
void hexapi print(qstring *vout) const
Definition hexrays.hpp:12190
qset< chain_t > base_t
Definition hexrays.hpp:3613
const chain_t * get_reg_chain(mreg_t reg, int width=1) const
Get chain for the specified register.
Definition hexrays.hpp:3622
const chain_t * get_chain(const voff_t &k, int width=1) const
Get chain for the specified value offset.
Definition hexrays.hpp:3638
chain_t * get_reg_chain(mreg_t reg, int width=1)
Definition hexrays.hpp:3624
chain_t * get_stk_chain(sval_t off, int width=1)
Definition hexrays.hpp:3632
chain_t * get_chain(const voff_t &k, int width=1)
Definition hexrays.hpp:3640
const char *hexapi dstr() const
Definition hexrays.hpp:12196
chain_t * get_chain(const chain_t &ch)
Definition hexrays.hpp:3646
Vector of bytes (use for dynamic memory)
Definition pro.h:3850
~chain_keeper_t()
Definition hexrays.hpp:5843
block_chains_t & back()
Definition hexrays.hpp:5849
int for_all_chains(chain_visitor_t &cv, int gca)
Definition hexrays.hpp:5851
chain_keeper_t(graph_chains_t *_gc)
Definition hexrays.hpp:5842
block_chains_t & operator[](size_t idx)
Definition hexrays.hpp:5847
block_chains_t & front()
Definition hexrays.hpp:5848
ud (use->def) and du (def->use) chain.
Definition hexrays.hpp:3553
const char *hexapi dstr() const
Definition hexrays.hpp:12172
sval_t get_stkoff() const
Definition hexrays.hpp:3591
void set_inited(bool b)
Definition hexrays.hpp:3586
bool includes(const chain_t &r) const
Definition hexrays.hpp:3594
bool operator<(const chain_t &r) const
Definition hexrays.hpp:3598
bool is_term() const
Definition hexrays.hpp:3585
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:12178
int width
size of the value in bytes
Definition hexrays.hpp:3558
bool is_stkoff() const
Definition hexrays.hpp:3580
chain_t()
Definition hexrays.hpp:3570
void hexapi print(qstring *vout) const
Definition hexrays.hpp:12166
bool is_replaced() const
Definition hexrays.hpp:3581
bool is_overlapped() const
Definition hexrays.hpp:3582
void set_value(const chain_t &r)
Definition hexrays.hpp:3575
bool overlap(const chain_t &r) const
Definition hexrays.hpp:3592
void set_term(bool b)
Definition hexrays.hpp:3589
uchar flags
combination Chain properties bits
Definition hexrays.hpp:3560
bool is_inited() const
Definition hexrays.hpp:3578
bool is_fake() const
Definition hexrays.hpp:3583
int varnum
allocated variable index (-1 - not allocated yet)
Definition hexrays.hpp:3559
bool is_reg() const
Definition hexrays.hpp:3579
bool is_passreg() const
Definition hexrays.hpp:3584
mreg_t get_reg() const
Definition hexrays.hpp:3590
chain_t(mopt_t t, sval_t off, int w=1, int v=-1)
Definition hexrays.hpp:3571
void clear_varnum()
Definition hexrays.hpp:3604
const voff_t & key() const
Definition hexrays.hpp:3577
const voff_t endoff() const
Definition hexrays.hpp:3596
void set_replaced(bool b)
Definition hexrays.hpp:3587
void set_overlapped(bool b)
Definition hexrays.hpp:3588
chain_t(const voff_t &_k, int w=1)
Definition hexrays.hpp:3573
Helper class to generate the initial microcode.
Definition hexrays.hpp:5977
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:5983
virtual merror_t idaapi analyze_prolog(const class qflow_chart_ea_t &fc, const class bitset_t &reachable)=0
Analyze prolog/epilog of the function to decompile.
codegen_t()=delete
virtual bool idaapi should_handle_switch(ea_t ea, const switch_info_t &si) const
Definition hexrays.hpp:6048
virtual ~codegen_t()
Definition hexrays.hpp:5987
char ignore_micro
Definition hexrays.hpp:5982
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:6075
virtual merror_t idaapi gen_micro()=0
Generate microcode for one instruction.
void hexapi clear()
Definition hexrays.hpp:12924
virtual void idaapi microgen_completed()
This method is called when the microcode generation is done.
Definition hexrays.hpp:6017
mblock_t * mb
Definition hexrays.hpp:5980
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:12930
virtual merror_t idaapi prepare_gen_micro()
Setup internal data to handle new instruction.
Definition hexrays.hpp:6026
insn_t insn
Definition hexrays.hpp:5981
mba_t * mba
Definition hexrays.hpp:5979
size_t reserved[4]
Definition hexrays.hpp:5984
Class to enumerate all function instructions and data sorted by addresses.
Definition funcs.hpp:1414
ea_t current(void) const
Definition funcs.hpp:1435
bool set(func_t *pfn, ea_t _ea=BADADDR)
Set a function range. if pfn == nullptr then a segment range will be set.
Definition funcs.hpp:1426
bool next_code(void)
Definition funcs.hpp:1448
A function is a set of continuous ranges of addresses with characteristics.
Definition funcs.hpp:106
bool next(void)
Definition funcs.hpp:1373
bool set(func_t *_pfn, ea_t ea=BADADDR)
Definition funcs.hpp:1354
const range_t & chunk(void) const
Definition funcs.hpp:1365
Class to enumerate all function instructions and data sorted by addresses.
Definition funcs.hpp:1919
ea_t current() const
Definition funcs.hpp:1954
bool next_code()
Definition funcs.hpp:1967
bool set(ea_t func_ea, ea_t ea=BADADDR)
Set a function range. if func_ea == BADADDR then a segment range will be set.
Definition funcs.hpp:1928
bool next()
Definition funcs.hpp:1859
void chunk(range_t *out) const
Definition funcs.hpp:1856
bool set(ea_t func_ea, ea_t ea=BADADDR)
Definition funcs.hpp:1853
gdl graph interface - includes only functions required to draw it
Definition gdl.hpp:259
Definition hexrays.hpp:3667
void hexapi release()
Unlock the chains.
Definition hexrays.hpp:12208
bool is_locked() const
Are the chains locked?
Definition hexrays.hpp:3688
~graph_chains_t()
Definition hexrays.hpp:3670
int hexapi for_all_chains(chain_visitor_t &cv, int gca_flags)
Visit all chains.
Definition hexrays.hpp:12202
void swap(graph_chains_t &r)
Definition hexrays.hpp:3693
void acquire()
Lock the chains.
Definition hexrays.hpp:3690
Definition hexrays.hpp:4267
intval64_t mop_value(const mop_t &mop)
Definition hexrays.hpp:4282
bool hexapi _mop_value(intval64_t *out, const mop_t &mop, vd_failure_t *vf=nullptr)
Definition hexrays.hpp:12376
virtual intval64_t read_glbmem(ea_t, int)
Definition hexrays.hpp:4276
bool hexapi _minsn_value(intval64_t *out, const minsn_t &insn, vd_failure_t *vf=nullptr)
Definition hexrays.hpp:12382
virtual intval64_t get_mop_value(const mop_t &mop)=0
virtual void write_glbmem(ea_t, int, const intval64_t &)
Definition hexrays.hpp:4277
intval64_t minsn_value(const minsn_t &insn)
Definition hexrays.hpp:4296
virtual ~int64_emulator_t()
Definition hexrays.hpp:4269
Definition hexrays.hpp:4051
intval64_t smod(const intval64_t &o) const
Definition hexrays.hpp:4169
void print(qstring *vout) const
Definition hexrays.hpp:4059
intval64_t sar(const intval64_t &o) const
Definition hexrays.hpp:4202
intval64_t sdiv(const intval64_t &o) const
Definition hexrays.hpp:4140
intval64_t operator!() const
Definition hexrays.hpp:4235
intval64_t high(int target_sz) const
Definition hexrays.hpp:4102
intval64_t sext(int target_sz) const
Definition hexrays.hpp:4081
intval64_t operator|(const intval64_t &o) const
Definition hexrays.hpp:4208
intval64_t operator^(const intval64_t &o) const
Definition hexrays.hpp:4222
intval64_t operator&(const intval64_t &o) const
Definition hexrays.hpp:4215
intval64_t operator~() const
Definition hexrays.hpp:4241
intval64_t operator+(const intval64_t &o) const
Definition hexrays.hpp:4110
intval64_t operator*(const intval64_t &o) const
Definition hexrays.hpp:4124
bool operator!=(const intval64_t &o) const
Definition hexrays.hpp:4068
intval64_t operator<<(const intval64_t &o) const
Definition hexrays.hpp:4190
intval64_t operator>>(const intval64_t &o) const
Definition hexrays.hpp:4196
uint64 uval() const
Definition hexrays.hpp:4058
int64 sval() const
Definition hexrays.hpp:4057
intval64_t operator-(const intval64_t &o) const
Definition hexrays.hpp:4117
intval64_t zext(int target_sz) const
Definition hexrays.hpp:4088
bool operator<(const intval64_t &o) const
Definition hexrays.hpp:4074
intval64_t(uint64 v=0, int _s=1)
Definition hexrays.hpp:4056
uint64 val
Definition hexrays.hpp:4053
bool operator==(const intval64_t &o) const
Definition hexrays.hpp:4062
intval64_t low(int target_sz) const
Definition hexrays.hpp:4095
intval64_t operator%(const intval64_t &o) const
Definition hexrays.hpp:4161
int size
Definition hexrays.hpp:4054
intval64_t operator/(const intval64_t &o) const
Definition hexrays.hpp:4131
intval64_t operator-() const
Definition hexrays.hpp:4229
Set of intervals.
Definition hexrays.hpp:2021
const ivl_t & lastivl() const
Definition hexrays.hpp:2039
iterator end()
Definition hexrays.hpp:2072
bool single_value(uint64 v) const
Definition hexrays.hpp:2047
bool hexapi has_common(const ivlset_t &ivs) const
Definition hexrays.hpp:11644
const_iterator end() const
Definition hexrays.hpp:2070
asize_t hexapi count() const
Definition hexrays.hpp:11636
qvector< ivl_t > bag_t
Definition hexrays.hpp:2023
bool empty() const
Definition hexrays.hpp:2041
bool operator==(const ivl_t &v) const
Definition hexrays.hpp:2064
bool is_subset_of(const ivlset_t &ivs) const
Definition hexrays.hpp:2062
bool hexapi addmasked(const ivlset_t &ivs, const ivl_t &mask)
Definition hexrays.hpp:11618
ivlset_t()
Definition hexrays.hpp:2033
bag_t::iterator iterator
Definition hexrays.hpp:2067
bool single_value() const
Definition hexrays.hpp:2046
bool operator!=(const ivl_t &v) const
Definition hexrays.hpp:2065
void qclear()
Definition hexrays.hpp:2043
iterator begin()
Definition hexrays.hpp:2071
bool sub(ea_t ea, asize_t size)
Definition hexrays.hpp:2054
bool hexapi sub(const ivl_t &ivl)
Definition hexrays.hpp:11624
void clear()
Definition hexrays.hpp:2042
bool hexapi contains(uint64 off) const
Definition hexrays.hpp:11656
DECLARE_COMPARISONS(ivlset_t)
bool add(ea_t ea, asize_t size)
Definition hexrays.hpp:2050
bool hexapi add(const ivl_t &ivl)
Definition hexrays.hpp:11606
bool hexapi intersect(const ivlset_t &ivs)
Definition hexrays.hpp:11668
ivlset_t(const ivl_t &ivl)
Definition hexrays.hpp:2034
DEFINE_MEMORY_ALLOCATION_FUNCS() void swap(ivlset_t &r)
Definition hexrays.hpp:2035
static bool ivl_all_values(const ivl_t &ivl)
Definition hexrays.hpp:2030
bool hexapi includes(const ivlset_t &ivs) const
Definition hexrays.hpp:11662
const char *hexapi dstr() const
Definition hexrays.hpp:11686
const_iterator begin() const
Definition hexrays.hpp:2069
const ivl_t & getivl(int idx) const
Definition hexrays.hpp:2038
size_t nivls() const
Definition hexrays.hpp:2040
void hexapi print(qstring *vout) const
Definition hexrays.hpp:11680
void set_all_values()
Definition hexrays.hpp:2045
bool all_values() const
Definition hexrays.hpp:2044
bag_t bag
Definition hexrays.hpp:2026
bag_t::const_iterator const_iterator
Definition hexrays.hpp:2068
bool verify() const
Definition of a local variable (register or stack) var lvar.
Definition hexrays.hpp:1223
void set_arg_var()
Definition hexrays.hpp:1362
bool is_spoiled_var() const
Is spoiled var? (meaningful only during lvar allocation)
Definition hexrays.hpp:1318
void set_shared()
Definition hexrays.hpp:1392
void set_mreg_done()
Definition hexrays.hpp:1358
void set_decl_unused()
Definition hexrays.hpp:1390
void set_non_typed()
Definition hexrays.hpp:1352
void clr_used_byref()
Definition hexrays.hpp:1389
uint64 divisor
max known divisor of the variable
Definition hexrays.hpp:1275
void clr_shared()
Definition hexrays.hpp:1393
void clr_fake_var()
Definition hexrays.hpp:1365
bool is_arg_var() const
Is the function argument?
Definition hexrays.hpp:1308
bool typed() const
Has the variable a type?
Definition hexrays.hpp:1288
void clr_overlapped_var()
Definition hexrays.hpp:1367
tinfo_t tif
variable type
Definition hexrays.hpp:1271
void set_used()
Definition hexrays.hpp:1349
friend class mba_t
Definition hexrays.hpp:1224
void clr_mreg_done()
Definition hexrays.hpp:1359
void clr_arg_var()
Definition hexrays.hpp:1363
bool is_partialy_typed() const
Variable type should be handled as a partial one.
Definition hexrays.hpp:1320
bool is_shared() const
Is lvar mapped to several chains.
Definition hexrays.hpp:1344
int defblk
first block defining the variable.
Definition hexrays.hpp:1273
void set_automapped()
Definition hexrays.hpp:1386
void clr_mapdst_var()
Definition hexrays.hpp:1373
bool is_aliasable(const mba_t *mba) const
Is the variable aliasable?
Definition hexrays.hpp:1456
void set_spoiled_var()
Definition hexrays.hpp:1370
void set_typed()
Definition hexrays.hpp:1351
void clr_notarg()
Definition hexrays.hpp:1385
qstring cmt
variable comment string
Definition hexrays.hpp:1270
void clr_user_type()
Definition hexrays.hpp:1356
void set_dummy_arg()
Definition hexrays.hpp:1382
void clr_automapped()
Definition hexrays.hpp:1387
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:11341
lvar_t(const qstring &n, const vdloc_t &l, ea_t e, const tinfo_t &t, int w, int db)
Definition hexrays.hpp:1278
void set_noptr_var()
Definition hexrays.hpp:1376
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:11329
void set_noprop()
Definition hexrays.hpp:1396
bool hexapi is_promoted_arg() const
Is the promoted function argument?
Definition hexrays.hpp:11317
bool was_scattered_arg() const
Was lvar transformed from a scattered argument?
Definition hexrays.hpp:1346
void clr_spoiled_var()
Definition hexrays.hpp:1371
bool is_automapped() const
Was the variable automatically mapped to another variable?
Definition hexrays.hpp:1338
bool has_common_bit(const vdloc_t &loc, asize_t width2) const
Does the variable overlap with the specified location?
Definition hexrays.hpp:1405
bool has_regname() const
Has a register name? (like _RAX)
Definition hexrays.hpp:1330
bool mreg_done() const
Have corresponding microregs been replaced by references to this variable?
Definition hexrays.hpp:1290
bool is_used_byref() const
Was the address of the variable taken?
Definition hexrays.hpp:1340
bool has_common(const lvar_t &v) const
Do variables overlap?
Definition hexrays.hpp:1400
bool used() const
Is the variable used in the code?
Definition hexrays.hpp:1286
bool has_user_type() const
Has user-defined type?
Definition hexrays.hpp:1304
bool is_decl_unused() const
Was declared as __unused by the user? See CVAR_UNUSED.
Definition hexrays.hpp:1342
void set_partialy_typed()
Definition hexrays.hpp:1374
void clr_floating_var()
Definition hexrays.hpp:1369
void set_floating_var()
Definition hexrays.hpp:1368
bool is_fake_var() const
Is fake return variable?
Definition hexrays.hpp:1312
void clear_used()
Definition hexrays.hpp:1350
void set_overlapped_var()
Definition hexrays.hpp:1366
qstring name
variable name.
Definition hexrays.hpp:1267
lvar_t()
Definition hexrays.hpp:1277
bool hexapi set_width(int w, int svw_flags=0)
Change the variable width.
Definition hexrays.hpp:11335
void set_split_var()
Definition hexrays.hpp:1380
void clr_decl_unused()
Definition hexrays.hpp:1391
const char *hexapi dstr() const
Definition hexrays.hpp:11311
void clr_user_info()
Definition hexrays.hpp:1353
void set_user_name()
Definition hexrays.hpp:1354
bool is_dummy_arg() const
Is a dummy argument (added to fill a hole in the argument list)
Definition hexrays.hpp:1334
void clr_unknown_width()
Definition hexrays.hpp:1361
bool is_unknown_width() const
Do we know the width of the variable?
Definition hexrays.hpp:1294
void clr_noptr_var()
Definition hexrays.hpp:1377
void clr_dummy_arg()
Definition hexrays.hpp:1383
void set_thisarg()
Definition hexrays.hpp:1378
bool in_asm() const
Is variable used in an instruction translated into __asm?
Definition hexrays.hpp:1332
void set_scattered_arg()
Definition hexrays.hpp:1394
bool is_overlapped_var() const
Is overlapped variable?
Definition hexrays.hpp:1314
bool hexapi accepts_type(const tinfo_t &t, bool may_change_thisarg=false)
Check if the variable accept the specified type.
Definition hexrays.hpp:11323
void clr_thisarg()
Definition hexrays.hpp:1379
bool has_user_name() const
Has user-defined name?
Definition hexrays.hpp:1302
void set_unknown_width()
Definition hexrays.hpp:1360
void set_fake_var()
Definition hexrays.hpp:1364
void set_used_byref()
Definition hexrays.hpp:1388
bool has_user_info() const
Has any user-defined information?
Definition hexrays.hpp:1296
bool is_floating_var() const
Used by a fpu insn?
Definition hexrays.hpp:1316
void clr_noprop()
Definition hexrays.hpp:1397
void set_mapdst_var()
Definition hexrays.hpp:1372
bool is_notarg() const
Is a local variable? (local variable cannot be an input argument)
Definition hexrays.hpp:1336
bool has_nice_name() const
Does the variable have a nice name?
Definition hexrays.hpp:1292
void set_notarg()
Definition hexrays.hpp:1384
void clr_scattered_arg()
Definition hexrays.hpp:1395
void clr_user_name()
Definition hexrays.hpp:1357
void clr_split_var()
Definition hexrays.hpp:1381
void set_user_type()
Definition hexrays.hpp:1355
bool is_thisarg() const
Is 'this' argument of a C++ member function?
Definition hexrays.hpp:1326
bool is_result_var() const
Is the function result?
Definition hexrays.hpp:1306
bool is_noprop() const
Is it forbidden to propagate the variable?
Definition hexrays.hpp:1348
void clr_partialy_typed()
Definition hexrays.hpp:1375
bool is_split_var() const
Is a split variable?
Definition hexrays.hpp:1328
int width
variable size in bytes
Definition hexrays.hpp:1272
bool is_noptr_var() const
Variable type should not be a pointer.
Definition hexrays.hpp:1322
const tinfo_t & type() const
Get variable type.
Definition hexrays.hpp:1410
bool is_mapdst_var() const
Other variable(s) map to this var?
Definition hexrays.hpp:1324
tinfo_t & type()
Definition hexrays.hpp:1411
void set_final_lvar_type(const tinfo_t &t)
Set final variable type.
Definition hexrays.hpp:1429
Vector of local variables.
Definition hexrays.hpp:1466
int hexapi find_stkvar(sval_t spoff, int width)
Find a stack variable at the specified location.
Definition hexrays.hpp:11347
lvar_t *hexapi find(const lvar_locator_t &ll)
Find a variable at the specified location.
Definition hexrays.hpp:11353
int hexapi find_lvar(const vdloc_t &location, size_t width, int defblk=-1) const
Find a variable at the specified location.
Definition hexrays.hpp:11359
int find_input_lvar(const vdloc_t &argloc, size_t _size)
Find an input variable at the specified location.
Definition hexrays.hpp:1472
int find_input_reg(int reg, size_t _size=1)
Find an input register variable.
Definition hexrays.hpp:1479
Array of micro blocks representing microcode for a decompiled function.
Definition hexrays.hpp:5185
int hexapi for_all_ops(mop_visitor_t &mv)
Visit all operands of all instructions.
Definition hexrays.hpp:12758
merror_t hexapi set_maturity(mba_maturity_t mat)
Set maturity level.
Definition hexrays.hpp:12644
mblock_t *hexapi copy_block(mblock_t *blk, int new_serial, int cpblk_flags=3)
Make a copy of a block.
Definition hexrays.hpp:12740
void hexapi dump() const
Dump microcode to a file.
Definition hexrays.hpp:12686
bool use_frame() const
Definition hexrays.hpp:5471
ea_t entry_ea
Definition hexrays.hpp:5383
mreg_t hexapi alloc_kreg(size_t size, bool check_size=true)
Allocate a kernel register.
Definition hexrays.hpp:12852
bool graph_insns() const
Definition hexrays.hpp:5260
int pfn_flags
copy of func_t::flags
Definition hexrays.hpp:5394
mblock_t ** natural
natural order of blocks
Definition hexrays.hpp:5437
bool lvars_allocated() const
Definition hexrays.hpp:5273
mblock_t * blocks
double linked list of blocks
Definition hexrays.hpp:5436
bool rtype_refined() const
Definition hexrays.hpp:5263
bool has_over_chains() const
Definition hexrays.hpp:5283
bool generated_asserts() const
Definition hexrays.hpp:5277
sval_t minstkref
The lowest stack location whose address was taken.
Definition hexrays.hpp:5404
mbl_graph_t *hexapi get_graph()
Get control graph.
Definition hexrays.hpp:12662
bool chain_varnums_ok() const
Definition hexrays.hpp:5274
qstring error_strarg
Definition hexrays.hpp:5434
bool lvars_renamed() const
Definition hexrays.hpp:5282
bool is_pattern() const
Definition hexrays.hpp:5268
bool hexapi set_lvar_name(lvar_t &v, const char *name, int flagbits)
Definition hexrays.hpp:12894
argloc_t get_ida_argloc(const lvar_t &v) const
Definition hexrays.hpp:5378
void set_mba_flags(int f)
Definition hexrays.hpp:5296
bool argidx_sorted() const
Definition hexrays.hpp:5286
ivlset_t aliased_memory
aliased_memory+restricted_memory=ALLMEM
Definition hexrays.hpp:5412
static vdloc_t hexapi idaloc2vd(const argloc_t &loc, int width, sval_t spd)
Definition hexrays.hpp:12594
ea_t hexapi map_fict_ea(ea_t fict_ea) const
Resolve a fictional address.
Definition hexrays.hpp:12808
bool hexapi remove_empty_and_unreachable_blocks()
Delete all empty and unreachable blocks.
Definition hexrays.hpp:12746
const char va_list va const
Definition hexrays.hpp:5539
ea_t hexapi alloc_fict_ea(ea_t real_ea)
Allocate a fictional address.
Definition hexrays.hpp:12800
bool short_display() const
Definition hexrays.hpp:5258
merror_t hexapi optimize_global()
Optimize microcode globally.
Definition hexrays.hpp:12674
bool display_valnums() const
Definition hexrays.hpp:5266
int get_mba_flags() const
Definition hexrays.hpp:5294
bool write_to_const_detected() const
Definition hexrays.hpp:5445
vdump_mba(_verify, title, va)
bool prop_complex() const
Definition hexrays.hpp:5293
sval_t stacksize
The maximal size of the function stack including bytes allocated for outgoing call arguments (up to r...
Definition hexrays.hpp:5398
lvar_t &hexapi arg(size_t n)
Get input argument of the decompiled function.
Definition hexrays.hpp:12794
const ivl_t & get_lvars_region() const
Definition hexrays.hpp:6167
bool display_ea() const
Definition hexrays.hpp:5267
mba_ranges_t mbr
Definition hexrays.hpp:5382
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:5570
mlist_t spoiled_list
MBA_SPLINFO && !final_type: info in vd format.
Definition hexrays.hpp:5422
sval_t frregs
size of saved registers range in the stack frame
Definition hexrays.hpp:5392
void set_mba_flags2(int f)
Definition hexrays.hpp:5298
int hexapi for_all_topinsns(minsn_visitor_t &mv)
Visit all top level instructions.
Definition hexrays.hpp:12770
bool hexapi clr_numform(const operand_locator_t &loc)
Clear the user-defined number format for an operand.
Definition hexrays.hpp:12828
bool deleted_pairs() const
Definition hexrays.hpp:5279
void clr_mba_flags(int f)
Definition hexrays.hpp:5297
int calc_shins_flags() const
Definition hexrays.hpp:5301
sval_t minargref
The lowest stack argument location whose address was taken This location and locations above it can b...
Definition hexrays.hpp:5406
bool hexapi get_numform(number_format_t *nf, const operand_locator_t &loc) const
Get the user-defined number format for an operand.
Definition hexrays.hpp:12816
lvars_t vars
local variables
Definition hexrays.hpp:5428
reginfovec_t idb_spoiled
MBA_SPLINFO && final_type: info in ida format.
Definition hexrays.hpp:5421
sval_t frsize
size of local stkvars range in the stack frame
Definition hexrays.hpp:5391
ivl_with_name_t std_ivls[6]
we treat memory as consisting of 6 parts see memreg_index_t
Definition hexrays.hpp:5439
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:12788
int retvaridx
index of variable holding the return value -1 means none
Definition hexrays.hpp:5430
int fti_flags
FTI_... constants for the current function.
Definition hexrays.hpp:5423
sval_t fullsize
Full stack size including incoming args.
Definition hexrays.hpp:5397
char reserved[]
Definition hexrays.hpp:5463
bool set_nice_lvar_name(lvar_t &v, const char *name)
Definition hexrays.hpp:5830
bool range_contains(ea_t ea) const
Definition hexrays.hpp:5472
bool regargs_is_not_aligned() const
Definition hexrays.hpp:5453
int get_mba_flags2() const
Definition hexrays.hpp:5295
mba_maturity_t maturity
current maturity level
Definition hexrays.hpp:5416
const char * title
Definition hexrays.hpp:5539
sval_t hexapi stkoff_vd2ida(sval_t off) const
Definition hexrays.hpp:12578
int hexapi optimize_local(int locopt_bits)
Optimize each basic block locally.
Definition hexrays.hpp:12650
void hexapi alloc_lvars()
Allocate local variables.
Definition hexrays.hpp:12680
bool is_thunk() const
Definition hexrays.hpp:5269
void hexapi free_kreg(mreg_t reg, size_t size)
Free a kernel register.
Definition hexrays.hpp:12858
const stkpnt_t *hexapi locate_stkpnt(ea_t ea) const
Definition hexrays.hpp:12876
bool is_dtr() const
Definition hexrays.hpp:5291
const ivl_t & get_args_region() const
Definition hexrays.hpp:6177
const decomp_ranges_t &hexapi get_decomp_ranges() const
Definition hexrays.hpp:12638
mba_maturity_t reqmat
required maturity level
Definition hexrays.hpp:5417
bool is_ctr() const
Definition hexrays.hpp:5290
void hexapi add_user_minsn(const user_minsn_t &uins, mba_maturity_t mmat)
Add a user-defined microinstruction action.
Definition hexrays.hpp:12882
sval_t fpd
frame pointer delta
Definition hexrays.hpp:5393
bool set_user_lvar_name(lvar_t &v, const char *name)
Definition hexrays.hpp:5831
bool valranges_done() const
Definition hexrays.hpp:5284
uchar occurred_warns[32]
Definition hexrays.hpp:5443
bool saverest_done() const
Definition hexrays.hpp:5270
const ivl_t & get_shadow_region() const
Definition hexrays.hpp:6172
static argloc_t hexapi vd2idaloc(const vdloc_t &loc, size_t width, sval_t spd)
Definition hexrays.hpp:12610
bool should_beautify() const
Definition hexrays.hpp:5262
qstring label
name of the function or pattern (colored)
Definition hexrays.hpp:5427
bool has_outlines() const
Definition hexrays.hpp:5289
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:5414
void hexapi save_snapshot(const char *description)
Create and save microcode snapshot.
Definition hexrays.hpp:12846
bool hexapi remove_blocks(int start_blk, int end_blk)
Definition hexrays.hpp:12734
bool lvar_names_ok() const
Definition hexrays.hpp:5281
const ivl_t & get_std_region(memreg_index_t idx) const
Get information about various memory regions.
Definition hexrays.hpp:6162
bool has_stack_retval() const
Definition hexrays.hpp:5288
bool optimized() const
Definition hexrays.hpp:5257
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:5389
void clr_mba_flags2(int f)
Definition hexrays.hpp:5299
bool hexapi remove_block(mblock_t *blk)
Delete a block.
Definition hexrays.hpp:12728
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:5420
mblock_t * get_mblock(uint n)
Definition hexrays.hpp:5571
bool final_type
is the function type final? (specified by the user)
Definition hexrays.hpp:5419
sval_t spd_adjust
If sp>0, the max positive sp value.
Definition hexrays.hpp:5409
bool code16_bit_removed() const
Definition hexrays.hpp:5287
bool precise_defeas() const
Definition hexrays.hpp:5256
int npurged
-1 - unknown
Definition hexrays.hpp:5387
ea_t error_ea
during microcode generation holds ins.ea
Definition hexrays.hpp:5433
int qty
number of basic blocks
Definition hexrays.hpp:5386
hexwarns_t notes
Definition hexrays.hpp:5442
HEXRAYS_MEMORY_ALLOCATION_FUNCS() void hexapi term()
ivl_t get_stack_region() const
Definition hexrays.hpp:6182
~mba_t()
Definition hexrays.hpp:5465
bool show_reduction() const
Definition hexrays.hpp:5259
func_t *hexapi get_curfunc() const
Definition hexrays.hpp:12632
merror_t hexapi build_graph()
Build control flow graph.
Definition hexrays.hpp:12656
bool bad_call_sp_detected() const
Definition hexrays.hpp:5449
int shadow_args
size of shadow argument area
Definition hexrays.hpp:5396
ea_t last_prolog_ea
Definition hexrays.hpp:5384
callcnv_t cc
calling convention
Definition hexrays.hpp:5388
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:12782
bool may_refine_rettype() const
Definition hexrays.hpp:5264
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:12722
sval_t argbase() const
Definition hexrays.hpp:5358
bool hexapi merge_blocks()
Merge blocks.
Definition hexrays.hpp:12752
bool common_stkvars_stkargs() const
Definition hexrays.hpp:5280
bool really_alloc() const
Definition hexrays.hpp:5272
bool is_stkarg(const lvar_t &v) const
Definition hexrays.hpp:5368
intvec_t argidx
input arguments (indexes into 'vars')
Definition hexrays.hpp:5429
void hexapi serialize(bytevec_t *vout) const
Serialize mbl array into a sequence of bytes.
Definition hexrays.hpp:12834
ssize_t get_stkvar(udm_t *udm, sval_t vd_stkoff, uval_t *p_idaoff=nullptr, tinfo_t *p_frame=nullptr) const
bool hexapi del_user_minsn(const minsn_locator_t &loc, user_minsn_action_t action, mba_maturity_t mmat)
Delete a user-defined microinstruction action.
Definition hexrays.hpp:12888
static WARN_UNUSED_RESULT mba_t *hexapi deserialize(const uchar *bytes, size_t nbytes)
Deserialize a byte sequence into mbl array.
Definition hexrays.hpp:12840
bool loaded_gdl() const
Definition hexrays.hpp:5261
int hexapi for_all_insns(minsn_visitor_t &mv)
Visit all instructions.
Definition hexrays.hpp:12764
bool is_snippet() const
Definition hexrays.hpp:5473
int retsize
size of return address in the stack frame
Definition hexrays.hpp:5395
bool returns_fpval() const
Definition hexrays.hpp:5275
bool callinfo_built() const
Definition hexrays.hpp:5271
merror_t hexapi inline_function(codegen_t &cdg, int blknum, decomp_ranges_t &ranges, int decomp_flags=0, int inline_flags=0)
Inline a range (ea-based variant).
Definition hexrays.hpp:12870
bool display_numaddrs() const
Definition hexrays.hpp:5265
int hexapi analyze_calls(int acflags)
Analyze calls and determine calling conventions.
Definition hexrays.hpp:12668
void hexapi set_numform(const operand_locator_t &loc, const number_format_t &nf)
Set the user-defined number format for an operand.
Definition hexrays.hpp:12822
DEPRECATED 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:12864
bool argidx_ok() const
Definition hexrays.hpp:5285
mblock_t *hexapi insert_block(int bblk)
Insert a block in the middle of the mbl array.
Definition hexrays.hpp:12716
bool propagated_asserts() const
Definition hexrays.hpp:5278
bool is_cdtr() const
Definition hexrays.hpp:5292
mlist_t nodel_memory
global dead elimination may not delete references to this area
Definition hexrays.hpp:5413
sval_t inargoff
offset of the first stack argument; after fix_scattered_movs() INARGOFF may be less than STACKSIZE
Definition hexrays.hpp:5401
void clr_cdtr()
Definition hexrays.hpp:5300
sval_t hexapi stkoff_ida2vd(sval_t off) const
Definition hexrays.hpp:12586
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:12776
ivlset_t gotoff_stkvars
stkvars that hold .got offsets. considered to be unaliasable
Definition hexrays.hpp:5410
bool has_bad_sp() const
Definition hexrays.hpp:5457
ea_t first_epilog_ea
Definition hexrays.hpp:5385
const lvar_t & arg(size_t n) const
Definition hexrays.hpp:5683
bool has_passregs() const
Definition hexrays.hpp:5276
ea_t minstkref_ea
address with lowest minstkref (for debugging)
Definition hexrays.hpp:5405
va_start(va, title)
va_end(va)
ivlset_t restricted_memory
Definition hexrays.hpp:5411
Control flow graph of microcode.
Definition hexrays.hpp:5869
int get_chain_stamp() const
Definition hexrays.hpp:5925
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:5934
graph_chains_t *hexapi get_ud(gctype_t gctype)
Get use-def chains.
Definition hexrays.hpp:12906
graph_chains_t *hexapi get_du(gctype_t gctype)
Get def-use chains.
Definition hexrays.hpp:12912
bool is_ud_chain_dirty(gctype_t gctype)
Is the use-def chain of the specified kind dirty?
Definition hexrays.hpp:5913
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:5938
bool is_du_chain_dirty(gctype_t gctype)
Is the def-use chain of the specified kind dirty?
Definition hexrays.hpp:5920
mblock_t * get_mblock(int n) const
Definition hexrays.hpp:5941
Microcode of one basic block.
Definition hexrays.hpp:4329
ea_t end
end address note: we cannot rely on start/end addresses very much because instructions are propagated...
Definition hexrays.hpp:4362
mlist_t dnu
data that is defined but not used in the block
Definition hexrays.hpp:4377
bool lists_ready() const
Definition hexrays.hpp:4398
sval_t minbargref
the same for arguments
Definition hexrays.hpp:4383
HEXRAYS_MEMORY_ALLOCATION_FUNCS() bool empty() const
Definition hexrays.hpp:4417
void mark_lists_dirty()
Definition hexrays.hpp:4393
minsn_t * head
pointer to the first instruction of the block
Definition hexrays.hpp:4366
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:12472
minsn_t * tail
pointer to the last instruction of the block
Definition hexrays.hpp:4367
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:4330
vdump_block(title, va)
mblock_type_t type
block type (BLT_NONE - not computed yet)
Definition hexrays.hpp:4370
int serial
block number
Definition hexrays.hpp:4369
intvec_t succset
control flow graph: list of our successors use nsucc() and succ() to access it
Definition hexrays.hpp:4387
void hexapi print(vd_printer_t &vp) const
Print block contents.
Definition hexrays.hpp:12394
void hexapi dump() const
Dump block info.
Definition hexrays.hpp:12400
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:12506
bool is_branch() const
Definition hexrays.hpp:4763
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:12448
int hexapi for_all_ops(mop_visitor_t &mv)
Visit all operands.
Definition hexrays.hpp:12436
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:4599
minsn_t * find_def(const mop_t &op, minsn_t **p_i1, const minsn_t *i2, int fdflags)
Definition hexrays.hpp:4702
bool is_simple_goto_block() const
Definition hexrays.hpp:4764
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:12500
void hexapi verify_insn(const minsn_t *m) const
Verify an instruction.
bool is_nway() const
Definition hexrays.hpp:4762
void request_demote64()
Definition hexrays.hpp:4396
mblock_t * prevb
previous block in the doubly linked list
Definition hexrays.hpp:4335
mlist_t mustbuse
data that must be used by the block
Definition hexrays.hpp:4373
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:4385
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:12518
mlist_t maybuse
data that may be used by the block
Definition hexrays.hpp:4374
bool is_simple_jcnd_block() const
Definition hexrays.hpp:4770
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:12512
mlist_t hexapi build_def_list(const minsn_t &ins, maymust_t maymust) const
Build def-list of an instruction.
Definition hexrays.hpp:12492
mlist_t maybdef
data that may be defined by the block
Definition hexrays.hpp:4376
int make_lists_ready()
Definition hexrays.hpp:4399
int npred() const
Get number of block predecessors.
Definition hexrays.hpp:4407
mlist_t dead_at_start
data that is dead at the block entry
Definition hexrays.hpp:4372
int hexapi optimize_useless_jump()
Remove a jump at the end of the block if it is useless.
Definition hexrays.hpp:12466
bool hexapi get_valranges(valrng_t *res, const vivl_t &vivl, int vrflags) const
Find possible values for a block.
Definition hexrays.hpp:12524
char reserved[]
Definition hexrays.hpp:4391
mlist_t mustbdef
data that must be defined by the block
Definition hexrays.hpp:4375
bool is_unknown_call() const
Definition hexrays.hpp:4761
int hexapi for_all_insns(minsn_visitor_t &mv)
Visit all instructions.
Definition hexrays.hpp:12430
int pred(int n) const
Definition hexrays.hpp:4411
sval_t maxbsp
maximal sp value in the block (0...stacksize)
Definition hexrays.hpp:4379
minsn_t * find_first_use(mlist_t *list, minsn_t *i1, const minsn_t *i2, maymust_t maymust=MAY_ACCESS) const
Definition hexrays.hpp:4614
uint32 flags
combination of Basic block properties bits
Definition hexrays.hpp:4336
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:4629
minsn_t * find_redefinition(const mlist_t &list, minsn_t *i1, const minsn_t *i2, maymust_t maymust=MAY_ACCESS) const
Definition hexrays.hpp:4651
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:12478
bool needs_propagation() const
Definition hexrays.hpp:4395
int nsucc() const
Get number of block successors.
Definition hexrays.hpp:4409
void make_nop(minsn_t *m)
Erase the instruction (convert it to nop) and mark the lists dirty.
Definition hexrays.hpp:4753
void hexapi undef_spoiled_regs(minsn_t *m)
Undefine registers spoiled by the instruction m (insert new 'und' instruction for them,...
Definition hexrays.hpp:12542
int hexapi optimize_block()
Optimize a basic block.
Definition hexrays.hpp:12454
sval_t minbstkref
lowest stack location accessible with indirect addressing (offset from the stack bottom) initially it...
Definition hexrays.hpp:4380
mba_t * mba
the parent micro block array
Definition hexrays.hpp:4368
minsn_t *hexapi remove_from_block(minsn_t *m)
Remove instruction from the doubly linked list.
Definition hexrays.hpp:12424
bool lists_dirty() const
Definition hexrays.hpp:4397
va_list va const
Definition hexrays.hpp:4429
minsn_t * find_use(const mop_t &op, minsn_t **p_i1, const minsn_t *i2, int fdflags)
Definition hexrays.hpp:4710
bool is_call_block() const
Definition hexrays.hpp:4760
mblock_t * nextb
next block in the doubly linked list
Definition hexrays.hpp:4334
int hexapi build_lists(bool kill_deads)
Build def-use lists and eliminate deads.
Definition hexrays.hpp:12460
mlist_t hexapi build_use_list(const minsn_t &ins, maymust_t maymust) const
Build use-list of an instruction.
Definition hexrays.hpp:12484
int succ(int n) const
Definition hexrays.hpp:4413
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:12442
virtual ~mblock_t()
size_t hexapi get_reginsn_qty() const
Calculate number of regular instructions in the block.
Definition hexrays.hpp:12536
void request_propagation()
Definition hexrays.hpp:4394
A call argument.
Definition hexrays.hpp:3199
const char *hexapi dstr() const
Definition hexrays.hpp:12078
void set_regarg(mreg_t mr, char dt, type_sign_t sign=type_unsigned)
Definition hexrays.hpp:3218
uint32 flags
FAI_...
Definition hexrays.hpp:3206
void make_uint(int val, ea_t val_ea, int opno=0)
Definition hexrays.hpp:3228
void copy_mop(const mop_t &op)
Definition hexrays.hpp:3210
void set_regarg(mreg_t mr, const tinfo_t &tif)
Definition hexrays.hpp:3214
void hexapi set_regarg(mreg_t mr, int sz, const tinfo_t &tif)
Definition hexrays.hpp:12084
tinfo_t type
formal argument type
Definition hexrays.hpp:3203
argloc_t argloc
ida argloc
Definition hexrays.hpp:3205
void hexapi print(qstring *vout, int shins_flags=SHINS_SHORT|SHINS_VALNUM) const
Definition hexrays.hpp:12072
ea_t ea
address where the argument was initialized.
Definition hexrays.hpp:3201
void make_int(int val, ea_t val_ea, int opno=0)
Definition hexrays.hpp:3223
mcallarg_t()
Definition hexrays.hpp:3208
qstring name
formal argument name
Definition hexrays.hpp:3204
mcallarg_t(const mop_t &rarg)
Definition hexrays.hpp:3209
Information about a call.
Definition hexrays.hpp:3370
mcallargs_t args
call arguments
Definition hexrays.hpp:3378
mcallinfo_t(ea_t _callee=BADADDR, int _sargs=0)
Definition hexrays.hpp:3420
int flags
combination of Call properties... bits
Definition hexrays.hpp:3396
int call_spd
sp value at call insn
Definition hexrays.hpp:3375
mlist_t return_regs
list of values returned by the function
Definition hexrays.hpp:3384
void hexapi print(qstring *vout, int size=-1, int shins_flags=SHINS_SHORT|SHINS_VALNUM) const
Definition hexrays.hpp:12110
ivlset_t visible_memory
what memory is visible to the call?
Definition hexrays.hpp:3391
HEXRAYS_MEMORY_ALLOCATION_FUNCS() int hexapi lexcompare(const mcallinfo_t &f) const
const char *hexapi dstr() const
Definition hexrays.hpp:12116
mlist_t spoiled
list of spoiled locations (includes RETURN_REGS)
Definition hexrays.hpp:3385
ea_t callee
address of the called function, if known
Definition hexrays.hpp:3372
type_attrs_t fti_attrs
extended function attributes
Definition hexrays.hpp:3418
mlist_t dead_regs
registers defined by the function but never used.
Definition hexrays.hpp:3392
mopvec_t retregs
return register(s) (e.g., AX, AX:DX, etc.) this vector is built from return_regs
Definition hexrays.hpp:3379
bool is_vararg() const
Definition hexrays.hpp:3428
funcrole_t role
function role
Definition hexrays.hpp:3417
tinfo_t return_type
type of the returned value
Definition hexrays.hpp:3381
int stkargs_top
first offset past stack arguments
Definition hexrays.hpp:3376
callcnv_t cc
calling convention
Definition hexrays.hpp:3377
argloc_t return_argloc
location of the returned value
Definition hexrays.hpp:3382
int solid_args
number of solid args.
Definition hexrays.hpp:3373
tinfo_t hexapi get_type() const
Definition hexrays.hpp:12102
mlist_t pass_regs
passthrough registers (subset of SPOILED) The called function only partially updates the register,...
Definition hexrays.hpp:3386
bool hexapi set_type(const tinfo_t &type)
Definition hexrays.hpp:12096
List of switch cases and targets.
Definition hexrays.hpp:3435
size_t size() const
Definition hexrays.hpp:3444
void resize(int s)
Definition hexrays.hpp:3445
casevec_t values
expression values for each target
Definition hexrays.hpp:3437
DECLARE_COMPARISONS(mcases_t)
intvec_t targets
target block numbers
Definition hexrays.hpp:3438
void swap(mcases_t &r)
Definition hexrays.hpp:3440
HEXRAYS_MEMORY_ALLOCATION_FUNCS() bool empty() const
Definition hexrays.hpp:3442
void hexapi print(qstring *vout) const
Definition hexrays.hpp:12128
const char *hexapi dstr() const
Definition hexrays.hpp:12134
Microinstruction class insn.
Definition hexrays.hpp:3702
void set_wild_match()
Definition hexrays.hpp:3793
bool is_ignlowsrc() const
Definition hexrays.hpp:3769
minsn_t * find_ins_op(mop_t **other, mcode_t op=m_nop)
Definition hexrays.hpp:3984
void hexapi set_combined()
Definition hexrays.hpp:12226
bool is_tailcall() const
Definition hexrays.hpp:3763
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:12256
bool is_wild_match() const
Definition hexrays.hpp:3767
bool was_split() const
Definition hexrays.hpp:3774
void set_farcall()
Definition hexrays.hpp:3783
bool is_propagatable() const
Definition hexrays.hpp:3768
void set_assert()
Definition hexrays.hpp:3790
void set_ignlowsrc()
Definition hexrays.hpp:3795
void clr_ignlowsrc()
Definition hexrays.hpp:3796
mop_t r
right operand
Definition hexrays.hpp:3712
minsn_t * prev
prev insn in doubly linked list. check also previ()
Definition hexrays.hpp:3709
bool hexapi is_noret_call(int flags=0)
Is a non-returing call?
Definition hexrays.hpp:12292
void set_split_size(int s)
Definition hexrays.hpp:3806
void set_noret_icall()
Definition hexrays.hpp:3798
void set_combinable()
Definition hexrays.hpp:3802
bool hexapi may_use_aliased_memory() const
Is it possible for the instruction to use aliased memory?
Definition hexrays.hpp:12346
bool contains_opcode(mcode_t mcode) const
Does the instruction have the specified opcode?
Definition hexrays.hpp:3958
minsn_t * next
next insn in doubly linked list. check also nexti()
Definition hexrays.hpp:3708
bool modifies_pair_mop() const
Definition hexrays.hpp:4012
bool is_multimov() const
Definition hexrays.hpp:3772
int hexapi lexcompare(const minsn_t &ri) const
Definition hexrays.hpp:12286
void set_extstx()
Definition hexrays.hpp:3785
bool contains_call(bool with_helpers=false) const
Does the instruction contain a call?
Definition hexrays.hpp:3936
bool is_combined() const
Definition hexrays.hpp:3759
int hexapi for_all_insns(minsn_visitor_t &mv)
Visit all instructions.
Definition hexrays.hpp:12268
bool hexapi has_side_effects(bool include_ldx_and_divs=false) const
Does the instruction have a side effect?
Definition hexrays.hpp:12310
funcrole_t get_role() const
Get the function role of a call.
Definition hexrays.hpp:3945
void set_unmerged()
Definition hexrays.hpp:3805
const minsn_t *hexapi find_ins_op(const mop_t **other, mcode_t op=m_nop) const
Find an operand that is a subinstruction with the specified opcode.
Definition hexrays.hpp:12322
int get_split_size() const
Definition hexrays.hpp:3814
void clr_noret_icall()
Definition hexrays.hpp:3799
bool is_mbarrier() const
Definition hexrays.hpp:3775
void clr_propagatable()
Definition hexrays.hpp:3794
void clr_fpinsn()
Definition hexrays.hpp:3789
void hexapi setaddr(ea_t new_ea)
Change the instruction address.
Definition hexrays.hpp:12250
bool is_farcall() const
Definition hexrays.hpp:3760
ea_t ea
instruction address
Definition hexrays.hpp:3710
bool is_memcpy() const
Definition hexrays.hpp:3946
void hexapi print(qstring *vout, int shins_flags=SHINS_SHORT|SHINS_VALNUM) const
Generate insn text into the buffer.
Definition hexrays.hpp:12238
bool is_readflags() const
Definition hexrays.hpp:3950
bool hexapi modifies_d() const
Does the instruction modify its 'd' operand?
Definition hexrays.hpp:12334
bool is_inverted_jx() const
Definition hexrays.hpp:3770
bool is_persistent() const
Definition hexrays.hpp:3766
minsn_t(ea_t _ea)
Constructor.
Definition hexrays.hpp:3821
mop_t l
left operand
Definition hexrays.hpp:3711
bool is_like_move() const
Definition hexrays.hpp:4007
int optimize_solo(int optflags=0)
Optimize one instruction without context.
Definition hexrays.hpp:3851
bool was_noret_icall() const
Definition hexrays.hpp:3771
bool is_cleaning_pop() const
Definition hexrays.hpp:3761
void set_fpinsn()
Definition hexrays.hpp:3788
void clr_combined()
Definition hexrays.hpp:3782
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:12340
bool was_unmerged() const
Definition hexrays.hpp:3776
void set_persistent()
Definition hexrays.hpp:3792
bool was_memfunc() const
Definition hexrays.hpp:3778
const mop_t *hexapi find_num_op(const mop_t **other) const
Find a numeric operand of the current instruction (operand with t == mop_n).
Definition hexrays.hpp:12328
HEXRAYS_MEMORY_ALLOCATION_FUNCS() minsn_t &operator
Assignment operator. It does not copy prev/next fields.
void set_tailcall()
Definition hexrays.hpp:3786
int hexapi for_all_ops(mop_visitor_t &mv)
Visit all instruction operands.
Definition hexrays.hpp:12262
bool is_alloca() const
Definition hexrays.hpp:3948
bool is_fpinsn() const
Definition hexrays.hpp:3764
minsn_t(const minsn_t &m)
Definition hexrays.hpp:3822
bool is_after(const minsn_t *m) const
Is the instruction after the specified one?
Definition hexrays.hpp:4023
bool is_memset() const
Definition hexrays.hpp:3947
int hexapi serialize(bytevec_t *b) const
Serialize an instruction.
Definition hexrays.hpp:12352
void clr_multimov()
Definition hexrays.hpp:3801
mop_t d
destination operand
Definition hexrays.hpp:3713
bool is_unknown_call() const
Is an unknown call?
Definition hexrays.hpp:3922
void clr_tailcall()
Definition hexrays.hpp:3787
bool is_extstx() const
Definition hexrays.hpp:3762
minsn_t *hexapi find_call(bool with_helpers=false) const
Find a call instruction.
Definition hexrays.hpp:12304
bool is_assert() const
Definition hexrays.hpp:3765
bool hexapi equal_insns(const minsn_t &m, int eqflags) const
Compare instructions.
Definition hexrays.hpp:12280
bool was_unpaired() const
Definition hexrays.hpp:3777
void set_cleaning_pop()
Definition hexrays.hpp:3784
const minsn_t * find_opcode(mcode_t mcode) const
Find a (sub)insruction with the specified opcode.
Definition hexrays.hpp:3962
mop_t * find_num_op(mop_t **other)
Definition hexrays.hpp:4004
const char *hexapi dstr() const
Get displayable text without tags in a static buffer.
Definition hexrays.hpp:12244
bool is_bswap() const
Definition hexrays.hpp:3949
bool is_combinable() const
Definition hexrays.hpp:3773
void set_multimov()
Definition hexrays.hpp:3800
void set_optional()
Definition hexrays.hpp:3780
bool hexapi is_helper(const char *name) const
Is a helper call with the specified name?
Definition hexrays.hpp:12298
void hexapi _make_nop()
Convert instruction to nop.
Definition hexrays.hpp:12274
void set_mbarrier()
Definition hexrays.hpp:3804
bool is_optional() const
Definition hexrays.hpp:3758
void clr_combinable()
Definition hexrays.hpp:3803
mcode_t opcode
instruction opcode
Definition hexrays.hpp:3706
void clr_assert()
Definition hexrays.hpp:3791
bool is_mov() const
Definition hexrays.hpp:4006
bool hexapi deserialize(const uchar *bytes, size_t nbytes, int format_version)
Deserialize an instruction.
Definition hexrays.hpp:12358
int iprops
combination of instruction property bits bits
Definition hexrays.hpp:3707
void set_inverted_jx()
Definition hexrays.hpp:3797
Address of an operand (mop_l, mop_v, mop_S, mop_r)
Definition hexrays.hpp:3169
mop_addr_t(const mop_addr_t &ra)
Definition hexrays.hpp:3175
mop_addr_t & operator=(const mop_addr_t &rop)
Definition hexrays.hpp:3180
int lexcompare(const mop_addr_t &ra) const
Definition hexrays.hpp:3187
int outsize
Definition hexrays.hpp:3172
mop_addr_t()
Definition hexrays.hpp:3174
mop_addr_t(const mop_t &ra, int isz, int osz)
Definition hexrays.hpp:3177
int insize
Definition hexrays.hpp:3171
Pair of operands.
Definition hexrays.hpp:3160
mop_t lop
low operand
Definition hexrays.hpp:3162
mop_t hop
high operand
Definition hexrays.hpp:3163
A microinstruction operand.
Definition hexrays.hpp:2604
int hexapi get_bitwidth(const mblock_t *blk, const minsn_t *top) const
Get the effective bitwidth of the operand.
Definition hexrays.hpp:11970
int64 signed_value() const
Definition hexrays.hpp:3019
bool is_one() const
Definition hexrays.hpp:3038
void hexapi _make_gvar(ea_t ea)
Create a global variable operand without erasing previous data.
Definition hexrays.hpp:11928
bool double_size(side_effect_t sideff=WITH_SIDEFF)
Definition hexrays.hpp:3126
bool is_for_abi() const
Definition hexrays.hpp:2667
friend int lexcompare(const mop_t &a, const mop_t &b)
Definition hexrays.hpp:2989
int b
Definition hexrays.hpp:2644
bool is_negative_constant() const
Definition hexrays.hpp:3044
HEXRAYS_MEMORY_ALLOCATION_FUNCS() void zero()
Definition hexrays.hpp:2691
bool has_side_effects(bool include_ldx_and_divs=false) const
Has any side effects?
Definition hexrays.hpp:6107
uint8 oprops
Operand properties.
Definition hexrays.hpp:2611
bool is_insn() const
Is a sub-instruction?
Definition hexrays.hpp:2928
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:12000
void make_reg(mreg_t reg, int _size)
Definition hexrays.hpp:2784
bool hexapi is_constant(uint64 *out=nullptr, bool is_signed=true) const
Retrieve value of a constant integer operand.
Definition hexrays.hpp:12012
uint64 unsigned_value() const
Definition hexrays.hpp:3020
bool hexapi is_zero_extended_from(int nbytes) const
Does the high part of the operand consist of zero bytes?
Definition hexrays.hpp:11982
mopt_t t
Operand type.
Definition hexrays.hpp:2608
bool is_reg() const
Is a register operand?
Definition hexrays.hpp:2900
void hexapi create_from_insn(const minsn_t *m)
Create operand from an instruction.
Definition hexrays.hpp:11910
~mop_t()
Definition hexrays.hpp:2687
bool hexapi create_from_mlist(mba_t *mba, const mlist_t &lst, sval_t fullsize)
Create operand from mlist_t.
Definition hexrays.hpp:11886
void hexapi make_reg_pair(int loreg, int hireg, int halfsize)
Create pair of registers.
Definition hexrays.hpp:11940
bool is_mblock() const
Is a block reference?
Definition hexrays.hpp:2916
bool is_glbaddr_from_fixup() const
Definition hexrays.hpp:2677
bool is_lowaddr() const
Definition hexrays.hpp:2666
void _make_lvar(mba_t *mba, int idx, sval_t off=0)
Create a local variable operand.
Definition hexrays.hpp:2792
bool is_pcval() const
Definition hexrays.hpp:2673
bool hexapi make_low_half(int width)
Make the low part of the operand.
Definition hexrays.hpp:12024
bool hexapi get_stkoff(sval_t *p_vdoff) const
Get the referenced stack offset.
Definition hexrays.hpp:12018
uint16 valnum
Value number.
Definition hexrays.hpp:2627
bool empty() const
Definition hexrays.hpp:2893
void set_udt()
Definition hexrays.hpp:2658
ssize_t get_stkvar(udm_t *udm=nullptr, uval_t *p_idaoff=nullptr) const
Retrieve the referenced stack variable.
Definition hexrays.hpp:3057
void _make_blkref(int blknum)
Create a block reference operand without erasing previous data.
Definition hexrays.hpp:2837
int size
Operand size.
Definition hexrays.hpp:2631
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:12060
bool is_glbvar() const
Is a global variable?
Definition hexrays.hpp:2895
bool hexapi equal_mops(const mop_t &rop, int eqflags) const
Compare operands.
Definition hexrays.hpp:11988
mop_addr_t * a
Definition hexrays.hpp:2647
char * helper
Definition hexrays.hpp:2648
void hexapi print(qstring *vout, int shins_flags=SHINS_SHORT|SHINS_VALNUM) const
Definition hexrays.hpp:11874
bool hexapi change_size(int nsize, side_effect_t sideff=WITH_SIDEFF)
Change the operand size.
Definition hexrays.hpp:12054
bool is_reg(mreg_t _r) const
Is the specified register?
Definition hexrays.hpp:2902
const minsn_t * get_insn(mcode_t code) const
Get subinstruction of the operand.
Definition hexrays.hpp:6121
mnumber_t * nnn
Definition hexrays.hpp:2640
mcases_t * c
Definition hexrays.hpp:2650
bool hexapi make_fpnum(const void *bytes, size_t _size)
Create a floating point constant operand.
Definition hexrays.hpp:11922
void _make_cases(mcases_t *_cases)
Create a 'switch cases' operand without erasing previous data.
Definition hexrays.hpp:2875
void set_lowaddr()
Definition hexrays.hpp:2660
void make_insn(minsn_t *ins)
Create a nested instruction.
Definition hexrays.hpp:2831
scif_t * scif
Definition hexrays.hpp:2653
void hexapi make_number(uint64 _value, int _size, ea_t _ea=BADADDR, int opnum=0)
Create an integer constant operand.
Definition hexrays.hpp:11916
bool is_arglist() const
Is a list of arguments?
Definition hexrays.hpp:2906
bool is_impptr_done() const
Definition hexrays.hpp:2662
bool is_equal_to(uint64 n, bool is_signed=true) const
Definition hexrays.hpp:3032
mop_t(const mop_t &rop)
Definition hexrays.hpp:2683
bool hexapi make_first_half(int width)
Make the first part of the operand.
Definition hexrays.hpp:12036
bool is_stkvar() const
Is a stack variable?
Definition hexrays.hpp:2897
void make_stkvar(mba_t *mba, sval_t off)
Definition hexrays.hpp:2816
void set_impptr_done()
Definition hexrays.hpp:2657
bool hexapi is_sign_extended_from(int nbytes) const
Does the high part of the operand consist of the sign bytes?
Definition hexrays.hpp:11976
void set_for_abi()
Definition hexrays.hpp:2661
bool hexapi make_high_half(int width)
Make the high part of the operand.
Definition hexrays.hpp:12030
const char *hexapi dstr() const
Definition hexrays.hpp:11880
bool operator!=(const mop_t &rop) const
Definition hexrays.hpp:2984
uint64 value(bool is_signed) const
Retrieve value of a constant integer operand.
Definition hexrays.hpp:3018
void apply_xds(ea_t ea, int newsize)
Definition hexrays.hpp:3154
bool is_undef_val() const
Definition hexrays.hpp:2665
bool is_glbaddr() const
Is address of a global memory cell?
Definition hexrays.hpp:6131
void _make_reg(mreg_t reg)
Create a register operand without erasing previous data.
Definition hexrays.hpp:2771
mcallinfo_t * f
Definition hexrays.hpp:2645
bool is_scattered() const
Is a scattered operand?
Definition hexrays.hpp:2920
void hexapi erase()
Definition hexrays.hpp:11868
void _make_insn(minsn_t *ins)
Create a nested instruction without erasing previous data.
Definition hexrays.hpp:6101
void _make_strlit(const char *str)
Create a constant string operand.
Definition hexrays.hpp:2851
mop_t & operator=(const mop_t &rop)
Definition hexrays.hpp:2685
bool is_kreg() const
Is a kernel register?
Definition hexrays.hpp:6112
bool is_cc() const
Is a condition code?
Definition hexrays.hpp:2908
bool is_reg(mreg_t _r, int _size) const
Is the specified register of the specified size?
Definition hexrays.hpp:2904
void hexapi swap(mop_t &rop)
Definition hexrays.hpp:11862
int hexapi for_all_scattered_submops(scif_visitor_t &sv) const
Visit all sub-operands of a scattered operand.
Definition hexrays.hpp:12006
bool is_bit_reg() const
Definition hexrays.hpp:2912
bool is_zero() const
Definition hexrays.hpp:3037
bool hexapi create_from_ivlset(mba_t *mba, const ivlset_t &ivs, sval_t fullsize)
Create operand from ivlset_t.
Definition hexrays.hpp:11892
void make_reg(mreg_t reg)
Create a register operand.
Definition hexrays.hpp:2783
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:2967
bool hexapi shift_mop(int offset)
Shift the operand.
Definition hexrays.hpp:12048
mop_t &hexapi assign(const mop_t &rop)
Definition hexrays.hpp:11856
bool is_positive_constant() const
Definition hexrays.hpp:3039
bool is_udt() const
Definition hexrays.hpp:2663
mop_pair_t * pair
Definition hexrays.hpp:2652
mreg_t r
Definition hexrays.hpp:2639
void _make_stkvar(mba_t *mba, sval_t off)
Create a stack variable operand.
Definition hexrays.hpp:2811
bool is_stkaddr() const
Is address of a stack variable?
Definition hexrays.hpp:6141
mop_t(mreg_t _r, int _s)
Definition hexrays.hpp:2684
bool hexapi is01() const
Are the possible values of the operand only 0 and 1?
Definition hexrays.hpp:11964
void set_undef_val()
Definition hexrays.hpp:2659
fnumber_t * fpc
Definition hexrays.hpp:2651
ea_t g
Definition hexrays.hpp:2643
mop_t()
Definition hexrays.hpp:2682
void _make_strlit(qstring *str)
Definition hexrays.hpp:2856
bool operator==(const mop_t &rop) const
Definition hexrays.hpp:2983
bool is_ccflags() const
Definition hexrays.hpp:2668
char * cstr
Definition hexrays.hpp:2649
void hexapi make_helper(const char *name)
Create a helper operand.
Definition hexrays.hpp:11946
minsn_t * d
Definition hexrays.hpp:2641
void hexapi create_from_vdloc(mba_t *mba, const vdloc_t &loc, int _size)
Create operand from vdloc_t.
Definition hexrays.hpp:11898
void make_blkref(int blknum)
Create a global variable operand.
Definition hexrays.hpp:2843
void _make_callinfo(mcallinfo_t *fi)
Create a call info operand without erasing previous data.
Definition hexrays.hpp:2866
stkvar_ref_t * s
Definition hexrays.hpp:2642
void _make_reg(mreg_t reg, int _size)
Definition hexrays.hpp:2776
bool hexapi make_second_half(int width)
Make the second part of the operand.
Definition hexrays.hpp:12042
void erase_but_keep_size()
Definition hexrays.hpp:2695
lvar_ref_t * l
Definition hexrays.hpp:2646
bool probably_floating() const
Definition hexrays.hpp:2664
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:11904
void hexapi apply_ld_mcode(mcode_t mcode, ea_t ea, int newsize)
Apply a unary opcode to the operand.
Definition hexrays.hpp:12066
void update_numop_value(uint64 val)
Definition hexrays.hpp:3021
void hexapi make_gvar(ea_t ea)
Create a global variable operand.
Definition hexrays.hpp:11934
bool is_mblock(int serial) const
Is a block reference to the specified block?
Definition hexrays.hpp:2918
void apply_xdu(ea_t ea, int newsize)
Definition hexrays.hpp:3153
void _make_pair(mop_pair_t *_pair)
Create a pair operand without erasing previous data.
Definition hexrays.hpp:2884
bool hexapi may_use_aliased_memory() const
Is it possible for the operand to use aliased memory?
Definition hexrays.hpp:11958
Definition hexrays.hpp:1916
node_bitset_t(int node)
Definition hexrays.hpp:1919
node_bitset_t()
Definition hexrays.hpp:1918
Node ordering in a graph.
Definition gdl.hpp:152
A flow chart for a function (ea-based, no func_t pointers).
Definition gdl.hpp:527
Linked list Note: linked list is not movable!
Definition pro.h:4115
Smart pointer to objects derived from qrefcnt_obj_t.
Definition pro.h:2996
Reimplementation of stack class from STL.
Definition pro.h:2848
Reimplementation of vector class from STL.
Definition pro.h:2262
const ivl_t * const_iterator
Definition pro.h:2681
void swap(qvector< T > &r) noexcept
Replace all attributes of this qvector with that of 'r', and vice versa.
Definition pro.h:2634
iterator end(void)
Get an iterator that points to the end of the qvector (NOT the last element)
Definition pro.h:2684
qvector(void)
Definition pro.h:2374
lvar_saved_info_t * iterator
Definition pro.h:2680
iterator begin(void)
Get an iterator that points to the first element in the qvector.
Definition pro.h:2683
void push_back(ea_t &&x)
Definition pro.h:2432
Definition hexrays.hpp:2087
const char *hexapi dstr() const
Definition hexrays.hpp:11698
rlist_t & operator=(const rlist_t &)=default
rlist_t(mreg_t reg, int width)
Definition hexrays.hpp:2091
rlist_t()
Definition hexrays.hpp:2089
rlist_t(const rlist_t &m)
Definition hexrays.hpp:2090
void hexapi print(qstring *vout) const
Definition hexrays.hpp:11692
~rlist_t()
Definition hexrays.hpp:2092
Used to manage arguments that are described by multiple locations (also see ALOC_DIST)
Definition typeinf.hpp:1347
Definition hexrays.hpp:2300
friend class simple_graph_t
Definition hexrays.hpp:2301
bool operator==(const iterator &n) const
Definition hexrays.hpp:2305
bool operator!=(const iterator &n) const
Definition hexrays.hpp:2306
int operator*() const
Definition hexrays.hpp:2307
Definition hexrays.hpp:2261
void calc_outgoing_edges(const intvec_t &sub, edgevec_t &el) const
int front() const
Definition hexrays.hpp:2312
void inc(iterator &p, int n=1) const
Definition hexrays.hpp:2313
void hexapi compute_dominators(array_of_node_bitset_t &domin, bool post=false) const
Definition hexrays.hpp:11784
void find_reaching_nodes(int n, node_bitset_t &reaching) const
bool colored_gdl_edges
Definition hexrays.hpp:2270
void hexapi compute_immediate_dominators(const array_of_node_bitset_t &domin, intvec_t &idomin, bool post=false) const
Definition hexrays.hpp:11790
void depth_first_postorder(node_ordering_t *post, edge_mapper_t *et) const
iterator begin() const
Definition hexrays.hpp:2310
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:2309
bool path_back(const edge_mapper_t &et, int m, int n) const
int const newapi
Definition hexrays.hpp:2274
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:11796
bool is_connected_without(const edge_t &forbidden_edge, const intvec_t &dead_nodes) const
qstring title
Definition hexrays.hpp:2269
int hexapi depth_first_postorder(node_ordering_t *post) const
Definition hexrays.hpp:11802
virtual int hexapi goup(int node) const newapi
Definition hexrays.hpp:11808
HEXRAYS_MEMORY_ALLOCATION_FUNCS() virtual bool ignore_edge(int
iterator end() const
Definition hexrays.hpp:2311
Primary mechanism for managing type information.
Definition typeinf.hpp:3077
bool create_typedef(const typedef_type_data_t &p, type_t decl_type=BTF_TYPEDEF, bool try_ordinal=true)
Definition typeinf.hpp:3937
void swap(tinfo_t &r)
Assign this = r and r = this.
Definition typeinf.hpp:3228
size_t get_size(uint32 *p_effalign=nullptr, int gts_code=0) const
Get the type size in bytes.
Definition typeinf.hpp:3350
Abstract class: User-defined call generator derived classes should implement method 'match'.
Definition hexrays.hpp:1814
~udc_filter_t()
Definition hexrays.hpp:1818
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:11432
void hexapi cleanup()
Cleanup the filter This function properly clears type information associated to this filter.
Definition hexrays.hpp:11426
bool empty() const
Definition hexrays.hpp:1830
virtual merror_t hexapi apply(codegen_t &cdg) override
generate microcode for an instruction
Definition hexrays.hpp:11438
Definition hexrays.hpp:373
void set_unk()
Definition hexrays.hpp:425
void hexapi set_cmp(cmpop_t cmp, uvlr_t _value)
Definition hexrays.hpp:11019
DEFINE_MEMORY_ALLOCATION_FUNCS() void set_none()
Definition hexrays.hpp:421
const char *hexapi dstr() const
Definition hexrays.hpp:11061
uvlr_t max_svalue() const
Definition hexrays.hpp:458
valrng_t(int size_=MAX_VLR_SIZE)
Definition hexrays.hpp:414
bool hexapi cvt_to_single_value(uvlr_t *v) const
Definition hexrays.hpp:11067
bool is_unknown() const
Definition hexrays.hpp:446
bool empty() const
Definition hexrays.hpp:444
char reserved[sizeof(qvector< int >)]
Definition hexrays.hpp:406
uvlr_t zeroes
Definition hexrays.hpp:403
bool hexapi unite_with(const valrng_t &r)
Definition hexrays.hpp:11037
void hexapi set_eq(uvlr_t v)
Definition hexrays.hpp:11013
void hexapi copy(const valrng_t &r)
Definition hexrays.hpp:10995
void swap(valrng_t &r)
Definition hexrays.hpp:419
int size
Definition hexrays.hpp:389
int flags
Definition hexrays.hpp:375
bool hexapi has(uvlr_t v) const
Definition hexrays.hpp:11049
uvlr_t value
Definition hexrays.hpp:396
DECLARE_COMPARISONS(valrng_t)
valrng_t(const valrng_t &r)
Definition hexrays.hpp:416
void set_all()
Definition hexrays.hpp:424
int get_size() const
Definition hexrays.hpp:455
void hexapi print(qstring *vout) const
Definition hexrays.hpp:11055
bool all_values() const
Definition hexrays.hpp:445
valrng_t & operator=(const valrng_t &r)
Definition hexrays.hpp:418
bool hexapi cvt_to_cmp(cmpop_t *cmp, uvlr_t *val) const
Definition hexrays.hpp:11073
bool hexapi reduce_size(int new_size)
Definition hexrays.hpp:11025
svlr_t stride
Definition hexrays.hpp:399
void hexapi inverse()
Definition hexrays.hpp:11043
valrng_t &hexapi assign(const valrng_t &r)
Definition hexrays.hpp:11001
uvlr_t min_svalue() const
Definition hexrays.hpp:457
uvlr_t ones
Definition hexrays.hpp:404
uvlr_t limit
Definition hexrays.hpp:397
void hexapi clear()
Definition hexrays.hpp:10989
~valrng_t()
Definition hexrays.hpp:417
bool hexapi intersect_with(const valrng_t &r)
Definition hexrays.hpp:11031
uvlr_t max_value() const
Definition hexrays.hpp:456
Definition hexrays.hpp:1141
int reg1() const
Definition hexrays.hpp:1147
void _set_reg1(int r1)
Definition hexrays.hpp:1152
bool hexapi is_aliasable(const mba_t *mb, size_t size) const
Definition hexrays.hpp:11281
const char *hexapi dstr(int width=0) const
Definition hexrays.hpp:11269
void set_reg1(int r1)
Definition hexrays.hpp:1155
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:1470
const argloc_type_t ALOC_REG2
register pair
Definition typeinf.hpp:961
const callcnv_t CM_CC_INVALID
this value is invalid
Definition typeinf.hpp:881
const callcnv_t CM_CC_UNKNOWN
unknown calling convention
Definition typeinf.hpp:882
merror_t
Definition hexrays.hpp:510
@ MERR_ONLY32
only 32-bit functions can be decompiled for the current database
Definition hexrays.hpp:536
@ MERR_LICENSE
no license available
Definition hexrays.hpp:535
@ MERR_CANCELED
decompilation has been cancelled
Definition hexrays.hpp:530
@ MERR_UNKTYPE
undefined type s (currently unused error code)
Definition hexrays.hpp:526
@ MERR_BADFRAME
function frame is wrong
Definition hexrays.hpp:525
@ MERR_BUSY
already decompiling a function
Definition hexrays.hpp:538
@ MERR_HUGESTACK
stack frame is too big
Definition hexrays.hpp:521
@ MERR_BADBLK
bad block found
Definition hexrays.hpp:516
@ MERR_BADIDB
inconsistent database information
Definition hexrays.hpp:527
@ MERR_CLOUD
cloud: s
Definition hexrays.hpp:546
@ MERR_EXCEPTION
exception analysis failed
Definition hexrays.hpp:520
@ MERR_BLOCK
no error, switch to new block
Definition hexrays.hpp:512
@ MERR_FUNCSIZE
too big function
Definition hexrays.hpp:541
@ MERR_PARTINIT
partially initialized variable s
Definition hexrays.hpp:533
@ MERR_BADRANGES
bad input ranges
Definition hexrays.hpp:542
@ MERR_DSLOT
bad instruction in the delay slot
Definition hexrays.hpp:544
@ MERR_OK
ok
Definition hexrays.hpp:511
@ MERR_INSN
cannot convert to microcode
Definition hexrays.hpp:514
@ MERR_COMPLEX
too complex function
Definition hexrays.hpp:534
@ MERR_BADARCH
current architecture is not supported
Definition hexrays.hpp:543
@ MERR_ONLY64
only 64-bit functions can be decompiled for the current database
Definition hexrays.hpp:537
@ MERR_RECDEPTH
max recursion depth reached during lvar allocation
Definition hexrays.hpp:531
@ MERR_FARPTR
far memory model is supported only for pc
Definition hexrays.hpp:539
@ MERR_STOP
no error, stop the analysis
Definition hexrays.hpp:545
@ MERR_BADCALL
could not determine call arguments
Definition hexrays.hpp:524
@ MERR_EMULATOR
emulator: s
Definition hexrays.hpp:547
@ MERR_SIZEOF
wrong basic type sizes in compiler settings
Definition hexrays.hpp:528
@ MERR_EXTERN
special segments cannot be decompiled
Definition hexrays.hpp:540
@ MERR_BITNESS
16-bit functions cannot be decompiled
Definition hexrays.hpp:523
@ MERR_LOOP
internal code: redo last loop (never reported)
Definition hexrays.hpp:549
@ MERR_REDO
redecompilation has been requested
Definition hexrays.hpp:529
@ MERR_PROLOG
prolog analysis failed
Definition hexrays.hpp:518
@ MERR_LVARS
local variable allocation failed
Definition hexrays.hpp:522
@ MERR_INTERR
internal error
Definition hexrays.hpp:513
@ MERR_OVERLAP
variables would overlap: s
Definition hexrays.hpp:532
@ MERR_BADSP
positive sp value has been found
Definition hexrays.hpp:517
@ MERR_SWITCH
wrong switch idiom
Definition hexrays.hpp:519
@ MERR_MAX_ERR
Definition hexrays.hpp:548
@ MERR_MEM
not enough memory
Definition hexrays.hpp:515
idaman ea_t ida_export get_func_start(ea_t ea)
Get start address of the function containing 'ea'.
idaman size_t ida_export get_func_tail_qty(ea_t func_ea)
Get the number of function tail chunks.
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:1004
int code
Definition fpro.h:88
idaman size_t n
Definition pro.h:1000
const type_sign_t type_unsigned
unsigned type
Definition typeinf.hpp:676
qvector< type_attr_t > type_attrs_t
this vector must be sorted by keys
Definition typeinf.hpp:670
int type_sign_t
type signedness
Definition typeinf.hpp:672
const type_sign_t no_sign
no sign, or unknown
Definition typeinf.hpp:674
const type_t BTF_UINT
unsigned int
Definition typeinf.hpp:411
const type_t BTF_INT
int, unknown signedness
Definition typeinf.hpp:410
bool hexapi get_type(uval_t id, tinfo_t *tif, type_source_t guess)
Get a global type.
Definition hexrays.hpp:11257
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:11263
bool hexapi is_type_correct(const type_t *ptr)
Verify a type string.
Definition hexrays.hpp:11179
int hexapi partial_type_num(const tinfo_t &type)
Calculate number of partial subtypes.
Definition hexrays.hpp:11203
bool hexapi is_small_udt(const tinfo_t &tif)
Is a small structure or union?
Definition hexrays.hpp:11185
THREAD_SAFE bool is_inplace_def(const tinfo_t &type)
Is struct/union/enum definition (not declaration)?
Definition hexrays.hpp:1024
tinfo_t hexapi get_unk_type(size_t size)
Create a partial type info by width.
Definition hexrays.hpp:11225
tinfo_t hexapi get_float_type(size_t width)
Get a type of a floating point value with the specified width.
Definition hexrays.hpp:11209
type_source_t
Type source (where the type information comes from)
Definition hexrays.hpp:1097
bool hexapi is_bool_type(const tinfo_t &type)
Is a boolean type?
Definition hexrays.hpp:11197
bool hexapi is_nonbool_type(const tinfo_t &type)
Is definitely a non-boolean type?
Definition hexrays.hpp:11191
THREAD_SAFE bool is_ptr_or_array(type_t t)
Is a pointer or array type?
Definition hexrays.hpp:1012
tinfo_t hexapi create_typedef(const char *name)
Create a reference to a named type.
Definition hexrays.hpp:11249
tinfo_t hexapi dummy_ptrtype(size_t ptrsize, bool isfp)
Generate a dummy pointer type.
Definition hexrays.hpp:11233
const char *hexapi dstr(const tinfo_t *tif)
Print the specified type info.
Definition hexrays.hpp:11173
THREAD_SAFE bool is_paf(type_t t)
Is a pointer, array, or function type?
Definition hexrays.hpp:1018
tinfo_t hexapi make_pointer(const tinfo_t &type)
Create a pointer type.
Definition hexrays.hpp:11241
tinfo_t hexapi get_int_type_by_width_and_sign(size_t srcwidth, type_sign_t sign)
Create a type info by width and sign.
Definition hexrays.hpp:11217
@ TS_DONTREF
Definition hexrays.hpp:1104
@ GUESSED_WEAK
Definition hexrays.hpp:1099
@ GUESSED_DATA
Definition hexrays.hpp:1101
@ TS_SHRINK
Definition hexrays.hpp:1103
@ GUESSED_FUNC
Definition hexrays.hpp:1100
@ TS_NOELL
Definition hexrays.hpp:1102
@ GUESSED_NONE
Definition hexrays.hpp:1098
@ TS_MASK
Definition hexrays.hpp:1105
input_device_t
Type of the input device.
Definition hexrays.hpp:8669
@ USE_MOUSE
Mouse.
Definition hexrays.hpp:8671
@ USE_KEYBOARD
Keyboard.
Definition hexrays.hpp:8670
GCC_DIAG_OFF(format-nonliteral)
GCC_DIAG_ON(format-nonliteral)
bool is_break_consumer(ctype_t op)
Does a break statement influence the specified statement code?
Definition hexrays.hpp:6491
operand_locator_t const & user_numforms_first(user_numforms_iterator_t p)
Get reference to the current map key.
Definition hexrays.hpp:9794
const maymust_t MAYMUST_ACCESS_MASK
Definition hexrays.hpp:476
void udcall_map_free(udcall_map_t *map)
Delete udcall_map_t instance.
Definition hexrays.hpp:10099
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:14131
cursor_item_type_t
Type of the cursor item.
Definition hexrays.hpp:7580
@ VDI_FUNC
the function itself (the very first line with the function prototype)
Definition hexrays.hpp:7584
@ VDI_TAIL
cursor is at (beyond) the line end (commentable line)
Definition hexrays.hpp:7585
@ VDI_LVAR
declaration of local variable
Definition hexrays.hpp:7583
@ VDI_NONE
undefined
Definition hexrays.hpp:7581
@ VDI_EXPR
c-tree item
Definition hexrays.hpp:7582
boundaries_iterator_t boundaries_end(const boundaries_t *map)
Get iterator pointing to the end of boundaries_t.
Definition hexrays.hpp:10816
size_t iterator_word
Definition hexrays.hpp:9764
THREAD_SAFE mcode_t jcnd2set(mcode_t code)
Definition hexrays.hpp:766
MSC_DIAG_ON(4996) GCC_DIAG_ON(deprecated-declarations) struct decomp_item_iterator_t
Item iterator for decomp_ranges_t.
Definition hexrays.hpp:5068
user_cmts_iterator_t user_cmts_prev(user_cmts_iterator_t p)
Move to the previous element.
Definition hexrays.hpp:10179
size_t user_numforms_size(user_numforms_t *map)
Get size of user_numforms_t.
Definition hexrays.hpp:9874
boundaries_iterator_t boundaries_find(const boundaries_t *map, const cinsn_t *&key)
Find the specified key in boundaries_t.
Definition hexrays.hpp:10789
void user_cmts_clear(user_cmts_t *map)
Clear user_cmts_t.
Definition hexrays.hpp:10194
const cmt_type_t CMT_FUNC
Function comment.
Definition hexrays.hpp:8723
memreg_index_t
< memory region types
Definition hexrays.hpp:4961
@ MMIDX_SHADOW
stack: shadow arguments
Definition hexrays.hpp:4965
@ MMIDX_GLBLOW
global memory: low part
Definition hexrays.hpp:4962
@ MMIDX_GLBHIGH
global memory: high part
Definition hexrays.hpp:4967
@ MMIDX_ARGS
stack: regular stack arguments
Definition hexrays.hpp:4966
@ MMIDX_RETADDR
stack: return address
Definition hexrays.hpp:4964
@ MMIDX_LVARS
stack: local variables
Definition hexrays.hpp:4963
const maymust_t EXCLUDE_PASS_REGS
Definition hexrays.hpp:483
bool is_unary(ctype_t op)
Is unary operator?
Definition hexrays.hpp:6426
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:10253
THREAD_SAFE mcode_t hexapi get_unsigned_mcode(mcode_t code)
Definition hexrays.hpp:11125
THREAD_SAFE bool is_unsigned_mcode(mcode_t code)
Definition hexrays.hpp:802
const mopt_t mop_d
result of another instruction
Definition hexrays.hpp:2410
const cmt_type_t CMT_BLOCK2
Posterior block comment.
Definition hexrays.hpp:8721
const minsn_t *hexapi getb_reginsn(const minsn_t *ins)
Skip assertions backward.
Definition hexrays.hpp:12370
void user_labels_clear(user_labels_t *map)
Clear user_labels_t.
Definition hexrays.hpp:10630
qmap< cinsn_t *, rangeset_t > boundaries_t
Definition hexrays.hpp:7867
size_t user_casts_size(user_casts_t *map)
Get size of user_casts_t.
Definition hexrays.hpp:10419
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:11293
enum hexrays_event_t ENUM_SIZE(int)
Decompiler events.
Definition hexrays.hpp:8371
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:10162
const size_t bitset_shift
Definition hexrays.hpp:1837
void * hexdsp_t(int code,...)
Hex-Rays decompiler dispatcher.
Definition hexrays.hpp:8364
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:11095
size_t user_unions_size(user_unions_t *map)
Get size of user_unions_t.
Definition hexrays.hpp:10528
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:13530
bool is_relational(ctype_t op)
Is comparison operator?
Definition hexrays.hpp:6428
uvlr_t max_vlr_value(int size)
Definition hexrays.hpp:315
const mreg_t mr_sf
Definition hexrays.hpp:819
bool is_signed_cmpop(cmpop_t cmpop)
Definition hexrays.hpp:351
bool init_hexrays_plugin(int flags=0)
Check that your plugin is compatible with hex-rays decompiler.
Definition hexrays.hpp:9771
qvector< mlist_t > mlistvec_t
Definition hexrays.hpp:2156
void lvar_mapping_clear(lvar_mapping_t *map)
Clear lvar_mapping_t.
Definition hexrays.hpp:9976
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:11413
item_preciser_t
Comment item preciser.
Definition hexrays.hpp:6594
@ ITP_ASM
__asm-line
Definition hexrays.hpp:6602
@ ITP_CASE
bit for switch cases
Definition hexrays.hpp:6614
@ ITP_BLOCK2
closing block comment.
Definition hexrays.hpp:6612
@ ITP_SEMI
semicolon
Definition hexrays.hpp:6605
@ ITP_INNER_LAST
Definition hexrays.hpp:6600
@ ITP_CURLY2
}
Definition hexrays.hpp:6607
@ ITP_SIGN
if this bit is set too, then we have a negative case value
Definition hexrays.hpp:6615
@ ITP_EMPTY
nothing
Definition hexrays.hpp:6596
@ ITP_COLON
: (label)
Definition hexrays.hpp:6609
@ ITP_ELSE
else-line
Definition hexrays.hpp:6603
@ ITP_DO
do-line
Definition hexrays.hpp:6604
@ ITP_ARG64
Definition hexrays.hpp:6598
@ ITP_CURLY1
{
Definition hexrays.hpp:6606
@ ITP_BRACE1
Definition hexrays.hpp:6599
@ ITP_ARG1
, (64 entries are reserved for 64 call arguments)
Definition hexrays.hpp:6597
@ ITP_BRACE2
)
Definition hexrays.hpp:6608
@ ITP_TRY
C++ try statement.
Definition hexrays.hpp:6613
@ ITP_BLOCK1
opening block comment.
Definition hexrays.hpp:6610
user_unions_iterator_t user_unions_prev(user_unions_iterator_t p)
Move to the previous element.
Definition hexrays.hpp:10506
int mreg_t
Micro register.
Definition hexrays.hpp:263
std::set< ea_t > easet_t
Definition hexrays.hpp:278
bool is_bitop(ctype_t op)
Is bit related operator?
Definition hexrays.hpp:6467
user_unions_iterator_t user_unions_next(user_unions_iterator_t p)
Move to the next element.
Definition hexrays.hpp:10498
const svlr_t MIN_VLR_SVALUE
Definition hexrays.hpp:312
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:9808
void user_cmts_free(user_cmts_t *map)
Delete user_cmts_t instance.
Definition hexrays.hpp:10208
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:10035
const maymust_t INCLUDE_DEAD_RETREGS
Definition hexrays.hpp:494
size_t mbitmap_t
Definition hexrays.hpp:1834
const mopt_t mop_l
local variable
Definition hexrays.hpp:2415
user_iflags_iterator_t user_iflags_next(user_iflags_iterator_t p)
Move to the next element.
Definition hexrays.hpp:10280
void hexapi remitem(const citem_t *e)
Definition hexrays.hpp:12996
const maymust_t CALL_SPOILS_ONLY_ARGS
Definition hexrays.hpp:497
void user_iflags_clear(user_iflags_t *map)
Clear user_iflags_t.
Definition hexrays.hpp:10303
const int64 HEXRAYS_API_MAGIC
Definition hexrays.hpp:8365
bool hexapi has_cached_cfunc(ea_t ea)
Do we have a cached decompilation result for 'ea'?
Definition hexrays.hpp:13846
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:10053
cexpr_t *hexapi lnot(cexpr_t *e)
Logically negate the specified expression.
Definition hexrays.hpp:13446
bool hexapi mark_cfunc_dirty(ea_t ea, bool close_views=false)
Flush the cached decompilation results.
Definition hexrays.hpp:13834
eamap_iterator_t eamap_prev(eamap_iterator_t p)
Move to the previous element.
Definition hexrays.hpp:10724
const cmt_type_t CMT_TAIL
Indented comment.
Definition hexrays.hpp:8719
boundaries_iterator_t boundaries_begin(const boundaries_t *map)
Get iterator pointing to the beginning of boundaries_t.
Definition hexrays.hpp:10807
bool is_additive(ctype_t op)
Is additive operator?
Definition hexrays.hpp:6449
vdui_t *hexapi open_pseudocode(ea_t ea, int flags)
Open pseudocode window.
Definition hexrays.hpp:12954
const tinfo_t const char va_list va
Definition hexrays.hpp:7698
intvec_t & user_unions_second(user_unions_iterator_t p)
Get reference to the current map value.
Definition hexrays.hpp:10455
int hexapi get_mreg_name(qstring *out, mreg_t reg, int width, void *ud=nullptr)
Get the microregister name.
Definition hexrays.hpp:11752
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:13488
rangeset_t & boundaries_second(boundaries_iterator_t p)
Get reference to the current map value.
Definition hexrays.hpp:10782
ssize_t idaapi hexrays_cb_t(void *ud, hexrays_event_t event, va_list va)
Handler of decompiler events.
Definition hexrays.hpp:8643
qvector< ui_stroff_op_t > ui_stroff_ops_t
Definition hexrays.hpp:9059
cmt_retrieval_type_t
Comment retrieval type.
Definition hexrays.hpp:6643
@ RETRIEVE_ALWAYS
Retrieve comment even if it has been used.
Definition hexrays.hpp:6645
@ RETRIEVE_ONCE
Retrieve comment if it has not been used yet.
Definition hexrays.hpp:6644
uvlr_t max_vlr_svalue(int size)
Definition hexrays.hpp:327
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:11383
size_t user_cmts_size(user_cmts_t *map)
Get size of user_cmts_t.
Definition hexrays.hpp:10201
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:9826
void hexapi print_vdloc(qstring *vout, const vdloc_t &loc, int nbytes)
Print vdloc.
Definition hexrays.hpp:11287
void user_cmts_erase(user_cmts_t *map, user_cmts_iterator_t p)
Erase current element from user_cmts_t.
Definition hexrays.hpp:10187
void hexapi get_cached_cfunc_eas(eavec_t *out)
Return the start EAs of all cached cfunc_t objects.
Definition hexrays.hpp:13852
eamap_iterator_t eamap_find(const eamap_t *map, const ea_t &key)
Find the specified key in eamap_t.
Definition hexrays.hpp:10680
bool op_uses_z(ctype_t op)
Does operator use the 'z' field of cexpr_t?
Definition hexrays.hpp:6422
THREAD_SAFE bool is_mcode_convertible_to_jmp(mcode_t mcode)
Definition hexrays.hpp:719
void hexapi clear_cached_cfuncs()
Flush all cached decompilation results.
Definition hexrays.hpp:13840
ea_t const & user_unions_first(user_unions_iterator_t p)
Get reference to the current map key.
Definition hexrays.hpp:10448
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:9944
lvar_locator_t & lvar_mapping_second(lvar_mapping_iterator_t p)
Get reference to the current map value.
Definition hexrays.hpp:9910
size_t udcall_map_size(udcall_map_t *map)
Get size of udcall_map_t.
Definition hexrays.hpp:10092
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:13506
bool accepts_small_udts(ctype_t op)
Is the operator allowed on small structure or union?
Definition hexrays.hpp:6508
const minsn_t *hexapi getf_reginsn(const minsn_t *ins)
Skip assertions forward.
Definition hexrays.hpp:12364
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:10044
const cmt_type_t CMT_LVAR
Local variable comment.
Definition hexrays.hpp:8722
user_numforms_iterator_t user_numforms_prev(user_numforms_iterator_t p)
Move to the previous element.
Definition hexrays.hpp:9852
bool hexapi change_hexrays_config(const char *directive)
Parse DIRECTIVE and update the current configuration variables.
Definition hexrays.hpp:12942
user_casts_iterator_t user_casts_prev(user_casts_iterator_t p)
Move to the previous element.
Definition hexrays.hpp:10397
va_end(va)
void block_chains_free(block_chains_t *set)
Delete block_chains_t instance.
Definition hexrays.hpp:10964
qmap< ea_t, intvec_t > user_unions_t
Definition hexrays.hpp:6684
qvector< mop_t > mopvec_t
Definition hexrays.hpp:283
cfuncptr_t decompile_snippet(const rangevec_t &ranges, hexrays_failure_t *hf=nullptr, int decomp_flags=0)
Decompile a snippet.
Definition hexrays.hpp:8189
qvector< bitset_t > array_of_bitsets
Definition hexrays.hpp:1911
eamap_iterator_t eamap_next(eamap_iterator_t p)
Move to the next element.
Definition hexrays.hpp:10716
udcall_map_iterator_t udcall_map_next(udcall_map_iterator_t p)
Move to the next element.
Definition hexrays.hpp:10062
bool is_commutative(ctype_t op)
Is commutative operator?
Definition hexrays.hpp:6436
const maymust_t MAY_ACCESS
Definition hexrays.hpp:474
udcall_map_iterator_t udcall_map_prev(udcall_map_iterator_t p)
Move to the previous element.
Definition hexrays.hpp:10070
void user_numforms_erase(user_numforms_t *map, user_numforms_iterator_t p)
Erase current element from user_numforms_t.
Definition hexrays.hpp:9860
const mlist_t &hexapi get_temp_regs()
Get list of temporary registers.
Definition hexrays.hpp:11728
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:13494
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:9844
eamap_iterator_t eamap_begin(const eamap_t *map)
Get iterator pointing to the beginning of eamap_t.
Definition hexrays.hpp:10698
ea_t hexapi get_merror_desc(qstring *out, merror_t code, mba_t *mba)
Get textual description of an error code.
Definition hexrays.hpp:11079
const mopt_t mop_b
micro basic block (mblock_t)
Definition hexrays.hpp:2413
user_casts_iterator_t user_casts_begin(const user_casts_t *map)
Get iterator pointing to the beginning of user_casts_t.
Definition hexrays.hpp:10371
block_chains_iterator_t block_chains_next(block_chains_iterator_t p)
Move to the next element.
Definition hexrays.hpp:10927
mcode_t
Definition hexrays.hpp:609
@ m_stx
Definition hexrays.hpp:611
@ m_ofadd
Definition hexrays.hpp:636
@ m_setbe
Definition hexrays.hpp:647
@ m_fdiv
Definition hexrays.hpp:682
@ m_call
Definition hexrays.hpp:666
@ m_jbe
Definition hexrays.hpp:658
@ m_low
Definition hexrays.hpp:620
@ m_und
Definition hexrays.hpp:671
@ m_ldx
Definition hexrays.hpp:612
@ m_setb
Definition hexrays.hpp:645
@ m_bnot
Definition hexrays.hpp:617
@ m_and
Definition hexrays.hpp:630
@ m_push
Definition hexrays.hpp:669
@ m_xdu
Definition hexrays.hpp:619
@ m_fsub
Definition hexrays.hpp:680
@ m_setg
Definition hexrays.hpp:648
@ m_fadd
Definition hexrays.hpp:679
@ m_jae
Definition hexrays.hpp:655
@ m_i2f
Definition hexrays.hpp:675
@ m_sdiv
Definition hexrays.hpp:626
@ m_seta
Definition hexrays.hpp:646
@ m_cfadd
Definition hexrays.hpp:635
@ m_mul
Definition hexrays.hpp:624
@ m_ja
Definition hexrays.hpp:657
@ m_seto
Definition hexrays.hpp:640
@ m_jz
Definition hexrays.hpp:654
@ m_or
Definition hexrays.hpp:629
@ m_shl
Definition hexrays.hpp:632
@ m_setae
Definition hexrays.hpp:644
@ m_ldc
Definition hexrays.hpp:613
@ m_udiv
Definition hexrays.hpp:625
@ m_neg
Definition hexrays.hpp:615
@ m_setge
Definition hexrays.hpp:649
@ m_setnz
Definition hexrays.hpp:642
@ m_cfshr
Definition hexrays.hpp:638
@ m_setz
Definition hexrays.hpp:643
@ m_jle
Definition hexrays.hpp:662
@ m_jcnd
Definition hexrays.hpp:652
@ m_shr
Definition hexrays.hpp:633
@ m_setp
Definition hexrays.hpp:641
@ m_sar
Definition hexrays.hpp:634
@ m_fmul
Definition hexrays.hpp:681
@ m_ret
Definition hexrays.hpp:668
@ m_add
Definition hexrays.hpp:622
@ m_lnot
Definition hexrays.hpp:616
@ m_sets
Definition hexrays.hpp:639
@ m_cfshl
Definition hexrays.hpp:637
@ m_nop
Definition hexrays.hpp:610
@ m_smod
Definition hexrays.hpp:628
@ m_fneg
Definition hexrays.hpp:678
@ m_pop
Definition hexrays.hpp:670
@ m_setl
Definition hexrays.hpp:650
@ m_goto
Definition hexrays.hpp:665
@ m_setle
Definition hexrays.hpp:651
@ m_xor
Definition hexrays.hpp:631
@ m_jtbl
Definition hexrays.hpp:663
@ m_ext
Definition hexrays.hpp:672
@ m_icall
Definition hexrays.hpp:667
@ m_sub
Definition hexrays.hpp:623
@ m_jnz
Definition hexrays.hpp:653
@ m_umod
Definition hexrays.hpp:627
@ m_f2i
Definition hexrays.hpp:673
@ m_jb
Definition hexrays.hpp:656
@ m_f2f
Definition hexrays.hpp:677
@ m_ijmp
Definition hexrays.hpp:664
@ m_f2u
Definition hexrays.hpp:674
@ m_jge
Definition hexrays.hpp:660
@ m_u2f
Definition hexrays.hpp:676
@ m_jg
Definition hexrays.hpp:659
@ m_high
Definition hexrays.hpp:621
@ m_jl
Definition hexrays.hpp:661
@ m_mov
Definition hexrays.hpp:614
@ m_xds
Definition hexrays.hpp:618
const mopt_t mop_S
local stack variable (they exist until MMAT_LVARS)
Definition hexrays.hpp:2411
int32 & user_iflags_second(user_iflags_iterator_t p)
Get reference to the current map value.
Definition hexrays.hpp:10237
user_unions_t * user_unions_new()
Create a new user_unions_t instance.
Definition hexrays.hpp:10542
size_t boundaries_size(boundaries_t *map)
Get size of boundaries_t.
Definition hexrays.hpp:10855
void eamap_erase(eamap_t *map, eamap_iterator_t p)
Erase current element from eamap_t.
Definition hexrays.hpp:10732
const mopt_t mop_sc
scattered
Definition hexrays.hpp:2421
THREAD_SAFE mcode_t hexapi swap_mcode_relation(mcode_t code)
Definition hexrays.hpp:11113
const int NOSIZE
wrong or unexisting operand size
Definition hexrays.hpp:2423
qset< qstring > strings_t
Definition hexrays.hpp:280
bool hexapi get_current_operand(gco_info_t *out)
Get the instruction operand under the cursor.
Definition hexrays.hpp:12990
size_t eamap_size(eamap_t *map)
Get size of eamap_t.
Definition hexrays.hpp:10746
void block_chains_clear(block_chains_t *set)
Clear block_chains_t.
Definition hexrays.hpp:10950
chain_t & block_chains_get(block_chains_iterator_t p)
Get reference to the current set value.
Definition hexrays.hpp:10884
bool op_uses_y(ctype_t op)
Does operator use the 'y' field of cexpr_t?
Definition hexrays.hpp:6420
allow_unused_labels_t
Unused label disposition.
Definition hexrays.hpp:7664
@ ALLOW_UNUSED_LABELS
Unused labels are permitted.
Definition hexrays.hpp:7666
@ FORBID_UNUSED_LABELS
Unused labels cause interr.
Definition hexrays.hpp:7665
const size_t bitset_width
Definition hexrays.hpp:1835
user_casts_iterator_t user_casts_end(const user_casts_t *map)
Get iterator pointing to the end of user_casts_t.
Definition hexrays.hpp:10380
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:10589
THREAD_SAFE bool is_signed_mcode(mcode_t code)
Definition hexrays.hpp:800
int const & user_labels_first(user_labels_iterator_t p)
Get reference to the current map key.
Definition hexrays.hpp:10557
THREAD_SAFE bool is_mcode_commutative(mcode_t mcode)
Definition hexrays.hpp:727
const mreg_t mr_pf
Definition hexrays.hpp:821
user_minsn_action_t
User microinstruction action types.
Definition hexrays.hpp:4915
@ UMA_APP
insert the instruction after the current
Definition hexrays.hpp:4918
@ UMA_MAX
Definition hexrays.hpp:4919
@ UMA_DEL
delete the instruction
Definition hexrays.hpp:4916
@ UMA_INS
insert the instruction before the current
Definition hexrays.hpp:4917
qlist< cinsn_t > cinsn_list_t
Definition hexrays.hpp:7218
qstring hexapi create_field_name(const tinfo_t &type, uval_t offset=BADADDR)
Definition hexrays.hpp:13864
qmap< citem_locator_t, tinfo_t > user_casts_t
Definition hexrays.hpp:6678
qmap< ea_t, udcall_t > udcall_map_t
Definition hexrays.hpp:1746
const mopt_t mop_z
none
Definition hexrays.hpp:2406
void user_casts_clear(user_casts_t *map)
Clear user_casts_t.
Definition hexrays.hpp:10412
boundaries_iterator_t boundaries_prev(boundaries_iterator_t p)
Move to the previous element.
Definition hexrays.hpp:10833
lvar_mapping_iterator_t lvar_mapping_prev(lvar_mapping_iterator_t p)
Move to the previous element.
Definition hexrays.hpp:9961
const mreg_t mr_cf
Definition hexrays.hpp:817
const mopt_t mop_fn
floating point constant
Definition hexrays.hpp:2419
void *hexapi hexrays_alloc(size_t size)
Definition hexrays.hpp:10977
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:10571
bool is_lvalue(ctype_t op)
Is Lvalue operator?
Definition hexrays.hpp:6497
citem_locator_t const & user_casts_first(user_casts_iterator_t p)
Get reference to the current map key.
Definition hexrays.hpp:10339
const mreg_t mr_zf
Definition hexrays.hpp:818
bool hexapi parse_user_call(udcall_t *udc, const char *decl, bool silent)
Convert function type declaration into internal structure.
Definition hexrays.hpp:11407
THREAD_SAFE bool hexapi is_mcode_propagatable(mcode_t mcode)
May opcode be propagated?
Definition hexrays.hpp:11101
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:10580
THREAD_SAFE bool is_mcode_shift(mcode_t mcode)
Definition hexrays.hpp:740
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:10489
cinsn_t *const & boundaries_first(boundaries_iterator_t p)
Get reference to the current map key.
Definition hexrays.hpp:10775
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:10153
const cmt_type_t CMT_NONE
No comment is possible.
Definition hexrays.hpp:8718
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:13470
const maymust_t INCLUDE_RESTRICTED
Definition hexrays.hpp:496
const char *hexapi get_ctype_name(ctype_t op)
Definition hexrays.hpp:13858
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:10891
DEPRECATED mba_t * create_empty_mba(const mba_ranges_t &mbr, hexrays_failure_t *hf=nullptr)
Create an empty microcode object.
Definition hexrays.hpp:8254
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:10144
qvector< cfuncptr_t > cfuncptrs_t
Definition hexrays.hpp:8105
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:9817
THREAD_SAFE bool is_mcode_jcond(mcode_t mcode)
Definition hexrays.hpp:717
qstack< history_item_t > history_t
Navigation history.
Definition hexrays.hpp:8713
uint64 uvlr_t
Definition hexrays.hpp:307
void user_iflags_erase(user_iflags_t *map, user_iflags_iterator_t p)
Erase current element from user_iflags_t.
Definition hexrays.hpp:10296
const mopt_t mop_r
register (they exist until MMAT_LVARS)
Definition hexrays.hpp:2407
const maymust_t INCLUDE_SPOILED_REGS
Definition hexrays.hpp:481
qvector< citem_t * > citem_pointers_t
Vector of parents.
Definition hexrays.hpp:6562
cinsnptrvec_t & eamap_second(eamap_iterator_t p)
Get reference to the current map value.
Definition hexrays.hpp:10673
void boundaries_free(boundaries_t *map)
Delete boundaries_t instance.
Definition hexrays.hpp:10862
eamap_iterator_t eamap_end(const eamap_t *map)
Get iterator pointing to the end of eamap_t.
Definition hexrays.hpp:10707
void udcall_map_clear(udcall_map_t *map)
Clear udcall_map_t.
Definition hexrays.hpp:10085
user_cmts_iterator_t user_cmts_next(user_cmts_iterator_t p)
Move to the next element.
Definition hexrays.hpp:10171
bool hexapi modify_user_lvars(ea_t entry_ea, user_lvar_modifier_t &mlv)
Modify saved local variable settings.
Definition hexrays.hpp:11377
ea_t const & eamap_first(eamap_iterator_t p)
Get reference to the current map key.
Definition hexrays.hpp:10666
const mopt_t mop_a
mop_addr_t: address of operand (mop_l, mop_v, mop_S, mop_r)
Definition hexrays.hpp:2416
const cmt_type_t CMT_BLOCK1
Anterioir block comment.
Definition hexrays.hpp:8720
const mopt_t mop_str
immediate string constant (user representation)
Definition hexrays.hpp:2409
bool accepts_udts(ctype_t op)
Definition hexrays.hpp:6432
bool is_prepost(ctype_t op)
Is pre/post increment/decrement operator?
Definition hexrays.hpp:6434
uint8 mopt_t
Instruction operand types.
Definition hexrays.hpp:2404
void eamap_clear(eamap_t *map)
Clear eamap_t.
Definition hexrays.hpp:10739
gctype_t
Kind of use-def and def-use chains.
Definition hexrays.hpp:5858
@ GC_DIRTY_ALL
bitmask to represent all chains
Definition hexrays.hpp:5863
@ GC_ASR
all the above and assertions
Definition hexrays.hpp:5860
@ GC_END
number of chain types
Definition hexrays.hpp:5862
@ GC_REGS_AND_STKVARS
registers and stkvars (restricted memory only)
Definition hexrays.hpp:5859
@ GC_XDSU
only registers calculated with FULL_XDSU
Definition hexrays.hpp:5861
user_iflags_t *hexapi restore_user_iflags(ea_t func_ea)
Restore user defined citem iflags from the database.
Definition hexrays.hpp:13548
ctree_maturity_t
Ctree maturity level.
Definition hexrays.hpp:6568
@ CMAT_CPA
corrected pointer arithmetic
Definition hexrays.hpp:6574
@ CMAT_FINAL
ready-to-use
Definition hexrays.hpp:6577
@ CMAT_CASTED
added necessary casts
Definition hexrays.hpp:6576
@ CMAT_BUILT
just generated
Definition hexrays.hpp:6570
@ CMAT_NICE
nicefied expressions
Definition hexrays.hpp:6572
@ CMAT_TRANS2
applied second wave of transformations
Definition hexrays.hpp:6573
@ CMAT_TRANS3
applied third wave of transformations
Definition hexrays.hpp:6575
@ CMAT_TRANS1
applied first wave of transformations
Definition hexrays.hpp:6571
@ CMAT_ZERO
does not exist
Definition hexrays.hpp:6569
const mreg_t mr_first
Definition hexrays.hpp:824
DECLARE_TYPE_AS_MOVABLE(valrng_t)
bool is_loop(ctype_t op)
Is loop statement code?
Definition hexrays.hpp:6484
type_sign_t hexapi get_op_signness(ctype_t op)
Get operator sign. Meaningful for sign-dependent operators, like cot_sdiv.
Definition hexrays.hpp:13014
qvector< uint64 > uint64vec_t
Definition hexrays.hpp:284
user_unions_t *hexapi restore_user_unions(ea_t func_ea)
Restore user defined union field selections from the database.
Definition hexrays.hpp:13554
const maymust_t FULL_XDSU
Definition hexrays.hpp:485
qvector< block_chains_t > block_chains_vec_t
Graph chains.
Definition hexrays.hpp:3665
int hexapi mreg2reg(mreg_t reg, size_t width)
Map a microregister to a processor register.
Definition hexrays.hpp:11746
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:10900
uvlr_t min_vlr_svalue(int size)
Definition hexrays.hpp:321
cfuncptr_t hexapi create_cfunc(mba_t *mba)
Create a new cfunc_t object.
Definition hexrays.hpp:13828
bool is_eh_role(funcrole_t r)
Is this an EH exception handling role?
Definition hexrays.hpp:3336
ctype_t hexapi negated_relation(ctype_t op)
Negate a comparison operator. For example, cot_sge becomes cot_slt.
Definition hexrays.hpp:13002
user_casts_iterator_t user_casts_find(const user_casts_t *map, const citem_locator_t &key)
Find the specified key in user_casts_t.
Definition hexrays.hpp:10353
THREAD_SAFE bool is_mcode_xdsu(mcode_t mcode)
Definition hexrays.hpp:709
THREAD_SAFE bool is_mcode_fpu(mcode_t mcode)
Definition hexrays.hpp:725
DEPRECATED cfuncptr_t decompile_func(func_t *pfn, hexrays_failure_t *hf=nullptr, int decomp_flags=0)
Decompile a function.
Definition hexrays.hpp:8168
qvector< mreg_t > mregvec_t
Definition hexrays.hpp:285
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:9835
THREAD_SAFE mcode_t set2jcnd(mcode_t code)
Definition hexrays.hpp:759
const mopt_t mop_p
operand pair
Definition hexrays.hpp:2420
size_t user_iflags_size(user_iflags_t *map)
Get size of user_iflags_t.
Definition hexrays.hpp:10310
mreg_t hexapi reg2mreg(int reg)
Map a processor register to a microregister.
Definition hexrays.hpp:11740
@ MAX_VLR_SIZE
Definition hexrays.hpp:309
THREAD_SAFE bool is_mcode_addsub(mcode_t mcode)
Definition hexrays.hpp:707
qmap< citem_locator_t, int32 > user_iflags_t
Definition hexrays.hpp:6675
void user_casts_free(user_casts_t *map)
Delete user_casts_t instance.
Definition hexrays.hpp:10426
qvector< catchexpr_t > catchexprs_t
Definition hexrays.hpp:7307
cexpr_t * e
Definition hexrays.hpp:7705
ctype_t hexapi swapped_relation(ctype_t op)
Swap a comparison operator. For example, cot_sge becomes cot_sle.
Definition hexrays.hpp:13008
int cmt_type_t
Comment types.
Definition hexrays.hpp:8716
qvector< mcallarg_t > mcallargs_t
Definition hexrays.hpp:3235
use_curly_t
Should curly braces be printed?
Definition hexrays.hpp:7037
@ USE_CURLY_BRACES
print curly braces without any checks
Definition hexrays.hpp:7040
@ CALC_CURLY_BRACES
print curly braces if necessary
Definition hexrays.hpp:7038
@ NO_CURLY_BRACES
don't print curly braces
Definition hexrays.hpp:7039
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:10026
void user_numforms_clear(user_numforms_t *map)
Clear user_numforms_t.
Definition hexrays.hpp:9867
ctype_t
Ctree item code.
Definition hexrays.hpp:6316
@ cot_asgxor
x ^= y
Definition hexrays.hpp:6321
@ cot_call
x(...)
Definition hexrays.hpp:6374
@ cot_ule
x <= y unsigned
Definition hexrays.hpp:6344
@ cot_asgsdiv
x /= y signed
Definition hexrays.hpp:6329
@ cit_break
break-statement
Definition hexrays.hpp:6396
@ cot_cast
(type)x
Definition hexrays.hpp:6365
@ cot_sgt
x > y signed or fpu (see EXFL_FPOP)
Definition hexrays.hpp:6345
@ cit_throw
C++ throw-statement.
Definition hexrays.hpp:6402
@ cot_sdiv
x / y signed
Definition hexrays.hpp:6355
@ cit_do
do-statement
Definition hexrays.hpp:6394
@ cot_insn
instruction in expression, internal representation only
Definition hexrays.hpp:6383
@ cot_lor
x || y
Definition hexrays.hpp:6334
@ cot_tern
x ? y : z
Definition hexrays.hpp:6333
@ cot_asgbor
x |= y
Definition hexrays.hpp:6320
@ cit_block
block-statement: { ... }
Definition hexrays.hpp:6389
@ cit_continue
continue-statement
Definition hexrays.hpp:6397
@ cot_lnot
!x
Definition hexrays.hpp:6366
@ cot_last
Definition hexrays.hpp:6387
@ cot_asgshl
x <<= y
Definition hexrays.hpp:6328
@ cot_ptr
*x, access size in 'ptrsize'
Definition hexrays.hpp:6368
@ cot_preinc
++x
Definition hexrays.hpp:6372
@ cot_shl
x << y
Definition hexrays.hpp:6351
@ cot_obj
obj_ea
Definition hexrays.hpp:6381
@ cot_neg
-x
Definition hexrays.hpp:6364
@ cot_xor
x ^ y
Definition hexrays.hpp:6337
@ cot_add
x + y
Definition hexrays.hpp:6352
@ cot_sshr
x >> y signed
Definition hexrays.hpp:6349
@ cit_try
C++ try-statement.
Definition hexrays.hpp:6401
@ cot_asg
x = y
Definition hexrays.hpp:6319
@ cot_type
arbitrary type
Definition hexrays.hpp:6386
@ cot_sub
x - y
Definition hexrays.hpp:6353
@ cot_slt
x < y signed or fpu (see EXFL_FPOP)
Definition hexrays.hpp:6347
@ cot_mul
x * y
Definition hexrays.hpp:6354
@ cot_udiv
x / y unsigned
Definition hexrays.hpp:6356
@ cot_asgsshr
x >>= y signed
Definition hexrays.hpp:6326
@ cot_eq
x == y int or fpu (see EXFL_FPOP)
Definition hexrays.hpp:6339
@ cit_return
return-statement
Definition hexrays.hpp:6398
@ cot_asgadd
x += y
Definition hexrays.hpp:6323
@ cot_ref
&x
Definition hexrays.hpp:6369
@ cot_ne
x != y int or fpu (see EXFL_FPOP)
Definition hexrays.hpp:6340
@ cit_empty
instruction types start here
Definition hexrays.hpp:6388
@ cit_asm
asm-statement
Definition hexrays.hpp:6400
@ cot_predec
–x
Definition hexrays.hpp:6373
@ cot_asgmul
x *= y
Definition hexrays.hpp:6325
@ cot_helper
arbitrary name
Definition hexrays.hpp:6385
@ cot_fneg
-x fp
Definition hexrays.hpp:6363
@ cot_ult
x < y unsigned
Definition hexrays.hpp:6348
@ cot_uge
x >= y unsigned
Definition hexrays.hpp:6342
@ cot_fadd
x + y fp
Definition hexrays.hpp:6359
@ cot_asgushr
x >>= y unsigned
Definition hexrays.hpp:6327
@ cot_fnum
fpc
Definition hexrays.hpp:6379
@ cot_postdec
x–
Definition hexrays.hpp:6371
@ cot_memref
x.m
Definition hexrays.hpp:6376
@ cot_postinc
x++
Definition hexrays.hpp:6370
@ cot_sizeof
sizeof(x)
Definition hexrays.hpp:6384
@ cot_sle
x <= y signed or fpu (see EXFL_FPOP)
Definition hexrays.hpp:6343
@ cot_ushr
x >> y unsigned
Definition hexrays.hpp:6350
@ cot_fdiv
x / y fp
Definition hexrays.hpp:6362
@ cit_while
while-statement
Definition hexrays.hpp:6393
@ cot_fsub
x - y fp
Definition hexrays.hpp:6360
@ cot_str
string constant (user representation)
Definition hexrays.hpp:6380
@ cot_var
v
Definition hexrays.hpp:6382
@ cot_sge
x >= y signed or fpu (see EXFL_FPOP)
Definition hexrays.hpp:6341
@ cit_goto
goto-statement
Definition hexrays.hpp:6399
@ cit_switch
switch-statement
Definition hexrays.hpp:6395
@ cot_asgband
x &= y
Definition hexrays.hpp:6322
@ cot_empty
Definition hexrays.hpp:6317
@ cot_asgsmod
x %= y signed
Definition hexrays.hpp:6331
@ cot_num
n
Definition hexrays.hpp:6378
@ cot_band
x & y
Definition hexrays.hpp:6338
@ cot_bnot
~x
Definition hexrays.hpp:6367
@ cot_comma
x, y
Definition hexrays.hpp:6318
@ cot_asgsub
x -= y
Definition hexrays.hpp:6324
@ cit_if
if-statement
Definition hexrays.hpp:6391
@ cot_smod
x % y signed
Definition hexrays.hpp:6357
@ cot_bor
x | y
Definition hexrays.hpp:6336
@ cot_umod
x % y unsigned
Definition hexrays.hpp:6358
@ cot_memptr
x->m, access size in 'ptrsize'
Definition hexrays.hpp:6377
@ cit_end
Definition hexrays.hpp:6403
@ cot_asgumod
x %= y unsigned
Definition hexrays.hpp:6332
@ cot_ugt
x > y unsigned
Definition hexrays.hpp:6346
@ cot_asgudiv
x /= y unsigned
Definition hexrays.hpp:6330
@ cot_idx
x[y]
Definition hexrays.hpp:6375
@ cot_fmul
x * y fp
Definition hexrays.hpp:6361
@ cit_expr
expression-statement: expr;
Definition hexrays.hpp:6390
@ cot_land
x && y
Definition hexrays.hpp:6335
@ cit_for
for-statement
Definition hexrays.hpp:6392
const tinfo_t & type
Definition hexrays.hpp:7698
lvar_mapping_iterator_t lvar_mapping_next(lvar_mapping_iterator_t p)
Move to the next element.
Definition hexrays.hpp:9953
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:11365
DEPRECATED 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:13804
qmap< lvar_locator_t, lvar_locator_t > lvar_mapping_t
Local variable mapping (is used to merge variables)
Definition hexrays.hpp:1575
funcrole_t
Function roles.
Definition hexrays.hpp:3241
@ ROLE_3WAYCMP1
3-way compare helper, returns 0/1/2
Definition hexrays.hpp:3275
@ ROLE_EH_EXIT_WIND_STATE
__eh_exit_wind_state() internal
Definition hexrays.hpp:3299
@ ROLE_EH_CATCH
__eh_catch() catch block start
Definition hexrays.hpp:3286
@ ROLE_VA_COPY
va_copy() function
Definition hexrays.hpp:3266
@ ROLE_INVOKE_SUPER
parent class method call (super.method)
Definition hexrays.hpp:3325
@ ROLE_UNK
unknown function role
Definition hexrays.hpp:3242
@ ROLE_VA_ARG
va_arg() macro
Definition hexrays.hpp:3265
@ ROLE_EH_UNWIND
__eh_unwind() destructor handler
Definition hexrays.hpp:3289
@ ROLE_CHKCAST
check and cast object type
Definition hexrays.hpp:3313
@ ROLE_INVOKE_INIT_SUPER
constructor chain to parent (super(args))
Definition hexrays.hpp:3327
@ ROLE_EH_CONTINUE_UNWINDING
__eh_continue_unwinding()
Definition hexrays.hpp:3296
@ ROLE_EH_TRY
__eh_try() try block start
Definition hexrays.hpp:3284
@ ROLE_BITTEST
[lock] bt
Definition hexrays.hpp:3261
@ ROLE_BUG
BUG() helper macro: never returns, causes exception.
Definition hexrays.hpp:3252
@ ROLE_IPUT
set instance field
Definition hexrays.hpp:3318
@ ROLE_SSE_CMP4
e.g. _mm_cmpgt_ss
Definition hexrays.hpp:3281
@ ROLE_EMPTY
empty, does not do anything (maybe spoils regs)
Definition hexrays.hpp:3243
@ ROLE_EH_EXIT_TRY_STATE
__eh_exit_try_state() internal
Definition hexrays.hpp:3300
@ ROLE_MEMSET64
memset64(void *dst, uint64 value, size_t count);
Definition hexrays.hpp:3246
@ ROLE_ALLOCA
alloca() function
Definition hexrays.hpp:3253
@ ROLE_WMEMCPY
wchar_t *wmemcpy(wchar_t *dst, const wchar_t *src, size_t n)
Definition hexrays.hpp:3276
@ ROLE_FASTFAIL
__fastfail()
Definition hexrays.hpp:3257
@ ROLE_EH_DEAD_END_TRY
__eh_dead_end_try() internal
Definition hexrays.hpp:3293
@ ROLE_SATURATED_MUL
saturated_mul
Definition hexrays.hpp:3260
@ ROLE_APUT
set array element
Definition hexrays.hpp:3322
@ ROLE_INVOKE_INIT_THIS
constructor chain to self (this(args))
Definition hexrays.hpp:3328
@ ROLE_EH_CATCH_ELLIPSIS
__eh_catch_ellipsis() catch-all
Definition hexrays.hpp:3288
@ ROLE_BITTESTANDSET
[lock] bts
Definition hexrays.hpp:3262
@ ROLE_WCSCPY
wchar_t *wcscpy(wchar_t *dst, const wchar_t *src);
Definition hexrays.hpp:3278
@ ROLE_SSE_CMP8
e.g. _mm_cmpgt_sd
Definition hexrays.hpp:3282
@ ROLE_EH_UNWIND_ABSENT
__eh_unwind_handler_absent() internal
Definition hexrays.hpp:3306
@ ROLE_STRCAT
strcat(char *dst, const char *src);
Definition hexrays.hpp:3250
@ ROLE_EH_THROW
__eh_throw() throw statement
Definition hexrays.hpp:3290
@ ROLE_CATCH_EXCEPTION
get caught exception object (Dalvik MOVE_EXCEPTION)
Definition hexrays.hpp:3329
@ ROLE_TAIL
char *tail(const char *str);
Definition hexrays.hpp:3251
@ ROLE_CFSUB3
carry flag after subtract with carry
Definition hexrays.hpp:3271
@ ROLE_READFLAGS
__readeflags, __readcallersflags
Definition hexrays.hpp:3258
@ ROLE_EH_CATCH_ABSENT
__eh_catch_handler_absent() internal
Definition hexrays.hpp:3307
@ ROLE_CONST_CLASS
get class reference (Dalvik CONST_CLASS)
Definition hexrays.hpp:3330
@ ROLE_EH_WIND
__eh_wind() wind state (C++ destructors)
Definition hexrays.hpp:3285
@ ROLE_IGET
get instance field
Definition hexrays.hpp:3317
@ ROLE_EH_RETHROW
__eh_rethrow_uncaught_exception() internal
Definition hexrays.hpp:3305
@ ROLE_SPUT
set static field
Definition hexrays.hpp:3320
@ ROLE_MEMCPY
memcpy(void *dst, const void *src, size_t count);
Definition hexrays.hpp:3247
@ ROLE_NEW_ARRAY
allocate new array
Definition hexrays.hpp:3310
@ ROLE_OFSUB3
overflow flag after subtract with carry
Definition hexrays.hpp:3272
@ ROLE_ARRLEN
get array length
Definition hexrays.hpp:3312
@ ROLE_EH_ENTER_TRY_STATE
__eh_enter_try_state() internal
Definition hexrays.hpp:3298
@ ROLE_EH_CATCH_TYPE
__eh_catch_type() typed catch clause
Definition hexrays.hpp:3287
@ ROLE_PRESENT
present() function (used in patterns)
Definition hexrays.hpp:3255
@ ROLE_EH_ENTER_WIND_STATE
__eh_enter_wind_state() internal
Definition hexrays.hpp:3297
@ ROLE_INVOKE_INIT
constructor call on new object (merged with new)
Definition hexrays.hpp:3326
@ ROLE_BITTESTANDCOMPLEMENT
[lock] btc
Definition hexrays.hpp:3264
@ ROLE_EH_CAUGHT_ELLIPSIS
__eh_caught_ellipsis() paired with catch_ellipsis
Definition hexrays.hpp:3303
@ ROLE_EH_SCOPE_STRUT
__eh_scope_strut() internal
Definition hexrays.hpp:3292
@ ROLE_ABS
integer absolute value
Definition hexrays.hpp:3273
@ ROLE_EH_CAUGHT_TYPE
__eh_caught_type() paired with catch_type
Definition hexrays.hpp:3302
@ ROLE_VA_START
va_start() function
Definition hexrays.hpp:3267
@ ROLE_EH_CAUGHT
__eh_caught() internal
Definition hexrays.hpp:3304
@ ROLE_EH_NO_UNWIND_HANDLER
__eh_no_unwind_handler() internal
Definition hexrays.hpp:3301
@ ROLE_STRLEN
strlen(const char *src);
Definition hexrays.hpp:3249
@ ROLE_EH_PROPAGATE
__eh_propagate_exception_into_caller()
Definition hexrays.hpp:3295
@ ROLE_STRCPY
strcpy(char *dst, const char *src);
Definition hexrays.hpp:3248
@ ROLE_NEW_OBJ
allocate new object instance
Definition hexrays.hpp:3309
@ ROLE_INSTANCEOF
test object type (returns 0/1)
Definition hexrays.hpp:3314
@ ROLE_UNLOCK
release lock (monitor exit)
Definition hexrays.hpp:3316
@ ROLE_WCSLEN
size_t wcslen(const wchar_t *s)
Definition hexrays.hpp:3279
@ ROLE_ROR
rotate right
Definition hexrays.hpp:3270
@ ROLE_FILL_ARRAY
allocate and fill new array
Definition hexrays.hpp:3311
@ ROLE_INVOKE_VIRTUAL
instance method call (obj.method)
Definition hexrays.hpp:3324
@ ROLE_MEMSET
memset(void *dst, uchar value, size_t count);
Definition hexrays.hpp:3244
@ ROLE_IS_MUL_OK
is_mul_ok
Definition hexrays.hpp:3259
@ ROLE_VA_END
va_end() function
Definition hexrays.hpp:3268
@ ROLE_WMEMSET
wchar_t *wmemset(wchar_t *dst, wchar_t wc, size_t n)
Definition hexrays.hpp:3277
@ ROLE_EH_DEAD_END_WIND
__eh_dead_end_wind() internal
Definition hexrays.hpp:3294
@ ROLE_FILL_ARRAY_DATA
fill existing array with constant data (Dalvik FILL_ARRAY_DATA, no allocation)
Definition hexrays.hpp:3331
@ ROLE_CONTAINING_RECORD
CONTAINING_RECORD() macro.
Definition hexrays.hpp:3256
@ ROLE_BITTESTANDRESET
[lock] btr
Definition hexrays.hpp:3263
@ ROLE_MEMSET32
memset32(void *dst, uint32 value, size_t count);
Definition hexrays.hpp:3245
@ ROLE_BSWAP
bswap() function (any size)
Definition hexrays.hpp:3254
@ ROLE_EH_TRY_CONTINUATION
__eh_try_continuation() internal
Definition hexrays.hpp:3291
@ ROLE_SGET
get static field
Definition hexrays.hpp:3319
@ ROLE_LOCK
acquire lock (monitor enter)
Definition hexrays.hpp:3315
@ ROLE_ROL
rotate left
Definition hexrays.hpp:3269
@ ROLE_FMOD
floating-point remainder (fmod)
Definition hexrays.hpp:3323
@ ROLE_WCSCAT
wchar_t *wcscat(wchar_t *dst, const wchar_t *src)
Definition hexrays.hpp:3280
@ ROLE_AGET
get array element
Definition hexrays.hpp:3321
@ ROLE_3WAYCMP0
3-way compare helper, returns -1/0/1
Definition hexrays.hpp:3274
bool hexapi remove_optblock_handler(optblock_t *opt)
Remove a block level custom optimizer.
Definition hexrays.hpp:11777
user_labels_t * user_labels_new()
Create a new user_labels_t instance.
Definition hexrays.hpp:10651
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:10598
bool hexapi close_pseudocode(TWidget *f)
Close pseudocode window.
Definition hexrays.hpp:12960
void hexapi close_hexrays_waitbox()
Close the waitbox displayed by the decompiler.
Definition hexrays.hpp:13798
user_casts_iterator_t user_casts_insert(user_casts_t *map, const citem_locator_t &key, const tinfo_t &val)
Insert new (citem_locator_t, tinfo_t) pair into user_casts_t.
Definition hexrays.hpp:10362
bool hexapi install_hexrays_callback(hexrays_cb_t *callback, void *ud)
Install handler for decompiler events.
Definition hexrays.hpp:13872
user_iflags_t * user_iflags_new()
Create a new user_iflags_t instance.
Definition hexrays.hpp:10324
void boundaries_clear(boundaries_t *map)
Clear boundaries_t.
Definition hexrays.hpp:10848
bool hexapi del_user_minsn(ea_t entry_ea, const minsn_locator_t &loc, user_minsn_action_t action, mba_maturity_t mmat)
Delete a user-defined microinstruction action.
Definition hexrays.hpp:12560
const mopt_t mop_n
immediate number constant
Definition hexrays.hpp:2408
const maymust_t INCLUDE_UNUSED_SRC
Definition hexrays.hpp:492
user_numforms_t * user_numforms_new()
Create a new user_numforms_t instance.
Definition hexrays.hpp:9888
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:10462
hexcall_t
API call numbers.
Definition hexrays.hpp:9096
@ hx_user_numforms_end
Definition hexrays.hpp:9098
@ hx_save_user_numforms
Definition hexrays.hpp:9623
@ hx_cexpr_t_requires_lvalue
Definition hexrays.hpp:9573
@ hx_user_labels_first
Definition hexrays.hpp:9179
@ hx_user_unions_free
Definition hexrays.hpp:9173
@ hx_mblock_t_vdump_block
Definition hexrays.hpp:9460
@ hx_simple_graph_t_compute_immediate_dominators
Definition hexrays.hpp:9357
@ hx_vdui_t_map_lvar
Definition hexrays.hpp:9692
@ hx_mba_t_alloc_kreg
Definition hexrays.hpp:9519
@ hx_valrng_t_assign
Definition hexrays.hpp:9230
@ hx_cfunc_t_redirect_gotos
Definition hexrays.hpp:9744
@ hx_get_cached_cfunc_eas
Definition hexrays.hpp:9760
@ hx_mop_t_create_from_insn
Definition hexrays.hpp:9380
@ hx_decompile_
Definition hexrays.hpp:9753
@ hx_block_chains_prev
Definition hexrays.hpp:9217
@ hx_cnumber_t_assign
Definition hexrays.hpp:9549
@ hx_lvar_t_dstr
Definition hexrays.hpp:9277
@ hx_cfunc_t_set_user_union_selection
Definition hexrays.hpp:9647
@ hx_lvar_ref_t_var
Definition hexrays.hpp:9365
@ hx_vdui_t_set_lvar_type
Definition hexrays.hpp:9686
@ hx_vdui_t_clear
Definition hexrays.hpp:9679
@ hx_getf_reginsn
Definition hexrays.hpp:9455
@ hx_cthrow_t_compare
Definition hexrays.hpp:9584
@ hx_mba_t_alloc_fict_ea
Definition hexrays.hpp:9514
@ hx_valrng_t_set_eq
Definition hexrays.hpp:9232
@ hx_has_cached_cfunc
Definition hexrays.hpp:9668
@ hx_restore_user_labels
Definition hexrays.hpp:9626
@ hx_udcall_map_begin
Definition hexrays.hpp:9123
@ hx_mark_cfunc_dirty
Definition hexrays.hpp:9666
@ hx_int64_emulator_t__mop_value
Definition hexrays.hpp:9719
@ hx_user_labels_second
Definition hexrays.hpp:9180
@ hx_user_casts_first
Definition hexrays.hpp:9731
@ hx_ivlset_t_count
Definition hexrays.hpp:9335
@ hx_user_labels_begin
Definition hexrays.hpp:9175
@ hx_lvar_mapping_end
Definition hexrays.hpp:9111
@ hx_lvar_locator_t_compare
Definition hexrays.hpp:9275
@ hx_eamap_find
Definition hexrays.hpp:9194
@ hx_user_numforms_begin
Definition hexrays.hpp:9097
@ hx_bitset_t_is_subset_of
Definition hexrays.hpp:9322
@ hx_mba_t_map_fict_ea
Definition hexrays.hpp:9515
@ hx_mop_t_make_second_half
Definition hexrays.hpp:9401
@ hx_cfunc_t_save_user_iflags
Definition hexrays.hpp:9651
@ hx_valrng_t_copy
Definition hexrays.hpp:9229
@ hx_get_merror_desc
Definition hexrays.hpp:9243
@ hx_cexpr_t_get_high_nbit_bound
Definition hexrays.hpp:9571
@ hx_mblock_t_optimize_insn
Definition hexrays.hpp:9466
@ hx_cinsn_t_new_insn
Definition hexrays.hpp:9591
@ hx_cfunc_t_del_orphan_cmts
Definition hexrays.hpp:9645
@ hx_remove_optblock_handler
Definition hexrays.hpp:9355
@ hx_cfunc_t_build_c_tree
Definition hexrays.hpp:9631
@ hx_valrng_t_compare
Definition hexrays.hpp:9231
@ hx_mba_t_stkoff_ida2vd
Definition hexrays.hpp:9483
@ hx_send_database
Definition hexrays.hpp:9538
@ hx_bitset_t_add_
Definition hexrays.hpp:9303
@ hx_user_casts_insert
Definition hexrays.hpp:9734
@ hx_boundaries_free
Definition hexrays.hpp:9212
@ hx_mop_t_is_zero_extended_from
Definition hexrays.hpp:9391
@ hx_locate_lvar
Definition hexrays.hpp:9291
@ hx_mbl_graph_t_get_du
Definition hexrays.hpp:9526
@ hx_ctree_item_t_get_lvar
Definition hexrays.hpp:9609
@ hx_create_typedef
Definition hexrays.hpp:9267
@ hx_boundaries_clear
Definition hexrays.hpp:9210
@ hx_cexpr_t_replace_by
Definition hexrays.hpp:9563
@ hx_mop_t_lexcompare
Definition hexrays.hpp:9393
@ hx_cfor_t_compare
Definition hexrays.hpp:9580
@ hx_user_casts_second
Definition hexrays.hpp:9732
@ hx_mcases_t_compare
Definition hexrays.hpp:9414
@ hx_eamap_next
Definition hexrays.hpp:9190
@ hx_minsn_t_swap
Definition hexrays.hpp:9433
@ hx_mop_t_create_from_ivlset
Definition hexrays.hpp:9377
@ hx_cexpr_t_contains_operator
Definition hexrays.hpp:9570
@ hx_save_user_lvar_settings
Definition hexrays.hpp:9288
@ hx_is_small_udt
Definition hexrays.hpp:9257
@ hx_cfunc_t_get_user_iflags
Definition hexrays.hpp:9642
@ hx_eamap_second
Definition hexrays.hpp:9193
@ hx_dummy_ptrtype
Definition hexrays.hpp:9264
@ hx_boundaries_begin
Definition hexrays.hpp:9201
@ hx_mba_t_insert_block
Definition hexrays.hpp:9502
@ hx_vdui_t_set_global_type
Definition hexrays.hpp:9695
@ hx_user_iflags_find
Definition hexrays.hpp:9155
@ hx_user_labels_new
Definition hexrays.hpp:9187
@ hx_minsn_t_find_call
Definition hexrays.hpp:9445
@ hx_cfunc_t_remove_unused_labels
Definition hexrays.hpp:9639
@ hx_user_cmts_erase
Definition hexrays.hpp:9144
@ hx_vdloc_t_dstr
Definition hexrays.hpp:9270
@ hx_get_signed_mcode
Definition hexrays.hpp:9248
@ hx_user_cmts_end
Definition hexrays.hpp:9137
@ hx_cinsn_t_contains_insn
Definition hexrays.hpp:9596
@ hx_decompile
Definition hexrays.hpp:9663
@ hx_mba_t_remove_empty_and_unreachable_blocks
Definition hexrays.hpp:9505
@ hx_mop_t_for_all_scattered_submops
Definition hexrays.hpp:9395
@ hx_mop_t_erase
Definition hexrays.hpp:9373
@ hx_ivlset_t_contains
Definition hexrays.hpp:9337
@ hx_lvar_t_append_list_
Definition hexrays.hpp:9283
@ hx_lvar_t_set_lvar_type
Definition hexrays.hpp:9280
@ hx_vdui_t_jump_enter
Definition hexrays.hpp:9698
@ hx_mop_t_make_number
Definition hexrays.hpp:9381
@ hx_mba_t_deserialize
Definition hexrays.hpp:9517
@ hx_mblock_t_append_def_list
Definition hexrays.hpp:9471
@ hx_catchexpr_t_compare
Definition hexrays.hpp:9713
@ hx_user_iflags_first
Definition hexrays.hpp:9153
@ hx_asgop_revert
Definition hexrays.hpp:9546
@ hx_cfunc_t_find_item_coords
Definition hexrays.hpp:9660
@ hx_mop_t_make_first_half
Definition hexrays.hpp:9400
@ hx_user_iflags_size
Definition hexrays.hpp:9159
@ hx_cfunc_t_save_user_unions
Definition hexrays.hpp:9652
@ hx_new_block
Definition hexrays.hpp:9615
@ hx_udcall_map_erase
Definition hexrays.hpp:9131
@ hx_vdui_t_rename_label
Definition hexrays.hpp:9697
@ hx_ctree_item_t_dstr
Definition hexrays.hpp:9613
@ hx_boundaries_prev
Definition hexrays.hpp:9204
@ hx_lvar_mapping_free
Definition hexrays.hpp:9121
@ hx_bitset_t_has_any
Definition hexrays.hpp:9312
@ hx_obsolete_int64_emulator_t_mop_value
Definition hexrays.hpp:9717
@ hx_decompile_many
Definition hexrays.hpp:9536
@ hx_user_cmts_next
Definition hexrays.hpp:9138
@ hx_ctree_item_t_get_ea
Definition hexrays.hpp:9610
@ hx_mop_t_apply_ld_mcode
Definition hexrays.hpp:9405
@ hx_lvar_mapping_clear
Definition hexrays.hpp:9119
@ hx_gco_info_t_append_to_list
Definition hexrays.hpp:9539
@ hx_parse_user_call
Definition hexrays.hpp:9294
@ hx_minsn_t_may_use_aliased_memory
Definition hexrays.hpp:9452
@ hx_chain_t_dstr
Definition hexrays.hpp:9422
@ hx_mba_t_build_graph
Definition hexrays.hpp:9492
@ hx_lvar_mapping_second
Definition hexrays.hpp:9115
@ hx_vdui_t_set_num_enum
Definition hexrays.hpp:9705
@ hx_cfunc_t_set_user_cast
Definition hexrays.hpp:9741
@ hx_cinsn_t_print
Definition hexrays.hpp:9593
@ hx_restore_user_numforms
Definition hexrays.hpp:9628
@ hx_lvar_locator_t_dstr
Definition hexrays.hpp:9276
@ hx_mop_t_create_from_vdloc
Definition hexrays.hpp:9378
@ hx_user_cmts_find
Definition hexrays.hpp:9142
@ hx_del_user_minsn
Definition hexrays.hpp:9748
@ hx_mblock_t_find_redefinition
Definition hexrays.hpp:9475
@ hx_mblock_t_optimize_block
Definition hexrays.hpp:9467
@ hx_user_cmts_first
Definition hexrays.hpp:9140
@ hx_user_numforms_free
Definition hexrays.hpp:9108
@ hx_mbl_graph_t_get_ud
Definition hexrays.hpp:9525
@ hx_mop_t_swap
Definition hexrays.hpp:9372
@ hx_udcall_map_clear
Definition hexrays.hpp:9132
@ hx_vdui_t_ui_set_call_type
Definition hexrays.hpp:9684
@ hx_user_labels_size
Definition hexrays.hpp:9185
@ hx_get_hexrays_version
Definition hexrays.hpp:9532
@ hx_vdui_t_rename_lvar
Definition hexrays.hpp:9683
@ hx_mba_t_stkoff_vd2ida
Definition hexrays.hpp:9482
@ hx_lvar_t_append_list
Definition hexrays.hpp:9282
@ hx_minsn_t_is_helper
Definition hexrays.hpp:9444
@ hx_cfunc_t_get_warnings
Definition hexrays.hpp:9654
@ hx_mreg2reg
Definition hexrays.hpp:9350
@ hx_save_user_iflags
Definition hexrays.hpp:9624
@ hx_user_unions_size
Definition hexrays.hpp:9172
@ hx_cfunc_t_get_user_cast
Definition hexrays.hpp:9742
@ hx_lvar_mapping_new
Definition hexrays.hpp:9122
@ hx_get_current_operand
Definition hexrays.hpp:9540
@ hx_mba_t_for_all_ops
Definition hexrays.hpp:9507
@ hx_bitset_t_count
Definition hexrays.hpp:9315
@ hx_eamap_end
Definition hexrays.hpp:9189
@ hx_bitset_t_has_common
Definition hexrays.hpp:9320
@ hx_user_cmts_free
Definition hexrays.hpp:9147
@ hx_cfunc_t_save_user_numforms
Definition hexrays.hpp:9650
@ hx_vdui_t_set_lvar_cmt
Definition hexrays.hpp:9689
@ hx_user_numforms_second
Definition hexrays.hpp:9102
@ hx_vdui_t_collapse_lvars
Definition hexrays.hpp:9710
@ hx_user_casts_erase
Definition hexrays.hpp:9735
@ hx_user_iflags_next
Definition hexrays.hpp:9151
@ hx_mblock_t_insert_into_block
Definition hexrays.hpp:9461
@ hx_vdui_t_set_locked
Definition hexrays.hpp:9673
@ hx_mba_t_inline_function
Definition hexrays.hpp:9752
@ hx_boundaries_erase
Definition hexrays.hpp:9209
@ hx_hexrays_free
Definition hexrays.hpp:9227
@ hx_ctree_parentee_t_recalc_parent_types
Definition hexrays.hpp:9554
@ hx_user_labels_find
Definition hexrays.hpp:9181
@ hx_mblock_t_build_use_list
Definition hexrays.hpp:9472
@ hx_user_cmts_clear
Definition hexrays.hpp:9145
@ hx_mblock_t_optimize_useless_jump
Definition hexrays.hpp:9469
@ hx_vdui_t_ui_set_lvar_type
Definition hexrays.hpp:9685
@ hx_bitset_t_goup
Definition hexrays.hpp:9324
@ hx_mop_t_is01
Definition hexrays.hpp:9389
@ hx_minsn_t_copy
Definition hexrays.hpp:9431
@ hx_cif_t_compare
Definition hexrays.hpp:9578
@ hx_mblock_t_get_valranges
Definition hexrays.hpp:9478
@ hx_cexpr_t_maybe_ptr
Definition hexrays.hpp:9575
@ hx_vdui_t_ctree_to_disasm
Definition hexrays.hpp:9699
@ hx_valrng_t_cvt_to_single_value
Definition hexrays.hpp:9241
@ hx_set_type
Definition hexrays.hpp:9269
@ hx_mba_t_locate_stkpnt
Definition hexrays.hpp:9522
@ hx_save_user_cmts
Definition hexrays.hpp:9622
@ hx_cfunc_t_get_boundaries
Definition hexrays.hpp:9656
@ hx_vdui_t_split_item
Definition hexrays.hpp:9711
@ hx_mop_t_preserve_side_effects
Definition hexrays.hpp:9404
@ hx_cfunc_t_recalc_item_addresses
Definition hexrays.hpp:9716
@ hx_create_field_name
Definition hexrays.hpp:9670
@ hx_cinsn_t_create_if
Definition hexrays.hpp:9592
@ hx_cexpr_t_assign
Definition hexrays.hpp:9561
@ hx_vdui_t_collapse_item
Definition hexrays.hpp:9709
@ hx_mblock_t_is_rhs_redefined
Definition hexrays.hpp:9476
@ hx_user_casts_free
Definition hexrays.hpp:9738
@ hx_mcallinfo_t_lexcompare
Definition hexrays.hpp:9409
@ hx_mba_t_find_mop
Definition hexrays.hpp:9510
@ hx_get_type
Definition hexrays.hpp:9268
@ hx_vdui_t_switch_to
Definition hexrays.hpp:9676
@ hx_ivlset_t_includes
Definition hexrays.hpp:9338
@ hx_simple_graph_t_depth_first_preorder
Definition hexrays.hpp:9358
@ hx_cexpr_t_calc_type
Definition hexrays.hpp:9567
@ hx_eamap_insert
Definition hexrays.hpp:9195
@ hx_cnumber_t_value
Definition hexrays.hpp:9548
@ hx_get_mreg_name
Definition hexrays.hpp:9351
@ hx_mba_t_alloc_lvars
Definition hexrays.hpp:9496
@ hx_cnumber_t_compare
Definition hexrays.hpp:9550
@ hx_cinsn_t_collect_free_breaks
Definition hexrays.hpp:9597
@ hx_user_casts_size
Definition hexrays.hpp:9737
@ hx_valrng_t_dstr
Definition hexrays.hpp:9240
@ hx_lvars_t_find_lvar
Definition hexrays.hpp:9286
@ hx_install_optblock_handler
Definition hexrays.hpp:9354
@ hx_vdui_t_rename_global
Definition hexrays.hpp:9696
@ hx_restore_user_defined_calls
Definition hexrays.hpp:9292
@ hx_get_unsigned_mcode
Definition hexrays.hpp:9249
@ hx_vdui_t_refresh_cpos
Definition hexrays.hpp:9680
@ hx_swapped_relation
Definition hexrays.hpp:9543
@ hx_vdui_t_get_current_item
Definition hexrays.hpp:9681
@ hx_cfunc_t_get_user_union_selection
Definition hexrays.hpp:9646
@ hx_get_int_type_by_width_and_sign
Definition hexrays.hpp:9262
@ hx_mop_t_get_stkoff
Definition hexrays.hpp:9397
@ hx_user_labels_clear
Definition hexrays.hpp:9184
@ hx_user_iflags_erase
Definition hexrays.hpp:9157
@ hx_cinsn_t_assign
Definition hexrays.hpp:9587
@ hx_get_temp_regs
Definition hexrays.hpp:9347
@ hx_decomp_ranges_t_range_contains
Definition hexrays.hpp:9750
@ hx_block_chains_erase
Definition hexrays.hpp:9221
@ hx_ivlset_t_print
Definition hexrays.hpp:9333
@ hx_eamap_clear
Definition hexrays.hpp:9197
@ hx_mba_t_term
Definition hexrays.hpp:9488
@ hx_cexpr_t_print1
Definition hexrays.hpp:9566
@ hx_ivlset_t_sub_
Definition hexrays.hpp:9331
@ hx_lvar_mapping_insert
Definition hexrays.hpp:9117
@ hx_udc_filter_t_init
Definition hexrays.hpp:9298
@ hx_user_unions_end
Definition hexrays.hpp:9163
@ hx_install_microcode_filter
Definition hexrays.hpp:9296
@ hx_make_num
Definition hexrays.hpp:9618
@ hx_modify_user_lvar_info
Definition hexrays.hpp:9290
@ hx_mblock_t_dump
Definition hexrays.hpp:9459
@ hx_mblock_t_get_reginsn_qty
Definition hexrays.hpp:9480
@ hx_udcall_map_free
Definition hexrays.hpp:9134
@ hx_cdo_t_compare
Definition hexrays.hpp:9582
@ hx_udcall_map_insert
Definition hexrays.hpp:9130
@ hx_mblock_t_find_first_use
Definition hexrays.hpp:9474
@ hx_mba_t_idaloc2vd
Definition hexrays.hpp:9484
@ hx_mlist_t_compare
Definition hexrays.hpp:9346
@ hx_mcallinfo_t_set_type
Definition hexrays.hpp:9410
@ hx_mba_t_optimize_global
Definition hexrays.hpp:9495
@ hx_vdui_t_set_num_radix
Definition hexrays.hpp:9704
@ hx_mba_t_merge_blocks
Definition hexrays.hpp:9506
@ hx_mba_t_analyze_calls
Definition hexrays.hpp:9494
@ hx_bitset_t_fill_with_ones
Definition hexrays.hpp:9318
@ hx_cfunc_t_verify
Definition hexrays.hpp:9632
@ hx_minsn_t_set_combined
Definition hexrays.hpp:9432
@ hx_user_numforms_prev
Definition hexrays.hpp:9100
@ hx_mutable_graph_t_resize
Definition hexrays.hpp:9361
@ hx_int64_emulator_t__minsn_value
Definition hexrays.hpp:9720
@ hx_minsn_t_serialize
Definition hexrays.hpp:9453
@ hx_mblock_t_for_all_insns
Definition hexrays.hpp:9463
@ hx_user_casts_clear
Definition hexrays.hpp:9736
@ hx_install_optinsn_handler
Definition hexrays.hpp:9352
@ hx_mop_t_copy
Definition hexrays.hpp:9370
@ hx_ctree_item_t_get_udm
Definition hexrays.hpp:9607
@ hx_boundaries_size
Definition hexrays.hpp:9211
@ hx_select_udt_by_offset
Definition hexrays.hpp:9712
@ hx_ctree_item_t_print
Definition hexrays.hpp:9612
@ hx_hexrays_failure_t_desc
Definition hexrays.hpp:9537
@ hx_block_chains_get
Definition hexrays.hpp:9218
@ hx_user_labels_end
Definition hexrays.hpp:9176
@ hx_cfunc_t_gather_derefs
Definition hexrays.hpp:9659
@ hx_lvars_t_find
Definition hexrays.hpp:9285
@ hx_remove_hexrays_callback
Definition hexrays.hpp:9672
@ hx_mop_t_assign
Definition hexrays.hpp:9371
@ hx_user_cmts_insert
Definition hexrays.hpp:9143
@ hx_bitset_t_cut_at
Definition hexrays.hpp:9308
@ hx_cwhile_t_compare
Definition hexrays.hpp:9581
@ hx_cexpr_t_put_number
Definition hexrays.hpp:9565
@ hx_cexpr_t_compare
Definition hexrays.hpp:9562
@ hx_graph_chains_t_for_all_chains
Definition hexrays.hpp:9428
@ hx_user_iflags_free
Definition hexrays.hpp:9160
@ hx_user_iflags_prev
Definition hexrays.hpp:9152
@ hx_mba_t_create_helper_call
Definition hexrays.hpp:9511
@ hx_user_cmts_new
Definition hexrays.hpp:9148
@ hx_simple_graph_t_depth_first_postorder
Definition hexrays.hpp:9359
@ hx_vcall_helper
Definition hexrays.hpp:9617
@ hx_make_pointer
Definition hexrays.hpp:9266
@ hx_ivlset_t_sub
Definition hexrays.hpp:9330
@ hx_mutable_graph_t_del_edge
Definition hexrays.hpp:9363
@ hx_bitset_t_sub__
Definition hexrays.hpp:9307
@ hx_udc_filter_t_apply
Definition hexrays.hpp:9299
@ hx_bitset_t_intersect
Definition hexrays.hpp:9321
@ hx_block_chains_insert
Definition hexrays.hpp:9220
@ hx_negated_relation
Definition hexrays.hpp:9542
@ hx_user_unions_begin
Definition hexrays.hpp:9162
@ hx_cfunc_t_get_lvars
Definition hexrays.hpp:9636
@ hx_mba_t_add_user_minsn
Definition hexrays.hpp:9745
@ hx_user_iflags_second
Definition hexrays.hpp:9154
@ hx_eamap_begin
Definition hexrays.hpp:9188
@ hx_vdui_t_ui_edit_lvar_cmt
Definition hexrays.hpp:9688
@ hx_cinsn_t_replace_by
Definition hexrays.hpp:9589
@ hx_boundaries_find
Definition hexrays.hpp:9207
@ hx_bitset_t_count_
Definition hexrays.hpp:9316
@ hx_bitset_t_has
Definition hexrays.hpp:9310
@ hx_fnumber_t_print
Definition hexrays.hpp:9368
@ hx_user_casts_next
Definition hexrays.hpp:9729
@ hx_vdui_t_ui_add_cast
Definition hexrays.hpp:9743
@ hx_get_float_type
Definition hexrays.hpp:9261
@ hx_bitset_t_add
Definition hexrays.hpp:9302
@ hx_cfunc_t_cleanup
Definition hexrays.hpp:9661
@ hx_bitset_t_sub_
Definition hexrays.hpp:9306
@ hx_user_unions_new
Definition hexrays.hpp:9174
@ hx_user_iflags_end
Definition hexrays.hpp:9150
@ hx_minsn_t__make_nop
Definition hexrays.hpp:9440
@ hx_cdg_insn_iterator_t_next
Definition hexrays.hpp:9527
@ hx_user_unions_prev
Definition hexrays.hpp:9165
@ hx_mop_t_make_high_half
Definition hexrays.hpp:9399
@ hx_mba_t_dump
Definition hexrays.hpp:9497
@ hx_codegen_t_clear
Definition hexrays.hpp:9528
@ hx_simple_graph_t_goup
Definition hexrays.hpp:9360
@ hx_ivlset_t_has_common_
Definition hexrays.hpp:9336
@ hx_cgoto_t_compare
Definition hexrays.hpp:9585
@ hx_mop_t_change_size
Definition hexrays.hpp:9403
@ hx_ivlset_t_has_common
Definition hexrays.hpp:9332
@ hx_block_chains_clear
Definition hexrays.hpp:9222
@ hx_vdui_t_set_num_stroff
Definition hexrays.hpp:9706
@ hx_mlist_t_addmem
Definition hexrays.hpp:9343
@ hx_ccase_t_compare
Definition hexrays.hpp:9602
@ hx_user_casts_end
Definition hexrays.hpp:9728
@ hx_ivlset_t_addmasked
Definition hexrays.hpp:9329
@ hx_getb_reginsn
Definition hexrays.hpp:9456
@ hx_mba_t_set_numform
Definition hexrays.hpp:9758
@ hx_vivl_t_print
Definition hexrays.hpp:9419
@ hx_mblock_t_remove_from_block
Definition hexrays.hpp:9462
@ hx_cfunc_t_get_line_item
Definition hexrays.hpp:9653
@ hx_mba_t_save_snapshot
Definition hexrays.hpp:9518
@ hx_vcreate_helper
Definition hexrays.hpp:9616
@ hx_eamap_size
Definition hexrays.hpp:9198
@ hx_mblock_t_for_all_ops
Definition hexrays.hpp:9464
@ hx_udc_filter_t_cleanup
Definition hexrays.hpp:9297
@ hx_minsn_t_setaddr
Definition hexrays.hpp:9436
@ hx_citem_t_find_closest_addr
Definition hexrays.hpp:9560
@ hx_mop_t_dstr
Definition hexrays.hpp:9375
@ hx_mop_t_is_constant
Definition hexrays.hpp:9396
@ hx_codegen_t_emit
Definition hexrays.hpp:9529
@ hx_mop_t_make_helper
Definition hexrays.hpp:9386
@ hx_user_cmts_begin
Definition hexrays.hpp:9136
@ hx_bitset_t_bitset_t
Definition hexrays.hpp:9300
@ hx_create_cfunc
Definition hexrays.hpp:9665
@ hx_cfunc_t_refresh_func_ctext
Definition hexrays.hpp:9658
@ hx_vivl_t_intersect
Definition hexrays.hpp:9418
@ hx_mop_t_make_gvar
Definition hexrays.hpp:9384
@ hx_mba_t_for_all_insns
Definition hexrays.hpp:9508
@ hx_close_pseudocode
Definition hexrays.hpp:9534
@ hx_cfunc_t_get_eamap
Definition hexrays.hpp:9655
@ hx_mcases_t_dstr
Definition hexrays.hpp:9416
@ hx_user_casts_new
Definition hexrays.hpp:9739
@ hx_lvar_t_is_promoted_arg
Definition hexrays.hpp:9278
@ hx_restore_user_unions
Definition hexrays.hpp:9630
@ hx_mop_t_equal_mops
Definition hexrays.hpp:9392
@ hx_block_chains_find
Definition hexrays.hpp:9219
@ hx_mcallarg_t_print
Definition hexrays.hpp:9406
@ hx_minsn_t_deserialize
Definition hexrays.hpp:9454
@ hx_mbl_graph_t_is_accessed_globally
Definition hexrays.hpp:9524
@ hx_user_labels_insert
Definition hexrays.hpp:9182
@ hx_operand_locator_t_compare
Definition hexrays.hpp:9251
@ hx_valrng_t_intersect_with
Definition hexrays.hpp:9235
@ hx_qstring_printer_t_print
Definition hexrays.hpp:9254
@ hx_ctry_t_compare
Definition hexrays.hpp:9606
@ hx_mblock_t_get_valranges_
Definition hexrays.hpp:9479
@ hx_mblock_t_build_lists
Definition hexrays.hpp:9468
@ hx_cinsn_t_print1
Definition hexrays.hpp:9594
@ hx_ivlset_t_compare
Definition hexrays.hpp:9340
@ hx_cexpr_t_has_side_effects
Definition hexrays.hpp:9574
@ hx_restore_user_lvar_settings
Definition hexrays.hpp:9287
@ hx_minsn_t_for_all_ops
Definition hexrays.hpp:9438
@ hx_user_casts_begin
Definition hexrays.hpp:9727
@ hx_mba_t_inline_func
Definition hexrays.hpp:9521
@ hx_valrng_t_clear
Definition hexrays.hpp:9228
@ hx_minsn_t_print
Definition hexrays.hpp:9434
@ hx_mba_t_idaloc2vd_
Definition hexrays.hpp:9485
@ hx_vdui_t_get_number
Definition hexrays.hpp:9677
@ hx_remitem
Definition hexrays.hpp:9541
@ hx_user_numforms_insert
Definition hexrays.hpp:9104
@ hx_mba_t_remove_block
Definition hexrays.hpp:9503
@ hx_cfunc_t_save_user_cmts
Definition hexrays.hpp:9649
@ hx_cexpr_t_dstr
Definition hexrays.hpp:9576
@ hx_bitset_t_shift_down
Definition hexrays.hpp:9309
@ hx_dstr
Definition hexrays.hpp:9255
@ hx_ctree_visitor_t_apply_to_exprs
Definition hexrays.hpp:9553
@ hx_user_iflags_clear
Definition hexrays.hpp:9158
@ hx_cblock_t_compare
Definition hexrays.hpp:9600
@ hx_print_vdloc
Definition hexrays.hpp:9273
@ hx_remove_optinsn_handler
Definition hexrays.hpp:9353
@ hx_mba_t_get_func_output_lists
Definition hexrays.hpp:9512
@ hx_minsn_t_modifies_d
Definition hexrays.hpp:9450
@ hx_cfunc_t_get_stkoff_delta
Definition hexrays.hpp:9637
@ hx_gen_microcode_
Definition hexrays.hpp:9754
@ hx_eamap_prev
Definition hexrays.hpp:9191
@ hx_boundaries_end
Definition hexrays.hpp:9202
@ hx_udcall_map_new
Definition hexrays.hpp:9135
@ hx_user_numforms_find
Definition hexrays.hpp:9103
@ hx_user_labels_erase
Definition hexrays.hpp:9183
@ hx_install_hexrays_callback
Definition hexrays.hpp:9671
@ hx_cfunc_t_set_user_cmt
Definition hexrays.hpp:9641
@ hx_vd_printer_t_print
Definition hexrays.hpp:9252
@ hx_mutable_graph_t_goup
Definition hexrays.hpp:9362
@ hx_cnumber_t_print
Definition hexrays.hpp:9547
@ hx_valrng_t_reduce_size
Definition hexrays.hpp:9234
@ hx_save_user_labels
Definition hexrays.hpp:9621
@ hx_obsolete_int64_emulator_t_minsn_value
Definition hexrays.hpp:9718
@ hx_open_pseudocode
Definition hexrays.hpp:9533
@ hx_mba_ranges_t_range_contains
Definition hexrays.hpp:9481
@ hx_valrng_t_inverse
Definition hexrays.hpp:9237
@ hx_rlist_t_dstr
Definition hexrays.hpp:9342
@ hx_mop_t_make_reg_pair
Definition hexrays.hpp:9385
@ hx_casm_t_compare
Definition hexrays.hpp:9586
@ hx_user_iflags_begin
Definition hexrays.hpp:9149
@ hx_mba_t_get_numform
Definition hexrays.hpp:9757
@ hx_vdui_t_invert_bits
Definition hexrays.hpp:9708
@ hx_bitset_t_sub
Definition hexrays.hpp:9305
@ hx_save_user_casts
Definition hexrays.hpp:9725
@ hx_cif_t_assign
Definition hexrays.hpp:9577
@ hx_arglocs_overlap
Definition hexrays.hpp:9274
@ hx_eamap_new
Definition hexrays.hpp:9200
@ hx_user_unions_clear
Definition hexrays.hpp:9171
@ hx_get_ctype_name
Definition hexrays.hpp:9669
@ hx_dereference
Definition hexrays.hpp:9620
@ hx_cfunc_t_deserialize
Definition hexrays.hpp:9722
@ hx_block_chains_next
Definition hexrays.hpp:9216
@ hx_user_labels_next
Definition hexrays.hpp:9177
@ hx_get_op_signness
Definition hexrays.hpp:9544
@ hx_bitset_t_add__
Definition hexrays.hpp:9304
@ hx_mop_t_may_use_aliased_memory
Definition hexrays.hpp:9388
@ hx_restore_user_iflags
Definition hexrays.hpp:9629
@ hx_vdui_t_rename_udm
Definition hexrays.hpp:9694
@ hx_simple_graph_t_compute_dominators
Definition hexrays.hpp:9356
@ hx_vdui_t_refresh_view
Definition hexrays.hpp:9674
@ hx_mba_t_set_lvar_name
Definition hexrays.hpp:9523
@ hx_mblock_t_undef_spoiled_regs
Definition hexrays.hpp:9756
@ hx_mop_t_shift_mop
Definition hexrays.hpp:9402
@ hx_bitset_t_has_all
Definition hexrays.hpp:9311
@ hx_mba_t_clr_numform
Definition hexrays.hpp:9759
@ hx_change_hexrays_config
Definition hexrays.hpp:9531
@ hx_ivlset_t_dstr
Definition hexrays.hpp:9334
@ hx_cfunc_t_has_orphan_cmts
Definition hexrays.hpp:9644
@ hx_block_chains_new
Definition hexrays.hpp:9225
@ hx_cinsn_t_is_ordinary_flow
Definition hexrays.hpp:9595
@ hx_hexrays_alloc
Definition hexrays.hpp:9226
@ hx_vdui_t_set_noptr_lvar
Definition hexrays.hpp:9687
@ hx_eamap_free
Definition hexrays.hpp:9199
@ hx_vdui_t_refresh_ctext
Definition hexrays.hpp:9675
@ hx_partial_type_num
Definition hexrays.hpp:9260
@ hx_lvar_mapping_next
Definition hexrays.hpp:9112
@ hx_user_minsn_t_compare
Definition hexrays.hpp:9749
@ hx_cfunc_t_set_user_iflags
Definition hexrays.hpp:9643
@ hx_vdui_t_del_orphan_cmts
Definition hexrays.hpp:9703
@ hx_stkvar_ref_t_compare
Definition hexrays.hpp:9366
@ hx_valrng_t_set_cmp
Definition hexrays.hpp:9233
@ hx_cfunc_t_find_addressable_item
Definition hexrays.hpp:9761
@ hx_cfunc_t_print_dcl
Definition hexrays.hpp:9633
@ hx_bitset_t_compare
Definition hexrays.hpp:9323
@ hx_lnot
Definition hexrays.hpp:9614
@ hx_vdui_t_ui_noprop_lvar
Definition hexrays.hpp:9724
@ hx_user_numforms_erase
Definition hexrays.hpp:9105
@ hx_user_numforms_new
Definition hexrays.hpp:9109
@ hx_cfunc_t_print_func
Definition hexrays.hpp:9634
@ hx_restore_user_cmts
Definition hexrays.hpp:9627
@ hx_block_chains_free
Definition hexrays.hpp:9224
@ hx_minsn_t_equal_insns
Definition hexrays.hpp:9441
@ hx_mop_t_for_all_ops
Definition hexrays.hpp:9394
@ hx_vdloc_t_is_aliasable
Definition hexrays.hpp:9272
@ hx_ccases_t_compare
Definition hexrays.hpp:9603
@ hx_block_chains_begin
Definition hexrays.hpp:9214
@ hx_udcall_map_first
Definition hexrays.hpp:9127
@ hx_mcode_modifies_d
Definition hexrays.hpp:9250
@ hx_udcall_map_size
Definition hexrays.hpp:9133
@ hx_mcallarg_t_set_regarg
Definition hexrays.hpp:9408
@ hx_ivl_t_dstr
Definition hexrays.hpp:9325
@ hx_mba_t_print
Definition hexrays.hpp:9499
@ hx_reg2mreg
Definition hexrays.hpp:9349
@ hx_lvar_mapping_first
Definition hexrays.hpp:9114
@ hx_mba_t_vd2idaloc
Definition hexrays.hpp:9486
@ hx_mblock_t_print
Definition hexrays.hpp:9458
@ hx_user_unions_first
Definition hexrays.hpp:9166
@ hx_vivl_t_dstr
Definition hexrays.hpp:9420
@ hx_user_numforms_clear
Definition hexrays.hpp:9106
@ hx_stkvar_ref_t_get_stkvar
Definition hexrays.hpp:9367
@ hx_mba_t_get_graph
Definition hexrays.hpp:9493
@ hx_mcallinfo_t_get_type
Definition hexrays.hpp:9411
@ hx_mba_t_arg
Definition hexrays.hpp:9513
@ hx_vdui_t_ui_rename_lvar
Definition hexrays.hpp:9682
@ hx_mba_t_mark_chains_dirty
Definition hexrays.hpp:9501
@ hx_lvar_ref_t_compare
Definition hexrays.hpp:9364
@ hx_get_widget_vdui
Definition hexrays.hpp:9535
@ hx_bitset_t_copy
Definition hexrays.hpp:9301
@ hx_udcall_map_find
Definition hexrays.hpp:9129
@ hx_bitset_t_last
Definition hexrays.hpp:9317
@ hx_user_labels_prev
Definition hexrays.hpp:9178
@ hx_bitset_t_fill_gaps
Definition hexrays.hpp:9319
@ hx_asgop
Definition hexrays.hpp:9545
@ hx_var_ref_t_compare
Definition hexrays.hpp:9551
@ hx_carglist_t_compare
Definition hexrays.hpp:9601
@ hx_mblock_t_init
Definition hexrays.hpp:9457
@ hx_mlist_t_dstr
Definition hexrays.hpp:9345
@ hx_minsn_t_is_noret_call
Definition hexrays.hpp:9443
@ hx_mcallinfo_t_print
Definition hexrays.hpp:9412
@ hx_mblock_t_build_def_list
Definition hexrays.hpp:9473
@ hx_user_unions_find
Definition hexrays.hpp:9168
@ hx_mop_t_create_from_mlist
Definition hexrays.hpp:9376
@ hx_vdui_t_set_udm_type
Definition hexrays.hpp:9693
@ hx_is_kreg
Definition hexrays.hpp:9348
@ hx_udcall_map_next
Definition hexrays.hpp:9125
@ hx_bitset_t_empty
Definition hexrays.hpp:9314
@ hx_codegen_t_emit_
Definition hexrays.hpp:9530
@ hx_block_chains_t_dstr
Definition hexrays.hpp:9427
@ hx_file_printer_t_print
Definition hexrays.hpp:9253
@ hx_mop_t_make_fpnum
Definition hexrays.hpp:9382
@ hx_vdui_t_ui_map_lvar
Definition hexrays.hpp:9690
@ hx_cfunc_t_get_func_type
Definition hexrays.hpp:9635
@ hx_udcall_map_end
Definition hexrays.hpp:9124
@ hx_mblock_t_verify_insn
Definition hexrays.hpp:9723
@ hx_cloop_t_assign
Definition hexrays.hpp:9579
@ hx_clear_cached_cfuncs
Definition hexrays.hpp:9667
@ hx_restore_user_casts
Definition hexrays.hpp:9726
@ hx_save_user_unions
Definition hexrays.hpp:9625
@ hx_mcallinfo_t_dstr
Definition hexrays.hpp:9413
@ hx_ccatch_t_compare
Definition hexrays.hpp:9605
@ hx_user_unions_insert
Definition hexrays.hpp:9169
@ hx_vdui_t_ui_unmap_lvar
Definition hexrays.hpp:9691
@ hx_cfunc_t_get_pseudocode
Definition hexrays.hpp:9657
@ hx_minsn_t_has_side_effects
Definition hexrays.hpp:9446
@ hx_user_iflags_insert
Definition hexrays.hpp:9156
@ hx_mba_t_vdump_mba
Definition hexrays.hpp:9498
@ hx_mba_t_split_block
Definition hexrays.hpp:9714
@ hx_user_unions_second
Definition hexrays.hpp:9167
@ hx_chain_t_append_list_
Definition hexrays.hpp:9424
@ hx_minsn_t_find_num_op
Definition hexrays.hpp:9449
@ hx_ctree_item_t_get_label_num
Definition hexrays.hpp:9611
@ hx_cfunc_parentee_t_calc_rvalue_type
Definition hexrays.hpp:9555
@ hx_is_mcode_propagatable
Definition hexrays.hpp:9245
@ hx_ivlset_t_add_
Definition hexrays.hpp:9328
@ hx_mba_t_get_curfunc
Definition hexrays.hpp:9489
@ hx_mblock_t_find_access
Definition hexrays.hpp:9477
@ hx_boundaries_first
Definition hexrays.hpp:9205
@ hx_vdui_t_calc_cmt_type
Definition hexrays.hpp:9700
@ hx_block_chains_size
Definition hexrays.hpp:9223
@ hx_vdui_t_edit_cmt
Definition hexrays.hpp:9701
@ hx_lvar_mapping_begin
Definition hexrays.hpp:9110
@ hx_must_mcode_close_block
Definition hexrays.hpp:9244
@ hx_boundaries_next
Definition hexrays.hpp:9203
@ hx_block_chains_t_get_chain
Definition hexrays.hpp:9425
@ hx_valrng_t_print
Definition hexrays.hpp:9239
@ hx_make_ref
Definition hexrays.hpp:9619
@ hx_citem_locator_t_compare
Definition hexrays.hpp:9556
@ hx_mop_t_is_sign_extended_from
Definition hexrays.hpp:9390
@ hx_vdui_t_invert_sign
Definition hexrays.hpp:9707
@ hx_modify_user_lvars
Definition hexrays.hpp:9289
@ hx_mblock_t_append_use_list
Definition hexrays.hpp:9470
@ hx_chain_t_print
Definition hexrays.hpp:9421
@ hx_user_labels_free
Definition hexrays.hpp:9186
@ hx_vdloc_t_compare
Definition hexrays.hpp:9271
@ hx_is_type_correct
Definition hexrays.hpp:9256
@ hx_user_casts_find
Definition hexrays.hpp:9733
@ hx_mba_t_optimize_local
Definition hexrays.hpp:9491
@ hx_is_bool_type
Definition hexrays.hpp:9259
@ hx_negate_mcode_relation
Definition hexrays.hpp:9246
@ hx_ivlset_t_intersect
Definition hexrays.hpp:9339
@ hx_ivlset_t_add
Definition hexrays.hpp:9327
@ hx_boundaries_insert
Definition hexrays.hpp:9208
@ hx_creturn_t_compare
Definition hexrays.hpp:9583
@ hx_get_member_type
Definition hexrays.hpp:9265
@ hx_cinsn_t_dstr
Definition hexrays.hpp:9599
@ hx_eamap_erase
Definition hexrays.hpp:9196
@ hx_minsn_t_is_between
Definition hexrays.hpp:9451
@ hx_fnumber_t_dstr
Definition hexrays.hpp:9369
@ hx_mba_t_vd2idaloc_
Definition hexrays.hpp:9487
@ hx_mba_t_copy_block
Definition hexrays.hpp:9504
@ hx_valrng_t_cvt_to_cmp
Definition hexrays.hpp:9242
@ hx_close_hexrays_waitbox
Definition hexrays.hpp:9662
@ hx_user_cmts_size
Definition hexrays.hpp:9146
@ hx_bitset_t_dstr
Definition hexrays.hpp:9313
@ hx_citem_t_find_parent_of
Definition hexrays.hpp:9559
@ hx_mba_t_free_kreg
Definition hexrays.hpp:9520
@ hx_citem_t_contains_label
Definition hexrays.hpp:9558
@ hx_mba_t_del_user_minsn
Definition hexrays.hpp:9746
@ hx_cfunc_t_save_user_labels
Definition hexrays.hpp:9648
@ hx_cexpr_t_get_low_nbit_bound
Definition hexrays.hpp:9572
@ hx_boundaries_new
Definition hexrays.hpp:9213
@ hx_mba_t_remove_blocks
Definition hexrays.hpp:9715
@ hx_get_unk_type
Definition hexrays.hpp:9263
@ hx_mop_t_make_low_half
Definition hexrays.hpp:9398
@ hx_user_unions_next
Definition hexrays.hpp:9164
@ hx_mop_t_print
Definition hexrays.hpp:9374
@ hx_block_chains_t_print
Definition hexrays.hpp:9426
@ hx_cfunc_t_get_user_cmt
Definition hexrays.hpp:9640
@ hx_user_cmts_prev
Definition hexrays.hpp:9139
@ hx_minsn_t_optimize_subtree
Definition hexrays.hpp:9437
@ hx_chain_t_append_list
Definition hexrays.hpp:9423
@ hx_user_unions_erase
Definition hexrays.hpp:9170
@ hx_vdui_t_get_current_label
Definition hexrays.hpp:9678
@ hx_eamap_first
Definition hexrays.hpp:9192
@ hx_vdui_t_edit_func_cmt
Definition hexrays.hpp:9702
@ hx_mop_t_create_from_scattered_vdloc
Definition hexrays.hpp:9379
@ hx_lvar_mapping_erase
Definition hexrays.hpp:9118
@ hx_mba_t_serialize
Definition hexrays.hpp:9516
@ hx_rlist_t_print
Definition hexrays.hpp:9341
@ hx_cswitch_t_compare
Definition hexrays.hpp:9604
@ hx_user_cmts_second
Definition hexrays.hpp:9141
@ hx_mba_t_verify
Definition hexrays.hpp:9500
@ hx_cinsn_t_cleanup
Definition hexrays.hpp:9590
@ hx_block_chains_end
Definition hexrays.hpp:9215
@ hx_boundaries_second
Definition hexrays.hpp:9206
@ hx_mba_t_set_maturity
Definition hexrays.hpp:9490
@ hx_lvar_t_set_width
Definition hexrays.hpp:9281
@ hx_cfunc_t_serialize
Definition hexrays.hpp:9721
@ hx_user_casts_prev
Definition hexrays.hpp:9730
@ hx_ctree_visitor_t_apply_to
Definition hexrays.hpp:9552
@ hx_ivl_t_compare
Definition hexrays.hpp:9326
@ hx_mba_t_get_decomp_ranges
Definition hexrays.hpp:9751
@ hx_valrng_t_unite_with
Definition hexrays.hpp:9236
@ hx_minsn_t_find_opcode
Definition hexrays.hpp:9447
@ hx_lvar_t_accepts_type
Definition hexrays.hpp:9279
@ hx_cinsn_t_collect_free_continues
Definition hexrays.hpp:9598
@ hx_cexpr_t_equal_effect
Definition hexrays.hpp:9568
@ hx_swap_mcode_relation
Definition hexrays.hpp:9247
@ hx_udcall_map_second
Definition hexrays.hpp:9128
@ hx_graph_chains_t_release
Definition hexrays.hpp:9429
@ hx_is_nonbool_type
Definition hexrays.hpp:9258
@ hx_user_numforms_next
Definition hexrays.hpp:9099
@ hx_cexpr_t_cleanup
Definition hexrays.hpp:9564
@ hx_lvars_t_find_stkvar
Definition hexrays.hpp:9284
@ hx_minsn_t_find_ins_op
Definition hexrays.hpp:9448
@ hx_mblock_t_for_all_uses
Definition hexrays.hpp:9465
@ hx_lvar_mapping_size
Definition hexrays.hpp:9120
@ hx_valrng_t_has
Definition hexrays.hpp:9238
@ hx_cinsn_t_compare
Definition hexrays.hpp:9588
@ hx_udcall_map_prev
Definition hexrays.hpp:9126
@ hx_citem_t_contains_expr
Definition hexrays.hpp:9557
@ hx_user_numforms_first
Definition hexrays.hpp:9101
@ hx_gen_microcode
Definition hexrays.hpp:9664
@ hx_vivl_t_extend_to_cover
Definition hexrays.hpp:9417
@ hx_cexpr_t_is_child_of
Definition hexrays.hpp:9569
@ hx_ctree_item_t_get_edm
Definition hexrays.hpp:9608
@ hx_mop_t__make_gvar
Definition hexrays.hpp:9383
@ hx_save_user_defined_calls
Definition hexrays.hpp:9293
@ hx_lvar_mapping_find
Definition hexrays.hpp:9116
@ hx_minsn_t_lexcompare
Definition hexrays.hpp:9442
@ hx_cfunc_t_save_user_casts
Definition hexrays.hpp:9740
@ hx_mcallarg_t_dstr
Definition hexrays.hpp:9407
@ hx_user_iflags_new
Definition hexrays.hpp:9161
@ hx_mop_t_get_bitwidth
Definition hexrays.hpp:9755
@ hx_minsn_t_for_all_insns
Definition hexrays.hpp:9439
@ hx_convert_to_user_call
Definition hexrays.hpp:9295
@ hx_mop_t_is_bit_reg
Definition hexrays.hpp:9387
@ hx_minsn_t_dstr
Definition hexrays.hpp:9435
@ hx_mlist_t_print
Definition hexrays.hpp:9344
@ hx_lvar_mapping_prev
Definition hexrays.hpp:9113
@ hx_add_user_minsn
Definition hexrays.hpp:9747
@ hx_cfunc_t_find_label
Definition hexrays.hpp:9638
@ hx_minsn_t_init
Definition hexrays.hpp:9430
@ hx_mba_t_for_all_topinsns
Definition hexrays.hpp:9509
@ hx_mcases_t_print
Definition hexrays.hpp:9415
@ hx_user_numforms_size
Definition hexrays.hpp:9107
mba_t mbl_array_t
Definition hexrays.hpp:5833
qmap< int, qstring > user_labels_t
Definition hexrays.hpp:7669
boundaries_t * boundaries_new()
Create a new boundaries_t instance.
Definition hexrays.hpp:10869
void hexapi save_user_casts(ea_t func_ea, const user_casts_t *casts)
Save user defined casts into the database.
Definition hexrays.hpp:13518
side_effect_t
How to handle side effect of change_size() Sometimes we need to create a temporary operand and change...
Definition hexrays.hpp:2588
@ ONLY_SIDEFF
only handle side effects
Definition hexrays.hpp:2593
@ ANY_REGSIZE
any register size is permitted
Definition hexrays.hpp:2594
@ NO_SIDEFF
change operand size but ignore side effects if you decide to keep the changed operand,...
Definition hexrays.hpp:2589
@ ANY_FPSIZE
any size of floating operand is permitted
Definition hexrays.hpp:2595
@ WITH_SIDEFF
change operand size and handle side effects
Definition hexrays.hpp:2592
int hexapi remove_hexrays_callback(hexrays_cb_t *callback, void *ud)
Uninstall handler for decompiler events.
Definition hexrays.hpp:13878
bool is_assignment(ctype_t op)
Is assignment operator?
Definition hexrays.hpp:6430
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:13500
void user_numforms_free(user_numforms_t *map)
Delete user_numforms_t instance.
Definition hexrays.hpp:9881
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:10480
void hexapi install_optblock_handler(optblock_t *opt)
Install a block level custom optimizer.
Definition hexrays.hpp:11771
cexpr_t *hexapi make_ref(cexpr_t *e)
Create a reference.
Definition hexrays.hpp:13476
THREAD_SAFE bool is_mcode_convertible_to_set(mcode_t mcode)
Definition hexrays.hpp:721
THREAD_SAFE bool is_mcode_j1(mcode_t mcode)
Definition hexrays.hpp:715
qvector< ivlset_t > array_of_ivlsets
Definition hexrays.hpp:2080
boundaries_iterator_t boundaries_next(boundaries_iterator_t p)
Move to the next element.
Definition hexrays.hpp:10825
THREAD_SAFE bool is_may_access(maymust_t maymust)
Definition hexrays.hpp:501
void user_unions_erase(user_unions_t *map, user_unions_iterator_t p)
Erase current element from user_unions_t.
Definition hexrays.hpp:10514
number_format_t & user_numforms_second(user_numforms_iterator_t p)
Get reference to the current map value.
Definition hexrays.hpp:9801
DEPRECATED 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:13816
void user_unions_free(user_unions_t *map)
Delete user_unions_t instance.
Definition hexrays.hpp:10535
bool is_logical(ctype_t op)
Is logical operator?
Definition hexrays.hpp:6476
qmap< ea_t, cinsnptrvec_t > eamap_t
Definition hexrays.hpp:7865
bool hexapi install_microcode_filter(microcode_filter_t *filter, bool install=true)
register/unregister non-standard microcode generator
Definition hexrays.hpp:11419
lvar_locator_t const & lvar_mapping_first(lvar_mapping_iterator_t p)
Get reference to the current map key.
Definition hexrays.hpp:9903
qvector< lvar_saved_info_t > lvar_saved_infos_t
Definition hexrays.hpp:1572
citem_cmt_t & user_cmts_second(user_cmts_iterator_t p)
Get reference to the current map value.
Definition hexrays.hpp:10128
THREAD_SAFE mcode_t hexapi negate_mcode_relation(mcode_t code)
Definition hexrays.hpp:11107
qvector< mop_t * > mopptrs_t
Definition hexrays.hpp:282
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:10244
void hexapi add_user_minsn(ea_t entry_ea, const user_minsn_t &uins, mba_maturity_t mmat)
Add a user-defined microinstruction action.
Definition hexrays.hpp:12554
const maymust_t EXCLUDE_VOLATILE
Definition hexrays.hpp:490
const mopt_t mop_f
list of arguments
Definition hexrays.hpp:2414
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:10689
void lvar_mapping_free(lvar_mapping_t *map)
Delete lvar_mapping_t instance.
Definition hexrays.hpp:9990
size_t block_chains_size(block_chains_t *set)
Get size of block_chains_t.
Definition hexrays.hpp:10957
ea_t const & udcall_map_first(udcall_map_iterator_t p)
Get reference to the current map key.
Definition hexrays.hpp:10012
void user_labels_free(user_labels_t *map)
Delete user_labels_t instance.
Definition hexrays.hpp:10644
size_t lvar_mapping_size(lvar_mapping_t *map)
Get size of lvar_mapping_t.
Definition hexrays.hpp:9983
bool is_unsigned_cmpop(cmpop_t cmpop)
Definition hexrays.hpp:347
void hexapi install_optinsn_handler(optinsn_t *opt)
Install an instruction level custom optimizer.
Definition hexrays.hpp:11758
cexpr_t *hexapi dereference(cexpr_t *e, size_t ptrsize, bool is_flt=false)
Dereference a pointer.
Definition hexrays.hpp:13482
const mreg_t mr_none
Definition hexrays.hpp:816
void user_iflags_free(user_iflags_t *map)
Delete user_iflags_t instance.
Definition hexrays.hpp:10317
bool rename_lvar(ea_t func_ea, const char *oldname, const char *newname)
Rename a local variable.
Definition hexrays.hpp:1716
qrefcnt_t< cfunc_t > cfuncptr_t
Definition hexrays.hpp:286
cfuncptr_t decompile_function(ea_t func_ea, hexrays_failure_t *hf=nullptr, int decomp_flags=0)
Decompile a function (ea-based variant).
Definition hexrays.hpp:8210
qvector< cblock_pos_t > cblock_posvec_t
Definition hexrays.hpp:7394
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:10262
void user_labels_erase(user_labels_t *map, user_labels_iterator_t p)
Erase current element from user_labels_t.
Definition hexrays.hpp:10623
THREAD_SAFE bool hexapi mcode_modifies_d(mcode_t mcode)
Definition hexrays.hpp:11131
const mreg_t mr_cc
Definition hexrays.hpp:823
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:9917
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:9935
qvector< hexwarn_t > hexwarns_t
Definition hexrays.hpp:4872
user_numforms_t *hexapi restore_user_numforms(ea_t func_ea)
Restore user defined number formats from the database.
Definition hexrays.hpp:13542
eamap_t * eamap_new()
Create a new eamap_t instance.
Definition hexrays.hpp:10760
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:10918
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:9926
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:13512
void user_casts_erase(user_casts_t *map, user_casts_iterator_t p)
Erase current element from user_casts_t.
Definition hexrays.hpp:10405
cmpop_t
Definition hexrays.hpp:335
@ CMP_A
Definition hexrays.hpp:340
@ CMP_GT
Definition hexrays.hpp:342
@ CMP_LT
Definition hexrays.hpp:344
@ CMP_NZ
Definition hexrays.hpp:336
@ CMP_GE
Definition hexrays.hpp:343
@ CMP_LE
Definition hexrays.hpp:345
@ CMP_B
Definition hexrays.hpp:339
@ CMP_Z
Definition hexrays.hpp:337
@ CMP_BE
Definition hexrays.hpp:341
@ CMP_AE
Definition hexrays.hpp:338
qvector< minsn_t * > minsnptrs_t
Definition hexrays.hpp:281
bool op_uses_x(ctype_t op)
Does operator use the 'x' field of cexpr_t?
Definition hexrays.hpp:6418
qmap< treeloc_t, citem_cmt_t > user_cmts_t
Definition hexrays.hpp:6658
const maymust_t ONE_ACCESS_TYPE
Definition hexrays.hpp:478
citem_locator_t const & user_iflags_first(user_iflags_iterator_t p)
Get reference to the current map key.
Definition hexrays.hpp:10230
bool is_cmpop_without_eq(cmpop_t cmpop)
Definition hexrays.hpp:362
const maymust_t MUST_ACCESS
Definition hexrays.hpp:473
const uvlr_t MAX_VLR_VALUE
Definition hexrays.hpp:310
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:10471
carglist_t * args
Definition hexrays.hpp:7720
const maymust_t WITH_ASSERTS
Definition hexrays.hpp:488
bool hexapi locate_lvar(lvar_locator_t *out, ea_t func_ea, const char *varname)
Find a variable by name.
Definition hexrays.hpp:11389
user_cmts_t * user_cmts_new()
Create a new user_cmts_t instance.
Definition hexrays.hpp:10215
qvector< cinsn_t * > cinsnptrvec_t
Vector of pointers to statements.
Definition hexrays.hpp:7116
user_casts_t *hexapi restore_user_casts(ea_t func_ea)
Restore user defined casts from the database.
Definition hexrays.hpp:13524
const mopt_t mop_c
mcases
Definition hexrays.hpp:2418
udcall_t & udcall_map_second(udcall_map_iterator_t p)
Get reference to the current map value.
Definition hexrays.hpp:10019
qvector< lvar_locator_t > lvar_locators
Definition hexrays.hpp:1219
block_chains_t * block_chains_new()
Create a new block_chains_t instance.
Definition hexrays.hpp:10971
void term_hexrays_plugin()
Stop working with hex-rays decompiler.
Definition hexrays.hpp:9779
mblock_type_t
Basic block types.
Definition hexrays.hpp:4309
@ BLT_NONE
unknown block type
Definition hexrays.hpp:4310
@ BLT_XTRN
external block (out of function address)
Definition hexrays.hpp:4316
@ BLT_STOP
stops execution regularly (must be the last block)
Definition hexrays.hpp:4311
@ BLT_2WAY
passes execution to two blocks (conditional jump)
Definition hexrays.hpp:4314
@ BLT_0WAY
does not have successors (tail is a noret function)
Definition hexrays.hpp:4312
@ BLT_1WAY
passes execution to one block (regular or goto block)
Definition hexrays.hpp:4313
@ BLT_NWAY
passes execution to many blocks (switch idiom)
Definition hexrays.hpp:4315
const mreg_t mr_of
Definition hexrays.hpp:820
qset< voff_t > voff_set_t
Definition hexrays.hpp:261
qmap< operand_locator_t, number_format_t > user_numforms_t
Definition hexrays.hpp:911
AS_PRINTF(3, 0) cexpr_t *hexapi vcreate_helper(bool standalone
Create a helper object.
Definition hexrays.hpp:12692
ctype_t hexapi asgop_revert(ctype_t cop)
Convert assignment operator into plain operator.
Definition hexrays.hpp:13026
size_t user_labels_size(user_labels_t *map)
Get size of user_labels_t.
Definition hexrays.hpp:10637
THREAD_SAFE bool is_mcode_divmod(mcode_t op)
Definition hexrays.hpp:747
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:10909
bool hexapi decompile_many(const char *outfile, const eavec_t *funcaddrs, int flags)
Batch decompilation.
Definition hexrays.hpp:12972
qvector< ccatch_t > ccatchvec_t
Definition hexrays.hpp:7325
void boundaries_erase(boundaries_t *map, boundaries_iterator_t p)
Erase current element from boundaries_t.
Definition hexrays.hpp:10841
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:10798
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:10135
tinfo_t & user_casts_second(user_casts_iterator_t p)
Get reference to the current map value.
Definition hexrays.hpp:10346
const svlr_t MAX_VLR_SVALUE
Definition hexrays.hpp:311
void hexapi hexrays_free(void *ptr)
Definition hexrays.hpp:10983
vdui_t *hexapi get_widget_vdui(TWidget *f)
Get the vdui_t instance associated to the TWidget.
Definition hexrays.hpp:12966
const mopt_t mop_v
global variable
Definition hexrays.hpp:2412
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:10271
GCC_DIAG_OFF(deprecated-declarations) MSC_DIAG_OFF(4996) struct mba_item_iterator_t
Item iterator for mba_ranges_t.
Definition hexrays.hpp:5030
int maymust_t
Definition hexrays.hpp:470
user_labels_iterator_t user_labels_prev(user_labels_iterator_t p)
Move to the previous element.
Definition hexrays.hpp:10615
THREAD_SAFE bool is_mcode_set(mcode_t mcode)
Definition hexrays.hpp:711
user_casts_t * user_casts_new()
Create a new user_casts_t instance.
Definition hexrays.hpp:10433
user_casts_iterator_t user_casts_next(user_casts_iterator_t p)
Move to the next element.
Definition hexrays.hpp:10389
user_iflags_iterator_t user_iflags_prev(user_iflags_iterator_t p)
Move to the previous element.
Definition hexrays.hpp:10288
bool is_multiplicative(ctype_t op)
Is multiplicative operator?
Definition hexrays.hpp:6457
citem_pointers_t parents_t
Definition hexrays.hpp:6563
void udcall_map_erase(udcall_map_t *map, udcall_map_iterator_t p)
Erase current element from udcall_map_t.
Definition hexrays.hpp:10078
cinsn_t *hexapi new_block()
Create a new block-statement.
Definition hexrays.hpp:13452
mba_maturity_t
Microcode maturity levels.
Definition hexrays.hpp:4877
@ MMAT_LOCOPT
local optimization of each basic block is complete.
Definition hexrays.hpp:4881
@ MMAT_LVARS
allocated local variables
Definition hexrays.hpp:4887
@ MMAT_CALLS
detected call arguments. see also hxe_calls_done
Definition hexrays.hpp:4883
@ MMAT_GLBOPT1
performed the first pass of global optimization
Definition hexrays.hpp:4884
@ MMAT_PREOPTIMIZED
preoptimized pass is complete
Definition hexrays.hpp:4880
@ MMAT_ZERO
microcode does not exist
Definition hexrays.hpp:4878
@ MMAT_GLBOPT3
completed all global optimization. microcode is fixed now.
Definition hexrays.hpp:4886
@ MMAT_GLBOPT2
most global optimization passes are done
Definition hexrays.hpp:4885
@ MMAT_GENERATED
generated microcode
Definition hexrays.hpp:4879
THREAD_SAFE bool has_mcode_seloff(mcode_t op)
Definition hexrays.hpp:752
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:11371
ctype_t hexapi asgop(ctype_t cop)
Convert plain operator into assignment operator. For example, cot_add returns cot_asgadd.
Definition hexrays.hpp:13020
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:11395
int64 svlr_t
Definition hexrays.hpp:308
bool hexapi remove_optinsn_handler(optinsn_t *opt)
Remove an instruction level custom optimizer.
Definition hexrays.hpp:11764
void eamap_free(eamap_t *map)
Delete eamap_t instance.
Definition hexrays.hpp:10753
warnid_t
Warning ids.
Definition hexrays.hpp:4786
@ WARN_OPT_VALRNG4
56 the cases s were optimized away because s
Definition hexrays.hpp:4843
@ WARN_OPT_VALRNG2
52 mask 0xX is shortened because s <= 0xX"
Definition hexrays.hpp:4839
@ WARN_GUESSED_TYPE
9 using guessed type s;
Definition hexrays.hpp:4796
@ WARN_BAD_STROFF
33 user specified stroff has not been processed: s
Definition hexrays.hpp:4820
@ WARN_OPT_USELESS_JCND
54 simplified comparisons for 's': s became s
Definition hexrays.hpp:4841
@ WARN_ODD_INPUT_REG
15 odd input register s
Definition hexrays.hpp:4802
@ WARN_ILL_FUNCTYPE
2 invalid function type 's' has been ignored
Definition hexrays.hpp:4789
@ WARN_ILL_PURGED
1 odd caller purged bytes d, correcting
Definition hexrays.hpp:4788
@ WARN_UNINITED_REG
28 reference to an uninitialized register has been removed: s
Definition hexrays.hpp:4815
@ WARN_ODD_ADDR_USE
16 odd use of a variable address
Definition hexrays.hpp:4803
@ WARN_CBUILD_LOOPS
13 too many cbuild loops
Definition hexrays.hpp:4800
@ WARN_BAD_VARSIZE
34 inconsistent variable size for 's'
Definition hexrays.hpp:4821
@ WARN_VARARG_MANY
5 too many varargs, some ignored
Definition hexrays.hpp:4792
@ WARN_MAX
may be used in notes as a placeholder when the warning id is not available
Definition hexrays.hpp:4848
@ WARN_UNBALANCED_STACK
51 unbalanced stack, ignored a potential tail call
Definition hexrays.hpp:4838
@ WARN_FRAG_LVAR
26 fragmented variable at s may be wrong
Definition hexrays.hpp:4813
@ WARN_BAD_PURGED
12 inconsistent function type and number of purged bytes
Definition hexrays.hpp:4799
@ WARN_UNSUPP_REG
35 unsupported processor register 's'
Definition hexrays.hpp:4822
@ WARN_VARARG_REGS
0 cannot handle register arguments in vararg function, discarded them
Definition hexrays.hpp:4787
@ WARN_MISSED_SWITCH
39 wrong markup of switch jump, skipped it
Definition hexrays.hpp:4826
@ WARN_UNDEF_LVAR
42 variable 's' is possibly undefined
Definition hexrays.hpp:4829
@ WARN_RET_LOCREF
47 returning address of temporary local variable 's'
Definition hexrays.hpp:4834
@ WARN_BAD_RETVAR
25 wrong return variable
Definition hexrays.hpp:4812
@ WARN_SUBFRAME_OVERFLOW
55 call arguments overflow the function chunk frame
Definition hexrays.hpp:4842
@ WARN_CR_NOFIELD
31 CONTAINING_RECORD: no field 's' in struct 's' at d
Definition hexrays.hpp:4818
@ WARN_BAD_CALL_SP
38 bad sp value at call
Definition hexrays.hpp:4825
@ WARN_WRITE_CONST
24 write access to const memory at a has been detected
Definition hexrays.hpp:4811
@ WARN_WIDEN_CHAINS
11 failed to widen chains
Definition hexrays.hpp:4798
@ WARN_FRAME_ACCESS
57 illegal frame access
Definition hexrays.hpp:4844
@ WARN_ILL_FPU_STACK
18 inconsistent fpu stack
Definition hexrays.hpp:4805
@ WARN_BAD_EHINFO
58 inconsistent exception info
Definition hexrays.hpp:4845
@ WARN_SELFREF_PROP
19 self-referencing variable has been detected
Definition hexrays.hpp:4806
@ WARN_WRONG_VA_OFF
30 wrong offset of va_list variable
Definition hexrays.hpp:4817
@ WARN_BAD_STKPNT
41 wrong sp change point
Definition hexrays.hpp:4828
@ WARN_OPT_VALRNG
46 conditional instruction was optimized away because s
Definition hexrays.hpp:4833
@ WARN_BAD_SHADOW
45 ignored the value written to the shadow area of the succeeding call
Definition hexrays.hpp:4832
@ WARN_NO_SAVE_REST
14 could not find valid save-restore pair for s
Definition hexrays.hpp:4801
@ WARN_BAD_INSN
49 bad instruction
Definition hexrays.hpp:4836
@ WARN_ILL_ELLIPSIS
8 erroneously detected ellipsis type has been ignored
Definition hexrays.hpp:4795
@ WARN_EXP_LINVAR
10 failed to expand a linear variable
Definition hexrays.hpp:4797
@ WARN_VARARG_NOSTK
4 call vararg without local stack
Definition hexrays.hpp:4791
@ WARN_MUST_RET_FP
17 function return type is incorrect (must be floating point)
Definition hexrays.hpp:4804
@ WARN_JUMPOUT
43 control flows out of bounds
Definition hexrays.hpp:4830
@ WARN_BAD_FIELD_TYPE
23 incorrect structure member type for s::s, ignored
Definition hexrays.hpp:4810
@ WARN_WOULD_OVERLAP
20 variables would overlap: s
Definition hexrays.hpp:4807
@ WARN_FIXED_INSN
29 fixed broken insn
Definition hexrays.hpp:4816
@ WARN_VARARG_TCAL
3 cannot handle tail call to vararg
Definition hexrays.hpp:4790
@ WARN_ODD_ABI
50 encountered odd instruction for the current ABI
Definition hexrays.hpp:4837
@ WARN_HUGE_STKOFF
27 exceedingly huge offset into the stack frame
Definition hexrays.hpp:4814
@ WARN_ADDR_OUTARGS
6 cannot handle address arithmetics in outgoing argument area of stack frame – unused
Definition hexrays.hpp:4793
@ WARN_MAX_ARGS
22 too many input arguments, some ignored
Definition hexrays.hpp:4809
@ WARN_ARRAY_INARG
21 array has been used for an input argument
Definition hexrays.hpp:4808
@ WARN_UNALIGNED_ARG
36 unaligned function argument 's'
Definition hexrays.hpp:4823
@ WARN_CR_BADOFF
32 CONTAINING_RECORD: too small offset d for struct 's'
Definition hexrays.hpp:4819
@ WARN_BAD_SP
40 positive sp value a has been found
Definition hexrays.hpp:4827
@ WARN_OPT_VALRNG3
53 masking with 0XX was optimized away because s <= 0xX
Definition hexrays.hpp:4840
@ WARN_DALVIK_ENUM
60 could not fully analyze enum <clinit>; constant order or bodies may be incomplete
Definition hexrays.hpp:4847
@ WARN_INCOMPAT_TYPE
59 incompatible types for 's': expected s but encountered s
Definition hexrays.hpp:4846
@ WARN_BAD_VALRNG
44 values range analysis failed
Definition hexrays.hpp:4831
@ WARN_DEP_UNK_CALLS
7 found interdependent unknown calls
Definition hexrays.hpp:4794
@ WARN_BAD_STD_TYPE
37 corrupted or unexisting local type 's'
Definition hexrays.hpp:4824
@ WARN_BAD_MAPDST
48 too short map destination 's' for variable 's'
Definition hexrays.hpp:4835
treeloc_t const & user_cmts_first(user_cmts_iterator_t p)
Get reference to the current map key.
Definition hexrays.hpp:10121
void block_chains_erase(block_chains_t *set, block_chains_iterator_t p)
Erase current element from block_chains_t.
Definition hexrays.hpp:10943
const int cc_count
Definition hexrays.hpp:822
block_chains_iterator_t block_chains_prev(block_chains_iterator_t p)
Move to the previous element.
Definition hexrays.hpp:10935
qset< minsn_t * > minsn_ptr_set_t
Definition hexrays.hpp:279
user_cmts_t *hexapi restore_user_cmts(ea_t func_ea)
Restore user defined comments from the database.
Definition hexrays.hpp:13536
const cmt_type_t CMT_ALL
All comments.
Definition hexrays.hpp:8724
void user_unions_clear(user_unions_t *map)
Clear user_unions_t.
Definition hexrays.hpp:10521
const size_t bitset_align
Definition hexrays.hpp:1836
const mopt_t mop_h
helper function
Definition hexrays.hpp:2417
THREAD_SAFE bool is_mcode_set1(mcode_t mcode)
Definition hexrays.hpp:713
void lvar_mapping_erase(lvar_mapping_t *map, lvar_mapping_iterator_t p)
Erase current element from lvar_mapping_t.
Definition hexrays.hpp:9969
const char *hexapi get_hexrays_version()
Get decompiler version.
Definition hexrays.hpp:12948
bool is_binary(ctype_t op)
Is binary operator?
Definition hexrays.hpp:6424
bool is_cmpop_with_eq(cmpop_t cmpop)
Definition hexrays.hpp:355
lvar_mapping_t * lvar_mapping_new()
Create a new lvar_mapping_t instance.
Definition hexrays.hpp:9997
bool hexapi is_kreg(mreg_t r)
Is a kernel register?
Definition hexrays.hpp:11734
udcall_map_t * udcall_map_new()
Create a new udcall_map_t instance.
Definition hexrays.hpp:10106
void hexapi send_database(const hexrays_failure_t &err, bool silent)
Send the database to Hex-Rays.
Definition hexrays.hpp:12978
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:11401
user_labels_iterator_t user_labels_next(user_labels_iterator_t p)
Move to the next element.
Definition hexrays.hpp:10607
qstring & user_labels_second(user_labels_iterator_t p)
Get reference to the current map value.
Definition hexrays.hpp:10564
THREAD_SAFE bool is_mcode_call(mcode_t mcode)
Definition hexrays.hpp:723
THREAD_SAFE mcode_t hexapi get_signed_mcode(mcode_t code)
Definition hexrays.hpp:11119
Contains the inf structure definition and some functions common to the whole IDA project.
uchar inf_get_cc_size_i()
Definition ida.hpp:1017
uint32 callcnv_t
Definition ida.hpp:75
Contains definition of the interface to IDP modules.
qvector< reg_info_t > reginfovec_t
vector of register info objects
Definition idp.hpp:2966
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:1399
int nbytes
Definition kernwin.hpp:3037
bool ok
Definition kernwin.hpp:7410
uval_t uval_t
Definition kernwin.hpp:1926
callui(ui_mbox, mbox_replace, format, va)
@ ui_broadcast
cb: broadcast call
Definition kernwin.hpp:397
asize_t size
Definition kernwin.hpp:6701
QT::QWidget TWidget
Definition kernwin.hpp:2075
qvector< simpleline_t > strvec_t
A collection of simple lines to populate a custom view.
Definition kernwin.hpp:1765
void(idaapi *range_marker)(ea_t ea
Pointer to range marker function (for idaviews and hexviews) This pointer is initialized by setup_ran...
MSC_DIAG_OFF(4826) struct cast_t
Preprocessor cast.
Definition lex.hpp:78
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:1312
THREAD_SAFE constexpr bool contains(uval_t off1, asize_t s1, uval_t off)
Does (off1,s1) contain off?
Definition pro.h:1472
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:1467
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:1462
This is the first header included in the IDA project.
idaman size_t const char time_t t
Definition pro.h:606
unsigned short uint16
unsigned 16 bit value
Definition pro.h:350
int bool
Definition pro.h:333
unsigned int uint32
unsigned 32 bit value
Definition pro.h:352
qvector< int > intvec_t
vector of integers
Definition pro.h:2839
uint64 asize_t
Definition pro.h:427
constexpr T make_mask(int count)
Make a mask of 'count' bits.
Definition pro.h:1524
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:1494
uint8 op_dtype_t
Definition pro.h:464
adiff_t sval_t
signed value used by the processor.
Definition pro.h:450
short int16
signed 16 bit value
Definition pro.h:349
uint64 ea_t
Definition pro.h:425
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:1489
uint32 flags_t
32-bit flags for each address
Definition pro.h:5105
int int32
signed 32 bit value
Definition pro.h:351
unsigned char uchar
unsigned 8 bit value
Definition pro.h:341
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:1728
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:2209
unsigned int uint
unsigned 32 bit value
Definition pro.h:343
int lexcompare(const T &a, const T &b)
Standard lexical comparison.
Definition pro.h:2964
qvector< ea_t > eavec_t
vector of addresses
Definition pro.h:2838
uint64 flags64_t
64-bit flags for each address
Definition pro.h:5106
ptrdiff_t ssize_t
Signed size_t - used to check for size overflows when the counter becomes negative.
Definition pro.h:385
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:1367
void idaapi setflag(T &where, U bit, bool cnd)
Set a 'bit' in 'where' if 'value' is not zero.
Definition pro.h:1530
unsigned char uint8
unsigned 8 bit value
Definition pro.h:348
char int8
signed 8 bit value
Definition pro.h:346
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:1484
_qstring< char > qstring
regular string
Definition pro.h:3771
int compare(const T &a, const T &b)
Definition pro.h:4607
unsigned int
Definition pronet.h:99
qtree_detail::qmap< Key, Value, Compare, ida_alloc_policy, true > qmap
Definition qmap.hpp:9
constexpr bool operator<(qpair< F, S > const &a, qpair< F, S > const &b)
Definition qpair.hpp:108
constexpr bool operator!=(qpair< F, S > const &a, qpair< F, S > const &b)
Definition qpair.hpp:103
void swap(qpair< F, S > &a, qpair< F, S > &b) noexcept(noexcept(a.swap(b)))
Definition qpair.hpp:78
constexpr bool operator==(qpair< F, S > const &a, qpair< F, S > const &b)
Definition qpair.hpp:98
qtree_detail::qset< Value, Compare, ida_alloc_policy, true > qset
Definition qset.hpp:9
Definition hexrays.hpp:6688
bit_bound_t(int n=0, int s=0)
Definition hexrays.hpp:6697
int16 nbits
Definition hexrays.hpp:6689
int16 sbits
Definition hexrays.hpp:6691
Definition hexrays.hpp:10876
bool operator==(const block_chains_iterator_t &p) const
Definition hexrays.hpp:10878
iterator_word x
Definition hexrays.hpp:10877
bool operator!=(const block_chains_iterator_t &p) const
Definition hexrays.hpp:10879
Definition hexrays.hpp:10767
bool operator!=(const boundaries_iterator_t &p) const
Definition hexrays.hpp:10770
iterator_word x
Definition hexrays.hpp:10768
bool operator==(const boundaries_iterator_t &p) const
Definition hexrays.hpp:10769
Function argument.
Definition hexrays.hpp:7229
tinfo_t formal_type
formal parameter type (if known)
Definition hexrays.hpp:7231
bool is_vararg
is a vararg (matches ...)
Definition hexrays.hpp:7230
void consume_cexpr(cexpr_t *e)
Definition hexrays.hpp:7232
DECLARE_COMPARISONS(carg_t)
Definition hexrays.hpp:7237
Function argument list.
Definition hexrays.hpp:7246
tinfo_t functype
function object type
Definition hexrays.hpp:7247
funcrole_t role
function role (propagated from microcode)
Definition hexrays.hpp:7252
void print(qstring *vout, const cfunc_t *func) const
carglist_t()
Definition hexrays.hpp:7253
int print(int curpos, vc_printer_t &vp) const
int flags
call flags
Definition hexrays.hpp:7248
DECLARE_COMPARISONS(carglist_t)
carglist_t(const tinfo_t &ftype, int fl=0)
Definition hexrays.hpp:7254
asm statement
Definition hexrays.hpp:7106
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:7107
bool one_insn() const
Definition hexrays.hpp:7111
casm_t(const casm_t &r)
Definition hexrays.hpp:7108
Catch expression.
Definition hexrays.hpp:7289
bool is_finally() const
Definition hexrays.hpp:7301
void swap(catchexpr_t &r)
Definition hexrays.hpp:7296
void convert_to_catch_all()
Definition hexrays.hpp:7303
cexpr_t obj
the caught object.
Definition hexrays.hpp:7290
DECLARE_COMPARISONS(catchexpr_t)
bool is_catch_all() const
Definition hexrays.hpp:7302
void convert_to_finally()
Definition hexrays.hpp:7304
qstring fake_type
if not empty, type of the caught object.
Definition hexrays.hpp:7292
Additional position information for cblocks.
Definition hexrays.hpp:7386
cinsn_t * insn() const
Definition hexrays.hpp:7390
cinsn_t * prev_insn()
Definition hexrays.hpp:7391
cblock_t::iterator p
Definition hexrays.hpp:7388
bool is_first_insn() const
Definition hexrays.hpp:7389
cblock_t * blk
Definition hexrays.hpp:7387
Compound statement (curly braces)
Definition hexrays.hpp:7222
bool is_ordinary_flow() const
Definition hexrays.hpp:8357
DECLARE_COMPARISONS(cblock_t)
Switch case. Usually cinsn_t is a block.
Definition hexrays.hpp:7262
uint64vec_t values
List of case values.
Definition hexrays.hpp:7263
DECLARE_COMPARISONS(ccase_t)
const uint64 & value(int i) const
Definition hexrays.hpp:7268
size_t size() const
Definition hexrays.hpp:7267
void set_insn(cinsn_t *i)
Vector of switch cases.
Definition hexrays.hpp:7274
DECLARE_COMPARISONS(ccases_t)
int find_value(uint64 v) const
Catch clause: "catch ( type obj )".
Definition hexrays.hpp:7311
void swap(ccatch_t &r)
Definition hexrays.hpp:7318
bool is_finally() const
Definition hexrays.hpp:7315
DECLARE_COMPARISONS(ccatch_t)
bool is_catch_all() const
Definition hexrays.hpp:7314
void convert_to_catch_all()
Definition hexrays.hpp:7316
catchexprs_t exprs
Definition hexrays.hpp:7312
void convert_to_finally()
Definition hexrays.hpp:7317
Definition hexrays.hpp:5947
ea_t ea
Definition hexrays.hpp:5949
cdg_insn_iterator_t(const cdg_insn_iterator_t &r)=default
const mba_t * mba
Definition hexrays.hpp:5948
ea_t end
Definition hexrays.hpp:5950
cdg_insn_iterator_t(const mba_t *mba_)
Definition hexrays.hpp:5957
bool is_severed_dslot() const
Definition hexrays.hpp:5965
ea_t severed_branch
Definition hexrays.hpp:5953
insn_t dslot_insn
Definition hexrays.hpp:5952
void start(const range_t &rng)
Definition hexrays.hpp:5966
bool dslot_with_xrefs() const
Definition hexrays.hpp:5963
cdg_insn_iterator_t & operator=(const cdg_insn_iterator_t &r)=default
bool ok() const
Definition hexrays.hpp:5961
ea_t dslot
Definition hexrays.hpp:5951
bool has_dslot() const
Definition hexrays.hpp:5962
bool is_likely_dslot
Definition hexrays.hpp:5955
merror_t hexapi next(insn_t *ins)
Definition hexrays.hpp:12918
Do-loop.
Definition hexrays.hpp:7085
DECLARE_COMPARISONS(cdo_t)
Statement with an expression.
Definition hexrays.hpp:7029
cexpr_t expr
Expression of the statement.
Definition hexrays.hpp:7030
Ctree item: expression.
Definition hexrays.hpp:6750
type_sign_t get_type_sign() const
Get expression sign.
Definition hexrays.hpp:6912
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:13154
int ptrsize
memory access size (used for cot_ptr, cot_memptr)
Definition hexrays.hpp:6777
uint32 exflags
Expression attributes
Definition hexrays.hpp:6786
~cexpr_t()
Definition hexrays.hpp:6843
bool contains_comma(int times=1) const
Does the expression contain a comma operator?
Definition hexrays.hpp:6892
void swap(cexpr_t &r)
Definition hexrays.hpp:6830
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:13106
cexpr_t & operator=(const cexpr_t &r)
Definition hexrays.hpp:6840
bool is_type_unsigned() const
Is expression unsigned?
Definition hexrays.hpp:6914
void hexapi cleanup()
Cleanup the expression.
Definition hexrays.hpp:13112
bool is_nice_cond() const
Is nice condition?
Definition hexrays.hpp:6904
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:6910
fnumber_t * fpc
used for cot_fnum
Definition hexrays.hpp:6754
cexpr_t(const cexpr_t &r)
Definition hexrays.hpp:6829
carglist_t * a
argument list (used for cot_call)
Definition hexrays.hpp:6770
bool hexapi requires_lvalue(const cexpr_t *child) const
Check if the expression requires an lvalue.
Definition hexrays.hpp:13168
void set_type_partial(bool val=true)
Definition hexrays.hpp:6817
uint64 numval() const
Get numeric value of the expression.
Definition hexrays.hpp:6938
bool is_zero_const() const
Check if the expression is a zero.
Definition hexrays.hpp:6964
void hexapi print1(qstring *vout, const cfunc_t *func) const
Print expression into one line.
Definition hexrays.hpp:13124
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:6984
void set_vftable()
Definition hexrays.hpp:6815
void set_user_cast()
Definition hexrays.hpp:6816
const cexpr_t * find_op(ctype_t _op) const
Find the child with the specified operator.
Definition hexrays.hpp:6993
bool is_type_signed() const
Is expression signed?
Definition hexrays.hpp:6916
char * string
utf8 string constant, user representation (used for cot_str)
Definition hexrays.hpp:6783
bool is_vftable() const
Definition hexrays.hpp:6810
bool is_negative_const() const
Check if the expression is a negative number.
Definition hexrays.hpp:6949
bool is_nice_expr() const
Is nice expression?
Definition hexrays.hpp:6901
const cexpr_t * find_num_op() const
Find the operand with a numeric value.
Definition hexrays.hpp:7007
cinsn_t * insn
an embedded statement, they are prohibited at the final maturity stage (CMAT_FINAL)
Definition hexrays.hpp:6780
bool is_non_negative_const() const
Check if the expression is a non-negative number.
Definition hexrays.hpp:6954
bool is_const_value(uint64 _v) const
Check if the expression is a number with the specified value.
Definition hexrays.hpp:6944
void hexapi calc_type(bool recursive)
Calculate the type of the expression.
Definition hexrays.hpp:13130
bool is_type_partial() const
Definition hexrays.hpp:6807
cnumber_t * n
used for cot_num
Definition hexrays.hpp:6753
bool hexapi equal_effect(const cexpr_t &r) const
Compare two expressions.
Definition hexrays.hpp:13136
ea_t obj_ea
used for cot_obj
Definition hexrays.hpp:6760
cexpr_t * y
the second operand of the expression
Definition hexrays.hpp:6769
bool is_call_object_of(const citem_t *parent) const
Is call object?
Definition hexrays.hpp:6907
const cexpr_t * theother(const cexpr_t *what) const
Get the other operand.
Definition hexrays.hpp:7015
bool contains_insn_or_label() const
Does the expression contain an embedded statement operator or a label?
Definition hexrays.hpp:6896
cexpr_t &hexapi assign(const cexpr_t &r)
Definition hexrays.hpp:13094
bool is_odd_lvalue() const
Definition hexrays.hpp:6804
const char *hexapi dstr() const
Definition hexrays.hpp:13186
bool is_undef_val() const
Definition hexrays.hpp:6808
bool hexapi is_child_of(const citem_t *parent) const
Verify if the specified item is our parent.
Definition hexrays.hpp:13142
bool contains_insn(int times=1) const
Does the expression contain an embedded statement operator?
Definition hexrays.hpp:6894
cexpr_t()
Definition hexrays.hpp:6825
char * helper
helper name (used for cot_helper)
Definition hexrays.hpp:6782
bool is_jumpout() const
Definition hexrays.hpp:6809
var_ref_t v
used for cot_var
Definition hexrays.hpp:6759
DECLARE_COMPARISONS(cexpr_t)
bool hexapi has_side_effects() const
Check if the expression has side effects.
Definition hexrays.hpp:13174
cexpr_t * z
the third operand of the expression
Definition hexrays.hpp:6776
int hexapi get_low_nbit_bound() const
Get min number of bits that are certainly required to represent the expression.
Definition hexrays.hpp:13162
bool is_cstr() const
Definition hexrays.hpp:6806
cexpr_t * theother(const cexpr_t *what)
Definition hexrays.hpp:7016
bool hexapi contains_operator(ctype_t needed_op, int times=1) const
Check if the expression contains the specified operator.
Definition hexrays.hpp:13148
bool is_fpop() const
Definition hexrays.hpp:6805
bool cpadone() const
Pointer arithmetic correction done for this expression?
Definition hexrays.hpp:6803
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:6959
uint32 m
member offset (used for cot_memptr, cot_memref) for unions, the member number
Definition hexrays.hpp:6771
void set_cpadone()
Definition hexrays.hpp:6814
cexpr_t * x
the first operand of the expression
Definition hexrays.hpp:6766
cexpr_t * find_num_op()
Definition hexrays.hpp:7008
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:6898
tinfo_t type
expression type. must be carefully maintained
Definition hexrays.hpp:6785
bool get_1num_op(cexpr_t **o1, cexpr_t **o2)
Get pointers to operands.
Definition hexrays.hpp:8327
cexpr_t(ctype_t cexpr_op, cexpr_t *_x, cexpr_t *_y=nullptr, cexpr_t *_z=nullptr)
Definition hexrays.hpp:6826
cexpr_t * find_op(ctype_t _op)
Definition hexrays.hpp:7001
void hexapi put_number(cfunc_t *func, uint64 value, size_t nbytes, type_sign_t sign=no_sign)
Assign a number to the expression.
Definition hexrays.hpp:13118
int refwidth
how many bytes are accessed? (-1: none)
Definition hexrays.hpp:6762
cexpr_t(mba_t *mba, const lvar_t &v)
bool get_const_value(uint64 *out) const
Get expression value.
Definition hexrays.hpp:6970
bool is_user_cast() const
Definition hexrays.hpp:6811
bool hexapi maybe_ptr() const
May the expression be a pointer?
Definition hexrays.hpp:13180
For-loop.
Definition hexrays.hpp:7071
cexpr_t init
Initialization expression.
Definition hexrays.hpp:7072
cexpr_t step
Step expression.
Definition hexrays.hpp:7073
DECLARE_COMPARISONS(cfor_t)
Class to traverse the whole function.
Definition hexrays.hpp:7541
cfunc_parentee_t(cfunc_t *f, bool post=false)
Definition hexrays.hpp:7543
cfunc_t * func
Pointer to current function.
Definition hexrays.hpp:7542
bool hexapi calc_rvalue_type(tinfo_t *target, const cexpr_t *e)
Calculate rvalue type.
Definition hexrays.hpp:13396
Decompiled function. Decompilation result is kept here.
Definition hexrays.hpp:7874
void hexapi set_user_union_selection(ea_t ea, const intvec_t &path)
Set a union field selection.
Definition hexrays.hpp:13664
user_cmts_t * user_cmts
user-defined comments.
Definition hexrays.hpp:7883
cfunc_t(mba_t *mba)
user_unions_t * user_unions
user-defined union field selections.
Definition hexrays.hpp:7886
const char *hexapi get_user_cmt(const treeloc_t &loc, cmt_retrieval_type_t rt) const
Retrieve a user defined comment.
Definition hexrays.hpp:13622
void hexapi recalc_item_addresses()
Recalculate item adresses.
Definition hexrays.hpp:13756
void hexapi remove_unused_labels()
Remove unused labels.
Definition hexrays.hpp:13610
strvec_t sv
decompilation output: function text. use get_pseudocode
Definition hexrays.hpp:7903
static WARN_UNUSED_RESULT cfunc_t *hexapi deserialize(mba_t *mba, const uchar *bytes, size_t nbytes)
Deserialize a byte sequence into cfunc_t.
Definition hexrays.hpp:13786
sval_t hexapi get_stkoff_delta()
Get stack offset delta.
Definition hexrays.hpp:13596
void hexapi print_func(vc_printer_t &vp) const
Print function text.
Definition hexrays.hpp:13578
const strvec_t &hexapi get_pseudocode()
Get pointer to decompilation output: the pseudocode.
Definition hexrays.hpp:13744
citem_pointers_t treeitems
vector of pointers to citem_t objects (nodes constituting the ctree)
Definition hexrays.hpp:7905
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:13720
user_iflags_t * user_iflags
user-defined item flags ctree item iflags bits
Definition hexrays.hpp:7885
user_casts_t * user_casts
user-defined casts.
Definition hexrays.hpp:7906
void hexapi set_user_iflags(const citem_locator_t &loc, int32 iflags)
Set citem iflags.
Definition hexrays.hpp:13640
int hdrlines
number of lines in the declaration area
Definition hexrays.hpp:7904
boundaries_t &hexapi get_boundaries()
Get pointer to map of instruction boundaries.
Definition hexrays.hpp:13738
hexwarns_t &hexapi get_warnings()
Get information about decompilation warnings.
Definition hexrays.hpp:13726
lvars_t *hexapi get_lvars()
Get vector of local variables.
Definition hexrays.hpp:13590
bool hexapi has_orphan_cmts() const
Check if there are orphan comments.
Definition hexrays.hpp:13646
void hexapi print_dcl(qstring *vout) const
Print function prototype.
Definition hexrays.hpp:13572
eamap_t * eamap
ea->insn map. use get_eamap
Definition hexrays.hpp:7901
void hexapi save_user_casts() const
Save user-defined casts into the database.
Definition hexrays.hpp:13700
user_numforms_t * numforms
user-defined number formats.
Definition hexrays.hpp:7884
HEXRAYS_MEMORY_ALLOCATION_FUNCS() void hexapi build_c_tree()
Generate the function body.
ctree_maturity_t maturity
maturity level
Definition hexrays.hpp:7879
void hexapi save_user_labels() const
Save user-defined labels into the database.
Definition hexrays.hpp:13670
void hexapi save_user_unions() const
Save user-defined union field selections into the database.
Definition hexrays.hpp:13694
intvec_t & argidx
list of arguments (indexes into vars)
Definition hexrays.hpp:7878
boundaries_t * boundaries
map of instruction boundaries. use get_boundaries
Definition hexrays.hpp:7902
void hexapi set_user_cast(const citem_locator_t &loc, const tinfo_t &type)
Set a user-defined cast.
Definition hexrays.hpp:13714
int statebits
current cfunc_t state.
Definition hexrays.hpp:7895
citem_t *hexapi find_label(int label)
Find the label.
Definition hexrays.hpp:13604
user_labels_t * user_labels
user-defined labels.
Definition hexrays.hpp:7882
int refcnt
reference count to this object. use cfuncptr_t
Definition hexrays.hpp:7894
bool hexapi get_user_union_selection(ea_t ea, intvec_t *path)
Retrieve a user defined union field selection.
Definition hexrays.hpp:13658
void release()
Definition hexrays.hpp:7914
void hexapi save_user_iflags() const
Save user-defined iflags into the database.
Definition hexrays.hpp:13688
void hexapi refresh_func_ctext()
Refresh ctext after a ctree modification.
Definition hexrays.hpp:13750
void hexapi redirect_gotos(int from, int to)
Redirect all gotos targeting one label to another.
Definition hexrays.hpp:13616
char reserved[]
Definition hexrays.hpp:7909
int hexapi del_orphan_cmts()
Delete all orphan comments.
Definition hexrays.hpp:13652
void hexapi save_user_cmts() const
Save user-defined comments into the database.
Definition hexrays.hpp:13676
mba_t * mba
underlying microcode
Definition hexrays.hpp:7876
void hexapi set_user_cmt(const treeloc_t &loc, const char *cmt)
Set a user defined comment.
Definition hexrays.hpp:13628
ea_t entry_ea
function entry address
Definition hexrays.hpp:7875
bool hexapi find_item_coords(const citem_t *item, int *px, int *py)
Definition hexrays.hpp:13774
cinsn_t body
function body, must be a block
Definition hexrays.hpp:7877
const citem_t *hexapi find_addressable_item(const citem_t *i) const
Find the closest addressable ancestor of an item.
Definition hexrays.hpp:13762
eamap_t &hexapi get_eamap()
Get pointer to ea->insn map.
Definition hexrays.hpp:13732
bool hexapi gather_derefs(const ctree_item_t &ci, udt_type_data_t *udm=nullptr) const
Definition hexrays.hpp:13768
void hexapi verify(allow_unused_labels_t aul, bool even_without_debugger) const
Verify the ctree.
Definition hexrays.hpp:13566
bool hexapi serialize(bytevec_t *vout)
Serialize cfunc into a sequence of bytes.
Definition hexrays.hpp:13780
~cfunc_t()
Definition hexrays.hpp:7913
bool hexapi get_func_type(tinfo_t *type) const
Get the function type.
Definition hexrays.hpp:13584
bool locked() const
Definition hexrays.hpp:8085
void hexapi save_user_numforms() const
Save user-defined number formats into the database.
Definition hexrays.hpp:13682
tinfo_t hexapi get_user_cast(const citem_locator_t &loc) const
Retrieve a user-defined cast.
Definition hexrays.hpp:13706
int32 hexapi get_user_iflags(const citem_locator_t &loc) const
Retrieve citem iflags.
Definition hexrays.hpp:13634
Goto statement.
Definition hexrays.hpp:7097
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:7098
Chain visitor class.
Definition hexrays.hpp:3656
virtual ~chain_visitor_t()
Definition hexrays.hpp:3658
block_chains_t * parent
parent of the current chain
Definition hexrays.hpp:3657
virtual int idaapi visit_chain(int nblock, chain_t &ch)=0
If statement.
Definition hexrays.hpp:7045
cinsn_t * ielse
Else-branch of the if-statement. May be nullptr.
Definition hexrays.hpp:7047
cif_t()
Definition hexrays.hpp:7048
DECLARE_COMPARISONS(cif_t)
void cleanup()
Definition hexrays.hpp:8308
cif_t & operator=(const cif_t &r)
Definition hexrays.hpp:7050
~cif_t()
Definition hexrays.hpp:7053
cif_t(const cif_t &r)
Definition hexrays.hpp:7049
cinsn_t * ithen
Then-branch of the if-statement.
Definition hexrays.hpp:7046
cif_t &hexapi assign(const cif_t &r)
Definition hexrays.hpp:13192
Ctree item: statement.
Definition hexrays.hpp:7121
cdo_t * cdo
details of do-statement
Definition hexrays.hpp:7129
ctry_t * ctry
details of try-statement
Definition hexrays.hpp:7134
bool contains_free_continue() const
Check if the statement has free continue statements.
Definition hexrays.hpp:7212
bool hexapi is_ordinary_flow() const
Check if the statement passes execution to the next statement.
Definition hexrays.hpp:13294
cinsn_t &hexapi assign(const cinsn_t &r)
Definition hexrays.hpp:13246
cinsn_t()
Definition hexrays.hpp:7138
void zero()
Overwrite with zeroes without cleaning memory or deleting children.
Definition hexrays.hpp:7157
cgoto_t * cgoto
details of goto-statement
Definition hexrays.hpp:7132
cif_t * cif
details of if-statement
Definition hexrays.hpp:7126
cexpr_t * cexpr
details of expression-statement
Definition hexrays.hpp:7125
void hexapi print1(qstring *vout, const cfunc_t *func) const
Print the statement into one line.
Definition hexrays.hpp:13288
~cinsn_t()
Definition hexrays.hpp:7144
cif_t &hexapi create_if(cexpr_t *cnd)
Create a new if-statement.
Definition hexrays.hpp:13276
cfor_t * cfor
details of for-statement
Definition hexrays.hpp:7127
cswitch_t * cswitch
details of switch-statement
Definition hexrays.hpp:7130
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:13282
bool hexapi collect_free_continues(cinsnptrvec_t *continues)
Collect free continue statements.
Definition hexrays.hpp:13312
void swap(cinsn_t &r)
Definition hexrays.hpp:7140
const char *hexapi dstr() const
Definition hexrays.hpp:13318
cinsn_t & operator=(const cinsn_t &r)
Definition hexrays.hpp:7141
void hexapi replace_by(cinsn_t *r)
Replace the statement.
Definition hexrays.hpp:13258
DECLARE_COMPARISONS(cinsn_t)
bool hexapi collect_free_breaks(cinsnptrvec_t *breaks)
Collect free break statements.
Definition hexrays.hpp:13306
void hexapi cleanup()
Cleanup the statement.
Definition hexrays.hpp:13264
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:13300
bool contains_free_break() const
Check if the statement has free break statements.
Definition hexrays.hpp:7210
cinsn_t &hexapi new_insn(ea_t insn_ea)
Create a new statement.
Definition hexrays.hpp:13270
cthrow_t * cthrow
details of throw-statement
Definition hexrays.hpp:7135
cwhile_t * cwhile
details of while-statement
Definition hexrays.hpp:7128
creturn_t * creturn
details of return-statement
Definition hexrays.hpp:7131
cblock_t * cblock
details of block-statement
Definition hexrays.hpp:7124
casm_t * casm
details of asm-statement
Definition hexrays.hpp:7133
cinsn_t(const cinsn_t &r)
Definition hexrays.hpp:7139
Ctree item comment.
Definition hexrays.hpp:6651
bool used
the comment has been retrieved?
Definition hexrays.hpp:6652
citem_cmt_t()
Definition hexrays.hpp:6653
citem_cmt_t(const char *s)
Definition hexrays.hpp:6654
Generic ctree item locator.
Definition hexrays.hpp:6663
DECLARE_COMPARISONS(citem_locator_t)
ea_t ea
citem address
Definition hexrays.hpp:6664
ctype_t op
citem operation
Definition hexrays.hpp:6665
citem_locator_t(ea_t _ea, ctype_t _op)
Definition hexrays.hpp:6668
citem_locator_t()=delete
Basic ctree item.
Definition hexrays.hpp:6706
bool hexapi contains_expr(const cexpr_t *e) const
Does the item contain an expression?
Definition hexrays.hpp:13070
ctype_t op
item type
Definition hexrays.hpp:6708
bool is_expr() const
Is an expression?
Definition hexrays.hpp:6725
citem_t(ctype_t o=cot_empty)
Definition hexrays.hpp:6716
citem_t *hexapi find_closest_addr(ea_t _ea)
Definition hexrays.hpp:13088
const citem_t *hexapi find_parent_of(const citem_t *item) const
Find parent of the specified item.
Definition hexrays.hpp:13082
~citem_t()
Definition hexrays.hpp:6739
void print1(qstring *vout, const cfunc_t *func) const
Print item into one line.
Definition hexrays.hpp:8316
bool hexapi contains_label() const
Does the item contain a label?
Definition hexrays.hpp:13076
citem_t * find_parent_of(const citem_t *item)
Definition hexrays.hpp:6735
int label_num
label number.
Definition hexrays.hpp:6709
int index
an index in cfunc_t::treeitems.
Definition hexrays.hpp:6714
void swap(citem_t &r)
Swap two citem_t.
Definition hexrays.hpp:6718
ea_t ea
address that corresponds to the item. may be BADADDR
Definition hexrays.hpp:6707
Base class for loop statements.
Definition hexrays.hpp:7059
void cleanup()
Definition hexrays.hpp:8309
~cloop_t()
Definition hexrays.hpp:7065
cloop_t & operator=(const cloop_t &r)
Definition hexrays.hpp:7063
cloop_t(cinsn_t *b=nullptr)
Definition hexrays.hpp:7061
cinsn_t * body
Definition hexrays.hpp:7060
cloop_t(const cloop_t &r)
Definition hexrays.hpp:7062
cloop_t &hexapi assign(const cloop_t &r)
Definition hexrays.hpp:13204
An immediate number.
Definition hexrays.hpp:6520
uint64 hexapi value(const tinfo_t &type) const
Get value.
Definition hexrays.hpp:13038
cnumber_t(int _opnum=0)
Definition hexrays.hpp:6523
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:13032
HEXRAYS_MEMORY_ALLOCATION_FUNCS() DECLARE_COMPARISONS(cnumber_t)
uint64 _value
its value
Definition hexrays.hpp:6521
number_format_t nf
how to represent it
Definition hexrays.hpp:6522
void hexapi assign(uint64 v, size_t nbytes, type_sign_t sign)
Assign new value.
Definition hexrays.hpp:13046
Return statement.
Definition hexrays.hpp:7091
DECLARE_COMPARISONS(creturn_t)
Switch statement.
Definition hexrays.hpp:7281
cnumber_t mvnf
Maximal switch value and number format.
Definition hexrays.hpp:7282
DECLARE_COMPARISONS(cswitch_t)
ccases_t cases
Switch cases: values and instructions.
Definition hexrays.hpp:7283
Cursor position in the output text (pseudocode).
Definition hexrays.hpp:8678
bool in_ctree(int hdrlines) const
Is the cursor in the variable/type declaration area?
Definition hexrays.hpp:8684
int lnnum
Line number.
Definition hexrays.hpp:8679
int y
y coordinate of the cursor within the window
Definition hexrays.hpp:8681
ctext_position_t(int _lnnum=-1, int _x=0, int _y=0)
Definition hexrays.hpp:8694
int x
x coordinate of the cursor within the window
Definition hexrays.hpp:8680
DECLARE_COMPARISONS(ctext_position_t)
Comparison operators.
Definition hexrays.hpp:8686
Throw statement.
Definition hexrays.hpp:7379
DECLARE_COMPARISONS(cthrow_t)
Invisible COLOR_ADDR tags in the output text are used to refer to ctree items and variables.
Definition hexrays.hpp:7561
uval_t value
Definition hexrays.hpp:7562
int get_index() const
Definition hexrays.hpp:7569
bool is_citem_anchor() const
Definition hexrays.hpp:7572
bool is_lvar_anchor() const
Definition hexrays.hpp:7573
item_preciser_t get_itp() const
Definition hexrays.hpp:7570
bool is_valid_anchor() const
Definition hexrays.hpp:7571
bool is_blkcmt_anchor() const
Definition hexrays.hpp:7575
bool is_itp_anchor() const
Definition hexrays.hpp:7574
Cursor item.
Definition hexrays.hpp:7591
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:13402
const char *hexapi dstr() const
Definition hexrays.hpp:13440
lvar_t * l
VDI_LVAR: Local variable.
Definition hexrays.hpp:7598
citem_t * it
Definition hexrays.hpp:7595
int hexapi get_edm(tinfo_t *parent) const
Get type of an enum member.
Definition hexrays.hpp:13408
ea_t hexapi get_ea() const
Get address of the current item.
Definition hexrays.hpp:13420
cinsn_t * i
VDI_EXPR: Statement.
Definition hexrays.hpp:7597
int hexapi get_label_num(int gln_flags) const
Get label number of the current item.
Definition hexrays.hpp:13428
cursor_item_type_t citype
Item type.
Definition hexrays.hpp:7592
cfunc_t * f
VDI_FUNC: Function.
Definition hexrays.hpp:7599
treeloc_t loc
VDI_TAIL: Line tail.
Definition hexrays.hpp:7600
lvar_t *hexapi get_lvar() const
Get pointer to local variable.
Definition hexrays.hpp:13414
void hexapi print(qstring *vout) const
Definition hexrays.hpp:13434
cexpr_t * e
VDI_EXPR: Expression.
Definition hexrays.hpp:7596
bool is_citem() const
Is the current item is a ctree item?
Definition hexrays.hpp:7655
void verify(const mba_t *mba) const
bool hexapi recalc_parent_types()
Recalculate type of parent nodes.
Definition hexrays.hpp:13390
ctree_parentee_t(bool post=false)
Definition hexrays.hpp:7526
virtual ~ctree_visitor_t()
Definition hexrays.hpp:7448
void set_restart()
Restart the travesal. Meaningful only in apply_to_exprs()
Definition hexrays.hpp:7434
void clr_prune()
Do not prune children. This is an internal function, no need to call it.
Definition hexrays.hpp:7432
parents_t parents
Vector of parents of the current item.
Definition hexrays.hpp:7438
ctree_visitor_t(int _flags)
Constructor.
Definition hexrays.hpp:7446
bool maintain_parents() const
Should the parent information by maintained?
Definition hexrays.hpp:7419
int hexapi apply_to(citem_t *item, citem_t *parent)
Traverse ctree.
Definition hexrays.hpp:13378
cexpr_t * parent_expr()
Get parent of the current item as an expression.
Definition hexrays.hpp:7472
bool is_postorder() const
Should the leave...() functions be called?
Definition hexrays.hpp:7425
bool must_restart() const
Should the traversal restart?
Definition hexrays.hpp:7423
void clr_restart()
Do not restart. This is an internal function, no need to call it.
Definition hexrays.hpp:7436
bool only_insns() const
Should all expressions be automatically pruned?
Definition hexrays.hpp:7427
cblock_posvec_t bposvec
Vector of block positions.
Definition hexrays.hpp:7439
cinsn_t * parent_insn()
Get parent of the current item as a statement.
Definition hexrays.hpp:7479
void prune_now()
Prune children.
Definition hexrays.hpp:7430
virtual int idaapi visit_insn(cinsn_t *)
Visit a statement.
Definition hexrays.hpp:7494
int cv_flags
Ctree visitor property bits
Definition hexrays.hpp:7403
virtual int idaapi visit_expr(cexpr_t *)
Visit an expression.
Definition hexrays.hpp:7502
bool must_prune() const
Should the traversal skip the children of the current item?
Definition hexrays.hpp:7421
virtual int idaapi leave_expr(cexpr_t *)
Visit an expression after having visited its children.
Definition hexrays.hpp:7518
citem_t * parent_item()
Get parent of the current item as an item (statement or expression)
Definition hexrays.hpp:7466
virtual int idaapi leave_insn(cinsn_t *)
Visit a statement after having visited its children.
Definition hexrays.hpp:7510
int hexapi apply_to_exprs(citem_t *item, citem_t *parent)
Traverse only expressions.
Definition hexrays.hpp:13384
C++ Try statement.
Definition hexrays.hpp:7330
size_t new_state
new state number (internal, MSVC related)
Definition hexrays.hpp:7334
void print(const citem_t *parent, int indent, vc_printer_t &vp) const
bool is_synchronized_block() const
Is a synchronized block?
Definition hexrays.hpp:7371
ccatchvec_t catchs
"catch all" or "finally" if present, must be the last element.
Definition hexrays.hpp:7331
bool is_wind() const
Is C++ wind statement?
Definition hexrays.hpp:7358
int flags
Definition hexrays.hpp:7336
size_t old_state
old state number (internal, MSVC related)
Definition hexrays.hpp:7333
DECLARE_COMPARISONS(ctry_t)
While-loop.
Definition hexrays.hpp:7079
DECLARE_COMPARISONS(cwhile_t)
Ranges to decompile. Either a function or an explicit vector of ranges.
Definition hexrays.hpp:4997
rangevec_t ranges
snippet mode: ranges to decompile.
Definition hexrays.hpp:4999
ea_t func_ea
function to decompile. if not BADADDR, then function mode.
Definition hexrays.hpp:4998
decomp_ranges_t(const rangevec_t &r)
Definition hexrays.hpp:5002
bool is_fragmented() const
Definition hexrays.hpp:5008
bool is_snippet() const
Definition hexrays.hpp:5006
bool empty() const
Definition hexrays.hpp:5004
ea_t start() const
Definition hexrays.hpp:5003
void clear()
Definition hexrays.hpp:5005
bool hexapi range_contains(ea_t ea) const
Definition hexrays.hpp:12572
decomp_ranges_t(ea_t _func_ea=BADADDR)
Definition hexrays.hpp:5001
Definition hexrays.hpp:10658
bool operator==(const eamap_iterator_t &p) const
Definition hexrays.hpp:10660
iterator_word x
Definition hexrays.hpp:10659
bool operator!=(const eamap_iterator_t &p) const
Definition hexrays.hpp:10661
Edge connecting two graph nodes.
Definition gdl.hpp:95
Definition gdl.hpp:109
Helper class to convert binary data structures into text and put into a file.
Definition hexrays.hpp:945
const char override
Definition hexrays.hpp:953
FILE * fp
Output file pointer.
Definition hexrays.hpp:946
file_printer_t(FILE *_fp)
Constructor.
Definition hexrays.hpp:955
const char * format
Definition hexrays.hpp:953
AS_PRINTF(3, 4) int hexapi print(int indent
Print.
Floating point constant.
Definition hexrays.hpp:2548
int calc_max_exp() const
Definition hexrays.hpp:2560
void hexapi print(qstring *vout) const
Definition hexrays.hpp:11838
bool is_nan() const
Definition hexrays.hpp:2566
fpvalue_t fnum
Internal representation of the number.
Definition hexrays.hpp:2549
HEXRAYS_MEMORY_ALLOCATION_FUNCS() DECLARE_COMPARISONS(fnumber_t)
Definition hexrays.hpp:2555
const char *hexapi dstr() const
Definition hexrays.hpp:11844
int nbytes
Original size of the constant in bytes.
Definition hexrays.hpp:2550
Processor-independent representation of a floating point value.
Definition ieee.h:98
Result of get_current_operand()
Definition hexrays.hpp:6266
int regnum
if register, the register id
Definition hexrays.hpp:6271
vivl_t cvt_to_ivl() const
Convert operand info to VIVL.
Definition hexrays.hpp:6293
int flags
Definition hexrays.hpp:6274
qstring name
register or stkvar name
Definition hexrays.hpp:6267
bool is_def() const
Definition hexrays.hpp:6281
bool hexapi append_to_list(mlist_t *list, const mba_t *mba) const
Append operand info to LIST.
Definition hexrays.hpp:12984
bool is_use() const
Definition hexrays.hpp:6280
sval_t stkoff
if stkvar, stack offset
Definition hexrays.hpp:6270
bool is_reg() const
Definition hexrays.hpp:6279
int size
operand size
Definition hexrays.hpp:6273
Exception object: decompiler failure information.
Definition hexrays.hpp:564
hexrays_failure_t(merror_t c, ea_t ea, const qstring &buf)
Definition hexrays.hpp:570
hexrays_failure_t()
Definition hexrays.hpp:568
hexrays_failure_t(merror_t c, ea_t ea, const char *buf=nullptr)
Definition hexrays.hpp:569
qstring hexapi desc() const
Definition hexrays.hpp:11087
qstring str
string information
Definition hexrays.hpp:567
merror_t code
Microcode error code
Definition hexrays.hpp:565
ea_t errea
associated address
Definition hexrays.hpp:566
Warning instances.
Definition hexrays.hpp:4854
ea_t ea
Address where the warning occurred.
Definition hexrays.hpp:4855
qstring text
Fully formatted text of the warning.
Definition hexrays.hpp:4857
warnid_t id
Warning id.
Definition hexrays.hpp:4856
DECLARE_COMPARISONS(hexwarn_t)
Definition hexrays.hpp:4858
ea_t curr_ea
Current address.
Definition hexrays.hpp:8704
ea_t func_ea
The entry address of the decompiled function.
Definition hexrays.hpp:8703
ea_t end
BADADDR-decompile a function; otherwise end of the range.
Definition hexrays.hpp:8705
history_item_t(ea_t fea=BADADDR, ea_t cea=BADADDR, int _lnnum=-1, int _x=0, int _y=0)
Definition hexrays.hpp:8706
history_item_t(ea_t fea, ea_t cea, const ctext_position_t &p)
Definition hexrays.hpp:8708
Definition hexrays.hpp:1927
bool extend_to_cover(const ivl_t &r)
Definition hexrays.hpp:1941
void print(qstring *vout) const
void intersect(const ivl_t &r)
Definition hexrays.hpp:1959
uint64 end() const
Definition hexrays.hpp:1935
bool overlap(const ivl_t &ivl) const
Definition hexrays.hpp:1977
bool valid() const
Definition hexrays.hpp:1934
uint64 last() const
Definition hexrays.hpp:1936
DEFINE_MEMORY_ALLOCATION_FUNCS() static ivl_t allmem()
Definition hexrays.hpp:1993
uint64 off
Definition hexrays.hpp:1929
ivl_t(uint64 _off=0, uint64 _size=0)
Definition hexrays.hpp:1932
DECLARE_COMPARISONS(ivl_t)
void clear()
Definition hexrays.hpp:1937
bool contains(uint64 off2) const
Definition hexrays.hpp:1987
bool empty() const
Definition hexrays.hpp:1933
uint64 size
Definition hexrays.hpp:1930
bool includes(const ivl_t &ivl) const
Definition hexrays.hpp:1982
const char *hexapi dstr() const
Definition hexrays.hpp:11594
Definition hexrays.hpp:2001
const char * whole
Definition hexrays.hpp:2003
const char * part
Definition hexrays.hpp:2004
ivl_t ivl
Definition hexrays.hpp:2002
ivl_with_name_t()
Definition hexrays.hpp:2005
Definition hexrays.hpp:2011
virtual int visit_ivl(const ivl_t &ivl)=0
Local variable locator.
Definition hexrays.hpp:1179
bool is_reg2() const
Is variable located on two registers?
Definition hexrays.hpp:1199
bool is_reg1() const
Is variable located on one register?
Definition hexrays.hpp:1197
const scattered_aloc_t & get_scattered() const
Get information about scattered variable.
Definition hexrays.hpp:1211
HEXRAYS_MEMORY_ALLOCATION_FUNCS() const char *hexapi dstr() const
ea_t defea
Definition address.
Definition hexrays.hpp:1181
bool is_scattered() const
Is variable scattered?
Definition hexrays.hpp:1205
scattered_aloc_t & get_scattered()
Definition hexrays.hpp:1212
sval_t get_stkoff() const
Get offset of the varialbe in the stack frame.
Definition hexrays.hpp:1192
bool is_stk_var() const
Is variable located on the stack?
Definition hexrays.hpp:1203
bool is_reg_var() const
Is variable located on register(s)?
Definition hexrays.hpp:1201
mreg_t get_reg2() const
Get the number of the second register (works only for ALOC_REG2 lvars)
Definition hexrays.hpp:1209
vdloc_t location
Variable location.
Definition hexrays.hpp:1180
mreg_t get_reg1() const
Get the register number of the variable.
Definition hexrays.hpp:1207
DECLARE_COMPARISONS(lvar_locator_t)
lvar_locator_t(const vdloc_t &loc, ea_t ea)
Definition hexrays.hpp:1186
lvar_locator_t()
Definition hexrays.hpp:1185
Definition hexrays.hpp:9895
bool operator==(const lvar_mapping_iterator_t &p) const
Definition hexrays.hpp:9897
iterator_word x
Definition hexrays.hpp:9896
bool operator!=(const lvar_mapping_iterator_t &p) const
Definition hexrays.hpp:9898
Reference to a local variable. Used by mop_l.
Definition hexrays.hpp:2428
lvar_ref_t(mba_t *m, int i, sval_t o=0)
Definition hexrays.hpp:2439
HEXRAYS_MEMORY_ALLOCATION_FUNCS() void swap(lvar_ref_t &r)
Definition hexrays.hpp:2448
int idx
index into mba->vars
Definition hexrays.hpp:2438
mba_t *const mba
Pointer to the parent mba_t object.
Definition hexrays.hpp:2436
lvar_t &hexapi var() const
Retrieve the referenced variable.
Definition hexrays.hpp:11820
sval_t off
offset from the beginning of the variable
Definition hexrays.hpp:2437
lvar_ref_t & operator=(const lvar_ref_t &r)
Definition hexrays.hpp:2441
lvar_ref_t(const lvar_ref_t &r)
Definition hexrays.hpp:2440
DECLARE_COMPARISONS(lvar_ref_t)
Saved user settings for local variables: name, type, comment.
Definition hexrays.hpp:1510
bool is_nomap_lvar() const
Definition hexrays.hpp:1561
void set_keep()
Definition hexrays.hpp:1554
void clr_nomap_lvar()
Definition hexrays.hpp:1563
ssize_t size
Type size (if not initialized then -1)
Definition hexrays.hpp:1515
bool operator!=(const lvar_saved_info_t &r) const
Definition hexrays.hpp:1551
bool is_kept() const
Definition hexrays.hpp:1552
void clr_unused_lvar()
Definition hexrays.hpp:1566
qstring cmt
Comment.
Definition hexrays.hpp:1514
void clr_noprop_lvar()
Definition hexrays.hpp:1569
bool is_split_lvar() const
Definition hexrays.hpp:1555
void set_noptr_lvar()
Definition hexrays.hpp:1559
bool is_noptr_lvar() const
Definition hexrays.hpp:1558
void set_unused_lvar()
Definition hexrays.hpp:1565
bool operator==(const lvar_saved_info_t &r) const
Definition hexrays.hpp:1544
void set_noprop_lvar()
Definition hexrays.hpp:1568
tinfo_t type
Type.
Definition hexrays.hpp:1513
void clr_noptr_lvar()
Definition hexrays.hpp:1560
bool is_noprop_lvar() const
Definition hexrays.hpp:1567
lvar_locator_t ll
Variable locator.
Definition hexrays.hpp:1511
void clr_split_lvar()
Definition hexrays.hpp:1557
bool has_info() const
Definition hexrays.hpp:1534
void set_split_lvar()
Definition hexrays.hpp:1556
uint32 flags
saved user lvar info property bits
Definition hexrays.hpp:1516
bool is_unused_lvar() const
Definition hexrays.hpp:1564
void set_nomap_lvar()
Definition hexrays.hpp:1562
qstring name
Name.
Definition hexrays.hpp:1512
void clear_keep()
Definition hexrays.hpp:1553
All user-defined information about local variables.
Definition hexrays.hpp:1579
void swap(lvar_uservec_t &r)
Definition hexrays.hpp:1599
void clear()
Definition hexrays.hpp:1606
int ulv_flags
Various flags. Possible values are from lvar_uservec_t property bits.
Definition hexrays.hpp:1597
uval_t stkoff_delta
Delta to add to IDA stack offset to calculate Hex-Rays stack offsets.
Definition hexrays.hpp:1589
lvar_mapping_t lmaps
Local variable mapping (used for merging variables)
Definition hexrays.hpp:1585
lvar_saved_infos_t lvvec
User-specified names, types, comments for lvars.
Definition hexrays.hpp:1582
bool empty() const
Definition hexrays.hpp:1613
lvar_saved_info_t * find_info(const lvar_locator_t &vloc)
find saved user settings for given var
Definition hexrays.hpp:1622
void keep_info(const lvar_t &v)
Preserve user settings for given var.
Definition hexrays.hpp:1633
Ranges to decompile.
Definition hexrays.hpp:4974
mba_ranges_t(func_t *_pfn=nullptr)
Definition hexrays.hpp:4978
bool is_fragmented() const
Definition hexrays.hpp:4985
void clear()
Definition hexrays.hpp:4982
ea_t start() const
Definition hexrays.hpp:4980
bool empty() const
Definition hexrays.hpp:4981
bool hexapi range_contains(ea_t ea) const
Definition hexrays.hpp:12566
bool is_snippet() const
Definition hexrays.hpp:4983
mba_ranges_t(const rangevec_t &r)
Definition hexrays.hpp:4979
rangevec_t ranges
snippet mode: ranges to decompile.
Definition hexrays.hpp:4976
func_t * pfn
function to decompile. if not null, then function mode.
Definition hexrays.hpp:4975
Generic microcode generator class.
Definition hexrays.hpp:1790
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:1791
Microinstruction locator.
Definition hexrays.hpp:4893
int serial
serial number, in case the ea/mcode are ambiguous
Definition hexrays.hpp:4897
int blknum
block number of the minsn
Definition hexrays.hpp:4898
DECLARE_COMPARISONS(minsn_locator_t)
Definition hexrays.hpp:4901
ea_t ea
address of the minsn
Definition hexrays.hpp:4895
mcode_t mcode
opcode of the minsn
Definition hexrays.hpp:4896
minsn_locator_t(ea_t _ea=BADADDR, mcode_t _mcode=m_nop, int _serial=0, int _blknum=-1)
Definition hexrays.hpp:4899
Micro instruction visitor.
Definition hexrays.hpp:2349
virtual int idaapi visit_minsn()=0
minsn_visitor_t(mba_t *_mba=nullptr, mblock_t *_blk=nullptr, minsn_t *_topins=nullptr)
Definition hexrays.hpp:2350
Definition hexrays.hpp:2387
virtual int idaapi visit_mop(mop_t *op)=0
minsn_t * curins
Definition hexrays.hpp:2389
bool prune
Should skip sub-operands of the current operand?
Definition hexrays.hpp:2394
mlist_t * list
Definition hexrays.hpp:2391
minsn_t * topins
Definition hexrays.hpp:2388
bool changed
Definition hexrays.hpp:2390
HEXRAYS_MEMORY_ALLOCATION_FUNCS() virtual ~mlist_mop_visitor_t()
Definition hexrays.hpp:2396
Definition hexrays.hpp:2102
bool add(mreg_t r, int size)
Definition hexrays.hpp:2112
bool add(const rlist_t &r)
Definition hexrays.hpp:2113
const char *hexapi dstr() const
Definition hexrays.hpp:11716
bool has_any(mreg_t r, int size) const
Definition hexrays.hpp:2138
void clear()
Definition hexrays.hpp:2135
bool intersect(const mlist_t &lst)
Definition hexrays.hpp:2143
bool add(const mlist_t &lst)
Definition hexrays.hpp:2115
DECLARE_COMPARISONS(mlist_t)
bool sub(const mlist_t &lst)
Definition hexrays.hpp:2124
rlist_t reg
Definition hexrays.hpp:2103
mlist_t(const ivl_t &ivl)
Definition hexrays.hpp:2107
bool has_memory() const
Definition hexrays.hpp:2139
bool sub(mreg_t r, int size)
Definition hexrays.hpp:2122
bool includes(const mlist_t &lst) const
Definition hexrays.hpp:2142
ivlset_t mem
Definition hexrays.hpp:2104
bool sub(const ivl_t &ivl)
Definition hexrays.hpp:2123
bool hexapi addmem(ea_t ea, asize_t size)
Definition hexrays.hpp:11704
bool is_subset_of(const mlist_t &lst) const
Definition hexrays.hpp:2150
mlist_t()
Definition hexrays.hpp:2106
asize_t count() const
Definition hexrays.hpp:2131
bool add(const ivl_t &ivl)
Definition hexrays.hpp:2114
void swap(mlist_t &r)
Definition hexrays.hpp:2110
bool has_all(mreg_t r, int size) const
Definition hexrays.hpp:2137
bool has_allmem() const
Definition hexrays.hpp:2140
bool empty() const
Definition hexrays.hpp:2134
void hexapi print(qstring *vout) const
Definition hexrays.hpp:11710
bool has(mreg_t r) const
Definition hexrays.hpp:2136
bool has_common(const mlist_t &lst) const
Definition hexrays.hpp:2141
mlist_t(mreg_t r, int size)
Definition hexrays.hpp:2108
An integer constant.
Definition hexrays.hpp:2522
uint64 org_value
Definition hexrays.hpp:2524
void update_value(uint64 val64)
Definition hexrays.hpp:2537
mnumber_t(uint64 v, ea_t _ea=BADADDR, int n=0)
Definition hexrays.hpp:2525
uint64 value
Definition hexrays.hpp:2523
HEXRAYS_MEMORY_ALLOCATION_FUNCS() DECLARE_COMPARISONS(mnumber_t)
Definition hexrays.hpp:2527
Micro operand visitor.
Definition hexrays.hpp:2362
mop_visitor_t(mba_t *_mba=nullptr, mblock_t *_blk=nullptr, minsn_t *_topins=nullptr)
Definition hexrays.hpp:2367
bool prune
Should skip sub-operands of the current operand?
Definition hexrays.hpp:2365
virtual int idaapi visit_mop(mop_t *op, const tinfo_t *type, bool is_target)=0
Number representation.
Definition hexrays.hpp:848
bool is_char() const
Is a character constant?
Definition hexrays.hpp:886
qstring type_name
for stroffs: structure for offsetof() for enums: enum name
Definition hexrays.hpp:866
number_format_t(int _opnum=0)
Contructor.
Definition hexrays.hpp:870
char opnum
operand number: 0..UA_MAXOP
Definition hexrays.hpp:850
bool is_stroff() const
Is a structure field offset?
Definition hexrays.hpp:888
bool has_unmutable_type() const
Definition hexrays.hpp:903
bool is_hex() const
Is a hexadecimal number?
Definition hexrays.hpp:878
bool is_numop() const
Is a number?
Definition hexrays.hpp:890
char props
properties: combination of NF_ bits (Number format property bits)
Definition hexrays.hpp:851
bool is_oct() const
Is a octal number?
Definition hexrays.hpp:882
flags_t flags32
low 32-bit of flags (for compatibility)
Definition hexrays.hpp:849
char org_nbytes
original number size in bytes
Definition hexrays.hpp:865
uchar serial
for enums: constant serial number
Definition hexrays.hpp:864
bool is_dec() const
Is a decimal number?
Definition hexrays.hpp:880
flags64_t flags
ida flags, which describe number radix, enum, etc
Definition hexrays.hpp:868
bool is_enum() const
Is a symbolic constant?
Definition hexrays.hpp:884
bool is_fixed() const
Is number representation fixed?
Definition hexrays.hpp:876
int get_radix() const
Get number radix.
Definition hexrays.hpp:873
bool needs_to_be_inverted() const
Does the number need to be negated or bitwise negated?
Definition hexrays.hpp:893
The context info used by visitors.
Definition hexrays.hpp:2329
op_parent_info_t(mba_t *_mba=nullptr, mblock_t *_blk=nullptr, minsn_t *_topins=nullptr)
Definition hexrays.hpp:2335
mblock_t * blk
Definition hexrays.hpp:2331
virtual ~op_parent_info_t()
Definition hexrays.hpp:2340
minsn_t * topins
Definition hexrays.hpp:2332
minsn_t * curins
Definition hexrays.hpp:2333
mba_t * mba
Definition hexrays.hpp:2330
HEXRAYS_MEMORY_ALLOCATION_FUNCS() bool really_alloc() const
Operand locator.
Definition hexrays.hpp:832
ea_t ea
address of the original processor instruction
Definition hexrays.hpp:837
operand_locator_t(ea_t _ea, int _opnum)
Definition hexrays.hpp:839
DECLARE_COMPARISONS(operand_locator_t)
int opnum
operand number in the instruction
Definition hexrays.hpp:838
User defined callback to optimize microcode blocks.
Definition hexrays.hpp:2232
virtual ~optblock_t()
Definition hexrays.hpp:2233
virtual int idaapi func(mblock_t *blk)=0
Optimize a block.
User defined callback to optimize individual microcode instructions.
Definition hexrays.hpp:2200
virtual ~optinsn_t()
Definition hexrays.hpp:2201
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:960
AS_PRINTF(3, 4) int hexapi print(int indent
Print.
const char * format
Definition hexrays.hpp:972
const char override
Definition hexrays.hpp:972
bool with_tags
Generate output with color tags.
Definition hexrays.hpp:961
qstring & s
Reference to the output string.
Definition hexrays.hpp:962
qstring_printer_t(const cfunc_t *f, qstring &_s, bool tags)
Constructor.
Definition hexrays.hpp:964
Chunk iterator of arbitrary rangevec items.
Definition hexrays.hpp:5111
const range_t & chunk() const
Definition hexrays.hpp:5116
const range_t * rptr
Definition hexrays.hpp:5112
const range_t * rend
Definition hexrays.hpp:5113
bool next()
Definition hexrays.hpp:5115
bool set(const rangevec_t &r)
Definition hexrays.hpp:5114
Item iterator of arbitrary rangevec items.
Definition hexrays.hpp:5019
ea_t cur
Definition hexrays.hpp:5022
const rangevec_t * ranges
Definition hexrays.hpp:5020
bool set(const rangevec_t &r)
ea_t current() const
Definition hexrays.hpp:5025
const range_t * rptr
Definition hexrays.hpp:5021
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:2488
scif_t(mba_t *_mba, tinfo_t *tif, qstring *n=nullptr)
Definition hexrays.hpp:2505
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:2503
mba_t * mba
Pointer to the parent mba_t object.
Definition hexrays.hpp:2494
qstring name
Usually scattered operands are created from a function prototype, which has the name information.
Definition hexrays.hpp:2499
Scattered mop: visit each of the scattered locations as a separate mop.
Definition hexrays.hpp:2378
virtual int idaapi visit_scif_mop(const mop_t &r, int off)=0
HEXRAYS_MEMORY_ALLOCATION_FUNCS() virtual ~scif_visitor_t()
Definition hexrays.hpp:2379
Definition frame.hpp:59
Reference to a stack variable. Used for mop_S.
Definition hexrays.hpp:2460
sval_t off
Offset to the stack variable from the bottom of the stack frame.
Definition hexrays.hpp:2469
mba_t *const mba
Pointer to the parent mba_t object.
Definition hexrays.hpp:2464
ssize_t hexapi get_stkvar(udm_t *udm=nullptr, uval_t *p_idaoff=nullptr) const
Retrieve the referenced stack variable.
Definition hexrays.hpp:11832
HEXRAYS_MEMORY_ALLOCATION_FUNCS() void swap(stkvar_ref_t &r)
Definition hexrays.hpp:2473
stkvar_ref_t(mba_t *m, sval_t o)
Definition hexrays.hpp:2471
DECLARE_COMPARISONS(stkvar_ref_t)
Information about a switch statement.
Definition nalt.hpp:699
Ctree location. Used to denote comment locations.
Definition hexrays.hpp:6621
ea_t ea
Definition hexrays.hpp:6622
item_preciser_t itp
Definition hexrays.hpp:6623
Definition hexrays.hpp:10004
bool operator==(const udcall_map_iterator_t &p) const
Definition hexrays.hpp:10006
iterator_word x
Definition hexrays.hpp:10005
bool operator!=(const udcall_map_iterator_t &p) const
Definition hexrays.hpp:10007
User-defined function calls.
Definition hexrays.hpp:1731
qstring name
Definition hexrays.hpp:1732
DECLARE_COMPARISONS(udcall_t)
Definition hexrays.hpp:1734
tinfo_t tif
Definition hexrays.hpp:1733
bool empty() const
Definition hexrays.hpp:1742
An object to represent struct or union members.
Definition typeinf.hpp:5393
Definition typeinf.hpp:5528
Callback to apply the selection.
Definition hexrays.hpp:9064
virtual ~ui_stroff_applicator_t()
Definition hexrays.hpp:9065
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:9049
uval_t offset
operand offset, will be used when calculating the UDT path
Definition hexrays.hpp:9051
bool operator==(const ui_stroff_op_t &r) const
Definition hexrays.hpp:9052
qstring text
any text for the column "Operand" of widget
Definition hexrays.hpp:9050
bool operator!=(const ui_stroff_op_t &r) const
Definition hexrays.hpp:9056
Definition hexrays.hpp:10331
iterator_word x
Definition hexrays.hpp:10332
bool operator!=(const user_casts_iterator_t &p) const
Definition hexrays.hpp:10334
bool operator==(const user_casts_iterator_t &p) const
Definition hexrays.hpp:10333
Definition hexrays.hpp:10113
bool operator==(const user_cmts_iterator_t &p) const
Definition hexrays.hpp:10115
bool operator!=(const user_cmts_iterator_t &p) const
Definition hexrays.hpp:10116
iterator_word x
Definition hexrays.hpp:10114
Definition hexrays.hpp:10222
iterator_word x
Definition hexrays.hpp:10223
bool operator!=(const user_iflags_iterator_t &p) const
Definition hexrays.hpp:10225
bool operator==(const user_iflags_iterator_t &p) const
Definition hexrays.hpp:10224
Definition hexrays.hpp:10549
bool operator==(const user_labels_iterator_t &p) const
Definition hexrays.hpp:10551
bool operator!=(const user_labels_iterator_t &p) const
Definition hexrays.hpp:10552
iterator_word x
Definition hexrays.hpp:10550
Helper class to modify saved local variable settings.
Definition hexrays.hpp:1658
virtual ~user_lvar_modifier_t()
Definition hexrays.hpp:1659
virtual bool idaapi modify_lvars(lvar_uservec_t *lvinf)=0
Modify lvar settings.
User-defined microinstruction action.
Definition hexrays.hpp:4926
user_minsn_action_t action
action type
Definition hexrays.hpp:4929
minsn_t ins
instruction to insert (for UMA_INS/UMA_APP)
Definition hexrays.hpp:4928
bool marked_for_addition() const
Does this action add a new instruction?
Definition hexrays.hpp:4931
minsn_locator_t loc
location of the target microinstruction
Definition hexrays.hpp:4927
DECLARE_COMPARISONS(user_minsn_t)
Definition hexrays.hpp:9786
iterator_word x
Definition hexrays.hpp:9787
bool operator!=(const user_numforms_iterator_t &p) const
Definition hexrays.hpp:9789
bool operator==(const user_numforms_iterator_t &p) const
Definition hexrays.hpp:9788
Definition hexrays.hpp:10440
bool operator!=(const user_unions_iterator_t &p) const
Definition hexrays.hpp:10443
bool operator==(const user_unions_iterator_t &p) const
Definition hexrays.hpp:10442
iterator_word x
Definition hexrays.hpp:10441
Reference to a local variable.
Definition hexrays.hpp:6553
lvar_t & getv() const
Definition hexrays.hpp:6556
int idx
index into lvars_t
Definition hexrays.hpp:6555
HEXRAYS_MEMORY_ALLOCATION_FUNCS() DECLARE_COMPARISONS(var_ref_t)
mba_t * mba
pointer to the underlying micro array
Definition hexrays.hpp:6554
Helper class to convert cfunc_t into text.
Definition hexrays.hpp:933
char lastchar
internal: last printed character
Definition hexrays.hpp:935
const cfunc_t * func
cfunc_t to generate text for
Definition hexrays.hpp:934
vc_printer_t(const cfunc_t *f)
Constructor.
Definition hexrays.hpp:937
virtual bool idaapi oneliner() const newapi
Are we generating one-line text representation?
Definition hexrays.hpp:940
Exception object: decompiler exception.
Definition hexrays.hpp:577
vd_failure_t()
Definition hexrays.hpp:579
vd_failure_t(const hexrays_failure_t &_hf)
Definition hexrays.hpp:582
hexrays_failure_t hf
Definition hexrays.hpp:578
~vd_failure_t()
Definition hexrays.hpp:588
vd_failure_t(merror_t code, ea_t ea, const char *buf=nullptr)
Definition hexrays.hpp:580
virtual const char * what() const noexcept override
Definition hexrays.hpp:585
qstring desc() const
Definition hexrays.hpp:583
vd_failure_t(merror_t code, ea_t ea, const qstring &buf)
Definition hexrays.hpp:581
vd_interr_t(ea_t ea, const qstring &buf)
Definition hexrays.hpp:596
vd_interr_t(ea_t ea, const char *buf)
Definition hexrays.hpp:597
Base helper class to convert binary data structures into text.
Definition hexrays.hpp:917
qstring tmpbuf
Definition hexrays.hpp:918
int hdrlines
number of header lines (prototype+typedef+lvars) valid at the end of print process
Definition hexrays.hpp:919
const char * format
Definition hexrays.hpp:927
AS_PRINTF(3, 4) virtual int hexapi print(int indent
Print.
Information about the pseudocode window.
Definition hexrays.hpp:8729
bool visible() const
Is the pseudocode window visible?
Definition hexrays.hpp:8740
bool hexapi rename_label(int label)
Rename a label.
Definition hexrays.hpp:14041
TWidget * ct
pseudocode view
Definition hexrays.hpp:8754
merror_t last_code
result of the last user action. See Microcode error code
Definition hexrays.hpp:8759
bool hexapi collapse_lvars(bool hide)
Collapse/uncollapse local variable declarations.
Definition hexrays.hpp:14119
bool hexapi set_lvar_cmt(lvar_t *v, const char *cmt)
Set local variable comment.
Definition hexrays.hpp:13981
bool hexapi set_global_type(ea_t ea)
Set global item type.
Definition hexrays.hpp:14029
void set_valid(bool v)
Definition hexrays.hpp:8750
bool hexapi ui_noprop_lvar(lvar_t *v)
Forbid variable propagation.
Definition hexrays.hpp:14005
bool hexapi refresh_cpos(input_device_t idv)
Refresh the current position.
Definition hexrays.hpp:13927
bool hexapi set_lvar_type(lvar_t *v, const tinfo_t &type)
Set local variable type.
Definition hexrays.hpp:13963
void hexapi refresh_ctext(bool activate=true)
Refresh pseudocode window.
Definition hexrays.hpp:13897
TWidget * toplevel
Definition hexrays.hpp:8755
ctree_item_t head
First ctree item on the current line (for block comments)
Definition hexrays.hpp:8763
bool hexapi map_lvar(lvar_t *from, lvar_t *to)
Map a local variable to another.
Definition hexrays.hpp:14011
bool hexapi invert_bits()
Bitwise negate a number.
Definition hexrays.hpp:14107
bool hexapi ui_map_lvar(lvar_t *v)
Map a local variable to another.
Definition hexrays.hpp:13987
void hexapi refresh_view(bool redo_mba)
Refresh pseudocode window.
Definition hexrays.hpp:13891
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:13969
int hexapi get_current_label()
Get current label.
Definition hexrays.hpp:13915
bool valid() const
Does the pseudocode window contain valid code?
Definition hexrays.hpp:8743
bool hexapi ui_set_lvar_type(lvar_t *v)
Set local variable type.
Definition hexrays.hpp:13957
void hexapi clear()
Clear the pseudocode window.
Definition hexrays.hpp:13921
bool hexapi ui_rename_lvar(lvar_t *v)
Rename local variable.
Definition hexrays.hpp:13939
ctree_item_t item
Current ctree item.
Definition hexrays.hpp:8764
ctext_position_t cpos
Current ctext position.
Definition hexrays.hpp:8762
bool hexapi invert_sign()
Negate a number.
Definition hexrays.hpp:14101
bool hexapi ui_add_cast(cexpr_t *e)
Add a user-defined cast on the current expression.
Definition hexrays.hpp:13999
void set_visible(bool v)
Definition hexrays.hpp:8749
bool in_ctree() const
Is the current item a statement?
Definition hexrays.hpp:8796
bool hexapi rename_udm(const tinfo_t &udt_type, int udm_idx)
Rename structure field.
Definition hexrays.hpp:14023
bool hexapi edit_cmt(const treeloc_t &loc)
Edit an indented comment.
Definition hexrays.hpp:14065
int view_idx
pseudocode window index (0..)
Definition hexrays.hpp:8753
bool hexapi set_udm_type(const tinfo_t &udt_type, int udm_idx)
Set structure field type.
Definition hexrays.hpp:14017
bool hexapi set_num_radix(int base)
Change number base.
Definition hexrays.hpp:14083
bool hexapi edit_func_cmt()
Edit a function comment.
Definition hexrays.hpp:14071
void hexapi switch_to(cfuncptr_t f, bool activate)
Display the specified pseudocode.
Definition hexrays.hpp:13903
bool hexapi del_orphan_cmts()
Delete all orphan comments.
Definition hexrays.hpp:14077
bool hexapi collapse_item(bool hide)
Collapse/uncollapse item.
Definition hexrays.hpp:14113
mba_t * mba
pointer to underlying microcode
Definition hexrays.hpp:8757
bool hexapi jump_enter(input_device_t idv, int omflags)
Process the Enter key.
Definition hexrays.hpp:14047
bool hexapi split_item(bool split)
Split/unsplit item.
Definition hexrays.hpp:14125
cfuncptr_t cfunc
pointer to function object
Definition hexrays.hpp:8758
bool hexapi rename_global(ea_t ea)
Rename global item.
Definition hexrays.hpp:14035
bool hexapi rename_lvar(lvar_t *v, const char *name, bool is_user_name)
Rename local variable.
Definition hexrays.hpp:13945
int flags
Properties of pseudocode window
Definition hexrays.hpp:8730
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:14059
bool hexapi get_current_item(input_device_t idv)
Get current item.
Definition hexrays.hpp:13933
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:13951
bool hexapi ctree_to_disasm()
Jump to disassembly.
Definition hexrays.hpp:14053
bool hexapi set_num_enum()
Convert number to symbolic constant.
Definition hexrays.hpp:14089
bool hexapi ui_edit_lvar_cmt(lvar_t *v)
Set local variable comment.
Definition hexrays.hpp:13975
ctree_item_t tail
Tail ctree item on the current line (for indented comments)
Definition hexrays.hpp:8765
cnumber_t *hexapi get_number()
Get current number.
Definition hexrays.hpp:13909
bool hexapi ui_unmap_lvar(lvar_t *v)
Unmap a local variable.
Definition hexrays.hpp:13993
bool locked() const
Does the pseudocode window contain valid code?
Definition hexrays.hpp:8748
bool hexapi set_locked(bool v)
Definition hexrays.hpp:13885
bool hexapi set_num_stroff()
Convert number to structure field offset.
Definition hexrays.hpp:14095
Value interval (register or stack range)
Definition hexrays.hpp:3490
DECLARE_COMPARISONS(vivl_t)
Definition hexrays.hpp:3535
uval_t hexapi intersect(const vivl_t &r)
Intersect value intervals the same type.
Definition hexrays.hpp:12146
void set(mopt_t _type, sval_t _off, int _size=0)
Definition hexrays.hpp:3499
void hexapi print(qstring *vout) const
Definition hexrays.hpp:12154
void set(const voff_t &voff, int _size)
Definition hexrays.hpp:3501
vivl_t(mopt_t _type=mop_z, sval_t _off=-1, int _size=0)
Definition hexrays.hpp:3493
bool overlap(const vivl_t &r) const
Do two value intervals overlap?
Definition hexrays.hpp:3515
bool contains(const voff_t &voff2) const
Does our value interval contain the specified value offset?
Definition hexrays.hpp:3528
void set_stkoff(sval_t stkoff, int sz=0)
Definition hexrays.hpp:3503
vivl_t(const class chain_t &ch)
int size
Interval size in bytes.
Definition hexrays.hpp:3491
void set_reg(mreg_t mreg, int sz=0)
Definition hexrays.hpp:3504
bool includes(const vivl_t &r) const
Does our value interval include another?
Definition hexrays.hpp:3521
const char *hexapi dstr() const
Definition hexrays.hpp:12160
bool operator==(const mop_t &mop) const
Definition hexrays.hpp:3540
bool hexapi extend_to_cover(const vivl_t &r)
Extend a value interval using another value interval of the same type.
Definition hexrays.hpp:12140
vivl_t(const mop_t &op)
Definition hexrays.hpp:3496
Value offset (microregister number or stack offset)
Definition hexrays.hpp:3453
mreg_t get_reg() const
Definition hexrays.hpp:3473
sval_t diff(const voff_t &r) const
Definition hexrays.hpp:3478
void set(mopt_t _type, sval_t _off)
Definition hexrays.hpp:3465
void undef()
Definition hexrays.hpp:3468
bool is_stkoff() const
Definition hexrays.hpp:3472
voff_t(const mop_t &op)
Definition hexrays.hpp:3459
sval_t off
register number or stack offset
Definition hexrays.hpp:3454
bool defined() const
Definition hexrays.hpp:3470
void inc(sval_t delta)
Definition hexrays.hpp:3476
DECLARE_COMPARISONS(voff_t)
Definition hexrays.hpp:3480
voff_t add(int width) const
Definition hexrays.hpp:3477
voff_t(mopt_t _type, sval_t _off)
Definition hexrays.hpp:3458
void set_reg(mreg_t mreg)
Definition hexrays.hpp:3467
mopt_t type
mop_r - register, mop_S - stack, mop_z - undefined
Definition hexrays.hpp:3455
sval_t get_stkoff() const
Definition hexrays.hpp:3474
void set_stkoff(sval_t stkoff)
Definition hexrays.hpp:3466
bool is_reg() const
Definition hexrays.hpp:3471
voff_t()
Definition hexrays.hpp:3457
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:2043
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:406