IDA C++ SDK 9.2
Loading...
Searching...
No Matches
kernwin.hpp
Go to the documentation of this file.
1 /*
2 * Interactive disassembler (IDA).
3 * Copyright (c) 1990-2025 Hex-Rays
4 * ALL RIGHTS RESERVED.
5 *
6 */
7
21
22#ifndef __KERNWIN_HPP
23#define __KERNWIN_HPP
24
25#ifndef SWIG
26typedef uchar color_t;
27struct rangevec_t;
28class location_t;
29struct lochist_entry_t;
30struct strwinsetup_t;
31struct renderer_info_t;
32struct segm_move_infos_t;
33struct load_info_t;
34#endif // SWIG
35
52
53
72
73
74enum beep_t
75{
77};
78
79
80// Notify UI about various events. The kernel will call this function
81// when something interesting for the UI happens.
82// The UI should avoid calling the kernel from this callback.
83
84class func_t;
85class segment_t;
86struct sreg_range_t;
87class plugin_t;
88struct plugmod_t;
89struct procmod_t;
90class minsn_t;
91class idc_value_t;
92class linput_t;
93class snapshot_t;
94class tinfo_t;
95struct til_t;
96
105
115
124
125//-------------------------------------------------------------------------
132#define SETMENU_POSMASK 0x3
133#define SETMENU_INS 0x0
134#define SETMENU_APP 0x1
135#define SETMENU_FIRST 0x2
136#define SETMENU_ENSURE_SEP 0x8
138
142#define CREATETB_ADV 0x1
144
145//-------------------------------------------------------------------------
149#define HIF_IDENTIFIER 0x1
150#define HIF_REGISTER 0x2
151#define HIF_LOCKED 0x4
152#define HIF_NOCASE 0x8
153
154 // bits 27-31 reserved
155#define HIF_USE_SLOT (1 << 27)
156#define HIF_SLOT_SHIFT 28
157#define HIF_GET_SLOT(flags) (((flags) >> HIF_SLOT_SHIFT) & 0x7)
158
159 // convenience constants
160 // (not a macro HIF_SLOT(n) because SWIG won't pick it up for IDAPython)
161#define HIF_SLOT_0 (HIF_USE_SLOT | (0 << HIF_SLOT_SHIFT))
162#define HIF_SLOT_1 (HIF_USE_SLOT | (1 << HIF_SLOT_SHIFT))
163#define HIF_SLOT_2 (HIF_USE_SLOT | (2 << HIF_SLOT_SHIFT))
164#define HIF_SLOT_3 (HIF_USE_SLOT | (3 << HIF_SLOT_SHIFT))
165#define HIF_SLOT_4 (HIF_USE_SLOT | (4 << HIF_SLOT_SHIFT))
166#define HIF_SLOT_5 (HIF_USE_SLOT | (5 << HIF_SLOT_SHIFT))
167#define HIF_SLOT_6 (HIF_USE_SLOT | (6 << HIF_SLOT_SHIFT))
168#define HIF_SLOT_7 (HIF_USE_SLOT | (7 << HIF_SLOT_SHIFT))
170
171#define REG_HINTS_MARKER SCOLOR_ON "\x7F"
172#define REG_HINTS_MARKER_LEN 2
173#define SRCDBG_HINTS_MARKER SCOLOR_ON "\x7E"
174#define SRCDBG_HINTS_MARKER_LEN 2
175
176
180#define CDVF_NOLINES 0x0001
181#define CDVF_LINEICONS 0x0002
182#define CDVF_STATUSBAR 0x0004
184
188#define IDCHK_OK 0
189#define IDCHK_ARG -1
190#define IDCHK_KEY -2
191#define IDCHK_MAX -3
193
197#define WCLS_SAVE 0x1
198#define WCLS_NO_CONTEXT 0x2
199#define WCLS_DONT_SAVE_SIZE 0x4
200#define WCLS_DELETE_LATER 0x8
201#define WCLS_CLOSE_LATER WCLS_DELETE_LATER
203
207#define DP_LEFT 0x0001
208#define DP_TOP 0x0002
209#define DP_RIGHT 0x0004
210#define DP_BOTTOM 0x0008
211#define DP_INSIDE 0x0010
212#define DP_TAB 0x0040
215#define DP_BEFORE 0x0020
217#define DP_FLOATING 0x0080
218#define DP_SZHINT 0x0100
222
226#define CDVF_NOLINES 0x0001
227#define CDVF_LINEICONS 0x0002
228#define CDVF_STATUSBAR 0x0004
230
234#define SVF_COPY_LINES 0x0000
235#define SVF_LINES_BYPTR 0x0001
237
241#define CVNF_LAZY (1 << 0)
244#define CVNF_JUMP (1 << 1)
246#define CVNF_ACT (1 << 2)
256//
257#define WOPN_RESTORE 0x00000004u
260#define WOPN_PERSIST 0x00000040u
261#define WOPN_CLOSED_BY_ESC 0x00000080u
262#define WOPN_NOT_CLOSED_BY_ESC 0x00000100u
263#define WOPN_DP_MASK 0x0FFF0000u
264#define WOPN_DP_SHIFT 16
265#define WOPN_DP_LEFT (DP_LEFT << WOPN_DP_SHIFT)
267#define WOPN_DP_TOP (DP_TOP << WOPN_DP_SHIFT)
269#define WOPN_DP_RIGHT (DP_RIGHT << WOPN_DP_SHIFT)
271#define WOPN_DP_BOTTOM (DP_BOTTOM << WOPN_DP_SHIFT)
273#define WOPN_DP_INSIDE (DP_INSIDE << WOPN_DP_SHIFT)
275#define WOPN_DP_TAB (DP_TAB << WOPN_DP_SHIFT)
279#define WOPN_DP_BEFORE (DP_BEFORE << WOPN_DP_SHIFT)
282#define WOPN_DP_FLOATING (DP_FLOATING << WOPN_DP_SHIFT)
284#define WOPN_DP_SZHINT (DP_SZHINT << WOPN_DP_SHIFT)
288#define WOPN_DP_INSIDE_BEFORE (WOPN_DP_INSIDE | WOPN_DP_BEFORE)
289#define WOPN_DP_TAB_BEFORE (WOPN_DP_TAB | WOPN_DP_BEFORE)
290#define WOPN_GET_DP(v) (((v) & WOPN_DP_MASK) >> WOPN_DP_SHIFT)
292
295#define RENADDR_IDA 0
296#define RENADDR_HR 1
301
305#define CVLF_USE_MOUSE 0x1
307
308#ifndef SWIG
312union callui_t
313{
314 bool cnd;
315 char i8;
316 int i;
317 short i16;
318 int32 i32;
319 uchar u8;
320 ushort u16;
339};
340
341//-------------------------------------------------------------------------
348};
349
351/// (See convenience functions like get_screen_ea())
352/// Events marked as 'cb:' are designed to be callbacks and should not
353/// be used in callui(). The user may hook to ::HT_UI events to catch them
357 ui_null = 0,
358
359 ui_range,
363
372
376
377 ui_suspend,
383 ui_resume,
388
395
397
399
401
403
404 ui_saving,
408
417
419
420 ui_refresh,
421
422 ui_choose,
428
430
432
433 ui_setidle,
436
443
444 ui_beep,
445
447
448 ui_msg,
452
458
460
464
466
473 ui_ask_str,
477 ui_ask_seg,
485
487
489
491
493
498 ui_noabort,
512
518
520
525
527
531
533
534 ui_is_idaq,
548
550
552
567
572
579
587
590
593
596
599
601
631
634
642
648
654
656
671
673
682
686
688
690
695
703
707
719
726
728
731
733
735
737
739
740 ui_addons,
744
760
762
774
776
778
785 ui_jumpto,
795
797
799
802
804
806
815
818
821
824
827
830
833
836
839
842
845
856
874
886
889
891
894
897
905
910
913
919
922
925
934
943
957
960
964
973
976
990
996
1001
1002 ui_obsolete_get_custom_viewer_location, // ui_get_custom_viewer_location_2
1003
1008
1015
1019
1022
1030
1036
1039
1042
1044
1050
1062
1070 ui_last,
1071
1203 // trace management
1215 // breakpoint management (new codes were introduced in v6.3)
1227 // calluis for creating traces from scratch (added in 6.4)
1242 // added in 6.6
1246 // added in 6.7
1258 // added in 7.1
1262 // source-level debugging
1270
1291 // added in 7.7
1294 // added in 9.1
1307 // Debugging notifications
1308#ifdef _DEBUG
1310#endif
1313
1314//--------------------------------------------------------------------------
1315
1316
1319
1320idaman callui_t ida_export_data (idaapi*callui)(ui_notification_t what,...);
1321
1322
1328
1329idaman int ida_export init_database(int argc, const char *const *argv, int *newfile);
1330
1331
1334
1335idaman void ida_export term_database();
1336
1337
1339
1340idaman NORETURN AS_PRINTF(1, 0) void ida_export verror(const char *format, va_list va);
1341
1342
1345idaman AS_PRINTF(3, 0) void ida_export vshow_hex(
1346 const void *dataptr,
1347 size_t len,
1348 const char *format,
1349 va_list va);
1350
1351
1353
1354idaman AS_PRINTF(4, 0) void ida_export vshow_hex_file(
1355 linput_t *li,
1357 size_t count,
1358 const char *format,
1359 va_list va);
1360
1361
1362#endif // SWIG
1366inline ssize_t get_kernel_version(char *buf, size_t bufsize)
1367{
1368 return callui(ui_get_kernel_version, buf, bufsize).ssize;
1369}
1370
1371// Return true if this is ida running as library
1372const int64 IDALIB_API_MAGIC = 0x001DA11B00000000LL;
1373inline bool is_ida_library(char *path = nullptr, size_t pathsize = 0, void** handle = nullptr)
1374{
1375 return callui(ui_broadcast, IDALIB_API_MAGIC, path, pathsize, handle).ssize > 0;
1376}
1377
1378//--------------------------------------------------------------------------
1379// K E R N E L S E R V I C E S F O R U I
1380//--------------------------------------------------------------------------
1382// Generating text for the disassembly, enum, and structure windows.
1383
1386
1408class place_t
1409{
1410public:
1411 int lnnum;
1412 place_t() {}
1413 place_t(int ln) : lnnum(ln) {}
1415
1416
1417 /// This description is used on the status bar.
1418 /// \param vout the output buffer
1419 /// \param ud pointer to user-defined context data. Is supplied by ::linearray_t
1420 virtual void idaapi print(qstring *vout, void *ud) const = 0;
1422 /// Map the location to a number.
1423 /// This mapping is used to draw the vertical scrollbar.
1424 /// \param ud pointer to user-defined context data. Is supplied by ::linearray_t
1425 virtual uval_t idaapi touval(void *ud) const = 0;
1426
1429 virtual place_t *idaapi clone() const = 0;
1430
1432 virtual void idaapi copyfrom(const place_t *from) = 0;
1433
1443 virtual place_t *idaapi makeplace(void *ud, uval_t x, int lnnum) const= 0;
1444
1446 virtual int idaapi compare(const place_t *t2) const = 0;
1447
1454 virtual void idaapi adjust(void *ud) = 0;
1459 virtual bool idaapi prev(void *ud) = 0;
1460
1464 virtual bool idaapi next(void *ud) = 0;
1465
1469 virtual bool idaapi beginning(void *ud) const = 0;
1470
1474 virtual bool idaapi ending(void *ud) const = 0;
1475
1485 virtual int idaapi generate(
1486 qstrvec_t *out,
1487 int *out_deflnnum,
1488 color_t *out_pfx_color,
1489 bgcolor_t *out_bgcolor,
1490 void *ud,
1491 int maxsize) const = 0;
1492
1497 virtual void idaapi serialize(bytevec_t *out) const = 0;
1498
1505 virtual bool idaapi deserialize(const uchar **pptr, const uchar *end) = 0;
1509 virtual int idaapi id() const = 0;
1510
1517 virtual const char *idaapi name() const = 0;
1521 virtual ea_t idaapi toea() const { return BADADDR; }
1522
1526 virtual bool idaapi rebase(const segm_move_infos_t & /*infos*/ ) { return true; }
1527
1539 virtual place_t *idaapi enter(uint32 * /*out_flags*/) const { return nullptr; }
1540
1543 virtual void idaapi leave(uint32 /*flags*/) const {}
1544
1556 virtual int idaapi compare2(const place_t *t2, void * /*ud*/) const { return compare(t2); }
1557
1569 virtual bool idaapi equals(const place_t *t2, void *ud) const
1570 {
1571 return compare2(t2, ud) == 0;
1572 }
1573};
1574
1575#define DEFAULT_PLACE_LNNUM -1
1576#define MAX_PLACE_LNNUM INT_MAX
1577
1578/// compare places and their lnnums
1579idaman int ida_export l_compare(const place_t *t1, const place_t *t2);
1580idaman int ida_export l_compare2(const place_t *t1, const place_t *t2, void *ud);
1581idaman bool ida_export l_equals(const place_t *t1, const place_t *t2, void *ud);
1582
1583#ifndef SWIG
1584
1585//--------------------------------------------------------------------------
1587#define define_place_exported_functions(classname) \
1588class classname; \
1589idaman void ida_export classname ## __print(const classname *, qstring *, void*); \
1590idaman uval_t ida_export classname ## __touval(const classname *, void*); \
1591idaman place_t * ida_export classname ## __clone(const classname *); \
1592idaman void ida_export classname ## __copyfrom(classname *, const place_t*); \
1593idaman place_t * ida_export classname ## __makeplace(const classname *, void*, uval_t, int); \
1594idaman int ida_export classname ## __compare(const classname *, const place_t*); \
1595idaman int ida_export classname ## __compare2(const classname *, const place_t*, void*); \
1596idaman bool ida_export classname ## __equals(const classname *, const place_t*, void*); \
1597idaman void ida_export classname ## __adjust(classname *, void*); \
1598idaman bool ida_export classname ## __prev(classname *, void*); \
1599idaman bool ida_export classname ## __next(classname *, void*); \
1600idaman bool ida_export classname ## __beginning(const classname *, void*); \
1601idaman bool ida_export classname ## __ending(const classname *, void*); \
1602idaman int ida_export classname ## __generate( \
1603 const classname *, \
1604 qstrvec_t*, \
1605 int*, \
1606 color_t*, \
1607 bgcolor_t*, \
1608 void*, \
1609 int); \
1610idaman void ida_export classname ## __serialize(const classname *, bytevec_t *out); \
1611idaman bool ida_export classname ## __deserialize(classname *, const uchar **, const uchar *); \
1612idaman int ida_export classname ## __id(const classname *); \
1613idaman const char *ida_export classname ## __name(const classname *); \
1614idaman ea_t ida_export classname ## __toea(const classname *); \
1615idaman place_t * ida_export classname ## __enter(const classname *, uint32 *); \
1616idaman void ida_export classname ## __leave(const classname *, uint32); \
1617idaman bool ida_export classname ## __rebase(classname *, const segm_move_infos_t &);
1618
1619
1621#define define_place_virtual_functions(class) \
1622 virtual void idaapi print(qstring *buf, void *ud) const override \
1623 { class ## __print(this, buf, ud); } \
1624 virtual uval_t idaapi touval(void *ud) const override \
1625 { return class ## __touval(this, ud); } \
1626 virtual place_t *idaapi clone() const override \
1627 { return class ## __clone(this); } \
1628 virtual void idaapi copyfrom(const place_t *from) override \
1629 { class ## __copyfrom(this, from); } \
1630 virtual place_t *idaapi makeplace( \
1631 void *ud, \
1632 uval_t x, \
1633 int _lnnum) const override \
1634 { return class ## __makeplace(this,ud,x,_lnnum); } \
1635 virtual int idaapi compare(const place_t *t2) const override \
1636 { return class ## __compare(this, t2); } \
1637 virtual void idaapi adjust(void *ud) override \
1638 { class ## __adjust(this,ud); } \
1639 virtual bool idaapi prev(void *ud) override \
1640 { return class ## __prev(this,ud); } \
1641 virtual bool idaapi next(void *ud) override \
1642 { return class ## __next(this,ud); } \
1643 virtual bool idaapi beginning(void *ud) const override \
1644 { return class ## __beginning(this,ud); } \
1645 virtual bool idaapi ending(void *ud) const override \
1646 { return class ## __ending(this,ud); } \
1647 virtual int idaapi generate( \
1648 qstrvec_t *_out, \
1649 int *_out_lnnum, \
1650 color_t *_out_pfx_color, \
1651 bgcolor_t *_out_bg_color, \
1652 void *_ud, \
1653 int _max) const override \
1654 { \
1655 return class ## __generate( \
1656 this, _out, _out_lnnum, _out_pfx_color, \
1657 _out_bg_color, _ud, _max); \
1658 } \
1659 virtual void idaapi serialize(bytevec_t *out) const override \
1660 { class ## __serialize(this, out); } \
1661 virtual bool idaapi deserialize( \
1662 const uchar **pptr, \
1663 const uchar *end) override \
1664 { return class ## __deserialize(this, pptr, end); } \
1665 virtual int idaapi id() const override \
1666 { return class ## __id(this); } \
1667 virtual const char * idaapi name() const override \
1668 { return class ## __name(this); } \
1669 virtual ea_t idaapi toea() const override \
1670 { return class ## __toea(this); } \
1671 virtual place_t *idaapi enter(uint32 *out_flags) const override \
1672 { return class ## __enter(this, out_flags); } \
1673 virtual void idaapi leave(uint32 flags) const override \
1674 { return class ## __leave(this, flags); } \
1675 virtual bool idaapi rebase(const segm_move_infos_t &infos) override \
1676 { return class ## __rebase(this, infos); } \
1677 virtual int idaapi compare2(const place_t *t2, void *ud) const override \
1678 { return class ## __compare2(this, t2, ud); } \
1679 virtual bool idaapi equals(const place_t *t2, void *ud) const override \
1680 { return class ## __equals(this, t2, ud); }
1681
1683
1684
1685#endif // SWIG
1686
1687//--------------------------------------------------------------------------
1688
1707
1709struct simpleline_t
1710{
1711 qstring line;
1712 color_t color = 1;
1713 bgcolor_t bgcolor = DEFCOLOR;
1714 simpleline_t() {}
1715 simpleline_t(color_t c, const char *str) : line(str), color(c) {}
1716 simpleline_t(const char *str) : line(str) {}
1717 simpleline_t(const qstring &str) : line(str) {}
1718 DEFINE_MEMORY_ALLOCATION_FUNCS()
1719};
1720
1724
1726class simpleline_place_t : public place_t
1727{
1728public:
1729 uint32 n;
1730 simpleline_place_t() { n = 0; lnnum = 0; }
1731 simpleline_place_t(int _n) { n = _n; lnnum = 0; }
1733};
1736//--------------------------------------------------------------------------
1737// user defined data for linearray_t: use ptr to result of calc_default_idaplace_flags()
1738#ifndef SWIG
1740#endif // SWIG
1741/// A location in a disassembly view
1742class idaplace_t : public place_t
1743{
1744public:
1745 ea_t ea;
1746 idaplace_t() {}
1747 idaplace_t(ea_t x, int ln) : place_t(ln), ea(x) {}
1749};
1750
1751//-------------------------------------------------------------------------
1753#ifndef SWIG
1755struct outctx_base_t;
1756struct hexplace_gen_t;
1757class hexview_t;
1758idaman void ida_export hexplace_t__out_one_item(
1759 const hexplace_t *_this,
1760 outctx_base_t &ctx,
1761 const hexplace_gen_t *hg,
1762 int itemno,
1763 color_t *color,
1764 color_t patch_or_edit);
1765idaman size_t ida_export hexplace_t__ea2str(
1766 char *buf,
1767 size_t bufsize,
1768 const hexplace_gen_t *hg,
1769 ea_t ea);
1770#endif // SWIG
1771
1772#define HEXPLACE_COLOR_EDITED COLOR_SYMBOL
1773#define HEXPLACE_COLOR_PATCHED COLOR_VOIDOP
1774#define HEXPLACE_COLOR_SHOWSPACES COLOR_RESERVED1
1775
1776// A helper, used as 'userdata' for generating lines in a hexplace_t
1777// None of the function pointers can be nullptr
1778struct hexplace_gen_t
1779{
1780 // data format to display
1781 enum data_kind_t
1782 {
1783 dk_float,
1784 dk_int,
1788 enum int_format_t
1789 {
1791 if_signed,
1794 // result of get_byte_value()
1796 {
1797 BK_VALID, // has a valid value
1798 BK_INVALIDADDR, // address is invalid
1799 BK_NOVALUE, // address is valid but contains no value
1802 virtual bool is_editing() const = 0;
1803 virtual bool is_editing_text() const = 0;
1804 virtual bool is_curitem_changed() const = 0;
1805 virtual bool is_edited_byte(ea_t ea, uint64 *out_value=nullptr) const = 0;
1808 uint64 *out_value,
1809 bool *out_edited) const = 0;
1810 virtual void get_encoding(qstring *out) const = 0;
1811 virtual ea_t get_cur_item_ea() const = 0;
1812 virtual void get_cur_item_text(qstring *out) const = 0;
1813 virtual int get_alignment() const = 0;
1814 virtual int get_line_len(ea_t ea) const = 0;
1815 virtual int get_items_per_line() const = 0;
1816 virtual int get_bytes_per_item() const = 0;
1817 virtual int get_item_width(ea_t ea) const = 0;
1818 virtual data_kind_t get_data_kind() const = 0;
1819 virtual int_format_t get_int_format() const = 0;
1820 virtual bool has_central_separator() const = 0;
1821 virtual bool show_text() const = 0;
1822 virtual bool show_segaddr() const = 0;
1823 virtual int get_bitness() const = 0;
1825 bool is_addr_kind() const
1828 return k == dk_addr_names || k == dk_addr_text;
1832//-------------------------------------------------------------------------
1833// class to represent lines in a hex dump window
1834// one line consists of hv->grid.items_per_line items
1835// each item is hv->grid.bytes_per_item bytes for 8-bit bytes or one "wide" byte
1836class hexplace_t : public idaplace_t
1837{
1838protected:
1839 ea_t sol; // EA at start-of-line
1840public:
1841 hexplace_t(ea_t _ea, int ln) : idaplace_t(_ea, ln), sol(_ea) {}
1843
1844 void out_one_item(
1846 const hexplace_gen_t *hg,
1847 int itemno,
1848 color_t *color,
1849 color_t patch_or_edit) const
1851 hexplace_t__out_one_item(this, ctx, hg, itemno, color, patch_or_edit);
1852 }
1854 // convert ea to text
1855 // use seg:off if segment base is not zero
1856 // otherwise print just the address
1857 static size_t ea2str(char *buf, size_t bufsize, const hexplace_gen_t *hg, ea_t ea)
1858 {
1859 return hexplace_t__ea2str(buf, bufsize, hg, ea);
1860 }
1861
1862};
1863
1864//--------------------------------------------------------------------------
1865#ifndef SWIG
1867#endif // SWIG
1868typedef uchar type_t;
1869typedef uval_t uval_t;
1870
1871//-------------------------------------------------------------------------
1872
1873typedef uint64 tif_cursor_t;
1874struct til_type_ref_t;
1875#define TIF_CURSOR_HEADER tif_cursor_t(-2)
1876#define TIF_CURSOR_FOOTER tif_cursor_t(-1)
1877
1878inline bool is_tif_cursor_header(tif_cursor_t c) { return c == TIF_CURSOR_HEADER; }
1879inline bool is_tif_cursor_footer(tif_cursor_t c) { return c == TIF_CURSOR_FOOTER; }
1880inline bool is_tif_cursor_index(tif_cursor_t c) { return c != TIF_CURSOR_HEADER && c != TIF_CURSOR_FOOTER; }
1881
1882//-------------------------------------------------------------------------
1883class tiplace_t : public place_t
1884{
1885public:
1886 uint32 ordinal = 0;
1887 tif_cursor_t cursor = TIF_CURSOR_HEADER;
1890 tiplace_t(uint32 ord, tif_cursor_t c, int _lnnum) : ordinal(ord), cursor(c)
1891 {
1892 lnnum = _lnnum;
1893 }
1894 bool valid_ord() const { return ordinal != 0; }
1895 void reset() { ordinal = 0; cursor = TIF_CURSOR_HEADER; lnnum = 0; }
1897 bool is_header() const { return cursor == TIF_CURSOR_HEADER; }
1898 bool is_footer() const { return cursor == TIF_CURSOR_FOOTER; }
1899 bool is_index() const { return cursor < TIF_CURSOR_HEADER; }
1900
1901 void set_header() { cursor = TIF_CURSOR_HEADER; }
1902 void set_footer() { cursor = TIF_CURSOR_FOOTER; }
1905
1913 virtual uint64 calc_udm_offset(const void *ud, ssize_t *p_udmidx=nullptr, int *p_bitoff=nullptr) const newapi;
1914
1918 virtual void set_index_by_offset(void *ud, uint64 offset) newapi;
1919
1923 virtual type_t get_kind(const void *ud) const newapi;
1924
1929 virtual bool fill_type_ref(til_type_ref_t *out, const void *ud) const newapi;
1930};
1931
1932//-------------------------------------------------------------------------
1933#define PCF_EA_CAPABLE 0x00000001
1934#define PCF_MAKEPLACE_ALLOCATES 0x00000002
1939
1940//-------------------------------------------------------------------------
1941idaman int ida_export internal_register_place_class(
1942 const place_t *tmplate,
1943 int flags,
1944 const plugin_t *owner,
1945 int sdk_version);
1946
1947
1948//-------------------------------------------------------------------------
1962inline int register_place_class(
1963 const place_t *tmplate,
1964 int flags,
1965 const plugin_t *owner)
1966{
1967 return internal_register_place_class(tmplate, flags, owner, IDA_SDK_VERSION);
1968}
1969
1970//-------------------------------------------------------------------------
1971/// Get information about a previously-registered place_t class.
1972/// See also register_place_class().
1973/// \param out_flags output flags (can be nullptr)
1974/// \param out_sdk_version sdk version the place was created with (can be nullptr)
1975/// \param id place class ID
1976/// \return the place_t template, or nullptr if not found
1977idaman const place_t *ida_export get_place_class(
1978 int *out_flags,
1979 int *out_sdk_version,
1980 int id);
1981
1982//-------------------------------------------------------------------------
1984inline const place_t *get_place_class_template(int id)
1985{
1986 return get_place_class(nullptr, nullptr, id);
1987}
1988
1989//-------------------------------------------------------------------------
1991inline bool is_place_class_ea_capable(int id)
1992{
1993 int flags;
1994 if ( get_place_class(&flags, nullptr, id) == nullptr )
1995 return false;
1996 return (flags & PCF_EA_CAPABLE) != 0;
1997}
1998
1999//-------------------------------------------------------------------------
2000/// Get the place class ID for the place that has been registered as 'name'.
2001/// \param name the class name
2002/// \return the place class ID, or -1 if not found
2003idaman int ida_export get_place_class_id(const char *name);
2004
2005#ifndef __UI__
2006 // A TWidget represents any user-facing widget present in IDA.
2007 // E.g., "IDA View-*", "Hex View-*", "Imports", "General registers", ...
2008 class TWidget;
2009#else
2010 #ifdef __QT__
2011 namespace QT
2013 class QWidget;
2014 };
2015 typedef QT::QWidget TWidget;
2016 #else
2017 class TView;
2018 typedef TView TWidget;
2019 #endif
2020#endif
2021
2022//-------------------------------------------------------------------------
2023class sync_source_t
2025 uchar storage[16];
2026
2027 const TWidget **get_widget_ptr_storage() const
2028 {
2029 return (const TWidget **) &storage[sizeof(storage) - sizeof(TWidget *)];
2030 }
2031
2032public:
2033 sync_source_t();
2034 sync_source_t(const TWidget *_view)
2035 {
2036 memset(storage, 0, sizeof(storage));
2037 *get_widget_ptr_storage() = _view;
2038 storage[0] = '\0';
2039 }
2040 sync_source_t(const char *_regname)
2041 {
2042 QASSERT(1716, _regname[0] != '\0');
2043 memset(storage, 0, sizeof(storage));
2044 ::qstrncpy((char *) storage, _regname, sizeof(storage));
2045 }
2046
2047 bool operator==(const sync_source_t &_o) const
2048 {
2049 return memcmp(storage, _o.storage, sizeof(storage)) == 0;
2050 }
2051 bool operator!=(const sync_source_t &_o) const
2052 {
2053 return !((*this) == _o);
2054 }
2055
2056 bool is_register() const { return storage[0] != '\0'; }
2057 bool is_widget() const { return !is_register(); }
2058 const TWidget *get_widget() const
2059 {
2060 QASSERT(1717, is_widget());
2061 return *get_widget_ptr_storage();
2062 }
2063 const char *get_register() const
2064 {
2065 QASSERT(1718, is_register());
2066 return (const char *) storage;
2068};
2069DECLARE_TYPE_AS_MOVABLE(sync_source_t);
2070CASSERT(sizeof(sync_source_t) == 16);
2071typedef qvector<sync_source_t> sync_source_vec_t;
2073struct synced_group_t : public sync_source_vec_t
2074{
2075 bool has_widget(const TWidget *v) const { return has(sync_source_t((TWidget *) v)); }
2076 bool has_register(const char *r) const { return has(sync_source_t(r)); }
2077 bool has(const sync_source_t &ss) const { return find(ss) != end(); }
2080//-------------------------------------------------------------------------
2082/// with another place type, to be used with the view 'view'. Typically
2083/// used when views are synchronized.
2084/// The 'renderer_info_t' part of 'dst' will be pre-filled with
2085/// the current renderer_info_t of 'view', while the 'place_t' instance
2086/// will always be nullptr.
2087enum lecvt_code_t
2088{
2089 LECVT_CANCELED = -1,
2090 LECVT_ERROR = 0,
2091 LECVT_OK = 1,
2092};
2093
2094#define LECVT_WITHIN_LISTING 0x1 // only perform conversion if the location is contained in the current listing (e.g., in the decompiler, don't decompile other functions)
2095typedef lecvt_code_t idaapi lochist_entry_cvt2_t(
2096 lochist_entry_t *dst,
2097 const lochist_entry_t &src,
2098 TWidget *view,
2099 uint32 flags);
2101//-------------------------------------------------------------------------
2102
2125idaman void ida_export register_loc_converter2(
2126 const char *p1,
2127 const char *p2,
2129
2130//-------------------------------------------------------------------------
2137 const char *p1,
2138 const char *p2);
2139
2140
2141
2142//----------------------------------------------------------------------
2144class twinpos_t
2146public:
2147 place_t *at;
2148 int x;
2149 twinpos_t(place_t *t=nullptr, int x0=0) { at=t; x=x0; }
2150 DEFINE_MEMORY_ALLOCATION_FUNCS()
2151};
2152
2153/// A line in a text window
2154class twinline_t
2155{
2156public:
2158 qstring line;
2159 color_t prefix_color;
2160 bgcolor_t bg_color;
2161 bool is_default = false;
2162 twinline_t(place_t *t=nullptr, color_t pc=1, bgcolor_t bc=DEFCOLOR)
2163 : at(t), prefix_color(pc), bg_color(bc) {}
2164 DEFINE_MEMORY_ALLOCATION_FUNCS()
2165};
2171#ifndef SWIG
2172
2173
2174#define DECLARE_LINEARRAY_HELPERS(decl) \
2175decl void ida_export linearray_t_ctr(linearray_t *, void *ud); \
2176decl void ida_export linearray_t_dtr(linearray_t *); \
2177decl int ida_export linearray_t_set_place(linearray_t *, const place_t *new_at); \
2178decl void ida_export linearray_t_copy_from(linearray_t *, const linearray_t *src); \
2179decl bool ida_export linearray_t_beginning(const linearray_t *); \
2180decl bool ida_export linearray_t_ending(const linearray_t *); \
2181decl const qstring *ida_export linearray_t_down(linearray_t *); \
2182decl const qstring *ida_export linearray_t_up(linearray_t *);
2183
2184class linearray_t;
2186#else
2187# define DECLARE_LINEARRAY_HELPERS(decl)
2188#endif // SWIG
2189
2191class linearray_t
2192{
2195 qstrvec_t lines; // lines corresponding to the current place_t
2196 place_t *at;
2197 void *ud; // user defined data (UD)
2198 // its meaning depends on the place_t used
2199 color_t prefix_color; // prefix color
2200 bgcolor_t bg_color; // background color
2201 qstring extra; // the last line of the previous location after moving down
2202 int dlnnum; // default line number (if unknown, -1)
2203 int max_lines; // max number of lines to generate
2204
2205 int getlines();
2206 void cleanup();
2207 int _set_place(const place_t *new_at);
2208 const qstring *_down();
2209 const qstring *_up();
2210 void _copy_from(const linearray_t *src);
2211
2212public:
2213
2214 linearray_t(void *_ud) { linearray_t_ctr(this, _ud); }
2215 ~linearray_t() { linearray_t_dtr(this); }
2216 DEFINE_MEMORY_ALLOCATION_FUNCS()
2217
2218
2225 int set_place(const place_t *new_at) { return linearray_t_set_place(this, new_at); }
2226
2229 void copy_from(const linearray_t *src) { linearray_t_copy_from(this, src); }
2230
2234 place_t *get_place() const { return at; }
2235
2238 bgcolor_t get_bg_color() const { return bg_color; }
2239
2242 bgcolor_t get_pfx_color() const { return prefix_color; }
2243
2246 int get_dlnnum() const { return dlnnum; }
2247
2250 int get_linecnt() const { return int(lines.size()); }
2251
2253 void *userdata() const { return ud; }
2254
2256 void set_userdata(void *userd) { ud = userd; }
2257
2259 bool beginning() const { return linearray_t_beginning(this); }
2260
2261 // Are we at the end?
2262 bool ending() const { return linearray_t_ending(this); }
2263
2266 const qstring *down() { return linearray_t_down(this); }
2267
2270 const qstring *up() { return linearray_t_up(this); }
2271
2274 void set_max_lines(int n) { max_lines = n; }
2275};
2276
2277//-------------------------------------------------------------------------
2278typedef qvector<const twinline_t*> section_lines_refs_t;
2279typedef qvector<section_lines_refs_t> sections_lines_refs_t;
2280
2281//-------------------------------------------------------------------------
2284struct lines_rendering_input_t
2285{
2286 int cb = sizeof(*this);
2287 sections_lines_refs_t sections_lines;
2289 const synced_group_t *sync_group = nullptr;
2292};
2294//-------------------------------------------------------------------------
2300//
2301#define CK_TRACE 80
2302#define CK_TRACE_OVL 81
2303#define CK_EXTRA1 82
2304#define CK_EXTRA2 83
2305#define CK_EXTRA3 84
2306#define CK_EXTRA4 85
2307#define CK_EXTRA5 86
2308#define CK_EXTRA6 87
2309#define CK_EXTRA7 88
2310#define CK_EXTRA8 89
2311#define CK_EXTRA9 90
2312#define CK_EXTRA10 91
2313#define CK_EXTRA11 92
2314#define CK_EXTRA12 93
2315#define CK_EXTRA13 94
2316#define CK_EXTRA14 95
2317#define CK_EXTRA15 96
2318#define CK_EXTRA16 97
2319
2321
2325#define LROEF_MASK 0x00FFFFFF
2326#define LROEF_FULL_LINE 0x00000000
2327#define LROEF_CPS_RANGE 0x00000001
2329
2331{
2332 const twinline_t *line;
2333 uint32 flags;
2334
2335 // 0x00000000: nothing
2336 // 0xAABBGGRR: where AA is 0: BBGGRR contains a key (CK_*) to a color property
2337 // 0xAABBGGRR: where AA is !0: 0xAABBGGRR is the background color, with alpha value, to be applied to that line
2338 //
2339 // The 'bg_color' specified here, will be applied on top of the background
2340 // color that was computed for 'line', which itself can be:
2341 // - none (i.e., the default background color),
2342 // - a possible value stored in the IDB (see 'set_item_color()'),
2343 // - a value provided by processor_t::ev_get_bg_color
2344 // The value provided here should typically be partly transparent
2345 // so that it doesn't obstruct the computed background color
2346 // (the best, by far, is to stick to CK_* keys: their corresponding
2347 // colors typically have partial translucency, and each theme can
2348 // customize them.)
2350
2351 int cpx;
2352 int nchars;
2353
2354 line_rendering_output_entry_t(const twinline_t *_line, uint32 _flags=0, bgcolor_t _bg_color=0)
2355 : line(_line), flags(_flags), bg_color(_bg_color), cpx(-1), nchars(-1) {}
2356
2357 line_rendering_output_entry_t(const twinline_t *_line, int _cpx, int _nchars, uint32 _flags, bgcolor_t _bg_color)
2358 : line(_line), flags(_flags|LROEF_CPS_RANGE), bg_color(_bg_color), cpx(_cpx), nchars(_nchars) {}
2359
2360 bool is_bg_color_empty() const { return bg_color == 0; }
2361 bool is_bg_color_key() const { return (bg_color & 0xFF000000) == 0 && !is_bg_color_empty(); }
2362 bool is_bg_color_direct() const { return (bg_color & 0xFF000000) != 0; }
2365 {
2366 bool ok = (flags & LROEF_MASK) == (r.flags & LROEF_MASK)
2367 && line == r.line
2368 && bg_color == r.bg_color;
2369 if ( ok && (flags & LROEF_CPS_RANGE) != 0 )
2370 ok = cpx == r.cpx && nchars == r.nchars;
2371 return ok;
2372 }
2374 bool operator!=(const line_rendering_output_entry_t &r) const
2375 { return !(*this == r); }
2376};
2377DECLARE_TYPE_AS_MOVABLE(line_rendering_output_entry_t);
2378typedef qvector<line_rendering_output_entry_t*> line_rendering_output_entries_refs_t;
2379
2380//-------------------------------------------------------------------------
2381struct lines_rendering_output_t
2382{
2385
2388 clear();
2389 }
2391 void clear()
2393 for ( size_t i = 0, n = entries.size(); i < n; ++i )
2394 delete entries[i];
2396
2397 bool operator==(const lines_rendering_output_t &r) const
2398 {
2399 if ( flags != r.flags )
2400 return false;
2401 const size_t n = entries.size();
2402 if ( n != r.entries.size() )
2403 return false;
2404 for ( size_t i = 0; i < n; ++i )
2405 if ( *entries[i] != *r.entries[i] )
2406 return false;
2407 return true;
2408 }
2409
2410 bool operator!=(const lines_rendering_output_t &r) const
2411 { return !(*this == r); }
2412
2413 void swap(lines_rendering_output_t &r)
2414 {
2415 qswap(flags, r.flags);
2416 entries.swap(r.entries);
2417 }
2418};
2420//-------------------------------------------------------------------------
2421// Represents a range in a line to be displayed in a listing (or graph).
2422// All coordinates are in codepoints (i.e., not UTF-8 bytes); color
2423// tags are ignored.
2424// In other words, coordinates are in "real, visible" glyphs.
2425typedef int cpidx_t; // codepoint index
2426typedef int cplen_t; // codepoint length
2428struct line_section_t
2429{
2430 cpidx_t start = -1;
2431 cplen_t length = -1;
2432
2433
2434 bool contains(cpidx_t x) const
2436 return x >= start && x < start + length;
2438
2439 bool is_open() const { return length < 0; }
2440 bool is_closed() const { return !is_open(); }
2441 bool valid() const { return is_closed(); }
2442
2443 bool operator==(const line_section_t &r) const { return start == r.start && length == r.length; }
2444 bool operator!=(const line_section_t &r) const { return !(*this == r); }
2445};
2446DECLARE_TYPE_AS_MOVABLE(line_section_t);
2447typedef qvector<line_section_t> line_sections_t;
2449//-------------------------------------------------------------------------
2450// A tagged section in a line.
2451// Note: multiple sections with different tags can overlap.
2452// For example, the portion of text `[ebp+char_in_main]`:
2453// <on><opnd1><on><symbol>[<off><symbol><on><reg>ebp<off><reg><on><symbol>+<off><symbol><on><locname>char_in_main<off><locname><on><symbol>]<off><symbol><off><opnd1>
2454// ^________________________________________________________________________________________________________________________________________________________________^ // a `COLOR_OPND1` section
2455// ^_________________________^ // a `COLOR_SYMBOL` section
2456// ^____________________^ // a `COLOR_REG` section
2457// etc...
2459{
2460 struct
2461 {
2462 int text_start = -1; // points right after <on><tag>
2463 int text_end = -1; // points right before <off><tag>
2464 } byte_offsets;
2465 color_t tag = 0;
2466
2468
2469 bool operator==(const tagged_line_section_t &r) const
2470 {
2472 && tag == r.tag
2475 }
2476 bool operator!=(const tagged_line_section_t &r) const { return !(*this == r); }
2477
2478 bool valid() const
2479 {
2480 return line_section_t::valid()
2481 && tag > 0
2482 && byte_offsets.text_start > -1
2483 && byte_offsets.text_end >= byte_offsets.text_start;
2484 }
2486 bool valid_in(const qstring &in) const
2488 return valid()
2489 && byte_offsets.text_start <= in.length()
2490 && byte_offsets.text_end <= in.length();
2491 }
2492
2493 bool substr(
2494 qstring *out,
2495 const qstring &in,
2496 const tagged_line_section_t *end = nullptr) const
2497 {
2498 bool ok = valid_in(in);
2499 if ( ok )
2500 {
2501 out->qclear();
2502 int e = byte_offsets.text_end;
2503 if ( end != nullptr && end->byte_offsets.text_start < e )
2504 e = end->byte_offsets.text_start;
2505 out->append(in.c_str() + byte_offsets.text_start,
2506 e - byte_offsets.text_start);
2507 }
2508 return ok;
2509 }
2510
2511};
2512DECLARE_TYPE_AS_MOVABLE(tagged_line_section_t);
2513typedef qvector<tagged_line_section_t> tagged_line_section_vec_t;
2514
2515//-------------------------------------------------------------------------
2516// The list of tagged sections corresponding to a line of text in a listing
2517struct tagged_line_sections_t : public tagged_line_section_vec_t
2518{
2519 const tagged_line_section_t *first(color_t tag) const
2520 {
2521 for ( const auto &one : *this )
2522 if ( one.tag == tag )
2523 return &one;
2524 return nullptr;
2525 }
2527 void sections_at(
2529 cpidx_t x,
2530 color_t tag=0) const
2531 {
2532 for ( const auto &one : *this )
2533 if ( one.contains(x) && (tag == 0 || one.tag == tag) )
2534 out->push_back(one);
2535 }
2537 // For example, '// XREF: __loff_t/r _IO_FILE/r'
2538 // <on><xref>// XREF: <on><addr:FF001BAC>__loff_t/r <on><addr:FF001BC9>_IO_FILE/r<off><dref>
2539 // ^___ r1 ________________________________________________________________________________^
2540 // ^ r2 ^ r3
2541 // nearest_at(<any p>) --> r1 (because r2 and r3 are zero-length)
2543 cpidx_t x,
2544 color_t tag=0) const
2545 {
2546 const tagged_line_section_t *nearest = nullptr;
2547 for ( const auto &one : *this )
2548 {
2549 if ( one.contains(x)
2550 && (tag == 0 || one.tag == tag)
2551 && (nearest == nullptr || one.start > nearest->start) )
2552 {
2553 nearest = &one;
2554 }
2555 }
2556 return nearest;
2557 }
2558
2559 // For example, '// XREF: __loff_t/r _IO_FILE/r'
2560 // <on><xref>// XREF: <on><addr:FF001BAC>__loff_t/r <on><addr:FF001BC9>_IO_FILE/r<off><dref>
2561 // ^___ r1 ________________________________________________________________________________^
2562 // ^ p1 ^ r2 ^ p2 ^ r3 ^ p3
2563 // nearest_before(r1, p1, COLOR_ADDR) --> nullptr
2564 // nearest_before(r1, p2, COLOR_ADDR) --> r2 (zero-length)
2565 // nearest_before(r1, p3, COLOR_ADDR) --> r3 (zero-length)
2566 // nearest_after (r1, p1, COLOR_ADDR) --> r2 (zero-length)
2567 // nearest_after (r1, p2, COLOR_ADDR) --> r3 (zero-length)
2568 // nearest_after (r1, p3, COLOR_ADDR) --> nullptr
2569 const tagged_line_section_t *nearest_before(
2570 const tagged_line_section_t &range,
2571 cpidx_t start,
2572 color_t tag=0) const
2573 {
2574 const tagged_line_section_t *nearest = nullptr;
2575 for ( const auto &one : *this )
2576 {
2577 if ( range.contains(one.start)
2578 && one.start <= start
2579 && (tag == 0 || one.tag == tag)
2580 && (nearest == nullptr || one.start > nearest->start) )
2581 {
2582 nearest = &one;
2583 }
2584 }
2585 return nearest;
2586 }
2587 const tagged_line_section_t *nearest_after(
2588 const tagged_line_section_t &range,
2589 cpidx_t start,
2590 color_t tag=0) const
2591 {
2592 const tagged_line_section_t *nearest = nullptr;
2593 for ( const auto &one : *this )
2594 {
2595 if ( range.contains(one.start)
2596 && one.start > start
2597 && (tag == 0 || one.tag == tag)
2598 && (nearest == nullptr || one.start < nearest->start) )
2599 {
2600 nearest = &one;
2601 }
2602 }
2603 return nearest;
2604 }
2605};
2606
2612struct listing_location_t
2613{
2614 int cb = sizeof(*this);
2615
2616 const lochist_entry_t *loc = nullptr;
2617 const qstring *text = nullptr;
2618 const tagged_line_sections_t *tagged_sections = nullptr;
2619};
2620
2621#ifndef SWIG
2623idaman uint64 ida_export get_dirty_infos();
2624#endif // SWIG
2629
2630
2631idaman void ida_export request_refresh(uint64 mask, bool cnd=true);
2632inline void clear_refresh_request(uint64 mask) { request_refresh(mask, false); }
2633
2634
2638
2639idaman bool ida_export is_refresh_requested(uint64 mask);
2642//-------------------------------------------------------------------------
2643typedef int twidget_type_t;
2644
2648#define BWN_UNKNOWN -1
2649#define BWN_EXPORTS 0
2650#define BWN_IMPORTS 1
2651#define BWN_NAMES 2
2652#define BWN_FUNCS 3
2653#define BWN_STRINGS 4
2654#define BWN_SEGS 5
2655#define BWN_SEGREGS 6
2656#define BWN_SELS 7
2657#define BWN_SIGNS 8
2658#define BWN_TILS 9
2659#define BWN_TICSR 10
2660#define BWN_CALLS 11
2661#define BWN_PROBS 12
2662#define BWN_BPTS 13
2663#define BWN_THREADS 14
2664#define BWN_MODULES 15
2665#define BWN_TRACE 16
2666#define BWN_CALL_STACK 17
2667#define BWN_XREFS 18
2668#define BWN_SEARCH 19
2669#define BWN_FRAME 25
2670#define BWN_NAVBAND 26
2671#define BWN_DISASM 27
2672#define BWN_HEXVIEW 28
2673#define BWN_NOTEPAD 29
2674#define BWN_OUTPUT 30
2675#define BWN_CLI 31
2676#define BWN_WATCH 32
2677#define BWN_LOCALS 33
2678#define BWN_STKVIEW 34
2679#define BWN_CHOOSER 35
2680#define BWN_SHORTCUTCSR 36
2681#define BWN_SHORTCUTWIN 37
2682#define BWN_CPUREGS 38
2683#define BWN_SO_STRUCTS 39
2684#define BWN_SO_OFFSETS 40
2685#define BWN_CMDPALCSR 41
2686#define BWN_CMDPALWIN 42
2687#define BWN_SNIPPETS 43
2688#define BWN_CUSTVIEW 44
2689#define BWN_ADDRWATCH 45
2690#define BWN_PSEUDOCODE 46
2691#define BWN_CALLS_CALLERS 47
2692#define BWN_CALLS_CALLEES 48
2693#define BWN_MDVIEWCSR 49
2694#define BWN_DISASM_ARROWS 50
2695#define BWN_CV_LINE_INFOS 51
2696#define BWN_SRCPTHMAP_CSR 52
2697#define BWN_SRCPTHUND_CSR 53
2698#define BWN_UNDOHIST 54
2699#define BWN_SNIPPETS_CSR 55
2700#define BWN_SCRIPTS_CSR 56
2701#define BWN_BOOKMARKS 57
2702#define BWN_TILIST 58
2703#define BWN_TIL_VIEW 59
2704#define BWN_TYPE_EDITOR 60
2705#define BWN_MICROCODE 61
2706#define BWN_XREF_TREE 62
2707
2709
2713#define IWID_EXPORTS (1ULL << BWN_EXPORTS )
2714#define IWID_IMPORTS (1ULL << BWN_IMPORTS )
2715#define IWID_NAMES (1ULL << BWN_NAMES )
2716#define IWID_FUNCS (1ULL << BWN_FUNCS )
2717#define IWID_STRINGS (1ULL << BWN_STRINGS )
2718#define IWID_SEGS (1ULL << BWN_SEGS )
2719#define IWID_SEGREGS (1ULL << BWN_SEGREGS )
2720#define IWID_SELS (1ULL << BWN_SELS )
2721#define IWID_SIGNS (1ULL << BWN_SIGNS )
2722#define IWID_TILS (1ULL << BWN_TILS )
2723#define IWID_TICSR (1ULL << BWN_TICSR )
2724#define IWID_CALLS (1ULL << BWN_CALLS )
2725#define IWID_PROBS (1ULL << BWN_PROBS )
2726#define IWID_BPTS (1ULL << BWN_BPTS )
2727#define IWID_THREADS (1ULL << BWN_THREADS )
2728#define IWID_MODULES (1ULL << BWN_MODULES )
2729#define IWID_TRACE (1ULL << BWN_TRACE )
2730#define IWID_CALL_STACK (1ULL << BWN_CALL_STACK )
2731#define IWID_XREFS (1ULL << BWN_XREFS )
2732#define IWID_SEARCH (1ULL << BWN_SEARCH )
2733#define IWID_FRAME (1ULL << BWN_FRAME )
2734#define IWID_NAVBAND (1ULL << BWN_NAVBAND )
2735#define IWID_DISASM (1ULL << BWN_DISASM )
2736#define IWID_HEXVIEW (1ULL << BWN_HEXVIEW )
2737#define IWID_NOTEPAD (1ULL << BWN_NOTEPAD )
2738#define IWID_OUTPUT (1ULL << BWN_OUTPUT )
2739#define IWID_CLI (1ULL << BWN_CLI )
2740#define IWID_WATCH (1ULL << BWN_WATCH )
2741#define IWID_LOCALS (1ULL << BWN_LOCALS )
2742#define IWID_STKVIEW (1ULL << BWN_STKVIEW )
2743#define IWID_CHOOSER (1ULL << BWN_CHOOSER )
2744#define IWID_SHORTCUTCSR (1ULL << BWN_SHORTCUTCSR )
2745#define IWID_SHORTCUTWIN (1ULL << BWN_SHORTCUTWIN )
2746#define IWID_CPUREGS (1ULL << BWN_CPUREGS )
2747#define IWID_SO_STRUCTS (1ULL << BWN_SO_STRUCTS )
2748#define IWID_SO_OFFSETS (1ULL << BWN_SO_OFFSETS )
2749#define IWID_CMDPALCSR (1ULL << BWN_CMDPALCSR )
2750#define IWID_CMDPALWIN (1ULL << BWN_CMDPALWIN )
2751#define IWID_SNIPPETS (1ULL << BWN_SNIPPETS )
2752#define IWID_CUSTVIEW (1ULL << BWN_CUSTVIEW )
2753#define IWID_ADDRWATCH (1ULL << BWN_ADDRWATCH )
2754#define IWID_PSEUDOCODE (1ULL << BWN_PSEUDOCODE )
2755#define IWID_CALLS_CALLERS (1ULL << BWN_CALLS_CALLERS)
2756#define IWID_CALLS_CALLEES (1ULL << BWN_CALLS_CALLEES)
2757#define IWID_MDVIEWCSR (1ULL << BWN_MDVIEWCSR )
2758#define IWID_DISASM_ARROWS (1ULL << BWN_DISASM_ARROWS)
2759#define IWID_CV_LINE_INFOS (1ULL << BWN_CV_LINE_INFOS)
2760#define IWID_SRCPTHMAP_CSR (1ULL << BWN_SRCPTHMAP_CSR)
2761#define IWID_SRCPTHUND_CSR (1ULL << BWN_SRCPTHUND_CSR)
2762#define IWID_UNDOHIST (1ULL << BWN_UNDOHIST )
2763#define IWID_SNIPPETS_CSR (1ULL << BWN_SNIPPETS_CSR )
2764#define IWID_SCRIPTS_CSR (1ULL << BWN_SCRIPTS_CSR )
2765#define IWID_BOOKMARKS (1ULL << BWN_BOOKMARKS )
2766#define IWID_TILIST (1ULL << BWN_TILIST )
2767#define IWID_TIL_VIEW (1ULL << BWN_TIL_VIEW )
2768#define IWID_TYPE_EDITOR (1ULL << BWN_TYPE_EDITOR )
2769#define IWID_XREF_TREE (1ULL << BWN_XREF_TREE )
2770
2771#define IWID_ANY_LISTING (IWID_DISASM|IWID_HEXVIEW|IWID_TILIST|IWID_FRAME|IWID_PSEUDOCODE|IWID_CUSTVIEW)
2772#define IWID_EA_LISTING (IWID_DISASM|IWID_HEXVIEW|IWID_PSEUDOCODE)
2773#define IWID_ALL 0xFFFFFFFFFFFFFFFFULL
2774
2776
2778
2780{
2781 return t == BWN_CHOOSER
2782 || (t >= BWN_EXPORTS && t <= BWN_SEARCH && t != BWN_CALLS)
2783 || t == BWN_SHORTCUTCSR
2784 || t == BWN_CMDPALCSR
2785 || t == BWN_CALLS_CALLERS
2786 || t == BWN_CALLS_CALLEES
2787 || t == BWN_MDVIEWCSR
2788 || t == BWN_SRCPTHMAP_CSR
2789 || t == BWN_SRCPTHUND_CSR
2790 || t == BWN_UNDOHIST
2791 || t == BWN_SNIPPETS_CSR
2792 || t == BWN_SCRIPTS_CSR
2793 || t == BWN_BOOKMARKS;
2794}
2795
2796
2797//---------------------------------------------------------------------------
2798// D E B U G G I N G F U N C T I O N S
2799//---------------------------------------------------------------------------
2800
2803
2804
2807#define IDA_DEBUG_DREFS 0x00000001
2808#define IDA_DEBUG_OFFSET 0x00000002
2809#define IDA_DEBUG_FLIRT 0x00000004
2810#define IDA_DEBUG_IDP 0x00000008
2811#define IDA_DEBUG_LDR 0x00000010
2812#define IDA_DEBUG_PLUGIN 0x00000020
2813#define IDA_DEBUG_IDS 0x00000040
2814#define IDA_DEBUG_CONFIG 0x00000080
2815#define IDA_DEBUG_CHECKMEM 0x00000100
2816#define IDA_DEBUG_LICENSE 0x00000200
2817#define IDA_DEBUG_DEMANGLE 0x00000400
2818#define IDA_DEBUG_QUEUE 0x00000800
2819#define IDA_DEBUG_ROLLBACK 0x00001000
2820#define IDA_DEBUG_ALREADY 0x00002000
2821#define IDA_DEBUG_TIL 0x00004000
2822#define IDA_DEBUG_NOTIFY 0x00008000
2823#define IDA_DEBUG_DEBUGGER 0x00010000
2824#define IDA_DEBUG_APPCALL 0x00020000
2825#define IDA_DEBUG_SRCDBG 0x00040000
2826#define IDA_DEBUG_ACCESSIBILITY 0x00080000
2827#define IDA_DEBUG_NETWORK 0x00100000
2828#define IDA_DEBUG_INTERNET IDA_DEBUG_NETWORK
2829#define IDA_DEBUG_SIMPLEX 0x00200000
2830#define IDA_DEBUG_DBGINFO 0x00400000
2831#define IDA_DEBUG_LUMINA 0x00800000
2832#define IDA_DEBUG_THEMES 0x01000000
2833#define IDA_DEBUG_REGEX 0x02000000
2834#define IDA_DEBUG_SUBPROC 0x04000000
2835#define IDA_DEBUG_RANGECB 0x08000000
2836#define IDA_DEBUG_ALWAYS 0xFFFFFFFF
2838
2839
2840#ifndef SWIG
2841
2847
2848AS_PRINTF(1, 2) inline int ida_deb(const char *format, ...)
2849{
2850 va_list va;
2851 va_start(va, format);
2852 int nbytes = callui(ui_msg, format, va).i;
2853 va_end(va);
2854 return nbytes;
2855}
2856
2857#define deb(ida_debug_bits, ...) \
2858 do \
2859 { \
2860 if ( (debug & (ida_debug_bits)) != 0 ) \
2861 ida_deb(__VA_ARGS__); \
2862 } while ( false )
2863
2865
2866AS_PRINTF(3, 4) inline void show_hex(
2867 const void *dataptr,
2868 size_t len,
2869 const char *format,
2870 ...)
2871{
2872 va_list va;
2874 vshow_hex(dataptr, len, format, va);
2876}
2877
2878
2880
2881AS_PRINTF(4, 5) inline void show_hex_file(
2882 linput_t *li,
2884 size_t count,
2885 const char *format,
2886 ...)
2887{
2888 va_list va;
2891 va_end(va);
2892}
2893#endif // SWIG
2894
2895//-------------------------------------------------------------------------
2896// U I S E R V I C E F U N C T I O N S
2897//-------------------------------------------------------------------------
2898
2900enum action_state_t
2901{
2903
2906
2926//-------------------------------------------------------------------------
2932#define CH_MODAL 0x00000001
2934
2938#define CH_KEEP 0x00000002
2941#define CH_MULTI 0x00000004
2943#define CH_MULTI_EDIT 0x00000008
2947#define CH_NOBTNS 0x00000010
2949#define CH_ATTRS 0x00000020
2950#define CH_UNUSED 0x00000040
2953#define CH_FORCE_DEFAULT 0x00000080
2955#define CH_CAN_INS 0x00000100
2957#define CH_CAN_DEL 0x00000200
2959#define CH_CAN_EDIT 0x00000400
2961#define CH_CAN_REFRESH 0x00000800
2962
2964#define CH_QFLT 0x00001000
2965#define CH_QFTYP_SHIFT 13
2966#define CH_QFTYP_DEFAULT 0
2967#define CH_QFTYP_NORMAL (1 << CH_QFTYP_SHIFT)
2968#define CH_QFTYP_WHOLE_WORDS (2 << CH_QFTYP_SHIFT)
2969#define CH_QFTYP_REGEX (3 << CH_QFTYP_SHIFT)
2970#define CH_QFTYP_FUZZY (4 << CH_QFTYP_SHIFT)
2971#define CH_QFTYP_MASK (0x7 << CH_QFTYP_SHIFT)
2972
2974#define CH_NO_STATUS_BAR 0x00010000
2975
2977#define CH_RESTORE 0x00020000
2978
2981#define CH_RENAME_IS_EDIT 0x00040000
2982
2983#define CH_BUILTIN_SHIFT 19
2984#define CH_BUILTIN(id) ((id+1) << CH_BUILTIN_SHIFT)
2986#define CH_BUILTIN_MASK (0x3F << CH_BUILTIN_SHIFT)
2987
2990#define CH_HAS_DIRTREE 0x02000000
2991
2992#define CH_TM_NO_TREE 0x00000000
2993#define CH_TM_FOLDERS_ONLY 0x04000000
2994#define CH_TM_FULL_TREE 0x08000000
2995#define CH_TM_SHIFT 26
2996#define CH_TM_MASK (0x3 << CH_TM_SHIFT)
2997
2999#define CH_HAS_DIFF 0x10000000
3000
3002#define CH_NO_SORT 0x20000000
3003
3005#define CH_NO_FILTER 0x40000000
3006
3009#define CH_NON_PERSISTED_TREE 0x80000000
3011
3015
3018#define CH2_LAZY_LOADED 0x0001
3020#define CH2_HAS_INODE2INDEX 0x0002
3021
3025#define CHCOL_PLAIN 0x00000000
3026#define CHCOL_PATH 0x00010000
3031#define CHCOL_HEX 0x00020000
3032#define CHCOL_DEC 0x00030000
3033#define CHCOL_EA 0x00040000
3034#define CHCOL_FNAME 0x00050000
3041#define CHCOL_FORMAT 0x00070000
3042
3043#define CHCOL_DEFHIDDEN 0x00100000
3044#define CHCOL_DRAGHINT 0x00200000
3048#define CHCOL_INODENAME 0x00400000
3054
3055
3059#define CHITEM_BOLD 0x0001
3060#define CHITEM_ITALIC 0x0002
3061#define CHITEM_UNDER 0x0004
3062#define CHITEM_STRIKE 0x0008
3063#define CHITEM_GRAY 0x0010
3065
3069#define CHOOSER_NOMAINMENU "NOMAINMENU\n"
3070#define CHOOSER_NOSTATUSBAR "NOSTATUSBAR\n"
3072
3073class dirtree_t;
3074
3077{
3078 int cb;
3081 int flags;
3082 bgcolor_t color;
3084 : cb(sizeof(chooser_item_attrs_t)),
3086 color(DEFCOLOR) {}
3087 void reset()
3088 {
3089 cb = sizeof(chooser_item_attrs_t);
3091 color = DEFCOLOR;
3093 bool operator==(const chooser_item_attrs_t &other) const
3094 {
3095 return cb == other.cb
3096 && flags == other.flags
3097 && color == other.color;
3098 }
3099};
3100DECLARE_TYPE_AS_MOVABLE(chooser_item_attrs_t);
3101
3102
3102/// Row data returned by get_chooser_rows().
3103struct chooser_row_info_t
3104{
3105 qstrvec_t texts;
3106 chooser_item_attrs_t attrs;
3107 int icon = -1;
3108
3109 // needed by pywraps
3110 bool operator==(const chooser_row_info_t &other) const
3111 {
3112 return texts == other.texts
3113 && attrs == other.attrs
3114 && icon == other.icon;
3116 bool operator!=(const chooser_row_info_t &other) const
3117 {
3118 return !(*this == other);
3120};
3121DECLARE_TYPE_AS_MOVABLE(chooser_row_info_t);
3122typedef qvector<chooser_row_info_t> chooser_row_info_vec_t;
3123
3125
3125///@{
3126#define GCRF_HIGH_BIT (0x8000000000000000ULL) // used to be:
3127 // (size_t(1) << (8 * sizeof(size_t) - 1))
3128 // but SWIG won't swallow the expression
3129#define GCRF_HEADER (GCRF_HIGH_BIT | 0)
3130#define GCRF_SELECTION (GCRF_HIGH_BIT | 1)
3131#define GCRF_CURRENT (GCRF_HIGH_BIT | 2)
3132#define GCRF_ALL (GCRF_HIGH_BIT | 3)
3134
3139struct action_ctx_base_t;
3142{
3143 int version = 1;
3144 const char *label;
3145 const char *tooltip;
3146 int icon;
3147
3149 const char *_label = nullptr,
3150 const char *_tooltip = nullptr,
3151 int _icon = -1)
3152 : label(_label), tooltip(_tooltip), icon(_icon) {}
3157 /// be sure that ctx.source.chooser is a valid pointer to chooser_base_t
3158 /// and that there are selected items for the Delete and Edit actions.
3159 virtual action_state_t idaapi ucb(action_update_ctx_t * /*ctx*/)
3160 {
3161 return AST_ENABLE_FOR_WIDGET;
3163};
3164
3166struct chooser_base_t
3167{
3168#ifdef SWIG
3169 %immutable;
3170#endif
3171protected:
3172 uint8 version = 3;
3173 uint8 reserved = 0;
3174 uint16 flags2;
3176
3177public:
3178 // TODO reduce to 4 values
3179 // embedded chooser: width, height. Other values are ignored.
3180 // qt: y1 == -2 => minimal height (and centered)
3181 // Other values are ignored.
3182 int x0 = -1;
3183 int y0 = -1;
3184 int x1 = -1;
3185 int y1 = -1;
3186 int width = 0;
3187 int height = 0;
3188
3189 const char *title;
3193 const int *widths;
3196 const char *const *header;
3202 int icon = -1;
3203
3212 // Context | 1 | 2 | 3
3213 // ---------------------------
3214 // NO_SELECTION | X | X | X
3215 // EMPTY_CHOOSER | X | |
3216 // ALREADY_EXISTS | X | |
3218 static constexpr ssize_t NO_SELECTION = -1;
3219 static constexpr ssize_t EMPTY_CHOOSER = -2;
3221 static constexpr ssize_t ALREADY_EXISTS = -3;
3224 static constexpr ssize_t NO_ATTR = -4;
3226
3237 int deflt_col = 0;
3238
3240 uint32 flags_ = 0,
3241 int columns_ = 0,
3242 const int *widths_ = nullptr,
3243 const char *const *header_ = nullptr,
3244 const char *title_ = nullptr,
3245 uint16 flags2_ = 0)
3246 : flags2(flags2_),
3247 flags(flags_),
3248 title(title_),
3249 columns(columns_),
3250 widths(widths_),
3251 header(header_) {}
3252 virtual ~chooser_base_t() {}
3253 DEFINE_MEMORY_ALLOCATION_FUNCS()
3254
3255 // called when the corresponding widget is destroyed.
3256 //
3257 // In some rare cases where multiple chooser_base_t instance can
3258 // be backed by the same data (\sa get_obj_id), and a second instance
3259 // is created while the first is already displayed (therefore making
3260 // that second instance a duplicate), the second instance will be
3261 // destroyed through this method (and chooser_base_t::ALREADY_EXISTS
3262 // will be returned from choose().)
3263 void call_destructor()
3264 {
3265 if ( has_widget_lifecycle() )
3266 delete this;
3267 }
3268
3273 virtual void *get_chooser_obj() { return this; }
3274
3277
3280 virtual const void *get_obj_id(size_t *len) const
3281 {
3282 // return the unique id
3283 *len = 0;
3284 return nullptr;
3285 }
3286
3288 bool is_same(const chooser_base_t *other) const
3290 size_t len1;
3291 const void *id1 = get_obj_id(&len1);
3292 size_t len2;
3293 const void *id2 = other->get_obj_id(&len2);
3294 return len1 == len2 && len1 != 0 && memcmp(id1, id2, len1) == 0;
3295 }
3296
3297 /// is an operation allowed?
3298 bool can_ins() const { return (flags & CH_CAN_INS ) != 0; }
3299 bool can_del() const { return (flags & CH_CAN_DEL ) != 0; }
3300 bool can_edit() const { return (flags & CH_CAN_EDIT ) != 0; }
3301 bool can_refresh() const { return (flags & CH_CAN_REFRESH) != 0; }
3302
3304 bool popup_allowed(int stdact_idx) const
3305 {
3306 switch ( stdact_idx )
3308 case POPUP_INS: return can_ins();
3309 case POPUP_DEL: return can_del();
3310 case POPUP_EDIT: return can_edit();
3311 case POPUP_REFRESH: return can_refresh();
3312 default: return false;
3314 }
3315 bool is_status_bar_hidden() const { return (flags & CH_NO_STATUS_BAR) != 0; }
3316 bool should_restore_geometry() const { return (flags & CH_RESTORE) != 0; }
3318 bool is_modal() const { return (flags & CH_MODAL) != 0; }
3320 bool has_widget_lifecycle() const { return (flags & CH_KEEP) == 0; }
3322 bool is_multi() const { return (flags & CH_MULTI) != 0; }
3324 bool ask_item_attrs() const { return (flags & CH_ATTRS) != 0; }
3326 bool is_force_default() const { return (flags & CH_FORCE_DEFAULT) != 0; }
3328 uint get_builtin_number() const
3330 return ((flags & CH_BUILTIN_MASK) >> CH_BUILTIN_SHIFT) - 1;
3333 void set_ask_item_attrs(bool enable)
3334 {
3335 if ( enable )
3336 flags |= CH_ATTRS;
3337 else
3338 flags &= ~CH_ATTRS;
3339 }
3340 // check chooser version
3341 void check_version(uint32 ver) const { QASSERT(40217, version >= ver); }
3342 // should the quick filter be visible at startup?
3343 bool is_quick_filter_visible_initially() const { return (flags & CH_QFLT) != 0; }
3344 // what mode should the quick filter initially be put in?
3345 int get_quick_filter_initial_mode() const { return flags & CH_QFTYP_MASK; }
3346 // does the chooser have the ability to show a tree view?
3347 bool has_dirtree() const { return (flags & CH_HAS_DIRTREE) != 0; }
3348 // does the chooser have the ability to participate in a diff/merge workflow?
3349 bool has_diff_capability() const { return (flags & CH_HAS_DIFF) != 0; }
3350 // does chooser have sorting abilities?
3351 bool can_sort() const { return (flags & CH_NO_SORT) == 0; }
3352 // does chooser have filtering abilities?
3353 bool can_filter() const { return (flags & CH_NO_FILTER) == 0; }
3354 // should renaming trigger the 'edit' callback?
3355 bool should_rename_trigger_edit() const { return (flags & CH_RENAME_IS_EDIT) != 0; }
3356 // is the chooser dirtree persisted?
3357 bool is_dirtree_persisted() const { return (flags & CH_NON_PERSISTED_TREE) == 0; }
3358 // is the chooser lazy-loaded?
3359 bool is_lazy_loaded() const { return version >= 3 && (flags2 & CH2_LAZY_LOADED) != 0; }
3360 // chooser_implement inode2index
3361 bool has_inode_to_index() const { return version >= 3 && (flags2 & CH2_HAS_INODE2INDEX) != 0; }
3365 virtual bool idaapi init() { return true; }
3368 virtual size_t idaapi get_count() const = 0;
3369
3376 virtual void idaapi get_row(
3378 int *out_icon,
3379 chooser_item_attrs_t *out_attrs,
3380 size_t n) const = 0;
3381
3382
3394 virtual ea_t idaapi get_ea(size_t /*n*/) const { return BADADDR; }
3395
3406 enum cbres_t
3407 {
3411 };
3412
3414 virtual void idaapi closed() {}
3416protected:
3417 // the default labels of the standard actions are different for the qt-
3418 // and txt-versions of the chooser
3419 void init_popup_names(const char *const default_popup_names[NSTDPOPUPS])
3420 {
3421 for ( int i = 0; i < NSTDPOPUPS; ++i )
3422 if ( popup_names[i].empty() )
3423 popup_names[i] = default_popup_names[i];
3424 }
3425#ifdef SWIG
3426 %mutable;
3427#endif
3429
3430#ifndef SWIG
3431
3433struct chooser_t : public chooser_base_t
3434{
3436 struct cbret_t
3437 {
3438 ssize_t idx;
3439 cbres_t changed;
3440 cbret_t() : idx(NO_SELECTION), changed(NOTHING_CHANGED) {}
3441 cbret_t(ssize_t idx_, cbres_t changed_ = ALL_CHANGED)
3442 : idx(idx_), changed(changed_) {}
3443 };
3444
3445 chooser_t(uint32 flags_ = 0,
3446 int columns_ = 0,
3447 const int *widths_ = nullptr,
3448 const char *const *header_ = nullptr,
3449 const char *title_ = nullptr,
3450 uint16 flags2_ = 0)
3452 (flags_ & ~CH_MULTI),
3453 columns_, widths_, header_,
3454 title_,
3455 flags2_) {}
3456
3461 //lint -sem(chooser_t::choose,custodial(t))
3462 inline ssize_t choose(ssize_t deflt = 0);
3463
3465
3469 virtual ssize_t idaapi get_item_index(const void *item_data) const newapi
3470 {
3471 // no calculation when `item_data` already is an index
3472 return *(const ssize_t *)item_data;
3473 }
3474
3476 typedef cbret_t (idaapi chooser_t::*cb_t)(size_t n);
3477
3478 /// User asked to insert an element.
3479 virtual cbret_t idaapi ins(ssize_t /*n*/) newapi { return cbret_t(); }
3480
3483
3485 virtual cbret_t idaapi del(size_t /*n*/) newapi { return cbret_t(); }
3486
3491 virtual cbret_t idaapi edit(size_t /*n*/) newapi { return cbret_t(); }
3492
3498 virtual cbret_t idaapi enter(size_t n) newapi
3499 {
3501 return cbret_t(n, changed);
3502 }
3503
3507 /// (as it may change during refresh)
3508 /// changed what is changed
3509 virtual cbret_t idaapi refresh(ssize_t n) newapi
3510 {
3511 return cbret_t(n, ALL_CHANGED);
3512 }
3513
3517 virtual void idaapi select(ssize_t /*n*/) const newapi {}
3522 virtual dirtree_t *idaapi get_dirtree() newapi { return nullptr; }
3523
3528 virtual inode_t idaapi index_to_inode(size_t /*n*/) const newapi { return inode_t(BADADDR); }
3529
3534 virtual diffpos_t idaapi index_to_diffpos(size_t /*n*/) const newapi { return diffpos_t(-1); }
3535
3545 virtual bool idaapi get_stdact_descs(
3546 chooser_stdact_desc_t * /*descs*/[NSTDPOPUPS]) newapi
3547 {
3548 return false;
3549 }
3550
3554 /// given dirtree's link() or mkdir() methods to add the folder contents.
3555 /// \note The dirtree is chdir()-positioned to the directory being loaded,
3556 /// so relative paths (like simple filenames) may be useful.
3557 /// \param dt dirtree used to fill the directory in
3558 /// \param dir_path an absolute dirtree path to this directory
3559 /// \return success
3560 virtual bool idaapi do_lazy_load_dir(
3561 dirtree_t * /*dt*/,
3562 const qstring & /*dir_path*/) newapi
3563 {
3564 return false;
3565 }
3566
3569 /// Implementing this function will result in increase overall performance
3570 /// especially for big choosers.
3571 /// \param inode inode of the item
3572 /// \return the index
3573 virtual size_t idaapi inode_to_index(inode_t /*inode*/) const newapi { return size_t(-1); }
3574
3575protected:
3576 ssize_t new_sel_after_del(size_t n) const
3577 {
3578 size_t cnt = get_count();
3579 // assert: n < cnt
3580 return n + 1 < cnt
3581 ? n + 1
3582 : n - 1; // the last item deleted => no selection
3583 }
3584 ssize_t adjust_last_item(size_t n) const
3586 size_t cnt = get_count();
3587 if ( cnt == 0 )
3588 return NO_SELECTION;
3589 // take in account deleting of the last item(s)
3590 return n < cnt ? n : cnt - 1;
3591 }
3592};
3595struct chooser_multi_t : public chooser_base_t
3596{
3598 uint32 flags_ = 0,
3599 int columns_ = 0,
3600 const int *widths_ = nullptr,
3601 const char *const *header_ = nullptr,
3602 const char *title_ = nullptr,
3603 uint16 flags2_ = 0)
3605 flags_ | CH_MULTI,
3606 columns_, widths_, header_,
3607 title_,
3608 flags2_) {}
3609
3614 //lint -sem(chooser_multi_t::choose,custodial(t))
3615 inline ssize_t choose(const sizevec_t &deflt = sizevec_t());
3616
3618
3621 virtual void idaapi get_item_index(
3622 sizevec_t *sel,
3623 const void *item_data) const newapi
3624 {
3625 // no calculation when `item_data` already is a vector
3626 *sel = *(const sizevec_t *)item_data;
3627 }
3628
3630 typedef cbres_t (idaapi chooser_multi_t::*cb_t)(sizevec_t *sel);
3631
3633 virtual cbres_t idaapi ins(sizevec_t * /*sel*/) newapi
3634 {
3635 return NOTHING_CHANGED;
3636 }
3637
3641 virtual cbres_t idaapi del(sizevec_t * /*sel*/) newapi
3643 return NOTHING_CHANGED;
3644 }
3645
3646
3649 virtual cbres_t idaapi edit(sizevec_t * /*sel*/) newapi
3651 return NOTHING_CHANGED;
3652 }
3653
3654
3657 virtual cbres_t idaapi enter(sizevec_t *sel) newapi
3659 return cbres_t(callui(ui_chooser_default_enter, this, sel).i);
3660 }
3661
3662
3666 virtual cbres_t idaapi refresh(sizevec_t * /*sel*/) newapi
3667 {
3668 return ALL_CHANGED;
3669 }
3670
3674 virtual void idaapi select(const sizevec_t &/*sel*/) const newapi {}
3679 virtual dirtree_t *idaapi get_dirtree() newapi { return nullptr; }
3680
3685 virtual inode_t idaapi index_to_inode(size_t /*n*/) const newapi { return inode_t(BADADDR); }
3686
3691 virtual diffpos_t idaapi index_to_diffpos(size_t /*n*/) const newapi { return diffpos_t(-1); }
3692
3702 virtual bool idaapi get_stdact_descs(
3703 chooser_stdact_desc_t * /*descs*/[NSTDPOPUPS]) newapi
3704 {
3705 return false;
3706 }
3707
3711 /// given dirtree's link() or mkdir() methods to add the folder contents.
3712 /// \note The dirtree is chdir()-positioned to the directory being loaded,
3713 /// so relative paths (like simple filenames) may be useful.
3714 /// \param dt dirtree used to fill the directory in
3715 /// \param dir_path an absolute dirtree path to this directory
3716 /// \return success
3717 virtual bool idaapi do_lazy_load_dir(
3718 dirtree_t * /*dt*/,
3719 const qstring & /*dir_path*/) newapi
3720 {
3721 return false;
3722 }
3723
3726 /// Implementing this function will result in increase overall performance
3727 /// especially for big choosers.
3728 /// \param inode inode of the item
3729 /// \return the index
3730 virtual size_t idaapi inode_to_index(inode_t /*inode*/) const newapi { return size_t(-1); }
3731
3732protected:
3733 // used in the del() callback to iterate
3734 static bool next_item_to_del(sizevec_t *sel);
3735 ssize_t new_sel_after_del(const sizevec_t &sel) const;
3736 void adjust_last_item(sizevec_t *sel, size_t n) const;
3737};
3738
3741struct textctrl_info_t
3742{
3743 size_t cb;
3744 qstring text;
3747
3749#define TXTF_AUTOINDENT 0x0001
3750#define TXTF_ACCEPTTABS 0x0002
3751#define TXTF_READONLY 0x0004
3752#define TXTF_SELECTED 0x0008
3753#define TXTF_MODIFIED 0x0010
3754#define TXTF_FIXEDFONT 0x0020
3755#define TXTF_LINENUMBERS 0x0040
3756#define TXTF_HTML 0x0080
3759 uint16 tabsize;
3760 textctrl_info_t(): cb(sizeof(textctrl_info_t)), flags(0), tabsize(0) {}
3761};
3762
3766
3767
3771
3792
3793//lint -sem(choose,custodial(1))
3794ssize_t choose(chooser_base_t *ch, const void *def_item);
3795
3797{
3798 // chooser uses the default implementation of the get_item_index()
3799 // callback
3800 return ::choose(this, &deflt);
3801}
3802
3804{
3805 // chooser uses the default implementation of the get_item_index()
3806 // callback
3807 return ::choose(this, &deflt);
3808}
3809
3811
3812#endif // SWIG
3813
3814//-------------------------------------------------------------------------
3815enum navaddr_type_t
3816{
3817 nat_lib = 0,
3818 nat_fun,
3819 nat_cod,
3820 nat_dat,
3821 nat_und,
3822 nat_ext,
3823 nat_err,
3825 nat_cur,
3826 nat_auto, // auto-analysis cursor color
3827 nat_lum, // related to lumina
3828 nat_hlo, // highlight outline
3840
3843
3844typedef uint32 idaapi nav_colorizer_t(ea_t ea, asize_t nbytes, void *ud);
3845
3846
3848
3849inline void set_nav_colorizer(
3850 nav_colorizer_t **out_was_func,
3851 void **out_was_ud,
3852 nav_colorizer_t *func,
3853 void *ud)
3854{
3855 callui(ui_set_nav_colorizer, out_was_func, out_was_ud, func, ud);
3856}
3857
3858/// Custom viewer & code viewer handler types
3860{
3862 CVH_KEYDOWN,
3863 CVH_POPUP,
3864 CVH_DBLCLICK,
3865 CVH_CURPOS,
3866 CVH_CLOSE,
3867 CVH_CLICK,
3892#define VES_SHIFT (1 << 0)
3893#define VES_ALT (1 << 1)
3894#define VES_CTRL (1 << 2)
3895#define VES_MOUSE_LEFT (1 << 3)
3896#define VES_MOUSE_RIGHT (1 << 4)
3897#define VES_MOUSE_MIDDLE (1 << 5)
3898#define VES_META (1 << 7)
3899typedef int input_event_modifiers_t;
3901
3902//-------------------------------------------------------------------------
3905{
3914 msg_click,
3920
3921 msg_dblclick,
3927
3928 msg_closed,
3931
3932 msg_keydown,
3938
3939//-------------------------------------------------------------------------
3942{
3944 renderer_pos_info_t() : node(-1), cx(-1), cy(-1), sx(-1) {}
3945
3946 int node;
3947
3948
3949 short cx;
3950 ///< When in graph mode: X coords of the character in 'node'. \n
3951 ///< When in flat mode: X coords of the character in the line, w/o \n
3952 ///< taking scrolling into consideration.
3954 short cy;
3957
3958 short sx;
3959
3960 bool operator == (const renderer_pos_info_t &r) const
3961 { return node == r.node && cx == r.cx && cy == r.cy && sx == r.sx; }
3962 bool operator != (const renderer_pos_info_t &r) const
3963 { return !(*this == r); }
3964};
3965
3966//-------------------------------------------------------------------------
3968
3969//-------------------------------------------------------------------------
3971
3971/// (out of 'view_mouse_event_t' to make it easy for SWiG to wrap)
3973{
3974 ea_t ea;
3975 const selection_item_t *item;
3977};
3978
3979
3987
3988 typedef view_mouse_event_location_t location_t;
3989 location_t location;
4001
4002//-------------------------------------------------------------------------
4006{
4009
4012
4013 view_keydown,
4014 ///< \param view (TWidget *)
4015 ///< \param key (int)
4016 ///< \param state (::view_event_state_t)
4017
4018 view_click,
4021
4025
4026 view_curpos,
4028
4029 view_created,
4032 view_close,
4034
4043
4049
4054
4055#ifndef SWIG
4056
4058
4059typedef bool idaapi custom_viewer_keydown_t(TWidget *cv, int vk_key, int shift, void *ud);
4060
4061
4063
4064typedef void idaapi custom_viewer_popup_t(TWidget *cv, void *ud);
4065
4066
4069typedef void idaapi custom_viewer_mouse_moved_t(TWidget *cv, int shift, view_mouse_event_t *e, void *ud);
4070
4071
4074typedef bool idaapi custom_viewer_click_t(TWidget *cv, int shift, void *ud);
4075
4076
4079typedef bool idaapi custom_viewer_dblclick_t(TWidget *cv, int shift, void *ud);
4080
4081
4086
4087typedef void idaapi custom_viewer_curpos_t(TWidget *cv, void *ud);
4089
4091
4092typedef void idaapi custom_viewer_close_t(TWidget *cv, void *ud);
4093
4094
4095// obsolete
4097typedef int idaapi obsolete_custom_viewer_help_t(TWidget *cv, void *ud);
4098
4099
4103
4104typedef bool idaapi custom_viewer_help_t(qstring *out, TWidget *cv, void *ud);
4105
4133
4134typedef void idaapi custom_viewer_adjust_place_t(TWidget *v, lochist_entry_t *loc, void *ud);
4135
4136
4161
4162typedef int idaapi custom_viewer_get_place_xcoord_t(TWidget *v, const place_t *pline, const place_t *pitem, void *ud);
4163
4164
4166{
4168 lcr_goto,
4169 lcr_user_switch, // user pressed <Space>
4170 lcr_auto_switch, // automatic switch
4172 lcr_navigate, // navigate back & forward
4173 lcr_scroll, // user used scrollbars
4174 lcr_internal, // misc. other reasons
4175};
4177#define LCMD_SYNC (1 << 0)
4178class locchange_md_t // location change metadata
4180protected:
4184 uchar reserved;
4185
4186public:
4188 : cb(sizeof(*this)), r(uchar(_reason)), f(_sync ? LCMD_SYNC : 0), reserved(0) {}
4189 locchange_reason_t reason() const { return locchange_reason_t(r); }
4190 bool is_sync() const { return (f & LCMD_SYNC) != 0; }
4192CASSERT(sizeof(locchange_md_t) == sizeof(uint32));
4194
4197/// This gives the view the possibility of declining the move.
4198/// Reasons for this can be:
4199/// - the location cannot be displayed,
4200/// - going there requires a long-running operation, that can be
4201/// canceled by the user (e.g., in case of the hexrays plugins:
4202/// during decompilation of the target function.)
4203/// - ...
4204///
4205/// This is called before the new location is committed to the view's history.
4206///
4207/// return
4208/// 0 if the move is accepted
4209/// != 0 otherwise
4210
4211typedef int idaapi custom_viewer_can_navigate_t(
4212 TWidget *v,
4213 const lochist_entry_t *now,
4214 const locchange_md_t &md,
4215 void *ud);
4216
4217
4219
4221 TWidget *v,
4222 const lochist_entry_t *was,
4223 const lochist_entry_t *now,
4224 const locchange_md_t &md,
4225 void *ud);
4226
4227
4228// Code viewer handlers for the lineinfo widget located to the left of the text.
4232
4233typedef void idaapi code_viewer_lines_click_t(TWidget *c, const place_t *p, int pos, int shift, void *ud);
4234
4235
4247
4248typedef int idaapi code_viewer_lines_icon_t(TWidget *cv, const place_t *p, int *pos, void *ud);
4249
4250
4252
4253typedef bool idaapi code_viewer_lines_linenum_t(TWidget *cv, const place_t *p, uval_t *num, void *ud);
4254
4255#endif // SWIG
4256
4257//-------------------------------------------------------------------------
4259{
4260 iek_unknown = 0,
4268
4269//-------------------------------------------------------------------------
4275 int cb;
4276 input_event_kind_t kind;
4277 input_event_modifiers_t modifiers;
4278 TWidget *target;
4279 void *source;
4280
4281 struct input_event_shortcut_data_t
4283 const char *action_name;
4287 int key;
4288 char text[8];
4289 };
4291 {
4292 int x;
4293 int y;
4295 };
4297 union
4298 {
4305 {
4306 memset(this, 0, sizeof(*this));
4307 cb = sizeof(*this);
4311//------------------------------------------------------------------------
4312
4313/// Command line interpreter.
4314/// Provides functionality for the command line (located at the bottom of the main window).
4315/// Only GUI version of IDA supports CLIs.
4316struct cli_t
4317{
4318 size_t size;
4319 int32 flags;
4323#define CLIF_QT_AWARE 1
4325 const char *sname;
4326 const char *lname;
4327 const char *hint;
4334 bool (idaapi *execute_line)(const char *line);
4346 bool (idaapi *keydown)(
4347 qstring *line,
4348 int *p_x,
4349 int *p_sellen,
4350 int *p_vk_key,
4351 int shift);
4352
4370 bool (idaapi *find_completions)(
4371 qstrvec_t *out_completions,
4374 int *out_match_start,
4375 int *out_match_end,
4376 const char *line,
4377 int x);
4378};
4380//---------------------------------------------------------------------------
4384#define MFF_FAST 0x0000
4387
4388#define MFF_READ 0x0001
4395
4396#define MFF_WRITE 0x0002
4402
4403#define MFF_NOWAIT 0x0004
4413
4414
4416struct exec_request_t
4417{
4419 enum { MFF_MAGIC = 0x12345678 };
4420
4422 bool valid() const
4423 {
4424 return (code & ~7) == MFF_MAGIC && (sem != nullptr || (code & MFF_NOWAIT) != 0);
4426
4427 ssize_t code = 0;
4428 qsemaphore_t sem = nullptr;
4434 virtual ssize_t idaapi execute() = 0;
4435
4437 virtual ~exec_request_t() { qsem_free(sem); sem = nullptr; code = 0; }
4438};
4439
4440//---------------------------------------------------------------------------
4444{
4445public:
4448
4449 virtual bool idaapi run() = 0;
4450 virtual ~ui_request_t() {}
4451};
4457class ui_requests_t : public qlist<ui_request_t *>
4459 DECLARE_UNCOPYABLE(ui_requests_t)
4460public:
4461 ui_requests_t() {}
4463 {
4464 for ( iterator p=begin(); p != end(); ++p )
4465 delete *p;
4467};
4468
4470typedef void idaapi ss_restore_cb_t(const char *errmsg, void *ud);
4471
4475#define UIJMP_ACTIVATE 0x0001
4476#define UIJMP_DONTPUSH 0x0002
4477
4478#define UIJMP_VIEWMASK 0x000C
4479#define UIJMP_ANYVIEW 0x0000
4480#define UIJMP_IDAVIEW 0x0004
4481#define UIJMP_IDAVIEW_NEW 0x0008
4483
4486struct dirtree_selection_t;
4487
4488//-------------------------------------------------------------------------
4489// Current selection
4491{
4492 twinpos_t from;
4493 twinpos_t to;
4494
4495 action_ctx_base_cur_sel_t() { reset(); }
4496 void reset()
4497 {
4498 from.at = nullptr;
4499 from.x = -1;
4500 to.at = nullptr;
4501 to.x = -1;
4503};
4505//-------------------------------------------------------------------------
4508struct action_ctx_base_t
4509{
4512 {
4513 reset();
4514 }
4515
4517/// used by action_ctx_base_t::cur_flags
4518///@{
4519#define ACF_HAS_SELECTION (1 << 0)
4520#define ACF_XTRN_EA (1 << 1)
4521#define ACF_HAS_FIELD_DIRTREE_SELECTION (1 << 2)
4522#define ACF_HAS_SOURCE (1 << 3)
4523#define ACF_HAS_TYPE_REF (1 << 4)
4524
4525
4527 void reset()
4528 {
4529 widget = nullptr;
4530 widget_type = BWN_UNKNOWN;
4531 widget_title.clear();
4532 chooser = nullptr;
4533 chooser_selection.clear();
4534 action = nullptr;
4535
4537 cur_flags = ACF_HAS_FIELD_DIRTREE_SELECTION | ACF_HAS_SOURCE | ACF_HAS_TYPE_REF;
4538 cur_ea = BADADDR;
4539 cur_value = BADADDR;
4540 cur_func = cur_fchunk = nullptr;
4541 cur_seg = nullptr;
4542 cur_sel.reset();
4543 regname = nullptr;
4544 focus = nullptr;
4545 graph = nullptr;
4546 graph_selection = nullptr;
4547 dirtree_selection = nullptr;
4548 type_ref = nullptr;
4549 }
4550 TWidget *widget;
4551 twidget_type_t widget_type;
4552 qstring widget_title;
4553 chooser_base_t *chooser;
4554 sizevec_t chooser_selection;
4555
4556 const char *action;
4557
4558 uint32 cur_flags;
4561 bool has_flag(uint32 flag) const { return (cur_flags & flag) == flag; }
4566 func_t *cur_func;
4568
4573 const char *regname;
4574
4579 const selection_item_t *hovered;
4585
4586//-------------------------------------------------------------------------
4593//-------------------------------------------------------------------------
4594
4599
4600#define AHF_VERSION 1
4601#define AHF_VERSION_MASK 0xFF
4602
4603//-------------------------------------------------------------------------
4605struct action_handler_t
4606{
4607 int flags;
4608
4610 action_handler_t(int _f = 0) : flags(_f) { flags |= AHF_VERSION; }
4611
4614 /// It is called when the action is triggered, from a menu, from
4615 /// a popup menu, from the toolbar, or programmatically.
4616 /// \return non-zero: all IDA windows will be refreshed
4617 virtual int idaapi activate(action_activation_ctx_t *ctx) = 0;
4618
4629 virtual action_state_t idaapi update(action_update_ctx_t *ctx) = 0;
4630
4632 virtual ~action_handler_t() {}
4633
4634 // Action handles may be allocated by a plugin and deleted by the kernel.
4635 // Therefore it is a good idea to unify the memory allocation methods.
4636 DEFINE_MEMORY_ALLOCATION_FUNCS();
4637};
4640struct action_desc_t
4642 int cb;
4643 const char *name;
4646
4647 const char *label;
4653 const void *owner;
4657 const char *shortcut;
4658 const char *tooltip;
4659 int icon;
4660
4664#define ADF_OWN_HANDLER 0x01
4667#define ADF_NO_UNDO 0x02
4669#define ADF_OT_MASK 0x0C
4670#define ADF_OT_PLUGIN 0x00
4671#define ADF_OT_PLUGMOD 0x04
4672#define ADF_OT_PROCMOD 0x08
4673#define ADF_GLOBAL 0x10
4675#define ADF_NO_HIGHLIGHT 0x20
4677#define ADF_CHECKABLE 0x40
4678#define ADF_CHECKED 0x80
4680 int flags;
4681};
4682
4685#define ACTION_DESC_LITERAL_PLUGMOD(name, label, handler, plgmod, shortcut, tooltip, icon) \
4686 { sizeof(action_desc_t), name, label, handler, plgmod, shortcut, tooltip, icon, ADF_OT_PLUGMOD }
4687
4690#define ACTION_DESC_LITERAL_PROCMOD(name, label, handler, prcmod, shortcut, tooltip, icon) \
4691 { sizeof(action_desc_t), name, label, handler, prcmod, shortcut, tooltip, icon, ADF_OT_PROCMOD }
4692
4694#define ACTION_DESC_LITERAL_OWNER(name, label, handler, owner, shortcut, tooltip, icon, flags) \
4695 { sizeof(action_desc_t), name, label, handler, owner, shortcut, tooltip, icon, flags }
4696
4698#define DYNACTION_DESC_LITERAL(label, handler, shortcut, tooltip, icon) \
4699 { sizeof(action_desc_t), nullptr, label, handler, nullptr, shortcut, tooltip, icon, ADF_OWN_HANDLER }
4700
4702enum action_attr_t
4703{
4704 AA_NONE,
4705 AA_LABEL,
4706 AA_SHORTCUT,
4707 AA_TOOLTIP,
4708 AA_ICON,
4709 AA_STATE,
4710 AA_CHECKABLE,
4715#ifndef SWIG
4716// Handlers to be used with create_custom_viewer()
4719 int cb;
4720public:
4722 custom_viewer_keydown_t *_keyboard = nullptr,
4723 custom_viewer_popup_t *_popup = nullptr,
4724 custom_viewer_mouse_moved_t *_mouse_moved = nullptr,
4725 custom_viewer_click_t *_click = nullptr,
4726 custom_viewer_dblclick_t *_dblclick = nullptr,
4727 custom_viewer_curpos_t *_curpos = nullptr,
4728 custom_viewer_close_t *_close = nullptr,
4729 custom_viewer_help_t *_help = nullptr,
4730 custom_viewer_adjust_place_t *_adjust_place = nullptr,
4731 custom_viewer_get_place_xcoord_t *_get_place_xcoord = nullptr,
4732 custom_viewer_location_changed_t *_location_changed = nullptr,
4733 custom_viewer_can_navigate_t *_can_navigate = nullptr)
4734 : cb(sizeof(*this)),
4735 keyboard(_keyboard),
4736 popup(_popup),
4737 mouse_moved(_mouse_moved),
4738 click(_click),
4739 dblclick(_dblclick),
4740 curpos(_curpos),
4741 close(_close),
4742 obsolete_help(nullptr),
4743 adjust_place(_adjust_place),
4744 get_place_xcoord(_get_place_xcoord),
4745 location_changed(_location_changed),
4746 can_navigate(_can_navigate),
4747 help(_help)
4748 {}
4749 custom_viewer_keydown_t *keyboard;
4750 custom_viewer_popup_t *popup;
4751 custom_viewer_mouse_moved_t *mouse_moved;
4752 custom_viewer_click_t *click;
4753 custom_viewer_dblclick_t *dblclick;
4754 custom_viewer_curpos_t *curpos;
4755 custom_viewer_close_t *close;
4756 obsolete_custom_viewer_help_t *obsolete_help;
4757 custom_viewer_adjust_place_t *adjust_place;
4763 int size() const { return cb; }
4765#endif // SWIG
4768#ifndef __UI__ // Not for the UI
4770// Convenience functions offered by the user interface
4771
4774
4775THREAD_SAFE inline int execute_ui_requests(ui_requests_t *reqs)
4776{
4777 return callui(ui_execute_ui_requests_list, reqs).i;
4778}
4779
4780
4784/// \return a request id: a unique number that can be used to cancel the request
4785
4786THREAD_SAFE inline int execute_ui_requests(ui_request_t *req, ...)
4787{
4788 va_list va;
4789 va_start(va, req);
4790 int req_id = callui(ui_execute_ui_requests, req, va).i;
4791 va_end(va);
4792 return req_id;
4793}
4794
4800
4801THREAD_SAFE inline bool cancel_exec_request(int req_id)
4802{
4803 return callui(ui_execute_sync_ctl, esctl_cancel_request, req_id).cnd;
4804}
4805
4806
4811THREAD_SAFE inline int cancel_thread_exec_requests(qthread_t tid)
4812{
4814}
4815
4816
4820/// Setting it to `esa_unavailable` will cause the existing requests for
4821/// this thread to be cancelled.
4822/// Setting it to `esa_release` will clear the status for this thread, and
4823/// should be issued right before a call to `qthread_free` is issued.
4824///
4825/// \param tid thread id
4826/// \param availability the availability
4827/// \return the previous availability
4828
4830 qthread_t tid,
4831 execute_sync_availability_t availability)
4832{
4833 auto i = callui(ui_execute_sync_ctl, esctl_set_availability, tid, availability).i;
4835}
4836
4837
4838/// Get the group of widgets/registers
4839/// this view is synchronized with
4840/// \param w the widget
4841/// \return the group of widgets/registers, or nullptr
4842
4843inline const synced_group_t *get_synced_group(const TWidget *w)
4844{
4845 return (synced_group_t *) callui(ui_get_synced_group, w).vptr;
4846}
4847
4852/// \return success
4853
4854inline bool jumpto(ea_t ea, int opnum=-1, int uijmp_flags=UIJMP_ACTIVATE)
4855{
4856 return callui(ui_jumpto, ea, opnum, uijmp_flags).cnd;
4857}
4858
4859
4863/// \retval 0 esc was pressed
4864
4865inline bool banner(int wait) { return callui(ui_banner, wait).cnd; }
4866
4867
4869
4870THREAD_SAFE inline bool is_msg_inited() { return callui(ui_is_msg_inited).cnd; }
4871
4872
4875inline void refresh_idaview() { callui(ui_refreshmarked); }
4876
4877
4880
4881inline void refresh_idaview_anyway() { callui(ui_refresh); }
4882
4883
4885
4887
4888
4891inline ea_t get_screen_ea() { ea_t ea; callui(ui_screenea, &ea); return ea; }
4892
4893
4896inline int get_opnum() { return callui(ui_get_opnum).i; }
4897
4898
4906inline bool get_cursor(int *x, int *y) { return callui(ui_get_cursor, x, y).cnd; }
4907
4908
4916
4917inline bool get_output_cursor(int *x, int *y) { return callui(ui_get_output_cursor, x, y).cnd; }
4918
4919
4923
4924inline const char *get_curline() { return callui(ui_get_curline).cptr; }
4925
4928
4929inline void open_url(const char *url) { callui(ui_open_url, url); }
4930
4931
4934
4935inline ea_t get_hexdump_ea(int hexdump_num) { ea_t ea; callui(ui_hexdumpea, &ea, hexdump_num); return ea; }
4936
4937
4939
4940inline ushort get_key_code(const char *keyname) { return callui(ui_get_key_code, keyname).i16; }
4941
4942
4947
4948inline ushort lookup_key_code(int key, int shift, bool is_qt) { return callui(ui_lookup_key_code, key, shift, is_qt).i16; }
4950
4953
4954inline void refresh_navband(bool force) { callui(ui_refresh_navband, force); }
4955
4956
4960
4961inline bool refresh_chooser(const char *title) { return callui(ui_refresh_chooser, title).cnd; }
4962
4967
4968inline bool close_chooser(const char *title) { return callui(ui_close_chooser, title).cnd; }
4969
4972
4973inline void install_command_interpreter(const cli_t *cp) { callui(ui_install_cli, cp, true); }
4974
4975
4978inline void remove_command_interpreter(const cli_t *cp) { callui(ui_install_cli, cp, false); }
4979
4980
4986
4987inline void gen_disasm_text(text_t &text, ea_t ea1, ea_t ea2, bool truncate_lines) { callui(ui_gen_disasm_text, &text, ea1, ea2, truncate_lines); }
4988
4989
4995
4996THREAD_SAFE inline ssize_t execute_sync(exec_request_t &req, int reqf) { return callui(ui_execute_sync, &req, reqf).ssize; }
4997
4998
5008
5009inline bool set_dock_pos(const char *src_ctrl, const char *dest_ctrl, int orient, int left = 0, int top = 0, int right = 0, int bottom = 0)
5010{
5011 return callui(ui_set_dock_pos, src_ctrl, dest_ctrl, orient, left, top, right, bottom).cnd;
5012}
5013
5017
5018inline int get_icon_id_by_name(const char *icon_name) { return callui(ui_get_icon_id_by_name, icon_name).i; }
5019
5022
5024
5025inline int load_custom_icon(const char *file_name) { return callui(ui_load_custom_icon_file, file_name).i; }
5026
5033
5034inline int load_custom_icon(const void *ptr, unsigned int len, const char *format) { return callui(ui_load_custom_icon, ptr, len, format).i; }
5035
5036
5038
5039inline void free_custom_icon(int icon_id) { callui(ui_free_custom_icon, icon_id); }
5040
5041
5046
5047inline bool process_ui_action(const char *name, int flags=0, void *param=nullptr)
5049 return callui(ui_process_action, name, flags, param).cnd;
5050}
5051
5052
5056/// - out: filename, id
5057/// \param err_msg optional error msg buffer
5058/// \return success
5059
5060inline bool take_database_snapshot(
5061 snapshot_t *ss,
5062 qstring *err_msg)
5063{
5064 return callui(ui_take_database_snapshot, ss, err_msg).cnd;
5065}
5066
5067
5069/// Note: This call is asynchronous. When it is completed, the callback will be triggered.
5070/// \param ss snapshot instance (see build_snapshot_tree())
5071/// \param cb A callback that will be triggered with a nullptr string.
5072/// on success and an actual error message on failure.
5073/// \param ud user data passed to be passed to the callback
5074/// \return false if restoration could not be started (snapshot file was not found). \n
5075/// If the returned value is True then check if the operation succeeded from the callback.
5076
5077inline bool restore_database_snapshot(
5078 const snapshot_t *ss,
5079 ss_restore_cb_t *cb,
5080 void *ud)
5081{
5082 return callui(ui_restore_database_snapshot, ss, cb, ud).cnd;
5083}
5084
5086typedef struct __qtimer_t {} *qtimer_t;
5087
5088
5093
5097
5098THREAD_SAFE inline qtimer_t register_timer(
5099 int interval_ms,
5100 int (idaapi *callback)(void *ud),
5101 void *ud)
5102{
5103 return (qtimer_t)(callui(ui_register_timer, interval_ms, callback, ud).vptr);
5104}
5105
5106
5107/// Unregister a timer (::ui_unregister_timer).
5108/// \param t handle to a registered timer
5109/// \return success
5110
5111THREAD_SAFE inline bool unregister_timer(qtimer_t t)
5112{
5113 return callui(ui_unregister_timer, t).cnd;
5114}
5115
5116//-------------------------------------------------------------------------
5117
5120/// to menu items (attach_action_to_menu()), or to popup menus
5121/// (attach_action_to_popup()).
5122///
5123/// Because the actions will need to call the handler's activate() and
5124/// update() methods at any time, you shouldn't build your action handler
5125/// on the stack.
5126///
5127/// Please see the SDK's "ht_view" plugin for an example how
5128/// to register actions.
5129/// \param desc action to register
5130/// \return success
5131
5132inline bool register_action(const action_desc_t &desc)
5133{
5134 return callui(ui_register_action, &desc).cnd;
5135}
5136
5137
5142inline bool unregister_action(const char *name)
5143{
5144 return callui(ui_unregister_action, name).cnd;
5145}
5146
5147
5150inline void get_registered_actions(qstrvec_t *out)
5153}
5154
5155
5159/// \param before if non-nullptr, the toolbar before which the new toolbar will be inserted
5160/// \param flags a combination of \ref CREATETB_, to determine toolbar position
5161/// \return success
5162inline bool create_toolbar(
5163 const char *name,
5164 const char *label,
5165 const char *before = nullptr,
5166 int flags = 0)
5167{
5168 return callui(ui_create_toolbar, name, label, before, flags).cnd;
5169}
5170
5175inline bool delete_toolbar(const char *name)
5176{
5177 return callui(ui_delete_toolbar, name).cnd;
5178}
5179
5180
5184/// the menu should be positioned.
5185/// First, IDA will try and resolve the corresponding menu by its name.
5186/// If such an existing menu is found and is present in the menubar,
5187/// then the new menu will be inserted in the menubar before it.
5188/// Otherwise, IDA will try to resolve 'menupath' as it would for
5189/// attach_action_to_menu() and, if found, add the new menu like so:
5190/// \code
5191/// // The new 'My menu' submenu will appear in the 'Comments' submenu
5192/// // before the 'Enter comment..." command
5193/// create_menu("(...)", "My menu", "Edit/Comments/Enter comment...");
5194/// \endcode
5195/// or
5196/// \code
5197/// // The new 'My menu' submenu will appear at the end of the
5198/// // 'Comments' submenu.
5199/// create_menu("(...)", "My menu", "Edit/Comments/");
5200/// \endcode
5201/// If the above fails, the new menu will be appended to the menubar.
5202/// \param name name of menu (must be unique)
5203/// \param label label of menu
5204/// \param menupath where should the menu be inserted
5205/// \return success
5206inline bool create_menu(
5207 const char *name,
5208 const char *label,
5209 const char *menupath=nullptr)
5210{
5211 return callui(ui_create_menu, name, label, menupath).cnd;
5212}
5213
5218inline bool delete_menu(const char *name)
5219{
5220 return callui(ui_delete_menu, name).cnd;
5221}
5222
5223
5226/// If you want to modify the debugger menu, do it at the ui_debugger_menu_change
5227/// event (ida might destroy your menu item if you do it elsewhere).
5228/// \param menupath path to the menu item after or before which the insertion will take place. \n
5229/// - Example: Debug/StartProcess
5230/// - Whitespace, punctuation are ignored.
5231/// - It is allowed to specify only the prefix of the menu item.
5232/// - Comparison is case insensitive.
5233/// - menupath may start with the following prefixes:
5234/// - [S] - modify the main menu of the structure window
5235/// - [E] - modify the main menu of the enum window
5236/// \param name the action name
5237/// \param flags a combination of \ref SETMENU_, to determine menu item position
5238/// \return success
5239
5240inline bool attach_action_to_menu(
5241 const char *menupath,
5242 const char *name,
5243 int flags=0)
5244{
5245 return callui(ui_attach_action_to_menu, menupath, name, flags).cnd;
5246}
5247
5253
5254inline bool detach_action_from_menu(
5255 const char *menupath,
5256 const char *name)
5257{
5258 return callui(ui_detach_action_from_menu, menupath, name).cnd;
5259}
5260
5261
5262/// Attach an action to an existing toolbar (::ui_attach_action_to_toolbar).
5263/// \param toolbar_name the name of the toolbar
5264/// \param name the action name
5265/// \return success
5266
5267inline bool attach_action_to_toolbar(
5268 const char *toolbar_name,
5269 const char *name)
5270{
5271 return callui(ui_attach_action_to_toolbar, toolbar_name, name).cnd;
5272}
5273
5274
5275/// Detach an action from the toolbar (::ui_detach_action_from_toolbar).
5276/// \param toolbar_name the name of the toolbar
5277/// \param name the action name
5278/// \return success
5279
5280inline bool detach_action_from_toolbar(
5281 const char *toolbar_name,
5282 const char *name)
5283{
5284 return callui(ui_detach_action_from_toolbar, toolbar_name, name).cnd;
5285}
5286
5287
5288/// Helper.
5289///
5290/// You are not encouraged to use this, as it mixes flags for
5291/// both register_action(), and attach_action_to_menu().
5292///
5293/// The only reason for its existence is to make it simpler
5294/// to port existing plugins to the new actions API.
5295
5296inline bool register_and_attach_to_menu(
5297 const char *menupath,
5298 const char *name,
5299 const char *label,
5300 const char *shortcut,
5301 int flags,
5302 action_handler_t *handler,
5303 void *owner,
5304 int action_desc_t_flags)
5305{
5306 action_desc_t desc = ACTION_DESC_LITERAL_OWNER(name, label, handler, owner, shortcut, nullptr, -1, action_desc_t_flags);
5307 if ( !register_action(desc) )
5308 return false;
5309 if ( !attach_action_to_menu(menupath, name, (flags & SETMENU_POSMASK)) )
5310 {
5312 return false;
5313 }
5314 return true;
5315}
5316
5317//------------------------------------------------------------------------
5318// Get VCL global variables
5319class TPopupMenu;
5320
5324
5327
5328inline void display_widget(TWidget *widget, uint32 options, const char *dest_ctrl=nullptr)
5329{
5330 callui(ui_display_widget, widget, options, dest_ctrl);
5331}
5332
5333
5336/// \param options \ref WIDGET_CLOSE
5337
5338inline void close_widget(TWidget *widget, int options)
5339{
5340 callui(ui_close_widget, widget, options);
5341}
5342
5343
5346/// \param take_focus give focus to given widget
5347
5348inline void activate_widget(TWidget *widget, bool take_focus)
5349{
5350 callui(ui_activate_widget, widget, take_focus);
5351}
5352
5353
5356/// \param caption title of tab, or window title if widget is not tabbed
5357/// \return pointer to the TWidget, nullptr if none is found
5358
5359inline TWidget *find_widget(const char *caption)
5360{
5361 return (TWidget *) callui(ui_find_widget, caption).vptr;
5362}
5363
5364
5366
5368{
5369 return (TWidget *) callui(ui_get_current_widget).vptr;
5370}
5371
5372
5374
5376{
5377 return twidget_type_t(callui(ui_get_widget_type, widget).i);
5378}
5379
5380
5382
5383inline bool get_widget_title(qstring *buf, TWidget *widget)
5384{
5385 return callui(ui_get_widget_title, buf, widget).cnd;
5386}
5387
5391/// \param maxplace last location of the viewer
5392/// \param curplace set current location
5393/// \param rinfo renderer information (can be nullptr)
5394/// \param ud user data for the viewer
5395/// \param cvhandlers handlers for the viewer (can be nullptr)
5396/// \param cvhandlers_ud pointer to arbitrary user data; it will be passed to cvhandlers
5397/// \param parent widget to hold viewer
5398/// \return pointer to resulting viewer
5399
5401 const char *title,
5402 const place_t *minplace,
5403 const place_t *maxplace,
5404 const place_t *curplace,
5405 const renderer_info_t *rinfo,
5406 void *ud,
5407 const custom_viewer_handlers_t *cvhandlers,
5408 void *cvhandlers_ud,
5409 TWidget *parent = nullptr)
5410{
5411 return (TWidget*) callui(
5412 ui_create_custom_viewer, title, minplace,
5413 maxplace, curplace, rinfo, ud, cvhandlers, cvhandlers_ud, parent).vptr;
5414}
5415
5416
5423
5424inline bool custom_viewer_jump(
5425 TWidget *v,
5426 const lochist_entry_t &loc,
5427 uint32 flags=0)
5428{
5429 return callui(ui_custom_viewer_jump, v, &loc, flags).cnd;
5430}
5431
5439
5440inline bool ea_viewer_history_push_and_jump(TWidget *v, ea_t ea, int x, int y, int lnnum)
5441{
5442 return callui(ui_ea_viewer_history_push_and_jump, v, ea, x, y, lnnum).cnd;
5443}
5444
5445
5448/// \param[out] nfwd number of available forward steps
5449/// \param v ea viewer
5450/// \retval false if the given ea viewer does not exist
5451/// \retval true otherwise
5452
5453inline bool get_ea_viewer_history_info(int *nback, int *nfwd, TWidget *v)
5454{
5455 return callui(ui_ea_viewer_history_info, nback, nfwd, v).cnd;
5456}
5457
5458
5460
5461inline void refresh_custom_viewer(TWidget *custom_viewer)
5462{
5463 callui(ui_refresh_custom_viewer, custom_viewer);
5464}
5465
5466
5468
5469inline void repaint_custom_viewer(TWidget *custom_viewer)
5470{
5471 callui(ui_repaint_qwidget, custom_viewer);
5472}
5473
5474
5476
5477inline void destroy_custom_viewer(TWidget *custom_viewer)
5478{
5479 callui(ui_destroy_custom_viewer, custom_viewer);
5480}
5481
5482
5485/// \param place target position
5486/// \param x desired cursor position (column)
5487/// \param y desired cursor position (line)
5488/// \return success
5489
5490inline bool jumpto(TWidget *custom_viewer, place_t *place, int x, int y)
5491{
5492 return callui(ui_jump_in_custom_viewer, custom_viewer, place, x, y).cnd;
5493}
5494
5495
5498/// See also the more complete get_custom_viewer_location()
5499///
5500/// \param custom_viewer view
5501/// \param mouse mouse position (otherwise cursor position)
5502/// \param[out] x x coordinate
5503/// \param[out] y y coordinate
5504
5506 TWidget *custom_viewer,
5507 bool mouse,
5508 int *x,
5509 int *y)
5510{
5511 return (place_t *)callui(ui_get_curplace, custom_viewer, mouse, x, y).vptr;
5512}
5514inline bool get_custom_viewer_location(
5515 lochist_entry_t *out,
5516 TWidget *custom_viewer,
5517 bool mouse=false)
5518{
5519 return callui(ui_obsolete_get_custom_viewer_location, out, custom_viewer, mouse).cnd;
5520}
5521
5522//-------------------------------------------------------------------------
5528inline bool get_custom_viewer_location(
5529 listing_location_t *out,
5530 TWidget *custom_viewer,
5531 uint32 flags=0)
5532{
5533 return callui(ui_get_custom_viewer_location_2, out, custom_viewer, flags).cnd;
5534}
5535
5538
5539inline bool is_idaq()
5540{
5541 return callui(ui_is_idaq).cnd;
5542}
5543
5544
5547/// \param widget target widget
5548/// \param popup_handle target popup menu
5549/// - if non-nullptr, the action is added to this popup
5550/// menu invocation (i.e., 'single-shot')
5551/// - if nullptr, the action is added to a list of actions
5552/// that should always be present in context menus for this widget
5553/// (i.e., 'permanent'.)
5554/// \param name action name
5555/// \param popuppath can be nullptr
5556/// \param flags a combination of SETMENU_ flags (see \ref SETMENU_)
5557/// \return success
5558
5559inline bool attach_action_to_popup(
5560 TWidget *widget,
5561 TPopupMenu *popup_handle,
5562 const char *name,
5563 const char *popuppath = nullptr,
5564 int flags=0)
5565{
5566 return callui(ui_attach_action_to_popup, widget, popup_handle, name, popuppath, flags).cnd;
5568
5569
5576
5577
5578inline bool detach_action_from_popup(TWidget *widget, const char *name)
5579{
5580 return callui(ui_detach_action_from_popup, widget, name).cnd;
5581}
5582
5583
5586/// will be 'delete'd when the action is unregistered.
5587/// \param unused deprecated; should be nullptr
5588/// \param popup_handle target popup
5589/// \param desc created with #DYNACTION_DESC_LITERAL
5590/// \param popuppath can be nullptr
5591/// \param flags a combination of SETMENU_ constants (see \ref SETMENU_)
5592/// \param buf a buffer, to retrieve the generated action name - can be nullptr
5593/// \return success
5594
5596 TWidget *unused,
5597 TPopupMenu *popup_handle,
5598 const action_desc_t &desc,
5599 const char *popuppath = nullptr,
5600 int flags = 0,
5601 qstring *buf = nullptr)
5602{
5604 popup_handle, &desc, popuppath, flags, buf).cnd;
5605}
5606
5610
5614
5615
5616inline bool update_action_label(const char *name, const char *label)
5617{
5618 return callui(ui_update_action_attr, name, AA_LABEL, label).cnd;
5619}
5620
5621
5624/// \param shortcut new shortcut
5625/// \return success
5626
5627inline bool update_action_shortcut(const char *name, const char *shortcut)
5628{
5629 return callui(ui_update_action_attr, name, AA_SHORTCUT, shortcut).cnd;
5630}
5631
5632
5635/// \param tooltip new tooltip
5636/// \return success
5637
5638inline bool update_action_tooltip(const char *name, const char *tooltip)
5639{
5640 return callui(ui_update_action_attr, name, AA_TOOLTIP, tooltip).cnd;
5641}
5642
5643
5646/// \param icon new icon id
5647/// \return success
5648
5649inline bool update_action_icon(const char *name, int icon)
5650{
5651 return callui(ui_update_action_attr, name, AA_ICON, &icon).cnd;
5652}
5653
5654
5657/// \param state new state
5658/// \return success
5659
5660inline bool update_action_state(const char *name, action_state_t state)
5661{
5662 return callui(ui_update_action_attr, name, AA_STATE, &state).cnd;
5663}
5664
5665
5668/// \param checkable new checkability
5669/// \return success
5670
5671inline bool update_action_checkable(const char *name, bool checkable)
5672{
5673 return callui(ui_update_action_attr, name, AA_CHECKABLE, &checkable).cnd;
5674}
5675
5676
5679/// \param checked new checked state
5680/// \return success
5681
5682inline bool update_action_checked(const char *name, bool checked)
5683{
5684 return callui(ui_update_action_attr, name, AA_CHECKED, &checked).cnd;
5685}
5686
5687
5690/// \param visible new visibility
5691/// \return success
5692
5693inline bool update_action_visibility(const char *name, bool visible)
5694{
5695 return callui(ui_update_action_attr, name, AA_VISIBILITY, &visible).cnd;
5696}
5697
5699
5701/// Convenience functions for ::ui_get_action_attr
5702//{
5703
5705
5708
5709inline bool get_action_label(qstring *label, const char *name)
5710{
5711 return callui(ui_get_action_attr, name, AA_LABEL, label).cnd;
5712}
5713
5714
5717/// \param name the action name
5718/// \return success
5719
5720inline bool get_action_shortcut(qstring *shortcut, const char *name)
5721{
5722 return callui(ui_get_action_attr, name, AA_SHORTCUT, shortcut).cnd;
5723}
5724
5725
5728/// \param name the action name
5729/// \return success
5730
5731inline bool get_action_tooltip(qstring *tooltip, const char *name)
5732{
5733 return callui(ui_get_action_attr, name, AA_TOOLTIP, tooltip).cnd;
5734}
5735
5736
5739/// \param[out] icon the icon id
5740/// \return success
5741
5742inline bool get_action_icon(const char *name, int *icon)
5743{
5744 return callui(ui_get_action_attr, name, AA_ICON, icon).cnd;
5745}
5746
5747
5750/// \param[out] state the action's state
5751/// \return success
5752
5753inline bool get_action_state(const char *name, action_state_t *state)
5754{
5755 return callui(ui_get_action_attr, name, AA_STATE, state).cnd;
5756}
5757
5758
5761/// \param[out] checkable the action's checkability
5762/// \return success
5763
5764inline bool get_action_checkable(const char *name, bool *checkable)
5765{
5766 return callui(ui_get_action_attr, name, AA_CHECKABLE, checkable).cnd;
5767}
5768
5769
5772/// \param[out] checked the action's checked state
5773/// \return success
5774
5775inline bool get_action_checked(const char *name, bool *checked)
5776{
5777 return callui(ui_get_action_attr, name, AA_CHECKED, checked).cnd;
5778}
5779
5780
5783/// \param[out] visibility the action's visibility
5784/// \return success
5785
5786inline bool get_action_visibility(const char *name, bool *visibility)
5787{
5788 return callui(ui_get_action_attr, name, AA_VISIBILITY, visibility).cnd;
5789}
5790
5792
5794/// Convenience functions for ::ui_set_custom_viewer_handler
5795///@{
5796
5798
5799
5800inline void set_custom_viewer_handlers(
5801 TWidget *custom_viewer,
5802 const custom_viewer_handlers_t *cvh,
5803 void *cvh_ud)
5804{
5805 callui(ui_set_custom_viewer_handlers, custom_viewer, cvh, cvh_ud);
5806}
5807
5815
5816inline void *set_custom_viewer_handler(
5817 TWidget *custom_viewer,
5818 custom_viewer_handler_id_t handler_id,
5819 void *handler_or_data)
5820{
5821 return callui(ui_set_custom_viewer_handler, custom_viewer, handler_id,
5822 handler_or_data).vptr;
5823}
5825
5827
5828inline bool set_custom_viewer_qt_aware(TWidget *custom_viewer)
5829{
5830 return callui(ui_set_custom_viewer_handler, custom_viewer, CVH_QT_AWARE).cnd;
5831}
5832
5834
5835
5836/// Get current line of custom viewer (::ui_get_custom_viewer_curline).
5837/// The returned line contains color codes
5838///
5839/// See also the more powerful get_custom_viewer_location()
5840///
5841/// \param custom_viewer view
5842/// \param mouse mouse position (otherwise cursor position)
5843/// \return pointer to contents of current line
5844
5845inline const char *get_custom_viewer_curline(TWidget *custom_viewer, bool mouse)
5846{
5847 return callui(ui_get_custom_viewer_curline, custom_viewer, mouse).cptr;
5848}
5849
5850
5853/// \param pline a place corresponding to the line
5854/// \param pitem a place corresponding to the item
5855/// \retval -1 if 'pitem' is not included in the line
5856/// \retval -2 if 'pitem' points at the entire line
5857/// \retval >= 0 for the X coordinate within the pline, where pitem points
5858
5860 TWidget *custom_viewer,
5861 const place_t *pline,
5862 const place_t *pitem)
5863{
5864 return callui(ui_get_custom_viewer_place_xcoord, custom_viewer, pline, pitem).i;
5865}
5866
5874
5875
5876inline bool get_user_input_event(
5877 input_event_t *out)
5878{
5879 return callui(ui_get_user_input_event, out).cnd;
5880}
5881
5884/// \param mouse current for mouse pointer?
5885/// \return false if output contains no text
5886
5887inline bool get_output_curline(qstring *buf, bool mouse)
5888{
5889 return callui(ui_get_output_curline, buf, mouse).cnd;
5890}
5891
5892
5895/// \return true if there is a selection
5896
5897inline bool get_output_selected_text(qstring *buf)
5898{
5899 return callui(ui_get_output_selected_text, buf).cnd;
5900}
5901
5902
5904
5906{
5907 return (TWidget *)callui(ui_get_current_viewer).vptr;
5908}
5909
5910
5913/// \return the viewer, if found
5914
5915inline TWidget *get_last_widget(uint64 mask=uint64(-1))
5916{
5917 return (TWidget *)callui(ui_get_last_widget, mask).vptr;
5918}
5919
5923/// Note: changes will not apply! It is the caller's job to apply the resulting out_tif.
5924/// Parameters:
5925/// \param[out] errbuf - (::qstring *) the output string for errors
5926/// \param[out] out_tif - (tinfo_t *) tif for created type
5927/// \param pfn - (func_t *) editing function
5928/// \param tif - (tinfo_t *) current function type
5929/// \param name - (const char *) function name
5930/// \return true if new type created successfully
5931
5932inline bool prompt_function_prototype(qstring *errbuf, tinfo_t *out_tif, func_t *pfn, tinfo_t *tif, const char *name)
5933{
5934 return callui(ui_prompt_function_prototype, errbuf, out_tif, pfn, tif, name).cnd;
5935}
5936
5940/// \param out sections storage
5941/// \param line input line
5942/// \return success
5943inline bool parse_tagged_line_sections(tagged_line_sections_t *out, const char *line)
5944{
5945 return callui(ui_parse_tagged_line_sections, out, line).cnd;
5946}
5947
5948
5949
5955}
5956
5957
5959
5964
5965
5967
5969 TWidget *custom_viewer,
5970 const place_t *minplace,
5971 const place_t *maxplace)
5972{
5973 callui(ui_set_custom_viewer_range, custom_viewer, minplace, maxplace);
5974}
5975
5979
5980inline TWidget *create_empty_widget(const char *title, int icon = -1)
5981{
5982 return (TWidget *) callui(ui_create_empty_widget, title, icon).vptr;
5983}
5984
5985
5987
5988inline void msg_clear()
5989{
5991}
5992
5993
5996/// An empty path means that the user will be prompted for
5997/// the destination and, if the file already exists, the user
5998/// will be asked to confirm before overriding its contents.
5999/// Upon return, 'path' will contain the path that the user
6000/// chose.
6001/// \return success
6002
6003inline bool msg_save(qstring &path)
6004{
6005 return callui(ui_msg_save, &path).cnd;
6006}
6007
6008
6011/// \param out Output storage
6012/// \param count The number of lines to retrieve. -1 means: all
6013
6014inline void msg_get_lines(qstrvec_t *out, int count=-1)
6015{
6017}
6018
6019
6022/// this function will return nullptr even if it is currently shown.
6023/// \return TWidget * the active modal widget, or nullptr
6024
6026{
6027 return (TWidget *) callui(ui_get_active_modal_widget).vptr;
6028}
6029
6030
6034inline int get_navband_pixel(bool *out_is_vertical, ea_t ea)
6035{
6036 return callui(ui_navband_pixel, out_is_vertical, ea).i;
6037}
6038
6039
6041
6042inline ea_t get_navband_ea(int pixel)
6043{
6044 ea_t ea = BADADDR;
6045 callui(ui_navband_ea, &ea, pixel);
6046 return ea;
6047}
6048
6049
6050/// Get the system-specific window ID (GUI version only)
6051/// \param name name of the window (nullptr means the main IDA window)
6052/// \return the low-level window ID
6053
6054inline void *get_window_id(const char *name=nullptr)
6055{
6056 return callui(ui_get_window_id, name).vptr;
6057}
6058
6059
6061
6062inline bool is_idaview(TWidget *v)
6063{
6064 return callui(ui_is_idaview, v).cnd;
6065}
6066
6067
6070/// \param[out] p1 start of selection
6071/// \param[out] p2 end of selection
6072/// \retval false no range is selected
6073/// \retval true ok, start and end are filled
6074
6075inline bool read_selection(TWidget *v, twinpos_t *p1, twinpos_t *p2)
6076{
6077 return callui(ui_read_selection, v, p1, p2).cnd;
6078}
6079
6080
6083/// \param v view, nullptr means the last active window
6084/// containing addresses
6085/// \param[out] ea1 start ea
6086/// \param[out] ea2 end ea
6087/// \retval 0 no range is selected \n
6088/// \retval 1 ok, start ea and end ea are filled
6089
6090inline bool read_range_selection(TWidget *v, ea_t *ea1, ea_t *ea2)
6091{
6092 return callui(ui_read_range_selection, v, ea1, ea2).cnd;
6093}
6094
6095
6097
6099
6100
6102
6110
6112 TWidget *custview,
6113 int flags = 0,
6114 TWidget *parent = nullptr)
6115{
6116 return (TWidget*)callui(ui_create_code_viewer, custview, flags, parent).vptr;
6117}
6118
6125
6126inline void *set_code_viewer_handler(
6127 TWidget *code_viewer,
6128 custom_viewer_handler_id_t handler_id,
6129 void *handler_or_data)
6130{
6131 return callui(ui_set_custom_viewer_handler, code_viewer, handler_id,
6132 handler_or_data).vptr;
6133}
6135
6137
6138inline bool set_code_viewer_user_data(TWidget *code_viewer, void *ud)
6139{
6140 return callui(ui_set_custom_viewer_handler, code_viewer, CDVH_USERDATA, ud).cnd;
6141}
6142
6143
6145
6146inline void *get_viewer_user_data(TWidget *viewer)
6147{
6148 return callui(ui_get_viewer_user_data, viewer).vptr;
6149}
6150
6151
6153
6158
6159
6164 TWidget *code_viewer,
6165 code_viewer_lines_click_t *click_handler,
6166 code_viewer_lines_click_t *popup_handler,
6167 code_viewer_lines_click_t *dblclick_handler,
6168 code_viewer_lines_icon_t *drawicon_handler,
6169 code_viewer_lines_linenum_t *linenum_handler)
6170{
6171 callui(ui_set_code_viewer_line_handlers, code_viewer, click_handler,
6172 popup_handler, dblclick_handler, drawicon_handler, linenum_handler);
6173}
6174
6175
6177
6178inline bool set_code_viewer_lines_icon_margin(TWidget *code_viewer, int margin)
6179{
6180 return callui(ui_set_custom_viewer_handler, code_viewer, CDVH_LINES_ICONMARGIN, margin).cnd;
6181}
6182
6183
6185
6186inline bool set_code_viewer_lines_alignment(TWidget *code_viewer, int align)
6187{
6188 return callui(ui_set_custom_viewer_handler, code_viewer, CDVH_LINES_ALIGNMENT, align).cnd;
6189}
6190
6191
6193
6194inline bool set_code_viewer_lines_radix(TWidget *code_viewer, int radix)
6195{
6196 return callui(ui_set_custom_viewer_handler, code_viewer, CDVH_LINES_RADIX, radix).cnd;
6197}
6198
6199
6201
6202inline bool set_code_viewer_is_source(TWidget *code_viewer)
6203{
6204 return callui(ui_set_custom_viewer_handler, code_viewer, CDVH_SRCVIEW).cnd;
6205}
6206
6207
6210/// - if nullptr, the default size is returned.
6211
6212inline int get_tab_size(const char *path)
6213{
6214 return callui(ui_get_tab_size, path).i;
6215}
6216
6217
6219
6220THREAD_SAFE inline void clr_cancelled() { callui(ui_clr_cancelled); }
6221
6222
6224
6225THREAD_SAFE inline void set_cancelled() { callui(ui_set_cancelled); }
6226
6227
6231
6232THREAD_SAFE inline bool user_cancelled() { return callui(ui_test_cancelled).cnd; }
6234
6246
6247inline bool ui_load_new_file(
6248 qstring *temp_file,
6249 qstring *filename,
6250 linput_t **pli,
6251 ushort neflags,
6252 load_info_t **ploaders)
6253{
6254 return callui(ui_load_file, temp_file, filename, pli, neflags, ploaders).cnd;
6256
6257
6264
6265inline bool ui_run_debugger(
6266 const char *dbgopts,
6267 const char *exename,
6268 int argc,
6269 const char *const *argv)
6270{
6271 return callui(ui_run_dbg, dbgopts, exename, argc, argv).cnd;
6272}
6274
6280
6281inline bool load_dbg_dbginfo(
6282 const char *path,
6283 linput_t *li=nullptr,
6284 ea_t base=BADADDR,
6285 bool verbose=false)
6286{
6287 return callui(ui_dbg_load_dbg_dbginfo, path, li, base, verbose).cnd;
6288}
6290
6295
6296inline int add_idc_hotkey(const char *hotkey, const char *idcfunc)
6297{
6298 return callui(ui_add_idckey, hotkey, idcfunc).i;
6299}
6300
6301
6304/// \param viewer the viewer
6305/// \param out_flags storage for the flags (see \ref HIF_)
6306/// \param flags input flags; optionally specify a highlight slot (0-7)
6307/// \return false if no identifier is highlighted
6308
6309inline bool get_highlight(qstring *out_str, TWidget *viewer, uint32 *out_flags, uint32 flags=0)
6310{
6311 return callui(ui_get_highlight_2, out_str, viewer, out_flags, flags).cnd;
6312}
6313
6314
6317/// \param str the text to match, or nullptr to remove current
6318/// \param flags combination of HIF_... bits (see \ref HIF_)
6319/// \return false if an error occurred
6320
6321inline bool set_highlight(TWidget *viewer, const char *str, int flags)
6322{
6323 return callui(ui_set_highlight, viewer, str, flags).cnd;
6324}
6325
6326
6327#ifndef SWIG
6329/// This pointer is initialized by setup_range_marker()
6330
6331extern void (idaapi*range_marker)(ea_t ea, asize_t size);
6332
6333
6335
6336inline void setup_range_marker()
6337{
6338 void *ptr = callui(ui_get_range_marker).vptr;
6339 if ( ptr != nullptr )
6340 range_marker = reinterpret_cast<void (idaapi*)(ea_t, asize_t)>(ptr);
6341}
6342
6345inline void mark_range_for_refresh(ea_t ea, asize_t size)
6346{
6347 if ( range_marker != nullptr )
6348 range_marker(ea, size);
6349}
6350
6351
6354inline void mark_all_eaviews_for_refresh()
6355{
6356 if ( range_marker != nullptr )
6357 range_marker(0, BADADDR);
6358}
6359
6363{
6364 void (idaapi *backup)(ea_t ea, asize_t size);
6366 {
6367 backup = range_marker;
6368 range_marker = nullptr;
6369 }
6371 {
6372 range_marker = backup;
6374 }
6375};
6376#endif // SWIG
6377
6382
6383
6384
6386
6388{
6389 return (TWidget *) callui(ui_open_builtin, BWN_EXPORTS, ea).vptr;
6390}
6391
6392
6395/// \return pointer to resulting window
6396
6398{
6399 return (TWidget *) callui(ui_open_builtin, BWN_IMPORTS, ea).vptr;
6400}
6401
6402
6405/// \return pointer to resulting window
6406
6407inline TWidget *open_names_window(ea_t ea)
6408{
6409 return (TWidget *) callui(ui_open_builtin, BWN_NAMES, ea).vptr;
6410}
6411
6412
6415/// \return pointer to resulting window
6416
6417inline TWidget *open_funcs_window(ea_t ea)
6418{
6419 return (TWidget *) callui(ui_open_builtin, BWN_FUNCS, ea).vptr;
6420}
6421
6422
6425/// \param selstart,selend only display strings that occur within this range
6426/// \return pointer to resulting window
6427
6428inline TWidget *open_strings_window(ea_t ea, ea_t selstart=BADADDR, ea_t selend=BADADDR)
6429{
6430 return (TWidget *) callui(ui_open_builtin, BWN_STRINGS, ea, selstart, selend).vptr;
6431}
6432
6433
6436/// \return pointer to resulting window
6437
6439{
6440 return (TWidget *) callui(ui_open_builtin, BWN_SEGS, ea).vptr;
6441}
6442
6443
6446/// \return pointer to resulting window
6447
6449{
6450 return (TWidget *) callui(ui_open_builtin, BWN_SEGREGS, ea).vptr;
6451}
6452
6453
6458{
6459 return (TWidget *) callui(ui_open_builtin, BWN_SELS, 0).vptr;
6460}
6461
6462
6467{
6468 return (TWidget *) callui(ui_open_builtin, BWN_SIGNS, 0).vptr;
6469}
6470
6471
6475inline TWidget *open_tils_window()
6476{
6477 return (TWidget *) callui(ui_open_builtin, BWN_TILS, 0).vptr;
6478}
6479
6480
6483/// \param cursor cursor to the type member
6484/// \return pointer to resulting window
6485
6486inline TWidget *open_loctypes_window(int ordinal, const tif_cursor_t *cursor=nullptr)
6487{
6488 return (TWidget *) callui(ui_open_builtin2, BWN_TICSR, ordinal, cursor).vptr;
6489}
6490
6494/// \return pointer to resulting window
6495
6496inline TWidget *open_til_view_window(tinfo_t *tif, const tif_cursor_t *cursor=nullptr)
6497{
6498 return (TWidget *) callui(ui_open_builtin2, BWN_TIL_VIEW, tif, cursor).vptr;
6499}
6500
6503
6505{
6506 return (TWidget *) callui(ui_open_builtin, BWN_CALLS, ea).vptr;
6507}
6508
6514{
6515 return (TWidget *) callui(ui_open_builtin, BWN_PROBS, ea).vptr;
6516}
6517
6518
6521/// \return pointer to resulting window
6522
6523inline TWidget *open_bpts_window(ea_t ea)
6524{
6525 return (TWidget *) callui(ui_open_builtin, BWN_BPTS, ea).vptr;
6526}
6527
6528
6533{
6534 return (TWidget *) callui(ui_open_builtin, BWN_THREADS, 0).vptr;
6535}
6536
6537
6542{
6543 return (TWidget *) callui(ui_open_builtin, BWN_MODULES, 0).vptr;
6544}
6545
6546
6550inline TWidget *open_trace_window()
6551{
6552 return (TWidget *) callui(ui_open_builtin, BWN_TRACE, 0).vptr;
6553}
6554
6555
6559inline TWidget *open_stack_window()
6560{
6561 return (TWidget *) callui(ui_open_builtin, BWN_CALL_STACK, 0).vptr;
6562}
6563
6564
6567/// \return pointer to resulting window
6568
6569inline TWidget *open_xrefs_window(ea_t ea)
6570{
6571 return (TWidget *) callui(ui_open_builtin, BWN_XREFS, ea).vptr;
6572}
6573
6574
6577/// \param offset offset where the cursor is placed
6578/// \return pointer to resulting window if 'pfn' is a valid function and the window was displayed, \n
6579/// nullptr otherwise
6580
6581inline TWidget *open_frame_window(func_t *pfn, uval_t offset)
6582{
6583 return (TWidget *) callui(ui_open_builtin, BWN_FRAME, pfn, offset).vptr;
6584}
6585
6586
6589/// \param zoom sets the navband zoom level
6590/// \return pointer to resulting window
6591
6592inline TWidget *open_navband_window(ea_t ea, int zoom)
6593{
6594 return (TWidget *) callui(ui_open_builtin, BWN_NAVBAND, ea, zoom).vptr;
6595}
6596
6597
6600/// \param ranges if != nullptr, then display a flow chart with the specified ranges
6601/// \return pointer to resulting window
6602
6603inline TWidget *open_disasm_window(const char *window_title, const rangevec_t *ranges=nullptr)
6604{
6605 return (TWidget *) callui(ui_open_builtin, BWN_DISASM, window_title, BADADDR, ranges, 0).vptr;
6606}
6607
6608
6611/// \return pointer to resulting window
6612
6613inline TWidget *open_hexdump_window(const char *window_title)
6614{
6615 return (TWidget *) callui(ui_open_builtin, BWN_HEXVIEW, window_title, BADADDR, 0).vptr;
6616}
6617
6618
6623{
6624 return (TWidget *) callui(ui_open_builtin, BWN_NOTEPAD, 0).vptr;
6625}
6626
6627
6630/// this can be an IDAView, or Enums view, etc.
6631/// \return pointer to resulting window
6632
6634{
6635 return (TWidget *) callui(ui_open_builtin, BWN_BOOKMARKS, w, 0).vptr;
6636}
6637
6638
6640
6641/// [Un]synchronize sources
6642/// \param what
6643/// \param with
6644/// \param sync
6645/// \return success
6646inline bool sync_sources(
6647 const sync_source_t &what,
6648 const sync_source_t &with,
6649 bool sync)
6650{
6651 return callui(ui_sync_sources, &what, &with, sync).cnd;
6652}
6653
6658
6659
6661
6662
6663inline char *choose_idasgn()
6664{
6665 return callui(ui_choose, chtype_idasgn).cptr;
6666}
6667
6668
6671/// \retval true 'buf' was filled with the name of the selected til
6672/// \retval false otherwise
6673
6674inline bool choose_til(qstring *buf)
6675{
6676 return callui(ui_choose, chtype_idatil, buf).cnd;
6677}
6678
6679
6682/// \return ea of selected entry point, #BADADDR if none selected
6683
6684inline ea_t choose_entry(const char *title)
6685{
6686 ea_t ea;
6687 callui(ui_choose, chtype_entry, &ea, title);
6688 return ea;
6689}
6690
6691
6692/// Choose a name (::ui_choose, ::chtype_name).
6693/// \param title chooser title
6694/// \return ea of selected name, #BADADDR if none selected
6695
6696inline ea_t choose_name(const char *title)
6697{
6698 ea_t ea;
6699 callui(ui_choose, chtype_name, &ea, title);
6700 return ea;
6701}
6702
6703
6704/// Choose an xref to a stack variable (::ui_choose, ::chtype_name).
6705/// \param pfn function
6706/// \param srkvar_tid frame variable TID
6707/// \return ea of the selected xref, BADADDR if none selected
6708
6709inline ea_t choose_stkvar_xref(func_t *pfn, tid_t srkvar_tid)
6710{
6711 ea_t ea;
6712 callui(ui_choose, chtype_stkvar_xref, &ea, pfn, srkvar_tid);
6713 return ea;
6714}
6715
6716
6717/// Choose an xref to an address (::ui_choose, ::chtype_xref).
6718/// \param to referenced address
6719/// \return ea of selected xref, BADADDR if none selected
6720
6721inline ea_t choose_xref(ea_t to)
6722{
6723 ea_t ea;
6724 callui(ui_choose, chtype_xref, &ea, to);
6725 return ea;
6726}
6727
6728
6729/// Choose an enum (::ui_choose, ::chtype_enum).
6730/// \param[out] out the selected enum type
6731/// \param title chooser title
6732/// \param default_ord ordinal of enum to select by default
6733/// \retval true the selected type is in OUT
6734/// \retval false nothing was selected
6735
6736inline bool choose_enum(tinfo_t *out, const char *title, uint32 default_ord)
6737{
6738 return callui(ui_choose, chtype_enum, out, title, default_ord).cnd;
6739}
6740
6741
6744/// ask if the user would like to import a standard enum.
6745/// \param[out] out the selected enum type
6746/// \param title chooser title
6747/// \param default_ord ordinal of enum to select by default
6748/// \param value value to search for
6749/// \param nbytes size of value
6750/// \param[out] serial serial number of imported enum member, if one was found
6751/// \retval true the selected type is in OUT
6752/// \retval false nothing was selected
6753
6754inline bool choose_enum_by_value(
6755 tinfo_t *out,
6756 const char *title,
6757 uint32 default_ord,
6758 uint64 value,
6759 int nbytes,
6760 uchar *serial)
6761{
6762 return callui(ui_choose, chtype_enum_by_value_and_size, out, default_ord, title, value, nbytes, serial).cnd;
6763}
6764
6769
6770inline func_t *choose_func(const char *title, ea_t default_ea)
6771{
6772 return callui(ui_choose, chtype_func, title, default_ea).fptr;
6773}
6774
6775
6778/// \param default_ea ea of segment to select by default
6779/// \return pointer to segment that was selected, nullptr if none selected
6780
6781inline segment_t *choose_segm(const char *title, ea_t default_ea)
6782{
6783 return callui(ui_choose, chtype_segm, title, default_ea).segptr;
6784}
6785
6786
6789/// \param[in] title chooser title
6790/// \retval true the selected type is in OUT
6791/// \retval false nothing was selected
6792
6793inline bool choose_struct(tinfo_t *out, const char *title)
6794{
6795 return callui(ui_choose, chtype_struct, out, title).cnd;
6796}
6797
6798
6801/// \return pointer to segment register range of selected change point, nullptr if none selected
6802
6803inline sreg_range_t *choose_srcp(const char *title)
6804{
6805 return callui(ui_choose, chtype_srcp, title).sraptr;
6806}
6807
6809
6810#ifndef SWIG
6813
6814inline int choose_struc_path(
6815 const char *title,
6816 tid_t strid,
6817 uval_t offset,
6818 adiff_t delta,
6819 bool appzero,
6820 tid_t *path)
6821{
6822 return callui(ui_choose, chtype_strpath, title, strid,
6823 offset, delta, appzero, path).i;
6824}
6825
6826
6827
6828
6831
6832//lint -sem(choose,custodial(1))
6833inline ssize_t choose(chooser_base_t *ch, const void *def_item)
6834{
6835 return callui(ui_choose, chtype_generic, ch, def_item).ssize;
6836}
6837
6838#endif // SWIG
6839
6840
6841/// Get the underlying object of the specified chooser (::ui_get_chooser_obj).
6842///
6843/// This attemps to find the choser by its title and, if found, returns
6844/// the result of calling its chooser_base_t::get_chooser_obj() method.
6845///
6846/// \note This is object is chooser-specific.
6847/// \return the object that was used to create the chooser
6848
6849inline void *get_chooser_obj(const char *chooser_caption)
6850{
6851 return callui(ui_get_chooser_obj, chooser_caption).vptr;
6852}
6853
6857/// See also get_chooser_rows().
6858
6859inline bool get_chooser_data(
6860 qstrvec_t *out,
6861 const char *chooser_caption,
6862 int n)
6863{
6864 return callui(ui_get_chooser_data, out, chooser_caption, n).cnd;
6865}
6866
6867/// Get the chooser contents corresponding to the rows indicated by "what".
6868/// \param out A vector of chooser_row_info_t, one entry per returned row.
6869/// \param chooser_caption The caption that identifies the desired chooser.
6870/// \param what Either one of the GCRF_ flags, or a row index.
6871/// \return Success.
6872
6873inline bool get_chooser_rows(
6875 const char *chooser_caption,
6876 size_t what)
6877{
6878 return callui(ui_get_chooser_rows, out, chooser_caption, what).cnd;
6879}
6880
6888
6889
6890inline bool idaapi enable_chooser_item_attrs(const char *chooser_caption, bool enable)
6891{
6892 return callui(ui_enable_chooser_item_attrs, chooser_caption, enable).cnd;
6893}
6894
6895
6897
6898THREAD_SAFE AS_PRINTF(1, 0) inline void show_wait_box_v(const char *format, va_list va)
6899{
6901}
6902
6903
6927THREAD_SAFE AS_PRINTF(1, 2) inline void show_wait_box(const char *format, ...)
6928{
6929 va_list va;
6930 va_start(va, format);
6932 va_end(va);
6933}
6934
6935
6937
6938THREAD_SAFE inline void hide_wait_box()
6940 // stupid watcom requires va_list should not be nullptr
6941 callui(ui_mbox, mbox_hide, nullptr, &callui);
6942}
6943
6944
6947THREAD_SAFE AS_PRINTF(1, 2) inline void replace_wait_box(const char *format, ...)
6948{
6949 va_list va;
6950 va_start(va, format);
6952 va_end(va);
6953}
6954
6955
6958
6959inline void beep(beep_t beep_type=beep_default)
6960{
6961 callui(ui_beep, beep_type);
6962}
6963
6964
6968inline bool display_copyright_warning()
6969{
6970 return callui(ui_copywarn).cnd;
6971}
6972
6973#endif // __UI__ END OF UI SERVICE FUNCTIONS
6974
6975
6976/// Show a message box asking to send the input file to support@hex-rays.com.
6977/// \param format the reason why the input file is bad
6978
6979THREAD_SAFE AS_PRINTF(1, 2) inline void ask_for_feedback(const char *format, ...)
6980{
6981 va_list va;
6982 va_start(va, format);
6984 va_end(va);
6985}
6986
6987
6993
6994AS_PRINTF(2, 3) inline bool ask_addr(ea_t *addr, const char *format, ...)
6995{
6996 va_list va;
6997 va_start(va, format);
6998 bool ok = callui(ui_ask_addr, addr, format, va).cnd;
6999 va_end(va);
7000 return ok;
7001}
7003
7011
7012AS_PRINTF(2, 3) inline bool ask_seg(sel_t *sel, const char *format, ...)
7013{
7014 va_list va;
7015 va_start(va, format);
7016 bool ok = callui(ui_ask_seg, sel, format, va).cnd;
7017 va_end(va);
7018 return ok;
7019}
7020
7021
7030
7031AS_PRINTF(2, 3) inline bool ask_long(sval_t *value, const char *format, ...)
7032{
7033 va_list va;
7034 va_start(va, format);
7035 bool ok = callui(ui_ask_long, value, format, va).cnd;
7036 va_end(va);
7037 return ok;
7038}
7039
7040
7041//---------------------------------------------------------------------------
7042// E R R O R / W A R N I N G / I N F O D I A L O G B O X E S
7043//---------------------------------------------------------------------------
7044
7050
7051idaman bool ida_export_data batch;
7052
7053
7056
7057idaman int ida_export_data errorexit;
7058
7066THREAD_SAFE AS_PRINTF(1, 2) NORETURN inline void error(const char *format, ...)
7067{
7068 va_list va;
7069 va_start(va, format);
7070 verror(format, va);
7071 // NOTREACHED
7072}
7073
7074
7083
7084THREAD_SAFE AS_PRINTF(1, 0) inline ssize_t vwarning(const char *format, va_list va)
7085{
7086 return callui(ui_mbox, mbox_warning, format, va).ssize;
7087}
7088
7089THREAD_SAFE AS_PRINTF(1, 2) inline ssize_t warning(const char *format, ...)
7090{
7091 va_list va;
7092 va_start(va, format);
7093 ssize_t rc = vwarning(format, va);
7094 va_end(va);
7095 return rc;
7096}
7097
7098
7107
7108THREAD_SAFE AS_PRINTF(1, 0) inline ssize_t vinfo(const char *format, va_list va)
7109{
7110 return callui(ui_mbox, mbox_info, format, va).ssize;
7111}
7112
7113THREAD_SAFE AS_PRINTF(1, 2) inline ssize_t info(const char *format, ...)
7114{
7115 va_list va;
7116 va_start(va, format);
7117 size_t rc = vinfo(format, va);
7118 va_end(va);
7119 return rc;
7120}
7121
7122
7126
7127THREAD_SAFE AS_PRINTF(1, 0) NORETURN inline void vnomem(const char *format, va_list va)
7128{
7130 // NOTREACHED
7131 abort(); // to suppress compiler warning or error
7132}
7133
7134THREAD_SAFE AS_PRINTF(1, 2) NORETURN inline void nomem(const char *format, ...)
7135{
7136 va_list va;
7137 va_start(va, format);
7138 vnomem(format, va);
7139 // NOTREACHED
7140}
7141
7142
7152
7153THREAD_SAFE AS_PRINTF(1, 0) inline int vmsg(const char *format, va_list va)
7154{
7155 return callui(ui_msg, format, va).i;
7156}
7157
7158THREAD_SAFE AS_PRINTF(1, 2) inline int msg(const char *format, ...)
7159{
7160 va_list va;
7161 va_start(va, format);
7162 int nbytes = vmsg(format, va);
7163 va_end(va);
7164 return nbytes;
7165}
7166
7167#ifndef SWIG
7168
7454//----------------------------------------------------------------------
7455// F O R M S - C O M P L E X D I A L O G B O X E S
7456//----------------------------------------------------------------------
7457
7459
7460inline int vask_form(const char *format, va_list va)
7461{
7462 return callui(ui_ask_form, format, va).i;
7463}
7464
7468/// \param form dialog box as a string. see \ref FORM_C
7469/// \retval 0 no memory to display or form syntax error
7470/// (a warning is displayed in this case).
7471/// the user pressed the 'No' button (if the form has it) or
7472/// the user cancelled the dialog otherwise.
7473/// all variables retain their original values.
7474/// \retval 1 ok, all input fields are filled and validated.
7475/// \retval -1 the form has the 'No' button and the user cancelled the dialog
7476
7477inline int ask_form(const char *form, ...)
7478{
7479 va_list va;
7480 va_start(va, form);
7481 int code = vask_form(form, va);
7482 va_end(va);
7483 return code;
7484}
7486
7492
7493inline TWidget *vopen_form(const char *format, uint32 flags, va_list va)
7494{
7495 return (TWidget *)callui(ui_open_form, format, flags, va).vptr;
7496}
7497
7498
7501/// - by pressing the small 'x' in the window title
7502/// - by calling form_actions_t::close() from the form callback
7503/// (\ref form_actions_t)
7504///
7505/// \note pressing the 'Yes/No/Cancel' buttons does not close the modeless
7506/// form, except if the form callback explicitly calls close().
7507/// \param form dialog box as a string. see \ref FORM_C
7508/// \param flags \ref WIDGET_OPEN
7509/// \return handle to the form or nullptr.
7510/// the handle can be used with TWidget functions: close_widget()/activate_widget()/etc
7511
7512inline TWidget *open_form(const char *form, uint32 flags, ...)
7513{
7514 va_list va;
7515 va_start(va, flags);
7516 TWidget *widget = vopen_form(form, flags, va);
7517 va_end(va);
7518 return widget;
7519}
7522
7523
7526struct form_actions_t
7527{
7528
7530 virtual bool idaapi _get_field_value(int field_id, void *buf) = 0;
7531
7534 virtual bool idaapi _set_field_value(int field_id, const void *buf) = 0;
7535
7538 virtual bool idaapi enable_field(int field_id, bool enable) = 0;
7539
7542 virtual bool idaapi show_field(int field_id, bool display) = 0;
7543
7547 virtual bool idaapi move_field(int field_id, int x, int y, int w, int h) = 0;
7548
7551 virtual int idaapi get_focused_field() = 0;
7552
7555 virtual bool idaapi set_focused_field(int field_id) = 0;
7556
7558 virtual void idaapi refresh_field(int field_id) = 0;
7561 virtual void idaapi close(int close_normally) = 0;
7562
7564 virtual void *idaapi get_ud() = 0;
7565
7568 virtual bool idaapi _get_str_field_value(int field_id, char *buf, const size_t bufsize) = 0;
7572#define DEF_SET_METHOD(NAME, TYPE) \
7573 bool idaapi set_ ## NAME ## _value(int field_id, const TYPE *val) \
7574 { \
7575 return _set_field_value(field_id, val); \
7578#define DEF_FIELD_METHOD(NAME, TYPE) \
7579 bool idaapi get_ ## NAME ## _value(int field_id, TYPE *val) \
7580 { \
7581 return _get_field_value(field_id, val); \
7582 } \
7583 DEF_SET_METHOD(NAME, TYPE)
7585#define DEF_STR_FIELD_METHOD(NAME ) \
7586 bool idaapi get_ ## NAME ## _value(int field_id, char *buf, const size_t bufsize) \
7587 { \
7588 return _get_str_field_value(field_id, buf, bufsize); \
7589 } \
7590 DEF_SET_METHOD(NAME, char)
7591
7592 // get/set value of radio button (r, R)
7593 DEF_FIELD_METHOD(radiobutton, ushort)
7594 // get/set value of radio button group
7595 DEF_FIELD_METHOD(rbgroup, ushort)
7596 // get/set value of check box (c, C)
7597 DEF_FIELD_METHOD(checkbox, ushort)
7598 // get/set value of check box group
7599 DEF_FIELD_METHOD(cbgroup, ushort)
7600 // get/set value of color control (K)
7602 // get/set embedded chooser selected items (E)
7603 DEF_FIELD_METHOD(chooser, sizevec_t)
7604 // get/set value of editable combo box (b when field 'width' >0)
7606 // get/set selected item of read-only combo box (b when field 'width' ==0)
7607 DEF_FIELD_METHOD(combobox, int)
7608 // get/set value of multiline text input control (t)
7610 // get/set text of buttons
7611 DEF_FIELD_METHOD(button, qstring)
7612 // get/set value of dynamic label (%)
7614 // get/set string value (X, F, f)
7615 DEF_STR_FIELD_METHOD(string)
7616 // get/set path value (F, f)
7618 // get/set string value (q, I, y, p)
7619 DEF_FIELD_METHOD(string, qstring)
7620 // get/set identifier value (I)
7622 // get/set value of segment (S)
7623 DEF_FIELD_METHOD(segment, sel_t)
7624 // get/set signed value (n, D, O, Y, H)
7625 DEF_FIELD_METHOD(signed, sval_t)
7626 // get/set unsigned value (N, M)
7627 DEF_FIELD_METHOD(unsigned, uval_t)
7628 // get/set value of default base (usually hex) number (l)
7630 // get/set value of default base (usually hex) number (L)
7632 // get/set address value ($)
7634 // get/set tabbed widget current tab
7635 DEF_FIELD_METHOD(current_tab, int)
7636
7637#undef DEF_FIELD_METHOD
7638#undef DEF_SET_METHOD
7639#undef DEF_STR_FIELD_METHOD
7640
7642 {
7643 dbt_yes,
7644 dbt_cancel,
7645 dbt_no
7646 };
7647
7648 // Enable or disable a standard dialog button (Yes, Cancel, None)
7649 virtual bool enable_dialog_button(dlgbtn_t btn, bool enabled) = 0;
7650
7651 // Get state of a standard button
7652 virtual bool is_dialog_button_enabled(dlgbtn_t btn) = 0;
7654 // Update the list of available options for a combobox (b)
7655 //
7656 // Note: the contents of the `qstrvec_t` that was passed to ask_form/open_form will be modified
7657 virtual void swap_combobox_choices(int fid, qstrvec_t &items) = 0;
7658
7664 virtual bool idaapi set_field_label(int fid, const qstring &text) = 0;
7666 // Update tab attribute
7667 enum tab_attr_t
7668 {
7669 ta_unknown = 0,
7670 ta_visible,
7671 ta_enabled,
7673 virtual bool idaapi set_tab_attribute(int fid, int tab, tab_attr_t attr, const void *in) = 0;
7674 virtual bool idaapi get_tab_attribute(void *out, int fid, int tab, tab_attr_t attr) = 0;
7675 inline bool set_tab_visible(int fid, int tab, bool visible)
7676 {
7677 return set_tab_attribute(fid, tab, ta_visible, &visible);
7679 inline bool is_tab_visible(bool *out, int fid, int tab)
7680 {
7681 return get_tab_attribute(out, fid, tab, ta_visible);
7683 inline bool set_tab_enabled(int fid, int tab, bool enabled)
7684 {
7685 return set_tab_attribute(fid, tab, ta_enabled, &enabled);
7686 }
7687 inline bool is_tab_enabled(bool *out, int fid, int tab)
7688 {
7689 return get_tab_attribute(out, fid, tab, ta_enabled);
7690 }
7692
7693
7695
7695/// The callback will be also called before displaying the form and as soon
7696/// as the user presses the 'Yes/No/Cancel' buttons or closes the window.
7697/// The callback will be called for both modal and modeless window.
7698/// \param field_id id of the modified field or a special field id \ref CB_
7699/// \param fa helper class with useful virtual functions
7700/// \retval 0 continue editing
7701/// \retval >0 form will be closed
7702/// \note the return value is used by IDA only for modal forms, and only for
7703/// the following special field ids: CB_CLOSE, CB_YES, CB_NO, CB_CANCEL
7704/// (for modeless forms CB_CLOSE is also used).
7705
7706typedef int idaapi formchgcb_t(int field_id, form_actions_t &fa);
7707
7708
7713
7714typedef int idaapi buttoncb_t(int button_code, form_actions_t &fa);
7715
7716
7717#endif // SWIG
7718
7719//---------------------------------------------------------------------------
7720// Y E S / N O D I A L O G B O X
7721//---------------------------------------------------------------------------
7726#define ASKBTN_YES 1
7727#define ASKBTN_NO 0
7728#define ASKBTN_CANCEL -1
7729#define ASKBTN_BTN1 1
7730#define ASKBTN_BTN2 0
7731#define ASKBTN_BTN3 -1
7733
7734
7735THREAD_SAFE AS_PRINTF(5, 0) inline int vask_buttons(
7736 const char *Yes,
7737 const char *No,
7738 const char *Cancel,
7739 int deflt,
7740 const char *format,
7741 va_list va)
7742{
7744}
7747AS_PRINTF(2, 0) inline int vask_yn(int deflt, const char *format, va_list va)
7748{
7749 return vask_buttons(nullptr, nullptr, nullptr, deflt, format, va);
7750}
7751
7752
7757
7758AS_PRINTF(2, 3) inline int ask_yn(int deflt, const char *format, ...)
7759{
7760 va_list va;
7761 va_start(va, format);
7762 int code = vask_yn(deflt, format, va);
7763 va_end(va);
7764 return code;
7765}
7766
7767
7780
7781AS_PRINTF(5, 6) inline int ask_buttons(
7782 const char *Yes,
7783 const char *No,
7784 const char *Cancel,
7785 int deflt,
7786 const char *format,
7787 ...)
7788{
7789 va_list va;
7790 va_start(va, format);
7791 int code = vask_buttons(Yes, No, Cancel, deflt, format, va);
7792 va_end(va);
7793 return code;
7794}
7795
7796//------------------------------------------------------------------------
7797/* Format of dialog box (actually they are mutliline strings
7798 delimited by newline characters)
7799
7800 The very first line of dialog box can specify a dialog box
7801 title if the following line appears:
7802
7803 TITLE title string
7804
7805
7806 Then, the next line may contain an icon to display
7807 in the GUI version (ignored by the text version):
7808
7809 ICON NONE (no icon)
7810 INFO (information icon)
7811 QUESTION (question icon)
7812 WARNING (warning icon)
7813 ERROR (error icon)
7814
7815
7816 Then, the next line may contain a 'Don't display this message again'
7817 checkbox. If this checkbox is selected and the user didn't select cancel,
7818 the button he selected is saved and automatically returned.
7819
7820 AUTOHIDE NONE (no checkbox)
7821 DATABASE (return value is saved to database)
7822 REGISTRY (return value is saved to Windows registry or idareg.cfg
7823 if non-Windows version)
7824 SESSION (return value is saved for the current IDA session)
7825 It is possible to append "*" to the AUTOHIDE keywords to have this checkbox
7826 initially checked. For example: "AUTOHIDE REGISTRY*"
7827
7828 To hide the cancel button the following keyword can be used:
7829
7830 HIDECANCEL
7831
7832 To enable rich text (i.e., HTML) in the Qt version of IDA,
7833 the following keyword can be used:
7834
7835 RICHTEXT
7836
7837 Please note that the user still can cancel the dialog box by pressing Esc
7838 or clicking on the 'close window' button.
7839
7840 Finally, if the dialog box is kept in IDA.HLP, the following may appear
7841 to add a Help button (this defines help context for the whole dialog box):
7842
7843 @hlpMessageName[]
7844
7845
7846 Each keyword should be alone on a line.
7847
7848 Next, a format string must be specified.
7849 To center message lines in the text version, start them with '\3' character
7850 (currently ignored in the GUI version).
7851*/
7852
7853//---------------------------------------------------------------------------
7854// A S K S T R I N G O F T E X T
7855//---------------------------------------------------------------------------
7856
7868
7869AS_PRINTF(3, 0) inline bool vask_str(
7870 qstring *str,
7871 int hist,
7872 const char *format,
7873 va_list va)
7874{
7875 return callui(ui_ask_str, str, hist, format, va).cnd;
7876}
7877
7878AS_PRINTF(3, 4) inline bool ask_str(qstring *str, int hist, const char *format, ...)
7880 va_list va;
7881 va_start(va, format);
7882 bool result = vask_str(str, hist, format, va);
7883 va_end(va);
7884 return result;
7885}
7886
7890#define HIST_SEG 1
7891#define HIST_CMT 2
7892#define HIST_SRCH 3
7893#define HIST_IDENT 4
7894#define HIST_FILE 5
7895#define HIST_TYPE 6
7896#define HIST_CMD 7
7897#define HIST_DIR 8
7898#define HIST_IDENT2 9
7900
7901
7908
7909AS_PRINTF(2, 3) inline bool ask_ident(qstring *str, const char *format, ...)
7910{
7911 va_list va;
7912 va_start(va, format);
7913 bool result = vask_str(str, HIST_IDENT, format, va);
7914 va_end(va);
7915 return result;
7916}
7917
7924
7925AS_PRINTF(2, 3) inline bool ask_ident2(qstring *str, const char *format, ...)
7926{
7927 va_list va;
7928 va_start(va, format);
7929 bool result = vask_str(str, HIST_IDENT2, format, va);
7930 va_end(va);
7931 return result;
7932}
7933
7934
7935
7947
7948AS_PRINTF(4, 0) inline bool vask_text(
7949 qstring *answer,
7950 size_t max_size,
7951 const char *defval,
7952 const char *format,
7953 va_list va)
7954{
7955 return callui(ui_ask_text, answer, max_size, defval, format, va).cnd;
7956}
7957
7958AS_PRINTF(4, 5) inline bool ask_text(
7960 size_t max_size,
7961 const char *defval,
7962 const char *format,
7963 ...)
7964{
7965 va_list va;
7966 va_start(va, format);
7967 bool result = vask_text(answer, max_size, defval, format, va);
7968 va_end(va);
7969 return result;
7970}
7971
7972
7973//---------------------------------------------------------------------------
7974// A S K A D D R E S S E S , N A M E S , N U M B E R S , E T C .
7975//---------------------------------------------------------------------------
7976
7996
7997AS_PRINTF(3, 0) inline char *vask_file(
7998 bool for_saving,
7999 const char *defval,
8000 const char *format,
8001 va_list va)
8002{
8003 return callui(ui_ask_file, for_saving, defval, format, va).cptr;
8004}
8005
8006
8007AS_PRINTF(3, 4) inline char *ask_file(
8008 bool for_saving,
8009 const char *defval,
8010 const char *format,
8011 ...)
8012{
8013 va_list va;
8014 va_start(va, format);
8015 char *answer = vask_file(for_saving, defval, format, va);
8016 va_end(va);
8017 return answer;
8018}
8019
8020
8021//---------------------------------------------------------------------------
8022// A D D - O N S
8023//---------------------------------------------------------------------------
8024
8026struct addon_info_t
8027{
8028 size_t cb; //< size of this structure
8029 const char *id; //< product code, e.g. "com.hexrays.hexx86w". Must be unique
8030 const char *name; //< descriptive name, e.g. "Hex-Rays x86 Decompiler (Windows)"
8031 const char *producer; //< e.g. "Hex-Rays SA"
8032 const char *version; //< version string, e.g. 1.5.110408
8033 const char *url; //< URL of the product http://www.hex-rays.com/decompiler.shtml
8034 const char *freeform; //< any string, e.g. "Copyright (c) 2007-2025 Hex-Rays"
8035 const void *custom_data; //< custom data (license ID etc). Can be nullptr. Not displayed in UI.
8040 : cb(sizeof(addon_info_t)),
8041 id(nullptr),
8042 name(nullptr),
8043 producer(nullptr),
8044 version(nullptr),
8045 url(nullptr),
8046 freeform(nullptr),
8047 custom_data(nullptr),
8048 custom_size(0)
8049 {}
8050};
8051
8052#ifndef __UI__
8053
8057
8058
8059
8062
8063inline int register_addon(const addon_info_t *info)
8064{
8065 return callui(ui_addons, 0, info).i;
8066}
8067
8068
8070
8071inline int addon_count()
8072{
8073 return callui(ui_addons, 1).i;
8074}
8075
8076
8079/// NB: all pointers are invalidated by next call to register_addon or get_addon_info
8080/// \return false if not found
8081
8082inline bool get_addon_info(const char *id, addon_info_t *info)
8083{
8084 return callui(ui_addons, 2, id, info).cnd;
8085}
8086
8087
8090/// NB: all pointers are invalidated by next call to register_addon or get_addon_info
8091/// \return false if index is out of range
8092
8093inline bool get_addon_info_idx(int index, addon_info_t *info)
8094{
8095 return callui(ui_addons, 3, index, info).cnd;
8096}
8097
8099
8100#endif
8102//---------------------------------------------------------------------------
8103// S T R I N G F U N C T I O N S
8104//---------------------------------------------------------------------------
8105
8108
8115
8116idaman THREAD_SAFE char *ida_export add_spaces(char *str, size_t bufsize, ssize_t len);
8117
8118
8122
8123idaman THREAD_SAFE char *ida_export trim(char *str);
8125
8128
8129idaman THREAD_SAFE const char *ida_export skip_spaces(const char *ptr);
8130inline char *skip_spaces(char *ptr)
8131 { return CONST_CAST(char*)(skip_spaces((const char *)ptr)); }
8132
8134struct strarray_t
8135{
8136 int code;
8137 const char *text;
8139
8140
8142/// Passed as 'flags' parameter to qcleanline()
8143///@{
8144#define CLNL_RTRIM (1 << 0)
8145#define CLNL_LTRIM (1 << 1)
8146#define CLNL_FINDCMT (1 << 2)
8147
8148#define CLNL_TRIM (CLNL_RTRIM|CLNL_LTRIM)
8150
8161
8162idaman THREAD_SAFE ssize_t ida_export qcleanline(
8163 qstring *buf,
8164 char cmt_char='\0',
8165 uint32 flags=CLNL_TRIM|CLNL_FINDCMT);
8166
8167
8171
8172idaman THREAD_SAFE const char *ida_export strarray(const strarray_t *array, size_t array_size, int code);
8173
8174
8176
8177idaman size_t ida_export ea2str(char *buf, size_t bufsize, ea_t ea);
8178
8179//---------------------------------------------------------------------------
8180// C O N V E R S I O N S
8181//---------------------------------------------------------------------------
8187inline bool ea2str(qstring *out, ea_t ea)
8188{
8189 char tmp[MAXSTR];
8190 if ( ea2str(tmp, sizeof(tmp), ea) <= 0 )
8191 return false;
8192 *out = tmp;
8193 return true;
8194}
8196
8203
8212
8213idaman bool ida_export str2ea(ea_t *out, const char *str, ea_t screen_ea=BADADDR);
8214
8215
8222
8223idaman bool ida_export str2ea_ex(ea_t *out, const char *str, ea_t screen_ea=BADADDR, int flags=0);
8224
8228#define S2EAOPT_NOCALC 0x00000001
8230
8238
8239idaman bool ida_export atoea(ea_t *out, const char *str);
8240
8241#ifndef SWIG
8242
8244
8245idaman size_t ida_export stoa(qstring *out, ea_t from, sel_t seg);
8246
8251
8252idaman int ida_export atos(sel_t *seg, const char *str);
8254
8255#define MAX_NUMBUF (128+8)
8256
8257
8262
8263idaman size_t ida_export b2a_width(int nbytes, int radix);
8264
8265
8273
8274idaman size_t ida_export b2a32(char *buf, size_t bufsize, uint32 x, int nbytes, int radix);
8275
8276
8278
8279idaman size_t ida_export b2a64(char *buf, size_t bufsize, uint64 x, int nbytes, int radix);
8280
8281
8288
8289idaman size_t ida_export btoa_width(int nbytes, flags64_t flag, int n);
8290
8291
8294
8295idaman size_t ida_export btoa32(char *buf, size_t bufsize, uint32 x, int radix=0);
8296
8299
8300idaman size_t ida_export btoa64(char *buf, size_t bufsize, uint64 x, int radix=0);
8301
8302
8304
8305idaman size_t ida_export btoa128(char *buf, size_t bufsize, uint128 x, int radix=0);
8306
8307#ifdef __EA64__
8308#define b2a b2a64
8309#define btoa btoa64
8310#define atob atob64
8311#else
8312#define b2a b2a32
8313#define btoa btoa32
8314#define atob atob32
8315#endif
8316
8317
8322
8323idaman size_t ida_export numop2str(
8324 char *buf,
8325 size_t bufsize,
8326 ea_t ea,
8327 int n,
8328 uint64 x,
8329 int nbytes,
8330 int radix=0);
8332
8336
8337idaman bool ida_export atob32(uint32 *x, const char *str);
8338
8339
8341
8342idaman bool ida_export atob64(uint64 *x, const char *str); // returns 1-ok
8343
8344
8353
8354idaman size_t ida_export pretty_print_size(char *buf, size_t bufsize, uint64 value);
8355
8361
8362idaman bool ida_export parse_pretty_size(uint64 *out, const char *in);
8363
8364
8371idaman void ida_export append_disp(qstring *buf, adiff_t disp, bool tag=true);
8372
8373
8383
8384idaman THREAD_SAFE int ida_export r50_to_asc(char *p, const ushort *r, int k);
8385
8386
8388
8389int THREAD_SAFE asc_to_r50(ushort *r, const char *p, int k);
8390
8391
8394
8395//----------------------------------------------------------------------------
8397#define IS_BUTTONCB_T(v) (std::is_same<decltype(v), buttoncb_t>::value)
8398#define IS_FORMCHGCB_T(v) (std::is_same<decltype(v), formchgcb_t>::value)
8399#define IS_TEXTCTRL_INFO_T(v) (std::is_base_of<textctrl_info_t, std::remove_reference<decltype(v)>::type>::value)
8400#define IS_CHOOSER_BASE_T(v) (std::is_base_of<chooser_base_t, std::remove_reference<decltype(v)>::type>::value)
8401
8403
8404#endif // SWIG
8405
8406//----------------------------------------------------------------------------
8412#define IK_CANCEL 0x03
8413#define IK_BACK 0x08
8414#define IK_TAB 0x09
8415#define IK_CLEAR 0x0C
8416#define IK_RETURN 0x0D
8417#define IK_SHIFT 0x10
8418#define IK_CONTROL 0x11
8419#define IK_MENU 0x12
8420#define IK_PAUSE 0x13
8421#define IK_CAPITAL 0x14
8422#define IK_KANA 0x15
8423#define IK_ESCAPE 0x1B
8424#define IK_MODECHANGE 0x1F
8425#define IK_SPACE 0x20
8426#define IK_PRIOR 0x21
8427#define IK_NEXT 0x22
8428#define IK_END 0x23
8429#define IK_HOME 0x24
8430#define IK_LEFT 0x25
8431#define IK_UP 0x26
8432#define IK_RIGHT 0x27
8433#define IK_DOWN 0x28
8434#define IK_SELECT 0x29
8435#define IK_PRINT 0x2A
8436#define IK_EXECUTE 0x2B
8437#define IK_SNAPSHOT 0x2C
8438#define IK_INSERT 0x2D
8439#define IK_DELETE 0x2E
8440#define IK_HELP 0x2F
8441#define IK_LWIN 0x5B
8442#define IK_RWIN 0x5C
8443#define IK_APPS 0x5D
8444#define IK_SLEEP 0x5F
8445#define IK_NUMPAD0 0x60
8446#define IK_NUMPAD1 0x61
8447#define IK_NUMPAD2 0x62
8448#define IK_NUMPAD3 0x63
8449#define IK_NUMPAD4 0x64
8450#define IK_NUMPAD5 0x65
8451#define IK_NUMPAD6 0x66
8452#define IK_NUMPAD7 0x67
8453#define IK_NUMPAD8 0x68
8454#define IK_NUMPAD9 0x69
8455#define IK_MULTIPLY 0x6A
8456#define IK_ADD 0x6B
8457#define IK_SEPARATOR 0x6C
8458#define IK_SUBTRACT 0x6D
8459#define IK_DECIMAL 0x6E
8460#define IK_DIVIDE 0x6F
8461#define IK_F1 0x70
8462#define IK_F2 0x71
8463#define IK_F3 0x72
8464#define IK_F4 0x73
8465#define IK_F5 0x74
8466#define IK_F6 0x75
8467#define IK_F7 0x76
8468#define IK_F8 0x77
8469#define IK_F9 0x78
8470#define IK_F10 0x79
8471#define IK_F11 0x7A
8472#define IK_F12 0x7B
8473#define IK_F13 0x7C
8474#define IK_F14 0x7D
8475#define IK_F15 0x7E
8476#define IK_F16 0x7F
8477#define IK_F17 0x80
8478#define IK_F18 0x81
8479#define IK_F19 0x82
8480#define IK_F20 0x83
8481#define IK_F21 0x84
8482#define IK_F22 0x85
8483#define IK_F23 0x86
8484#define IK_F24 0x87
8485#define IK_NUMLOCK 0x90
8486#define IK_SCROLL 0x91
8487#define IK_OEM_FJ_MASSHOU 0x93
8488#define IK_OEM_FJ_TOUROKU 0x94
8489#define IK_LSHIFT 0xA0
8490#define IK_RSHIFT 0xA1
8491#define IK_LCONTROL 0xA2
8492#define IK_RCONTROL 0xA3
8493#define IK_LMENU 0xA4
8494#define IK_RMENU 0xA5
8495#define IK_BROWSER_BACK 0xA6
8496#define IK_BROWSER_FORWARD 0xA7
8497#define IK_BROWSER_REFRESH 0xA8
8498#define IK_BROWSER_STOP 0xA9
8499#define IK_BROWSER_SEARCH 0xAA
8500#define IK_BROWSER_FAVORITES 0xAB
8501#define IK_BROWSER_HOME 0xAC
8502#define IK_VOLUME_MUTE 0xAD
8503#define IK_VOLUME_DOWN 0xAE
8504#define IK_VOLUME_UP 0xAF
8505#define IK_MEDIA_NEXT_TRACK 0xB0
8506#define IK_MEDIA_PREV_TRACK 0xB1
8507#define IK_MEDIA_STOP 0xB2
8508#define IK_MEDIA_PLAY_PAUSE 0xB3
8509#define IK_LAUNCH_MAIL 0xB4
8510#define IK_LAUNCH_MEDIA_SELECT 0xB5
8511#define IK_LAUNCH_APP1 0xB6
8512#define IK_LAUNCH_APP2 0xB7
8513#define IK_OEM_1 0xBA
8514#define IK_OEM_PLUS 0xBB
8515#define IK_OEM_COMMA 0xBC
8516#define IK_OEM_MINUS 0xBD
8517#define IK_OEM_PERIOD 0xBE
8518#define IK_OEM_2 0xBF
8519#define IK_OEM_3 0xC0
8520#define IK_OEM_4 0xDB
8521#define IK_OEM_5 0xDC
8522#define IK_OEM_6 0xDD
8523#define IK_OEM_7 0xDE
8524#define IK_OEM_102 0xE2
8525#define IK_PLAY 0xFA
8526#define IK_ZOOM 0xFB
8527#define IK_OEM_CLEAR 0xFE
8529
8532enum cb_id
8533{
8534 CB_INIT = -1,
8535 CB_YES = -2, // the user pressed 'Yes' button
8536 CB_CLOSE = -3, // the form is closed by the window manager
8537 // (usually by pressing the small 'x' at the title)
8538 CB_INVISIBLE = -4, // corresponds to ui_widget_invisible
8539 CB_DESTROYING = -5, // the actual widget tree is being destroyed
8540 CB_NO = -6, // the user pressed 'No' button
8541 CB_CANCEL = -7, // the user pressed 'Cancel' button or Esc
8545#ifndef SWIG
8546//-------------------------------------------------------------------------
8547inline void place_t__serialize(const place_t *_this, bytevec_t *out)
8549 out->pack_dd(_this->lnnum);
8550}
8551
8552//-------------------------------------------------------------------------
8553inline bool place_t__deserialize(place_t *_this, const uchar **pptr, const uchar *end)
8554{
8555 if ( *pptr >= end )
8556 return false;
8557 _this->lnnum = unpack_dd(pptr, end);
8558 return true;
8559}
8560#endif
8562#ifndef NO_OBSOLETE_FUNCS
8564#define ACTION_DESC_LITERAL(name, label, handler, shortcut, tooltip, icon)\
8565 { sizeof(action_desc_t), name, label, handler, &PLUGIN, shortcut, tooltip, icon, ADF_OT_PLUGIN }
8566
8567DEPRECATED inline void get_user_strlist_options(strwinsetup_t *out)
8568{
8570}
8571DEPRECATED inline bool del_idc_hotkey(const char *hotkey)
8572{
8573 return callui(ui_obsolete_del_idckey, hotkey).cnd;
8574}
8575idaman DEPRECATED void ida_export ida_checkmem(const char *file, int line);
8576#endif
8577
8578#endif // __KERNWIN_HPP
void qclear(void)
Clear qstring but do not free memory yet.
Definition pro.h:3167
size_t length(void) const
Get number of chars in this qstring (not including terminating zero)
Definition pro.h:3123
_qstring & append(qchar c)
Append c to the end of the qstring.
Definition pro.h:3493
const qchar * c_str(void) const
Convert the qstring to a char *.
Definition pro.h:3170
Vector of bytes (use for dynamic memory)
Definition pro.h:3773
void pack_dd(uint32 x)
Pack a dword and append the result to the bytevec.
Definition pro.h:3805
Definition kernwin.hpp:4727
custom_viewer_mouse_moved_t * mouse_moved
Definition kernwin.hpp:4760
custom_viewer_keydown_t * keyboard
Definition kernwin.hpp:4758
custom_viewer_click_t * click
Definition kernwin.hpp:4761
custom_viewer_location_changed_t * location_changed
Definition kernwin.hpp:4768
custom_viewer_get_place_xcoord_t * get_place_xcoord
Definition kernwin.hpp:4767
custom_viewer_popup_t * popup
Definition kernwin.hpp:4759
custom_viewer_dblclick_t * dblclick
Definition kernwin.hpp:4762
custom_viewer_can_navigate_t * can_navigate
Definition kernwin.hpp:4769
custom_viewer_adjust_place_t * adjust_place
Definition kernwin.hpp:4766
custom_viewer_close_t * close
Definition kernwin.hpp:4764
custom_viewer_curpos_t * curpos
Definition kernwin.hpp:4763
obsolete_custom_viewer_help_t * obsolete_help
Definition kernwin.hpp:4765
custom_viewer_help_t * help
Definition kernwin.hpp:4770
Directory tree.
Definition dirtree.hpp:276
A function is a set of continuous ranges of addresses with characteristics.
Definition funcs.hpp:85
Definition kernwin.hpp:1846
hexplace_t(ea_t _ea, int ln)
Definition kernwin.hpp:1850
void out_one_item(outctx_base_t &ctx, const hexplace_gen_t *hg, int itemno, color_t *color, color_t patch_or_edit) const
Definition kernwin.hpp:1853
define_place_virtual_functions(hexplace_t)
static size_t ea2str(char *buf, size_t bufsize, const hexplace_gen_t *hg, ea_t ea)
Definition kernwin.hpp:1866
ea_t sol
Definition kernwin.hpp:1848
Class to hold idc values.
Definition expr.hpp:315
The base class used to display graphs in IDA.
Definition graph.hpp:877
Definition kernwin.hpp:4188
uchar reserved
Definition kernwin.hpp:4193
locchange_md_t(locchange_reason_t _reason, bool _sync)
Definition kernwin.hpp:4196
uchar r
Definition kernwin.hpp:4191
uchar f
Definition kernwin.hpp:4192
bool is_sync() const
Definition kernwin.hpp:4199
uchar cb
Definition kernwin.hpp:4190
Microinstruction class insn.
Definition hexrays.hpp:3604
Denotes a displayed line.
Definition kernwin.hpp:1418
virtual bool idaapi beginning(void *ud) const =0
Are we at the first displayable object?
int lnnum
Number of line within the current object.
Definition kernwin.hpp:1420
virtual int idaapi compare2(const place_t *t2, void *) const
Compare two locations except line numbers (lnnum).
Definition kernwin.hpp:1565
virtual void idaapi adjust(void *ud)=0
Adjust the current location to point to a displayable object.
virtual bool idaapi rebase(const segm_move_infos_t &)
Rebase the place instance.
Definition kernwin.hpp:1535
virtual ea_t idaapi toea() const
Map the location to an ea_t.
Definition kernwin.hpp:1530
DEFINE_MEMORY_ALLOCATION_FUNCS() virtual void idaapi print(qstring *vout
Generate a short description of the location.
virtual void idaapi serialize(bytevec_t *out) const =0
Serialize this instance.
virtual place_t *idaapi enter(uint32 *) const
Visit this place, possibly 'unhiding' a section of text.
Definition kernwin.hpp:1548
virtual bool idaapi prev(void *ud)=0
Move to the previous displayable location.
virtual uval_t idaapi touval(void *ud) const =0
Map the location to a number.
virtual void idaapi copyfrom(const place_t *from)=0
Copy the specified location object to the current object.
virtual place_t *idaapi clone() const =0
Clone the location.
virtual int idaapi generate(qstrvec_t *out, int *out_deflnnum, color_t *out_pfx_color, bgcolor_t *out_bgcolor, void *ud, int maxsize) const =0
Generate text lines for the current location.
virtual const char *idaapi name() const =0
Get this place type name.
virtual bool idaapi equals(const place_t *t2, void *ud) const
Compare two places for equality, ignoring line numbers (lnnum).
Definition kernwin.hpp:1578
place_t()
Constructor.
Definition kernwin.hpp:1421
virtual int idaapi compare(const place_t *t2) const =0
Deprecated. Please consider compare2(const place_t *, void *) instead.
virtual void idaapi leave(uint32) const
Leave this place, possibly 'hiding' a section of text that was previously expanded (at enter()-time....
Definition kernwin.hpp:1552
virtual place_t *idaapi makeplace(void *ud, uval_t x, int lnnum) const =0
Map a number to a location.
virtual bool idaapi next(void *ud)=0
Move to the next displayable location.
virtual bool idaapi deserialize(const uchar **pptr, const uchar *end)=0
De-serialize into this instance.
virtual bool idaapi ending(void *ud) const =0
Are we at the last displayable object?
void *ud const
Definition kernwin.hpp:1429
A plugin is a module in the plugins subdirectory that can perform an action asked by the user.
Definition loader.hpp:578
Linked list Note: linked list is not movable!
Definition pro.h:4038
Reimplementation of vector class from STL.
Definition pro.h:2250
void swap(qvector< T > &r) noexcept
Replace all attributes of this qvector with that of 'r', and vice versa.
Definition pro.h:2560
void push_back(T &&x)
Append a new element to the end the qvector with a move semantics.
Definition pro.h:2361
size_t size(void) const
Get the number of elements in the qvector.
Definition pro.h:2423
Describes a program segment.
Definition segment.hpp:69
A location in a view populated by a strvec_t.
Definition kernwin.hpp:1736
uint32 n
line number
Definition kernwin.hpp:1738
simpleline_place_t()
Constructor.
Definition kernwin.hpp:1739
define_place_virtual_functions(simpleline_place_t)
Snapshot attributes.
Definition loader.hpp:897
Definition kernwin.hpp:2033
bool is_widget() const
Definition kernwin.hpp:2066
bool is_register() const
Definition kernwin.hpp:2065
Primary mechanism for managing type information.
Definition typeinf.hpp:3046
Definition kernwin.hpp:1893
virtual void set_index_by_offset(void *ud, uint64 offset) new api
for structs: calculate the index that corresponds to the offset and set it.
virtual bool fill_type_ref(til_type_ref_t *out, const void *ud) const newapi
fill the type information for use in actions
virtual type_t get_kind(const void *ud) const newapi
get the kind of type this place represents
uint32 ordinal
Definition kernwin.hpp:1895
tiplace_t()
Definition kernwin.hpp:1898
bool is_footer() const
Definition kernwin.hpp:1907
bool is_header() const
Definition kernwin.hpp:1906
bool is_index() const
Definition kernwin.hpp:1908
void reset()
Definition kernwin.hpp:1904
virtual uint64 calc_udm_offset(const void *ud, ssize_t *p_udmidx=nullptr, int *p_bitoff=nullptr) const newapi
for structs: calculate the offset that corresponds to the tiplace.
tif_cursor_t cursor
Definition kernwin.hpp:1896
define_place_virtual_functions(tiplace_t)
void set_header()
Definition kernwin.hpp:1910
bool valid_ord() const
Definition kernwin.hpp:1903
void set_footer()
Definition kernwin.hpp:1911
A line in a text window.
Definition kernwin.hpp:2164
color_t prefix_color
line prefix color
Definition kernwin.hpp:2168
twinline_t(place_t *t=nullptr, color_t pc=1, bgcolor_t bc=DEFCOLOR)
Definition kernwin.hpp:2171
bgcolor_t bg_color
line background color
Definition kernwin.hpp:2169
place_t * at
location in view
Definition kernwin.hpp:2166
A position in a text window.
Definition kernwin.hpp:2154
place_t * at
location in view
Definition kernwin.hpp:2156
Base class for defining UI requests.
Definition kernwin.hpp:4453
List of UI requests.
Definition kernwin.hpp:4467
Definition llong.hpp:65
cb_id
Definition kernwin.hpp:8541
@ CB_INIT
Definition kernwin.hpp:8542
@ CB_DESTROYING
Definition kernwin.hpp:8547
@ CB_NO
Definition kernwin.hpp:8548
@ CB_CANCEL
Definition kernwin.hpp:8549
@ CB_INVISIBLE
Definition kernwin.hpp:8546
@ CB_CLOSE
Definition kernwin.hpp:8544
@ CB_YES
Definition kernwin.hpp:8543
int vask_form(const char *format, va_list va)
See ask_form()
Definition kernwin.hpp:7468
int ask_form(const char *form,...)
Display a dialog box and wait for the user.
Definition kernwin.hpp:7485
TWidget * vopen_form(const char *format, uint32 flags, va_list va)
Create and/or activate dockable modeless form (ui_open_form).
Definition kernwin.hpp:7501
TWidget * open_form(const char *form, uint32 flags,...)
Display a dockable modeless dialog box and return a handle to it.
Definition kernwin.hpp:7520
static constexpr ssize_t EMPTY_CHOOSER
the chooser has no data and cannot be displayed
Definition kernwin.hpp:3228
static constexpr ssize_t ALREADY_EXISTS
the non-modal chooser with the same data is already open
Definition kernwin.hpp:3230
static constexpr ssize_t NO_ATTR
reserved for IDAPython
Definition kernwin.hpp:3233
static constexpr ssize_t NO_SELECTION
there is no selected item
Definition kernwin.hpp:3227
ssize_t choose(ssize_t deflt=0)
Display a generic list chooser and allow the user to select an item.
Definition kernwin.hpp:3805
ssize_t choose(chooser_base_t *ch, const void *def_item)
Display a generic list chooser (n-column) and allow the user to select an item.
Definition kernwin.hpp:6841
ssize_t choose(const sizevec_t &deflt=sizevec_t())
Display a generic list chooser and allow the user to select an item.
Definition kernwin.hpp:3812
uchar color_t
see <lines.hpp>
Definition kernwin.hpp:26
idaman bool ida_export str2ea(ea_t *out, const char *str, ea_t screen_ea=BADADDR)
Convert string to linear address.
idaman size_t ida_export btoa128(char *buf, size_t bufsize, uint128 x, int radix=0)
128-bit equivalent of btoa32()
idaman THREAD_SAFE int ida_export r50_to_asc(char *p, const ushort *r, int k)
Convert RADIX50 -> UTF-8.
idaman size_t ida_export btoa_width(int nbytes, flags64_t flag, int n)
Get max number of UTF-8 characters required to represent a given type of value, with a given size (wi...
idaman size_t ida_export b2a64(char *buf, size_t bufsize, uint64 x, int nbytes, int radix)
Same as b2a32(), but can handle 'nbytes' = 8.
idaman int ida_export atos(sel_t *seg, const char *str)
Convert UTF-8 string to segment selector.
idaman size_t ida_export btoa32(char *buf, size_t bufsize, uint32 x, int radix=0)
Same as b2a32(), but will generate a string without any leading zeroes.
idaman size_t ida_export numop2str(char *buf, size_t bufsize, ea_t ea, int n, uint64 x, int nbytes, int radix=0)
Convert instruction operand immediate number to UTF-8.
int THREAD_SAFE asc_to_r50(ushort *r, const char *p, int k)
Convert UTF-8 -> RADIX50 (see r50_to_asc())
idaman size_t ida_export b2a_width(int nbytes, int radix)
Get the number of UTF-8 characters required to represent a number with the specified number of bytes ...
idaman size_t ida_export btoa64(char *buf, size_t bufsize, uint64 x, int radix=0)
64-bit equivalent of btoa32()
idaman size_t ida_export pretty_print_size(char *buf, size_t bufsize, uint64 value)
Pretty-print a size.
idaman size_t ida_export stoa(qstring *out, ea_t from, sel_t seg)
Convert segment selector to UTF-8 string.
idaman void ida_export append_disp(qstring *buf, adiff_t disp, bool tag=true)
Auxiliary function.
idaman bool ida_export atob32(uint32 *x, const char *str)
Convert UTF-8 to a number using the current assembler formats.
idaman bool ida_export atob64(uint64 *x, const char *str)
64-bit equivalent of atob32()
idaman bool ida_export atoea(ea_t *out, const char *str)
Convert a number in C notation to an address.
idaman bool ida_export parse_pretty_size(uint64 *out, const char *in)
Parse a pretty-printed size.
idaman bool ida_export str2ea_ex(ea_t *out, const char *str, ea_t screen_ea=BADADDR, int flags=0)
Same as str2ea() but possibly with some steps skipped.
idaman size_t ida_export b2a32(char *buf, size_t bufsize, uint32 x, int nbytes, int radix)
Convert number to UTF-8 string (includes leading zeroes).
idaman THREAD_SAFE va_list va
See qsscanf()
Definition err.h:21
idaman THREAD_SAFE const char * format
Definition fpro.h:78
idaman THREAD_SAFE AS_PRINTF(1, 0) void ida_export vqperror(const char *format
Print error message to stderr (analog of perror)
idaman const char * end
Definition pro.h:1001
int code
Definition fpro.h:88
idaman size_t n
Definition pro.h:997
idaman THREAD_SAFE ssize_t ida_export qcleanline(qstring *buf, char cmt_char='\0', uint32 flags=CLNL_TRIM|CLNL_FINDCMT)
Performs some cleanup operations to a line.
idaman THREAD_SAFE char *ida_export trim(char *str)
Remove trailing space characters from a string.
idaman THREAD_SAFE char *ida_export add_spaces(char *str, size_t bufsize, ssize_t len)
Add space characters to the colored string so that its length will be at least 'len' characters.
idaman THREAD_SAFE const char *ida_export strarray(const strarray_t *array, size_t array_size, int code)
Find a line with the specified code in the strarray_t array.
idaman THREAD_SAFE const char *ida_export skip_spaces(const char *ptr)
Skip whitespaces in the string.
idaman size_t ida_export ea2str(char *buf, size_t bufsize, ea_t ea)
Convert linear address to UTF-8 string.
bool get_addon_info_idx(int index, addon_info_t *info)
Get info about a registered addon with specific index.
Definition kernwin.hpp:8101
int register_addon(const addon_info_t *info)
Register an add-on.
Definition kernwin.hpp:8071
bool get_addon_info(const char *id, addon_info_t *info)
Get info about a registered addon with a given product code.
Definition kernwin.hpp:8090
int addon_count()
Get number of installed addons.
Definition kernwin.hpp:8079
ea_t choose_stkvar_xref(func_t *pfn, tid_t srkvar_tid)
Choose an xref to a stack variable (ui_choose, chtype_name).
Definition kernwin.hpp:6717
func_t * choose_func(const char *title, ea_t default_ea)
Choose a function (ui_choose, chtype_func).
Definition kernwin.hpp:6778
ea_t choose_name(const char *title)
Choose a name (ui_choose, chtype_name).
Definition kernwin.hpp:6704
bool choose_enum_by_value(tinfo_t *out, const char *title, uint32 default_ord, uint64 value, int nbytes, uchar *serial)
Choose an enum, restricted by value & size (ui_choose, chtype_enum_by_value_and_size).
Definition kernwin.hpp:6762
bool choose_struct(tinfo_t *out, const char *title)
Choose a structure (ui_choose, chtype_struct).
Definition kernwin.hpp:6801
sreg_range_t * choose_srcp(const char *title)
Choose a segment register change point (ui_choose, chtype_srcp).
Definition kernwin.hpp:6811
bool choose_til(qstring *buf)
Choose a type library (ui_choose, chtype_idatil).
Definition kernwin.hpp:6682
char * choose_idasgn()
Choose a signature (ui_choose, chtype_idasgn).
Definition kernwin.hpp:6671
ea_t choose_xref(ea_t to)
Choose an xref to an address (ui_choose, chtype_xref).
Definition kernwin.hpp:6729
ea_t choose_entry(const char *title)
Choose an entry point (ui_choose, chtype_entry).
Definition kernwin.hpp:6692
segment_t * choose_segm(const char *title, ea_t default_ea)
Choose a segment (ui_choose, chtype_segm).
Definition kernwin.hpp:6789
bool choose_enum(tinfo_t *out, const char *title, uint32 default_ord)
Choose an enum (ui_choose, chtype_enum).
Definition kernwin.hpp:6744
TWidget * open_threads_window()
Open the threads window (ui_open_builtin).
Definition kernwin.hpp:6540
TWidget * open_imports_window(ea_t ea)
Open the exports window (ui_open_builtin).
Definition kernwin.hpp:6405
TWidget * open_segments_window(ea_t ea)
Open the segments window (ui_open_builtin).
Definition kernwin.hpp:6446
TWidget * open_strings_window(ea_t ea, ea_t selstart=BADADDR, ea_t selend=BADADDR)
Open the 'Strings' window (ui_open_builtin).
Definition kernwin.hpp:6436
TWidget * open_tils_window()
Open the type libraries window (ui_open_builtin).
Definition kernwin.hpp:6483
TWidget * open_hexdump_window(const char *window_title)
Open a hexdump view (ui_open_builtin).
Definition kernwin.hpp:6621
TWidget * open_exports_window(ea_t ea)
Open the exports window (ui_open_builtin).
Definition kernwin.hpp:6395
TWidget * open_problems_window(ea_t ea)
Open the problems window (ui_open_builtin).
Definition kernwin.hpp:6521
TWidget * open_xrefs_window(ea_t ea)
Open the cross references window (ui_open_builtin).
Definition kernwin.hpp:6577
TWidget * open_bpts_window(ea_t ea)
Open the breakpoints window (ui_open_builtin).
Definition kernwin.hpp:6531
TWidget * open_navband_window(ea_t ea, int zoom)
Open the navigation band window (ui_open_builtin).
Definition kernwin.hpp:6600
TWidget * open_names_window(ea_t ea)
Open the names window (ui_open_builtin).
Definition kernwin.hpp:6415
TWidget * open_til_view_window(tinfo_t *tif, const tif_cursor_t *cursor=nullptr)
Open the sub-til window (ui_open_builtin2).
Definition kernwin.hpp:6504
TWidget * open_calls_window(ea_t ea)
Open the function calls window (ui_open_builtin).
Definition kernwin.hpp:6512
TWidget * open_signatures_window()
Open the signatures window (ui_open_builtin).
Definition kernwin.hpp:6474
TWidget * open_frame_window(func_t *pfn, uval_t offset)
Open the frame window for the given function (ui_open_builtin).
Definition kernwin.hpp:6589
TWidget * open_funcs_window(ea_t ea)
Open the 'Functions' window (ui_open_builtin).
Definition kernwin.hpp:6425
TWidget * open_bookmarks_window(TWidget *w)
Open the bookmarks window (ui_open_builtin).
Definition kernwin.hpp:6641
TWidget * open_stack_window()
Open the call stack window (ui_open_builtin).
Definition kernwin.hpp:6567
TWidget * open_selectors_window()
Open the selectors window (ui_open_builtin).
Definition kernwin.hpp:6465
TWidget * open_notepad_window()
Open the notepad window (ui_open_builtin).
Definition kernwin.hpp:6630
TWidget * open_modules_window()
Open the modules window (ui_open_builtin).
Definition kernwin.hpp:6549
TWidget * open_loctypes_window(int ordinal, const tif_cursor_t *cursor=nullptr)
Open the local types window (ui_open_builtin2).
Definition kernwin.hpp:6494
TWidget * open_segregs_window(ea_t ea)
Open the segment registers window (ui_open_builtin).
Definition kernwin.hpp:6456
TWidget * open_trace_window()
Open the tracing window (ui_open_builtin).
Definition kernwin.hpp:6558
TWidget * open_disasm_window(const char *window_title, const rangevec_t *ranges=nullptr)
Open a disassembly view (ui_open_builtin).
Definition kernwin.hpp:6611
bool set_custom_viewer_qt_aware(TWidget *custom_viewer)
Allow the given viewer to interpret Qt events (ui_set_custom_viewer_handler)
Definition kernwin.hpp:5836
void * set_custom_viewer_handler(TWidget *custom_viewer, custom_viewer_handler_id_t handler_id, void *handler_or_data)
Set a handler for a custom viewer event (ui_set_custom_viewer_handler).
Definition kernwin.hpp:5824
void * set_code_viewer_handler(TWidget *code_viewer, custom_viewer_handler_id_t handler_id, void *handler_or_data)
Set a handler for a code viewer event (ui_set_custom_viewer_handler).
Definition kernwin.hpp:6134
bool set_code_viewer_user_data(TWidget *code_viewer, void *ud)
Set the user data on a code viewer (ui_set_custom_viewer_handler).
Definition kernwin.hpp:6146
bool set_code_viewer_lines_icon_margin(TWidget *code_viewer, int margin)
Set space allowed for icons in the margin of a code viewer (ui_set_custom_viewer_handler).
Definition kernwin.hpp:6186
bool set_code_viewer_lines_alignment(TWidget *code_viewer, int align)
Set alignment for lines in a code viewer (ui_set_custom_viewer_handler).
Definition kernwin.hpp:6194
void set_custom_viewer_handlers(TWidget *custom_viewer, const custom_viewer_handlers_t *cvh, void *cvh_ud)
Set handlers for custom viewer events Any of these handlers may be nullptr.
Definition kernwin.hpp:5808
bool set_code_viewer_is_source(TWidget *code_viewer)
Specify that the given code viewer is used to display source code (ui_set_custom_viewer_handler).
Definition kernwin.hpp:6210
bool set_code_viewer_lines_radix(TWidget *code_viewer, int radix)
Set radix for values displayed in a code viewer (ui_set_custom_viewer_handler).
Definition kernwin.hpp:6202
bool update_action_shortcut(const char *name, const char *shortcut)
Update an action's shortcut (ui_update_action_attr).
Definition kernwin.hpp:5635
bool update_action_icon(const char *name, int icon)
Update an action's icon (ui_update_action_attr).
Definition kernwin.hpp:5657
bool update_action_visibility(const char *name, bool visible)
Update an action's visibility (ui_update_action_attr).
Definition kernwin.hpp:5701
bool update_action_state(const char *name, action_state_t state)
Update an action's state (ui_update_action_attr).
Definition kernwin.hpp:5668
bool update_action_tooltip(const char *name, const char *tooltip)
Update an action's tooltip (ui_update_action_attr).
Definition kernwin.hpp:5646
bool update_action_checked(const char *name, bool checked)
Update an action's checked state (ui_update_action_attr).
Definition kernwin.hpp:5690
bool update_action_checkable(const char *name, bool checkable)
Update an action's checkability (ui_update_action_attr).
Definition kernwin.hpp:5679
bool update_action_label(const char *name, const char *label)
Update an action's label (ui_update_action_attr).
Definition kernwin.hpp:5624
int vask_yn(int deflt, help_t format, va_list va)
Definition help.h:54
int ask_yn(int deflt, help_t format,...)
Definition help.h:59
cexpr_t * e
Definition hexrays.hpp:7308
bool get_action_label(qstring *label, const char *name)
Get an action's label (ui_get_action_attr).
Definition kernwin.hpp:5717
void activate_widget(TWidget *widget, bool take_focus)
Activate widget (only gui version) (ui_activate_widget).
Definition kernwin.hpp:5356
idaman int64 size_t count
Definition kernwin.hpp:1366
char * answer
Definition kernwin.hpp:8023
int nbytes
Definition kernwin.hpp:2861
idaman int ida_export internal_register_place_class(const place_t *tmplate, int flags, const plugin_t *owner, int sdk_version)
qvector< tagged_line_section_t > tagged_line_section_vec_t
Definition kernwin.hpp:2522
execute_sync_availability_t
Definition kernwin.hpp:342
@ esa_app_unavailable
Definition kernwin.hpp:347
@ esa_available
Definition kernwin.hpp:344
@ esa_release
Definition kernwin.hpp:346
@ esa_unavailable
Definition kernwin.hpp:345
@ esa_unknown
Definition kernwin.hpp:343
bool ok
Definition kernwin.hpp:7006
place_t * get_custom_viewer_place(TWidget *custom_viewer, bool mouse, int *x, int *y)
Get current place in a custom viewer (ui_get_curplace).
Definition kernwin.hpp:5513
TWidget * create_custom_viewer(const char *title, const place_t *minplace, const place_t *maxplace, const place_t *curplace, const renderer_info_t *rinfo, void *ud, const custom_viewer_handlers_t *cvhandlers, void *cvhandlers_ud, TWidget *parent=nullptr)
Create new ida viewer based on place_t (ui_create_custom_viewer).
Definition kernwin.hpp:5408
uval_t uval_t
Definition kernwin.hpp:1878
bool idaapi code_viewer_lines_linenum_t(TWidget *cv, const place_t *p, uval_t *num, void *ud)
Calculate the line number. Return false to not print any number.
Definition kernwin.hpp:4262
TWidget * get_current_viewer()
Get current ida viewer (idaview or custom viewer) (ui_get_current_viewer)
Definition kernwin.hpp:5913
ea_t get_screen_ea()
Get the address at the screen cursor (ui_screenea)
Definition kernwin.hpp:4900
abort()
void msg_get_lines(qstrvec_t *out, int count=-1)
Retrieve the last 'count' lines from the output window, in reverse order (from most recent,...
Definition kernwin.hpp:6022
void set_custom_viewer_range(TWidget *custom_viewer, const place_t *minplace, const place_t *maxplace)
Set position range for custom viewer (ui_set_custom_viewer_range)
Definition kernwin.hpp:5976
bool get_action_checkable(const char *name, bool *checkable)
Get an action's checkability (ui_get_action_attr).
Definition kernwin.hpp:5772
int idaapi custom_viewer_can_navigate_t(TWidget *v, const lochist_entry_t *now, const locchange_md_t &md, void *ud)
The user asked to navigate to the given location.
Definition kernwin.hpp:4220
bool process_ui_action(const char *name, int flags=0, void *param=nullptr)
Processes a UI action by name.
Definition kernwin.hpp:5056
void unmark_selection()
Unmark selection (ui_unmarksel)
Definition kernwin.hpp:6106
bool delete_menu(const char *name)
Delete an existing menu.
Definition kernwin.hpp:5226
bool load_dbg_dbginfo(const char *path, linput_t *li=nullptr, ea_t base=BADADDR, bool verbose=false)
Load debugging information from a file.
Definition kernwin.hpp:6289
bool get_action_tooltip(qstring *tooltip, const char *name)
Get an action's tooltip (ui_get_action_attr).
Definition kernwin.hpp:5739
bool read_range_selection(TWidget *v, ea_t *ea1, ea_t *ea2)
Get the address range for the selected range boundaries, this is the convenient function for read_sel...
Definition kernwin.hpp:6098
lecvt_code_t
Converts from an entry with a given place type, to another entry, with another place type,...
Definition kernwin.hpp:2097
@ LECVT_OK
Definition kernwin.hpp:2100
@ LECVT_ERROR
Definition kernwin.hpp:2099
@ LECVT_CANCELED
Definition kernwin.hpp:2098
void repaint_custom_viewer(TWidget *custom_viewer)
Repaint the given widget immediately (ui_repaint_qwidget)
Definition kernwin.hpp:5477
bool is_tif_cursor_header(tif_cursor_t c)
Definition kernwin.hpp:1887
THREAD_SAFE bool unregister_timer(qtimer_t t)
Unregister a timer (ui_unregister_timer).
Definition kernwin.hpp:5120
void place_t__serialize(const place_t *_this, bytevec_t *out)
Definition kernwin.hpp:8555
vshow_hex(dataptr, len, format, va)
bool prompt_function_prototype(qstring *errbuf, tinfo_t *out_tif, func_t *pfn, tinfo_t *tif, const char *name)
Open function prototype editor to edit function type and create new type.
Definition kernwin.hpp:5940
bool ea_viewer_history_push_and_jump(TWidget *v, ea_t ea, int x, int y, int lnnum)
Push current location in the history and jump to the given location (ui_ea_viewer_history_push_and_ju...
Definition kernwin.hpp:5448
int register_place_class(const place_t *tmplate, int flags, const plugin_t *owner)
Register information about a place_t class.
Definition kernwin.hpp:1971
ea_t get_hexdump_ea(int hexdump_num)
Get the current address in a hex view.
Definition kernwin.hpp:4944
void idaapi custom_viewer_curpos_t(TWidget *cv, void *ud)
Deprecated.
Definition kernwin.hpp:4096
void * get_window_id(const char *name=nullptr)
Get the system-specific window ID (GUI version only)
Definition kernwin.hpp:6062
qvector< cpidx_t > cpidxvec_t
Definition kernwin.hpp:2436
int cplen_t
Definition kernwin.hpp:2435
ssize_t rc
Definition kernwin.hpp:7101
idaman bool ida_export is_refresh_requested(uint64 mask)
Get a refresh request state.
const char * get_custom_viewer_curline(TWidget *custom_viewer, bool mouse)
Get current line of custom viewer (ui_get_custom_viewer_curline).
Definition kernwin.hpp:5853
THREAD_SAFE void set_cancelled()
Set "Cancelled" flag (ui_set_cancelled)
Definition kernwin.hpp:6233
bool refresh_chooser(const char *title)
Mark a non-modal custom chooser for a refresh (ui_refresh_chooser).
Definition kernwin.hpp:4970
bool attach_action_to_menu(const char *menupath, const char *name, int flags=0)
Attach a previously-registered action to the menu (ui_attach_action_to_menu).
Definition kernwin.hpp:5248
bool attach_action_to_toolbar(const char *toolbar_name, const char *name)
Attach an action to an existing toolbar (ui_attach_action_to_toolbar).
Definition kernwin.hpp:5275
void remove_command_interpreter(const cli_t *cp)
Remove command line interpreter (ui_install_cli)
Definition kernwin.hpp:4987
bool get_chooser_data(qstrvec_t *out, const char *chooser_caption, int n)
Get the text corresponding to the index N in the chooser data.
Definition kernwin.hpp:6867
input_event_kind_t
Definition kernwin.hpp:4268
@ iek_mouse_wheel
Definition kernwin.hpp:4275
@ iek_key_release
Definition kernwin.hpp:4272
@ iek_shortcut
Definition kernwin.hpp:4270
@ iek_mouse_button_press
Definition kernwin.hpp:4273
@ iek_key_press
Definition kernwin.hpp:4271
@ iek_mouse_button_release
Definition kernwin.hpp:4274
@ iek_unknown
Definition kernwin.hpp:4269
idaman uint32 ida_export_data debug
Controls debug messages - combination of IDA debug bits.
Definition kernwin.hpp:2811
lecvt_code_t idaapi lochist_entry_cvt2_t(lochist_entry_t *dst, const lochist_entry_t &src, TWidget *view, uint32 flags)
Definition kernwin.hpp:2104
int get_navband_pixel(bool *out_is_vertical, ea_t ea)
Translate the provided ea_t, into its pixel position (plus pixel ranges) on the navigation band.
Definition kernwin.hpp:6042
verror(format, va)
idaman void ida_export term_database()
The database termination function.
tcc_renderer_type_t
TWidget renderer type.
Definition kernwin.hpp:99
@ TCCRT_GRAPH
graph view
Definition kernwin.hpp:102
@ TCCRT_INVALID
invalid
Definition kernwin.hpp:100
@ TCCRT_FLAT
flat view
Definition kernwin.hpp:101
@ TCCRT_PROXIMITY
proximity view
Definition kernwin.hpp:103
THREAD_SAFE bool user_cancelled()
Test the cancellation flag (ui_test_cancelled).
Definition kernwin.hpp:6240
void get_registered_actions(qstrvec_t *out)
Get a list of all currently-registered actions.
Definition kernwin.hpp:5159
qvector< line_rendering_output_entry_t * > line_rendering_output_entries_refs_t
Definition kernwin.hpp:2387
TWidget * create_code_viewer(TWidget *custview, int flags=0, TWidget *parent=nullptr)
Create a code viewer (ui_create_code_viewer).
Definition kernwin.hpp:6119
beep_t
< Beep types
Definition kernwin.hpp:75
@ beep_default
Definition kernwin.hpp:76
int idaapi code_viewer_lines_icon_t(TWidget *cv, const place_t *p, int *pos, void *ud)
Retrieve an icon for a code viewer line.
Definition kernwin.hpp:4257
callui(ui_mbox, mbox_replace, format, va)
int get_custom_viewer_place_xcoord(TWidget *custom_viewer, const place_t *pline, const place_t *pitem)
Get the X position of the item, in the line.
Definition kernwin.hpp:5867
THREAD_SAFE void clr_cancelled()
Clear "Cancelled" flag (ui_clr_cancelled)
Definition kernwin.hpp:6228
void display_widget(TWidget *widget, uint32 options, const char *dest_ctrl=nullptr)
Display a widget, dock it if not done before.
Definition kernwin.hpp:5336
bool read_selection(TWidget *v, twinpos_t *p1, twinpos_t *p2)
Get the selected range boundaries (ui_read_selection).
Definition kernwin.hpp:6083
va_end(va)
int idaapi formchgcb_t(int field_id, form_actions_t &fa)
Callback.
Definition kernwin.hpp:7714
const int64 IDALIB_API_MAGIC
Definition kernwin.hpp:1381
THREAD_SAFE const char * No
Definition kernwin.hpp:7745
bool ui_run_debugger(const char *dbgopts, const char *exename, int argc, const char *const *argv)
Load a debugger plugin and run the specified program (ui_run_dbg).
Definition kernwin.hpp:6273
msg_notification_t
Notification codes for events in the message window.
Definition kernwin.hpp:3914
@ msg_closed
View closed.
Definition kernwin.hpp:3937
@ msg_click
Click event.
Definition kernwin.hpp:3923
@ msg_activated
The message window is activated.
Definition kernwin.hpp:3915
@ msg_keydown
Key down event.
Definition kernwin.hpp:3941
@ msg_deactivated
The message window is deactivated.
Definition kernwin.hpp:3919
@ msg_dblclick
Double click event.
Definition kernwin.hpp:3930
int add_idc_hotkey(const char *hotkey, const char *idcfunc)
Add hotkey for IDC function (ui_add_idckey).
Definition kernwin.hpp:6304
ui_notification_t
Events marked as 'ui:' should be used as a parameter to callui().
Definition kernwin.hpp:365
@ debug_obsolete_assert_thread_waitready
Definition kernwin.hpp:1318
@ ui_dbg_get_trace_file_desc
Definition kernwin.hpp:1217
@ ui_unlock_range_refresh
ui: Unlock the ui_range refreshes.
Definition kernwin.hpp:517
@ ui_debugger_menu_change
cb: debugger menu modification detected
Definition kernwin.hpp:547
@ ui_close_chooser
ui: see close_chooser()
Definition kernwin.hpp:438
@ ui_msg_get_lines
ui: see msg_get_lines()
Definition kernwin.hpp:951
@ ui_enable_chooser_item_attrs
ui: see enable_chooser_item_attrs()
Definition kernwin.hpp:702
@ ui_get_chooser_rows
ui: see get_chooser_rows()
Definition kernwin.hpp:1060
@ ui_set_renderer_type
ui: see set_view_renderer_type()
Definition kernwin.hpp:814
@ ui_dbg_request_add_bpt
Definition kernwin.hpp:1229
@ ui_dbg_request_enable_bpt
Definition kernwin.hpp:1200
@ ui_display_widget
ui: see display_widget()
Definition kernwin.hpp:984
@ ui_dbg_get_reg_val
Definition kernwin.hpp:1174
@ ui_choose
ui: Allow the user to choose an object.
Definition kernwin.hpp:431
@ ui_execute_sync_ctl
ui: see cancel_thread_exec_requests(), cancel_exec_request(), set_execute_sync_availability()
Definition kernwin.hpp:698
@ ui_dbg_request_step_over
Definition kernwin.hpp:1102
@ ui_destroying_plugmod
cb: The plugin object is about to be destroyed
Definition kernwin.hpp:1021
@ ui_dbg_get_bptloc_string
Definition kernwin.hpp:1187
@ ui_updated_actions
cb: IDA is done updating actions.
Definition kernwin.hpp:862
@ ui_dbg_get_local_var
Definition kernwin.hpp:1274
@ ui_destroy_custom_viewer
ui: see destroy_custom_viewer()
Definition kernwin.hpp:600
@ ui_updating_actions
cb: IDA is about to update all actions.
Definition kernwin.hpp:855
@ ui_dbg_set_trace_platform
Definition kernwin.hpp:1249
@ ui_install_custom_optype_menu
ui: install/remove custom operand type menu item.
Definition kernwin.hpp:723
@ ui_get_tab_size
ui: see get_tab_size()
Definition kernwin.hpp:784
@ ui_dbg_del_vmod
Definition kernwin.hpp:1183
@ ui_dbg_get_insn_tev_reg_val_i
Definition kernwin.hpp:1290
@ ui_current_widget_changed
cb: The currently-active TWidget changed.
Definition kernwin.hpp:909
@ ui_get_registered_actions
ui: see get_registered_actions()
Definition kernwin.hpp:932
@ ui_get_active_modal_widget
ui: see get_active_modal_widget()
Definition kernwin.hpp:967
@ ui_banner
ui: see banner()
Definition kernwin.hpp:440
@ ui_dbg_add_tev
Definition kernwin.hpp:1238
@ ui_is_idaview
ui: see is_idaview()
Definition kernwin.hpp:611
@ ui_prompt_function_prototype
ui: open Function Prototype Editor and return new type for function
Definition kernwin.hpp:1074
@ ui_saving
cb: The kernel is flushing its buffers to the disk.
Definition kernwin.hpp:413
@ ui_dbg_set_insn_trace_options
Definition kernwin.hpp:1127
@ ui_lock_range_refresh
ui: Lock the ui_range refreshes.
Definition kernwin.hpp:511
@ ui_dbg_wait_for_next_event
Definition kernwin.hpp:1150
@ ui_dbg_get_reg_val_i
Definition kernwin.hpp:1292
@ ui_finish_populating_widget_popup
cb: IDA is about to be done populating the context menu for a widget.
Definition kernwin.hpp:884
@ ui_dbg_get_tev_event
Definition kernwin.hpp:1222
@ ui_dbg_set_trace_file_desc
Definition kernwin.hpp:1216
@ ui_unregister_action
ui: see unregister_action()
Definition kernwin.hpp:831
@ ui_dbg_edit_manual_regions
Definition kernwin.hpp:1171
@ ui_dbg_retrieve_exceptions
Definition kernwin.hpp:1155
@ ui_dbg_add_call_tev
Definition kernwin.hpp:1240
@ ui_dbg_add_path_mapping
Definition kernwin.hpp:1276
@ ui_execute_sync
ui: see execute_sync()
Definition kernwin.hpp:696
@ ui_ea_viewer_history_info
ui: see get_ea_viewer_history_info()
Definition kernwin.hpp:825
@ ui_dbg_request_del_bpt
Definition kernwin.hpp:1202
@ ui_dbg_save_trace_file
Definition kernwin.hpp:1214
@ ui_dbg_register_provider
Definition kernwin.hpp:1179
@ ui_dbg_begin
debugger callgates. should not be used directly, see dbg.hpp for details
Definition kernwin.hpp:1081
@ ui_beep
ui: see beep()
Definition kernwin.hpp:453
@ ui_dbg_read_memory
Definition kernwin.hpp:1192
@ ui_get_ea_hint
cb: ui wants to display a simple hint for an address.
Definition kernwin.hpp:582
@ ui_dbg_getn_thread
Definition kernwin.hpp:1096
@ ui_get_widget_config
cb: retrieve the widget configuration (it will be passed back at ui_create_desktop_widget-,...
Definition kernwin.hpp:1000
@ ui_dbg_request_attach_process
Definition kernwin.hpp:1143
@ ui_dbg_step_until_ret
Definition kernwin.hpp:1105
@ ui_dbg_compare_bpt_locs
Definition kernwin.hpp:1184
@ ui_addons
ui: see Functions: add-ons
Definition kernwin.hpp:749
@ ui_get_custom_viewer_curline
ui: see get_custom_viewer_curline()
Definition kernwin.hpp:606
@ ui_obsolete_get_highlight
now ui_get_highlight_2
Definition kernwin.hpp:941
@ ui_obsolete_del_idckey
ui: see ui_del_idckey()
Definition kernwin.hpp:492
@ ui_get_cursor
ui: see get_cursor()
Definition kernwin.hpp:501
@ ui_restore_database_snapshot
ui: see restore_database_snapshot()
Definition kernwin.hpp:764
@ ui_dbg_update_bpt
Definition kernwin.hpp:1230
@ ui_refresh_navband
ui: see refresh_navband()
Definition kernwin.hpp:545
@ ui_dbg_request_continue_process
Definition kernwin.hpp:1092
@ ui_dbg_write_register
Definition kernwin.hpp:1195
@ ui_set_mappings
ui: Show current memory mappings and allow the user to change them.
Definition kernwin.hpp:944
@ ui_dbg_get_running_notification
Definition kernwin.hpp:1084
@ ui_register_timer
ui: see register_timer()
Definition kernwin.hpp:757
@ ui_dbg_add_insn_tev
Definition kernwin.hpp:1239
@ ui_dbg_suspend_thread
Definition kernwin.hpp:1158
@ ui_dbg_is_valid_trace_file
Definition kernwin.hpp:1215
@ ui_dbg_set_reg_val_i
Definition kernwin.hpp:1293
@ ui_dbg_request_del_oldbpt
Definition kernwin.hpp:1111
@ ui_dbg_add_bpt
Definition kernwin.hpp:1228
@ ui_set_nav_colorizer
ui: see set_nav_colorizer()
Definition kernwin.hpp:983
@ ui_dbg_load_dbg_dbginfo
Definition kernwin.hpp:1256
@ ui_genfile_callback
cb: handle html generation.
Definition kernwin.hpp:522
@ ui_msg_save
ui: see msg_save()
Definition kernwin.hpp:950
@ ui_suspend
cb: Suspend graphical interface.
Definition kernwin.hpp:386
@ ui_lookup_key_code
ui: see lookup_key_code()
Definition kernwin.hpp:736
@ ui_dbg_srcdbg_step_into
Definition kernwin.hpp:1280
@ ui_dbg_set_bptloc_string
Definition kernwin.hpp:1186
@ ui_dbg_request_run_to
Definition kernwin.hpp:1104
@ ui_dbg_request_suspend_process
Definition kernwin.hpp:1090
@ ui_dbg_set_func_trace_options
Definition kernwin.hpp:1133
@ ui_gen_disasm_text
ui: see gen_disasm_text()
Definition kernwin.hpp:681
@ ui_obsolete_set_nav_colorizer
Definition kernwin.hpp:939
@ ui_ask_addr
ui: see ask_addr()
Definition kernwin.hpp:484
@ ui_set_code_viewer_line_handlers
ui: see set_code_viewer_line_handlers()
Definition kernwin.hpp:767
@ ui_dbg_clear_trace
Definition kernwin.hpp:1115
@ ui_dbg_set_manual_regions
Definition kernwin.hpp:1166
@ ui_get_user_input_event
ui: see get_user_input_event()
Definition kernwin.hpp:1049
@ ui_get_output_curline
ui: see get_output_curline()
Definition kernwin.hpp:807
@ ui_dbg_get_reg_value_type
Definition kernwin.hpp:1140
@ ui_widget_closing
TWidget is about to close.
Definition kernwin.hpp:570
@ ui_dbg_set_process_state
Definition kernwin.hpp:1164
@ ui_dbg_suspend_process
Definition kernwin.hpp:1089
@ ui_dbg_get_local_vars
Definition kernwin.hpp:1275
@ ui_read_range_selection
ui: see read_range_selection()
Definition kernwin.hpp:407
@ ui_dbg_request_select_thread
Definition kernwin.hpp:1098
@ ui_dbg_define_exception
Definition kernwin.hpp:1157
@ ui_last
the last notification code
Definition kernwin.hpp:1079
@ ui_create_empty_widget
ui: see create_empty_widget()
Definition kernwin.hpp:946
@ ui_refresh_choosers
cb: The list (chooser) window contents have been changed (names, signatures, etc).
Definition kernwin.hpp:373
@ ui_dbg_is_insn_trace_enabled
Definition kernwin.hpp:1123
@ ui_dbg_set_event_cond
Definition kernwin.hpp:1198
@ ui_create_desktop_widget
cb: create a widget, to be placed in the widget tree (at desktop-creation time.)
Definition kernwin.hpp:974
@ ui_activate_widget
ui: see activate_widget()
Definition kernwin.hpp:558
@ ui_dbg_run_requests
Definition kernwin.hpp:1082
@ ui_dbg_get_ip_val
Definition kernwin.hpp:1173
@ ui_get_current_viewer
ui: see get_current_viewer()
Definition kernwin.hpp:609
@ ui_set_custom_viewer_mode
ui: switch between graph/text modes.
Definition kernwin.hpp:674
@ ui_dbg_step_into
Definition kernwin.hpp:1099
@ ui_dbg_get_bpt
Definition kernwin.hpp:1226
@ ui_dbg_add_bpt_tev
Definition kernwin.hpp:1242
@ ui_dbg_enable_manual_regions
Definition kernwin.hpp:1167
@ ui_get_window_id
ui: set get_window_id (GUI only)
Definition kernwin.hpp:972
@ ui_dbg_set_suspend_on_event
Definition kernwin.hpp:1312
@ ui_get_range_marker
ui: Get pointer to function.
Definition kernwin.hpp:729
@ ui_get_key_code
ui: see get_key_code()
Definition kernwin.hpp:535
@ ui_dbg_get_tev_type
Definition kernwin.hpp:1233
@ ui_get_current_widget
ui: see get_current_widget()
Definition kernwin.hpp:562
@ ui_setidle
ui: Set a function to call at idle times.
Definition kernwin.hpp:442
@ ui_populating_widget_popup
cb: IDA is populating the context menu for a widget.
Definition kernwin.hpp:866
@ ui_unrecognized_config_directive
ui: Possibly handle an extra config directive, passed through '-d' or '-D'.
Definition kernwin.hpp:798
@ ui_dbg_get_first_module
Definition kernwin.hpp:1146
@ ui_dbg_find_bpt
Definition kernwin.hpp:1227
@ ui_screen_ea_changed
cb: The "current address" changed
Definition kernwin.hpp:961
@ ui_resume
cb: Resume the suspended graphical interface.
Definition kernwin.hpp:392
@ ui_take_database_snapshot
ui: see take_database_snapshot()
Definition kernwin.hpp:761
@ ui_dbg_set_remote_debugger
Definition kernwin.hpp:1153
@ ui_dbg_add_vmod
Definition kernwin.hpp:1182
@ ui_dbg_add_debug_event
Definition kernwin.hpp:1243
@ ui_dbg_request_detach_process
Definition kernwin.hpp:1145
@ ui_dbg_set_resume_mode
Definition kernwin.hpp:1257
@ ui_dbg_request_set_step_trace_options
Definition kernwin.hpp:1122
@ ui_dbg_internal_appcall
Definition kernwin.hpp:1188
@ ui_dbg_select_thread
Definition kernwin.hpp:1097
@ ui_dbg_get_tev_info
Definition kernwin.hpp:1136
@ ui_execute_ui_requests
ui: see execute_ui_requests(ui_request_t, ...)
Definition kernwin.hpp:751
@ ui_dbg_enable_func_trace
Definition kernwin.hpp:1130
@ ui_dbg_get_process_options
Definition kernwin.hpp:1162
@ ui_dbg_get_tev_tid
Definition kernwin.hpp:1234
@ ui_execute_ui_requests_list
ui: see execute_ui_requests(ui_requests_t)
Definition kernwin.hpp:754
@ ui_set_custom_viewer_handler
ui: see set_custom_viewer_handler().
Definition kernwin.hpp:658
@ ui_custom_viewer_jump
ui: set the current location, and have the viewer display it
Definition kernwin.hpp:923
@ ui_dbg_get_insn_tev_reg_result_i
Definition kernwin.hpp:1291
@ ui_dbg_del_bpt
Definition kernwin.hpp:1201
@ ui_detach_action_from_toolbar
ui: see detach_action_from_toolbar()
Definition kernwin.hpp:852
@ ui_dbg_get_thread_qty
Definition kernwin.hpp:1095
@ ui_dbg_srcdbg_step_until_ret
Definition kernwin.hpp:1284
@ ui_ea_viewer_history_push_and_jump
ui: see ea_viewer_history_push_and_jump()
Definition kernwin.hpp:822
@ ui_idcstop
cb: Stop of IDC engine work.
Definition kernwin.hpp:382
@ ui_dbg_set_process_options
Definition kernwin.hpp:1168
@ ui_dbg_request_add_oldbpt
Definition kernwin.hpp:1109
@ ui_attach_action_to_toolbar
ui: see attach_action_to_toolbar()
Definition kernwin.hpp:849
@ ui_open_builtin2
ui: open a window of a built-in type.
Definition kernwin.hpp:1067
@ ui_dbg_get_memory_info
Definition kernwin.hpp:1196
@ ui_dbg_request_enable_oldbpt
Definition kernwin.hpp:1113
@ ui_jump_in_custom_viewer
ui: see jumpto()
Definition kernwin.hpp:603
@ ui_dbg_request_enable_bblk_trace
Definition kernwin.hpp:1208
@ ui_get_curline
ui: see get_curline()
Definition kernwin.hpp:503
@ ui_idcstart
cb: Start of IDC engine work.
Definition kernwin.hpp:378
@ ui_set_highlight
ui: see set_highlight()
Definition kernwin.hpp:942
@ ui_run_dbg
ui: see ui_run_debugger()
Definition kernwin.hpp:499
@ ui_dbg_graph_trace
Definition kernwin.hpp:1220
@ ui_dbg_store_exceptions
Definition kernwin.hpp:1156
@ ui_dbg_is_func_trace_enabled
Definition kernwin.hpp:1129
@ ui_dbg_attach_process
Definition kernwin.hpp:1142
@ ui_mbox
ui: Show a message box.
Definition kernwin.hpp:462
@ ui_read_selection
ui: see read_selection()
Definition kernwin.hpp:405
@ ui_obsolete_get_custom_viewer_location
Definition kernwin.hpp:1011
@ ui_delete_menu
ui: see delete_menu()
Definition kernwin.hpp:938
@ ui_dbg_del_thread
Definition kernwin.hpp:1245
@ ui_dbg_internal_get_sreg_base
Definition kernwin.hpp:1190
@ ui_sync_sources
ui: [un]synchronize sources
Definition kernwin.hpp:993
@ ui_dbg_srcdbg_request_step_until_ret
Definition kernwin.hpp:1285
@ ui_dbg_run_to_backwards
Definition kernwin.hpp:1310
@ ui_dbg_request_step_over_backwards
Definition kernwin.hpp:1309
@ ui_dbg_step_into_backwards
Definition kernwin.hpp:1306
@ ui_dbg_exit_process
Definition kernwin.hpp:1093
@ ui_dbg_get_call_tev_callee
Definition kernwin.hpp:1137
@ ui_get_synced_group
ui: see get_synced_group()
Definition kernwin.hpp:1029
@ ui_broadcast
cb: broadcast call
Definition kernwin.hpp:398
@ ui_dbg_get_sp_val
Definition kernwin.hpp:1172
@ ui_is_idaq
ui: see is_idaq()
Definition kernwin.hpp:543
@ ui_open_builtin
ui: open a window of a built-in type. see Functions: open built-in windows
Definition kernwin.hpp:664
@ ui_dbg_diff_trace_file
Definition kernwin.hpp:1219
@ ui_plugin_loaded
cb: The plugin was loaded in memory.
Definition kernwin.hpp:901
@ ui_dbg_enable_step_trace
Definition kernwin.hpp:1118
@ ui_dbg_request_exit_process
Definition kernwin.hpp:1094
@ ui_get_highlight_2
ui: see get_highlight()
Definition kernwin.hpp:1052
@ ui_dbg_get_tev_qty
Definition kernwin.hpp:1135
@ ui_dbg_request_set_insn_trace_options
Definition kernwin.hpp:1128
@ ui_obsolete_display_widget
Definition kernwin.hpp:555
@ ui_get_action_attr
ui: see Functions: get action attributes
Definition kernwin.hpp:899
@ ui_dbg_is_bblk_trace_enabled
Definition kernwin.hpp:1206
@ ui_dbg_get_module_info
Definition kernwin.hpp:1269
@ ui_copywarn
ui: see display_copyright_warning()
Definition kernwin.hpp:505
@ ui_create_source_viewer
ui: Create new source viewer.
Definition kernwin.hpp:772
@ ui_dbg_internal_set_elang
Definition kernwin.hpp:1253
@ ui_dbg_change_bptlocs
Definition kernwin.hpp:1265
@ ui_parse_tagged_line_sections
ui: see parse_tagged_line_sections()
Definition kernwin.hpp:1077
@ ui_dbg_step_over_backwards
Definition kernwin.hpp:1308
@ ui_dbg_get_reg_info
Definition kernwin.hpp:1295
@ ui_dbg_enable_oldbpt
Definition kernwin.hpp:1112
@ ui_dbg_unregister_provider
Definition kernwin.hpp:1180
@ ui_null
Definition kernwin.hpp:366
@ ui_dbg_map_source_path
Definition kernwin.hpp:1203
@ ui_attach_action_to_menu
ui: see attach_action_to_menu()
Definition kernwin.hpp:834
@ ui_dbg_get_process_state
Definition kernwin.hpp:1086
@ ui_saved
cb: The kernel has saved the database.
Definition kernwin.hpp:418
@ ui_delete_toolbar
ui: see delete_toolbar()
Definition kernwin.hpp:936
@ ui_dbg_continue_process
Definition kernwin.hpp:1091
@ ui_dbg_get_bpt_group
Definition kernwin.hpp:1264
@ ui_analyzer_options
ui: see analyzer_options()
Definition kernwin.hpp:495
@ ui_create_code_viewer
ui: see create_code_viewer()
Definition kernwin.hpp:747
@ ui_refresh_custom_viewer
ui: see refresh_custom_viewer()
Definition kernwin.hpp:597
@ ui_load_file
ui: see ui_load_new_file()
Definition kernwin.hpp:497
@ ui_dbg_write_memory
Definition kernwin.hpp:1193
@ ui_dbg_collect_stack_trace
Definition kernwin.hpp:1268
@ ui_dbg_del_oldbpt
Definition kernwin.hpp:1110
@ ui_dbg_get_insn_tev_reg_mem
Definition kernwin.hpp:1223
@ ui_unregister_timer
ui: see unregister_timer()
Definition kernwin.hpp:759
@ ui_dbg_set_trace_size
Definition kernwin.hpp:1114
@ ui_dbg_start_process
Definition kernwin.hpp:1087
@ ui_install_custom_datatype_menu
ui: install/remove custom data type menu item.
Definition kernwin.hpp:717
@ ui_open_url
ui: see open_url()
Definition kernwin.hpp:528
@ ui_dbg_get_trace_dynamic_register_set
Definition kernwin.hpp:1298
@ ui_ask_form
ui: see ask_form()/open_form()
Definition kernwin.hpp:478
@ ui_widget_invisible
TWidget is being closed.
Definition kernwin.hpp:577
@ ui_dbg_get_trace_platform
Definition kernwin.hpp:1250
@ ui_dbg_bring_to_front
Definition kernwin.hpp:1148
@ ui_dbg_set_bptloc_group
Definition kernwin.hpp:1259
@ ui_hexdumpea
ui: Return the current address in a hex view.
Definition kernwin.hpp:530
@ ui_dbg_request_clear_trace
Definition kernwin.hpp:1116
@ ui_dbg_srcdbg_request_step_over
Definition kernwin.hpp:1283
@ ui_get_renderer_type
ui: see get_view_renderer_type()
Definition kernwin.hpp:812
@ ui_dbg_modify_source_paths
Definition kernwin.hpp:1205
@ ui_get_item_hint
cb: ui wants to display multiline hint for an item.
Definition kernwin.hpp:589
@ ui_dbg_get_bpt_tev_ea
Definition kernwin.hpp:1139
@ ui_dbg_get_trace_base_address
Definition kernwin.hpp:1235
@ ui_get_chooser_item_attrs
cb: get item-specific attributes for a chooser.
Definition kernwin.hpp:705
@ ui_dbg_continue_backwards
Definition kernwin.hpp:1304
@ ui_dbg_get_grp_bpts
Definition kernwin.hpp:1263
@ ui_update_action_attr
ui: see Functions: update actions
Definition kernwin.hpp:896
@ ui_dbg_internal_get_elang
Definition kernwin.hpp:1252
@ ui_dbg_request_resume_thread
Definition kernwin.hpp:1161
@ ui_dbg_request_step_into
Definition kernwin.hpp:1100
@ ui_get_widget_title
ui: see get_widget_title()
Definition kernwin.hpp:915
@ ui_dbg_get_current_source_line
Definition kernwin.hpp:1278
@ ui_dbg_map_source_file_path
Definition kernwin.hpp:1204
@ ui_dbg_get_srcinfo_provider
Definition kernwin.hpp:1272
@ ui_dbg_request_set_func_trace_options
Definition kernwin.hpp:1134
@ ui_dbg_getn_bpt
Definition kernwin.hpp:1225
@ ui_dbg_resume_thread
Definition kernwin.hpp:1160
@ ui_dbg_request_set_resume_mode
Definition kernwin.hpp:1258
@ ui_update_file_history
ui: manipulate the file history
Definition kernwin.hpp:1025
@ ui_dbg_get_insn_tev_reg_val
Definition kernwin.hpp:1177
@ ui_dbg_get_tev_ea
Definition kernwin.hpp:1232
@ ui_dbg_check_bpt
Definition kernwin.hpp:1163
@ ui_dbg_get_ret_tev_return
Definition kernwin.hpp:1138
@ ui_dbg_request_suspend_thread
Definition kernwin.hpp:1159
@ ui_close_widget
ui: see close_widget()
Definition kernwin.hpp:556
@ ui_jumpto
ui: see jumpto(ea_t, int, int)
Definition kernwin.hpp:794
@ ui_dbg_get_tev_memory_info
Definition kernwin.hpp:1221
@ ui_chooser_default_enter
ui: jump to the address returned by get_ea() callback in the case of the non-modal choosers
Definition kernwin.hpp:953
@ ui_set_widget_config
cb: set the widget configuration
Definition kernwin.hpp:1006
@ ui_dbg_add_ret_tev
Definition kernwin.hpp:1241
@ ui_test_cancelled
ui: see user_cancelled()
Definition kernwin.hpp:472
@ ui_dbg_add_thread
Definition kernwin.hpp:1244
@ ui_dbg_end
Definition kernwin.hpp:1314
@ ui_register_action
ui: see register_action()
Definition kernwin.hpp:828
@ ui_dbg_hide_all_bpts
Definition kernwin.hpp:1170
@ ui_dbg_read_registers
Definition kernwin.hpp:1194
@ ui_add_idckey
ui: see add_idc_hotkey()
Definition kernwin.hpp:490
@ ui_ask_file
ui: see ask_file()
Definition kernwin.hpp:476
@ ui_refresh_chooser
ui: see refresh_chooser()
Definition kernwin.hpp:662
@ ui_obsolete_dbg_save_bpts
Definition kernwin.hpp:1185
@ ui_dbg_enable_bptgrp
Definition kernwin.hpp:1301
@ ui_dbg_enable_bpt
Definition kernwin.hpp:1199
@ ui_detach_action_from_menu
ui: see detach_action_from_menu()
Definition kernwin.hpp:837
@ ui_dbg_add_oldbpt
Definition kernwin.hpp:1108
@ ui_set_dock_pos
ui: see set_dock_pos()
Definition kernwin.hpp:713
@ ui_range
cb: The disassembly range has been changed ( idainfo::min_ea ... idainfo::max_ea).
Definition kernwin.hpp:368
@ ui_dbg_list_bptgrps
Definition kernwin.hpp:1260
@ ui_set_cancelled
ui: see set_cancelled()
Definition kernwin.hpp:470
@ ui_dbg_request_enable_step_trace
Definition kernwin.hpp:1119
@ ui_open_form
ui: see vopen_form()
Definition kernwin.hpp:796
@ ui_dbg_enable_insn_trace
Definition kernwin.hpp:1124
@ ui_get_viewer_place_type
ui: see get_viewer_place_type()
Definition kernwin.hpp:819
@ ui_dbg_get_insn_tev_reg_result
Definition kernwin.hpp:1178
@ ui_dbg_set_trace_dynamic_register_set
Definition kernwin.hpp:1297
@ ui_attach_dynamic_action_to_popup
ui: see create attach_dynamic_action_to_popup()
Definition kernwin.hpp:846
@ ui_get_widget_type
ui: see get_widget_type()
Definition kernwin.hpp:907
@ ui_postprocess_action
cb: an ida ui action has been handled
Definition kernwin.hpp:672
@ ui_ready_to_run
cb: all UI elements have been initialized.
Definition kernwin.hpp:652
@ ui_dbg_getn_thread_name
Definition kernwin.hpp:1287
@ ui_repaint_qwidget
ui: see repaint_custom_viewer()
Definition kernwin.hpp:786
@ ui_ask_text
ui: see ask_text()
Definition kernwin.hpp:480
@ ui_dbg_get_step_trace_options
Definition kernwin.hpp:1120
@ ui_refresh
ui: see refresh_idaview_anyway()
Definition kernwin.hpp:429
@ ui_plugin_unloading
cb: The plugin is about to be unloaded
Definition kernwin.hpp:904
@ ui_refreshmarked
ui: see refresh_idaview()
Definition kernwin.hpp:427
@ ui_dbg_get_event_cond
Definition kernwin.hpp:1197
@ ui_obsolete_get_user_strlist_options
ui: see get_user_strlist_options()
Definition kernwin.hpp:917
@ ui_create_custom_viewer
ui: see create_custom_viewer()
Definition kernwin.hpp:920
@ ui_get_output_selected_text
ui: see get_output_selected_text()
Definition kernwin.hpp:809
@ ui_process_action
ui: see process_ui_action()
Definition kernwin.hpp:745
@ ui_dbg_load_debugger
Definition kernwin.hpp:1154
@ ui_database_closed
cb: The database has been closed.
Definition kernwin.hpp:446
@ ui_dbg_request_step_into_backwards
Definition kernwin.hpp:1307
@ ui_msg_clear
ui: see msg_clear()
Definition kernwin.hpp:949
@ ui_dbg_get_next_module
Definition kernwin.hpp:1147
@ ui_dbg_set_reg_val
Definition kernwin.hpp:1175
@ ui_navband_ea
ui: see get_navband_ea
Definition kernwin.hpp:971
@ ui_widget_visible
TWidget is displayed on the screen.
Definition kernwin.hpp:565
@ ui_clr_cancelled
ui: see clr_cancelled()
Definition kernwin.hpp:468
@ ui_noabort
ui: Disable 'abort' menu item - the database was not compressed.
Definition kernwin.hpp:507
@ ui_dbg_get_func_trace_options
Definition kernwin.hpp:1132
@ ui_dbg_get_current_source_file
Definition kernwin.hpp:1277
@ ui_obsolete_refresh_custom_code_viewer
Definition kernwin.hpp:770
@ ui_dbg_get_debug_event
Definition kernwin.hpp:1151
@ ui_dbg_request_continue_backwards
Definition kernwin.hpp:1305
@ ui_create_menu
ui: see create_menu()
Definition kernwin.hpp:937
@ ui_dbg_internal_cleanup_appcall
Definition kernwin.hpp:1189
@ ui_dbg_load_trace_file
Definition kernwin.hpp:1213
@ ui_dbg_request_set_reg_val
Definition kernwin.hpp:1176
@ ui_create_toolbar
ui: see create_toolbar()
Definition kernwin.hpp:935
@ ui_dbg_enable_bblk_trace
Definition kernwin.hpp:1207
@ ui_get_icon_id_by_name
ui: see get_icon_id_by_name()
Definition kernwin.hpp:1064
@ ui_dbg_request_start_process
Definition kernwin.hpp:1088
@ ui_get_chooser_data
ui: see get_chooser_data()
Definition kernwin.hpp:940
@ ui_ask_str
ui: see ask_str()
Definition kernwin.hpp:482
@ ui_choose_bookmark
ui: modal chooser (legacy)
Definition kernwin.hpp:1040
@ ui_dbg_add_many_tevs
Definition kernwin.hpp:1246
@ ui_dbg_set_trace_base_address
Definition kernwin.hpp:1237
@ ui_preprocess_action
cb: ida ui is about to handle a user action.
Definition kernwin.hpp:666
@ ui_database_inited
cb: database initialization has completed.
Definition kernwin.hpp:644
@ ui_dbg_srcdbg_request_step_into
Definition kernwin.hpp:1281
@ ui_detach_action_from_popup
ui: see detach_action_from_popup()
Definition kernwin.hpp:843
@ ui_load_custom_icon
ui: see load_custom_icon(const void *, unsigned int, const char *)
Definition kernwin.hpp:741
@ ui_custom_viewer_set_userdata
ui: Change place_t user data for a custom view.
Definition kernwin.hpp:788
@ ui_get_output_cursor
ui: see get_output_cursor()
Definition kernwin.hpp:805
@ ui_dbg_srcdbg_step_over
Definition kernwin.hpp:1282
@ ui_dbg_clear_requests_queue
Definition kernwin.hpp:1085
@ ui_load_custom_icon_file
ui: see load_custom_icon(const char *)
Definition kernwin.hpp:738
@ ui_desktop_applied
cb: a desktop has been applied
Definition kernwin.hpp:1035
@ ui_initing_database
cb: database initialization has started.
Definition kernwin.hpp:1013
@ ui_msg
ui: Show a message in the message window.
Definition kernwin.hpp:457
@ ui_get_opnum
ui: see get_opnum()
Definition kernwin.hpp:715
@ ui_dbg_is_step_trace_enabled
Definition kernwin.hpp:1117
@ ui_navband_pixel
ui: see get_navband_pixel
Definition kernwin.hpp:970
@ ui_get_custom_viewer_hint
cb: ui wants to display a hint for a viewer (idaview or custom).
Definition kernwin.hpp:613
@ ui_ask_long
ui: see ask_long()
Definition kernwin.hpp:488
@ ui_dbg_get_manual_regions
Definition kernwin.hpp:1165
@ ui_dbg_handle_debug_event
Definition kernwin.hpp:1181
@ ui_ask_buttons
ui: see ask_yn() and ask_buttons()
Definition kernwin.hpp:474
@ ui_dbg_run_to
Definition kernwin.hpp:1103
@ ui_find_widget
ui: see find_widget()
Definition kernwin.hpp:560
@ ui_dbg_for_all_bpts
Definition kernwin.hpp:1231
@ ui_dbg_request_enable_func_trace
Definition kernwin.hpp:1131
@ ui_dbg_detach_process
Definition kernwin.hpp:1144
@ ui_show_rename_dialog
ui: undocumented
Definition kernwin.hpp:1032
@ ui_dbg_request_run_to_backwards
Definition kernwin.hpp:1311
@ ui_dbg_request_set_bblk_trace_options
Definition kernwin.hpp:1211
@ ui_dbg_set_step_trace_options
Definition kernwin.hpp:1121
@ ui_get_lines_rendering_info
cb: get lines rendering information
Definition kernwin.hpp:986
@ ui_setup_plugins_menu
ui: setup plugins submenu
Definition kernwin.hpp:537
@ ui_screenea
ui: see get_screen_ea()
Definition kernwin.hpp:411
@ ui_get_viewer_user_data
ui: see get_viewer_user_data()
Definition kernwin.hpp:816
@ ui_dbg_set_highlight_trace_options
Definition kernwin.hpp:1248
@ ui_dbg_del_bptgrp
Definition kernwin.hpp:1262
@ ui_dbg_rename_bptgrp
Definition kernwin.hpp:1261
@ ui_destroying_procmod
cb: The processor module is about to be destroyed
Definition kernwin.hpp:1018
@ ui_ask_seg
ui: see ask_seg()
Definition kernwin.hpp:486
@ ui_get_chooser_obj
ui: see get_chooser_obj()
Definition kernwin.hpp:700
@ ui_get_custom_viewer_place_xcoord
ui: see get_custom_viewer_place_xcoord()
Definition kernwin.hpp:1046
@ ui_set_custom_viewer_range
ui: set_custom_viewer_range()
Definition kernwin.hpp:641
@ ui_dbg_get_bpt_qty
Definition kernwin.hpp:1107
@ ui_dbg_set_debugger_options
Definition kernwin.hpp:1152
@ ui_attach_action_to_popup
ui: see attach_action_to_popup()
Definition kernwin.hpp:840
@ ui_dbg_get_current_thread
Definition kernwin.hpp:1149
@ ui_unmarksel
ui: see unmark_selection()
Definition kernwin.hpp:409
@ ui_dbg_set_bblk_trace_options
Definition kernwin.hpp:1210
@ ui_dbg_internal_ioctl
Definition kernwin.hpp:1191
@ ui_dbg_get_insn_trace_options
Definition kernwin.hpp:1126
@ ui_get_last_widget
ui: see get_last_widget()
Definition kernwin.hpp:1072
@ ui_dbg_bin_search
Definition kernwin.hpp:1288
@ ui_free_custom_icon
ui: see free_custom_icon()
Definition kernwin.hpp:743
@ ui_is_msg_inited
ui: see is_msg_inited()
Definition kernwin.hpp:455
@ ui_set_custom_viewer_handlers
ui: see set_custom_viewer_handlers()
Definition kernwin.hpp:929
@ ui_dbg_request_step_until_ret
Definition kernwin.hpp:1106
@ ui_dbg_choose_trace_file
Definition kernwin.hpp:1218
@ ui_dbg_get_processes
Definition kernwin.hpp:1141
@ ui_dbg_request_enable_insn_trace
Definition kernwin.hpp:1125
@ ui_dbg_set_bpt_group
Definition kernwin.hpp:1247
@ ui_dbg_get_running_request
Definition kernwin.hpp:1083
@ ui_get_curplace
ui: see get_custom_viewer_place(). See also ui_get_custom_viewer_location
Definition kernwin.hpp:553
@ ui_get_custom_viewer_location_2
ui: see get_custom_viewer_location()
Definition kernwin.hpp:1054
@ ui_install_cli
ui: see: install_command_interpreter(), remove_command_interpreter()
Definition kernwin.hpp:692
@ ui_get_kernel_version
ui: see get_kernel_version()
Definition kernwin.hpp:541
@ ui_strchoose
ui: undocumented
Definition kernwin.hpp:980
@ ui_dbg_get_global_var
Definition kernwin.hpp:1273
@ ui_dbg_get_bblk_trace_options
Definition kernwin.hpp:1209
@ ui_dbg_step_over
Definition kernwin.hpp:1101
@ ui_gen_idanode_text
cb: generate disassembly text for a node.
Definition kernwin.hpp:683
@ ui_dbg_is_busy
Definition kernwin.hpp:1169
bool unregister_action(const char *name)
Delete a previously-registered action (ui_unregister_action).
Definition kernwin.hpp:5151
bool is_chooser_widget(twidget_type_t t)
Does the given widget type specify a chooser widget?
Definition kernwin.hpp:2788
bool get_output_selected_text(qstring *buf)
Returns selected text from output window (ui_get_output_selected_text).
Definition kernwin.hpp:5905
THREAD_SAFE ssize_t execute_sync(exec_request_t &req, int reqf)
Execute code in the main thread.
Definition kernwin.hpp:5005
idaman void ida_export request_refresh(uint64 mask, bool cnd=true)
Request a refresh of a builtin window.
bool idaapi custom_viewer_keydown_t(TWidget *cv, int vk_key, int shift, void *ud)
The user has pressed a key.
Definition kernwin.hpp:4068
THREAD_SAFE qtimer_t register_timer(int interval_ms, int(idaapi *callback)(void *ud), void *ud)
Register a timer (ui_register_timer).
Definition kernwin.hpp:5107
int get_opnum()
Get current operand number, -1 means no operand (ui_get_opnum)
Definition kernwin.hpp:4905
idaman int64 pos
Definition kernwin.hpp:1365
idaman void ida_export hexplace_t__out_one_item(const hexplace_t *_this, outctx_base_t &ctx, const hexplace_gen_t *hg, int itemno, color_t *color, color_t patch_or_edit)
qvector< section_lines_refs_t > sections_lines_refs_t
Definition kernwin.hpp:2288
input_event_modifiers_t view_event_state_t
Definition kernwin.hpp:3909
vme_button_t
Represents mouse button for view_mouse_event_t objects.
Definition kernwin.hpp:118
@ VME_LEFT_BUTTON
left mouse button
Definition kernwin.hpp:120
@ VME_UNKNOWN
unknown mouse button
Definition kernwin.hpp:119
@ VME_RIGHT_BUTTON
right mouse button
Definition kernwin.hpp:121
@ VME_MID_BUTTON
middle mouse button
Definition kernwin.hpp:122
int idaapi custom_viewer_get_place_xcoord_t(TWidget *v, const place_t *pline, const place_t *pitem, void *ud)
Does the line pointed to by pline include pitem, and if so at what X coordinate?
Definition kernwin.hpp:4171
bool jumpto(ea_t ea, int opnum=-1, int uijmp_flags=UIJMP_ACTIVATE)
Jump to the specified address (ui_jumpto).
Definition kernwin.hpp:4863
int get_tab_size(const char *path)
Get the size of a tab in spaces (ui_get_tab_size).
Definition kernwin.hpp:6220
show_wait_box_v(format, va)
execute_sync_ctl_t
Definition kernwin.hpp:352
@ esctl_cancel_thread_requests
Definition kernwin.hpp:355
@ esctl_none
Definition kernwin.hpp:353
@ esctl_set_availability
Definition kernwin.hpp:356
@ esctl_cancel_request
Definition kernwin.hpp:354
void set_code_viewer_line_handlers(TWidget *code_viewer, code_viewer_lines_click_t *click_handler, code_viewer_lines_click_t *popup_handler, code_viewer_lines_click_t *dblclick_handler, code_viewer_lines_icon_t *drawicon_handler, code_viewer_lines_linenum_t *linenum_handler)
Set handlers for code viewer line events.
Definition kernwin.hpp:6171
bool idaapi custom_viewer_dblclick_t(TWidget *cv, int shift, void *ud)
The user double clicked.
Definition kernwin.hpp:4088
bool take_database_snapshot(snapshot_t *ss, qstring *err_msg)
Take a database snapshot (ui_take_database_snapshot).
Definition kernwin.hpp:5069
bool create_menu(const char *name, const char *label, const char *menupath=nullptr)
Create a menu with the given name, label and optional position, either in the menubar,...
Definition kernwin.hpp:5214
idaman uint64 ida_export get_dirty_infos()
Bitmask of builtin window types to be refreshed:
TWidget * find_widget(const char *caption)
Find widget with the specified caption (only gui version) (ui_find_widget).
Definition kernwin.hpp:5367
int idaapi obsolete_custom_viewer_help_t(TWidget *cv, void *ud)
Definition kernwin.hpp:4106
idaman callui_t idaman int ida_export init_database(int argc, const char *const *argv, int *newfile)
After calling init_kernel() the ui must call this function.
bool get_cursor(int *x, int *y)
Get the cursor position on the screen (ui_get_cursor).
Definition kernwin.hpp:4915
bool ui_load_new_file(qstring *temp_file, qstring *filename, linput_t **pli, ushort neflags, load_info_t **ploaders)
Display a load file dialog and load file (ui_load_file).
Definition kernwin.hpp:6255
void refresh_custom_viewer(TWidget *custom_viewer)
Refresh custom ida viewer (ui_refresh_custom_viewer)
Definition kernwin.hpp:5469
void refresh_navband(bool force)
Refresh navigation band if changed (ui_refresh_navband).
Definition kernwin.hpp:4963
ea_t get_navband_ea(int pixel)
Translate the pixel position on the navigation band, into an address.
Definition kernwin.hpp:6050
idaman lochist_entry_cvt2_t *ida_export lookup_loc_converter2(const char *p1, const char *p2)
Search for a place converter from lochist_entry_t's with places of type 'p1' to lochist_entry_t's wit...
void idaapi code_viewer_lines_click_t(TWidget *c, const place_t *p, int pos, int shift, void *ud)
The user clicked, right clicked or double clicked.
Definition kernwin.hpp:4242
CASSERT(sizeof(sync_source_t)==16)
idaman callui_t ida_export_data(idaapi *callui)(ui_notification_t what
Pointer to the user-interface dispatcher function.
bool set_dock_pos(const char *src_ctrl, const char *dest_ctrl, int orient, int left=0, int top=0, int right=0, int bottom=0)
Set the docking position of a widget (ui_set_dock_pos).
Definition kernwin.hpp:5018
bool create_toolbar(const char *name, const char *label, const char *before=nullptr, int flags=0)
Create a toolbar with the given name, label and optional position.
Definition kernwin.hpp:5171
void * get_viewer_user_data(TWidget *viewer)
Get the user data from a custom viewer (ui_get_viewer_user_data)
Definition kernwin.hpp:6154
void setup_range_marker()
Initialize pointer to idaview marker.
Definition kernwin.hpp:6344
bool restore_database_snapshot(const snapshot_t *ss, ss_restore_cb_t *cb, void *ud)
Restore a database snapshot.
Definition kernwin.hpp:5086
idaman size_t len
Definition kernwin.hpp:1356
THREAD_SAFE int execute_ui_requests(ui_requests_t *reqs)
Execute a list of UI requests (ui_execute_ui_requests_list).
Definition kernwin.hpp:4784
size_t const char * defval
Definition kernwin.hpp:7959
void install_command_interpreter(const cli_t *cp)
Install command line interpreter (ui_install_cli)
Definition kernwin.hpp:4982
action_ctx_base_t action_activation_ctx_t
Instances of this class will be filled with information that is commonly used by actions when they ne...
Definition kernwin.hpp:4600
bool msg_save(qstring &path)
Save the "Output" window contents into a file.
Definition kernwin.hpp:6011
void idaapi ss_restore_cb_t(const char *errmsg, void *ud)
Snapshot restoration completion callback. see restore_database_snapshot()
Definition kernwin.hpp:4479
idaman bool ida_export l_equals(const place_t *t1, const place_t *t2, void *ud)
void idaapi custom_viewer_adjust_place_t(TWidget *v, lochist_entry_t *loc, void *ud)
Fine-tune 'loc->place()' according to the X position (i.e., 'loc->renderer_info()....
Definition kernwin.hpp:4143
idaman int ida_export l_compare2(const place_t *t1, const place_t *t2, void *ud)
void clear_refresh_request(uint64 mask)
Definition kernwin.hpp:2641
idaman int ida_export_data errorexit
Exiting because of a a fatal error?
Definition kernwin.hpp:7065
idaman int ida_export get_place_class_id(const char *name)
Get the place class ID for the place that has been registered as 'name'.
void set_nav_colorizer(nav_colorizer_t **out_was_func, void **out_was_ud, nav_colorizer_t *func, void *ud)
Install new navigation band colorizer (ui_set_nav_colorizer).
Definition kernwin.hpp:3858
TWidget * get_last_widget(uint64 mask=uint64(-1))
Get last ida viewer (idaview or custom viewer) (ui_get_last_widget)
Definition kernwin.hpp:5923
bool delete_toolbar(const char *name)
Delete an existing toolbar.
Definition kernwin.hpp:5184
view_notification_t
Notification codes sent by the UI for IDAView or custom viewer events.
Definition kernwin.hpp:4015
@ view_switched
A view's renderer has changed.
Definition kernwin.hpp:4044
@ view_mouse_moved
The mouse moved on the view.
Definition kernwin.hpp:4059
@ view_mouse_over
The user moved the mouse over (or out of) a node or an edge.
Definition kernwin.hpp:4048
@ view_activated
A view is activated.
Definition kernwin.hpp:4016
@ view_dblclick
Double click event.
Definition kernwin.hpp:4031
@ view_deactivated
A view is deactivated.
Definition kernwin.hpp:4019
@ view_created
A view is being created.
Definition kernwin.hpp:4038
@ view_close
View closed.
Definition kernwin.hpp:4041
@ view_loc_changed
The location for the view has changed (can be either the place_t, the renderer_info_t,...
Definition kernwin.hpp:4053
@ view_click
Click event.
Definition kernwin.hpp:4027
@ view_curpos
Cursor position changed.
Definition kernwin.hpp:4035
@ view_keydown
Key down event.
Definition kernwin.hpp:4022
bool is_tif_cursor_index(tif_cursor_t c)
Definition kernwin.hpp:1889
bool detach_action_from_toolbar(const char *toolbar_name, const char *name)
Detach an action from the toolbar (ui_detach_action_from_toolbar).
Definition kernwin.hpp:5288
TWidget * get_active_modal_widget()
Get the current, active modal TWidget instance.
Definition kernwin.hpp:6033
THREAD_SAFE const char const char * Cancel
Definition kernwin.hpp:7746
THREAD_SAFE bool cancel_exec_request(int req_id)
Try to cancel an asynchronous exec request (ui_cancel_exec_request).
Definition kernwin.hpp:4810
twidget_type_t get_widget_type(TWidget *widget)
Get the type of the TWidget * (ui_get_widget_type).
Definition kernwin.hpp:5383
asize_t size
Definition kernwin.hpp:6339
int load_custom_icon(const char *file_name)
Load an icon from a file (ui_load_custom_icon_file).
Definition kernwin.hpp:5034
bool custom_viewer_jump(TWidget *v, const lochist_entry_t &loc, uint32 flags=0)
Append 'loc' to the viewer's history, and cause the viewer to display it.
Definition kernwin.hpp:5432
void mark_all_eaviews_for_refresh()
Tell UI to refresh all idaviews and hexviews.
Definition kernwin.hpp:6362
action_attr_t
Codes for getting/setting action attributes.
Definition kernwin.hpp:4712
@ AA_VISIBILITY
see update_action_visibility()
Definition kernwin.hpp:4721
@ AA_NONE
no effect
Definition kernwin.hpp:4713
@ AA_CHECKED
see update_action_checked()
Definition kernwin.hpp:4720
@ AA_ICON
see update_action_icon()
Definition kernwin.hpp:4717
@ AA_CHECKABLE
see update_action_checkable()
Definition kernwin.hpp:4719
@ AA_TOOLTIP
see update_action_tooltip()
Definition kernwin.hpp:4716
@ AA_LABEL
see update_action_label()
Definition kernwin.hpp:4714
@ AA_SHORTCUT
see update_action_shortcut()
Definition kernwin.hpp:4715
@ AA_STATE
see update_action_state()
Definition kernwin.hpp:4718
qvector< sync_source_t > sync_source_vec_t
Definition kernwin.hpp:2080
idaman const place_t *ida_export get_place_class(int *out_flags, int *out_sdk_version, int id)
Get information about a previously-registered place_t class.
bool get_widget_title(qstring *buf, TWidget *widget)
Get the TWidget's title (ui_get_widget_title).
Definition kernwin.hpp:5391
qvector< line_section_t > line_sections_t
Definition kernwin.hpp:2456
bool idaapi custom_viewer_help_t(qstring *out, TWidget *cv, void *ud)
Custom viewer: the user pressed F1 If true and out is filled, it will be considered either an absolut...
Definition kernwin.hpp:4113
DECLARE_TYPE_AS_MOVABLE(sync_source_t)
ssize_t get_kernel_version(char *buf, size_t bufsize)
Get IDA kernel version (in a string like "5.1").
Definition kernwin.hpp:1375
void idaapi custom_viewer_mouse_moved_t(TWidget *cv, int shift, view_mouse_event_t *e, void *ud)
The user moved the mouse.
Definition kernwin.hpp:4078
bool is_tif_cursor_footer(tif_cursor_t c)
Definition kernwin.hpp:1888
int choose_struc_path(const char *title, tid_t strid, uval_t offset, adiff_t delta, bool appzero, tid_t *path)
Get path to a structure offset (for nested structures/enums) (ui_choose, chtype_strpath).
Definition kernwin.hpp:6822
QT::QWidget TWidget
Definition kernwin.hpp:2024
ushort get_key_code(const char *keyname)
Get keyboard key code by its name (ui_get_key_code)
Definition kernwin.hpp:4949
idaman bool ida_export_data batch
If this variable is set, then dialog boxes will not appear on the screen.
Definition kernwin.hpp:7059
vshow_hex_file(li, pos, count, format, va)
bool get_action_shortcut(qstring *shortcut, const char *name)
Get an action's shortcut (ui_get_action_attr).
Definition kernwin.hpp:5728
va_start(va, format)
bool parse_tagged_line_sections(tagged_line_sections_t *out, const char *line)
Collect tagged sections in a color-tagged line (produced by place_t::generate)
Definition kernwin.hpp:5951
tcc_place_type_t
TWidget place_t type.
Definition kernwin.hpp:108
@ TCCPT_PLACE
place_t
Definition kernwin.hpp:110
@ TCCPT_INVALID
invalid
Definition kernwin.hpp:109
@ TCCPT_SIMPLELINE_PLACE
simpleline_place_t
Definition kernwin.hpp:111
@ TCCPT_TIPLACE
tiplace_t
Definition kernwin.hpp:113
@ TCCPT_IDAPLACE
idaplace_t
Definition kernwin.hpp:112
TWidget * get_current_widget()
Get a pointer to the current widget (ui_get_current_widget).
Definition kernwin.hpp:5375
bool banner(int wait)
Show a banner dialog box (ui_banner).
Definition kernwin.hpp:4874
bool is_idaview(TWidget *v)
Is the given custom view an idaview? (ui_is_idaview)
Definition kernwin.hpp:6070
bool detach_action_from_menu(const char *menupath, const char *name)
Detach an action from the menu (ui_detach_action_from_menu).
Definition kernwin.hpp:5262
bool get_action_visibility(const char *name, bool *visibility)
Get an action's visibility (ui_get_action_attr).
Definition kernwin.hpp:5794
void set_view_renderer_type(TWidget *v, tcc_renderer_type_t rt)
Set the type of renderer to use in a view (ui_set_renderer_type)
Definition kernwin.hpp:5968
locchange_reason_t
Definition kernwin.hpp:4175
@ lcr_jump
Definition kernwin.hpp:4180
@ lcr_unknown
Definition kernwin.hpp:4176
@ lcr_internal
Definition kernwin.hpp:4183
@ lcr_auto_switch
Definition kernwin.hpp:4179
@ lcr_scroll
Definition kernwin.hpp:4182
@ lcr_user_switch
Definition kernwin.hpp:4178
@ lcr_goto
Definition kernwin.hpp:4177
@ lcr_navigate
Definition kernwin.hpp:4181
void open_url(const char *url)
Open the given url (ui_open_url)
Definition kernwin.hpp:4938
void mark_range_for_refresh(ea_t ea, asize_t size)
Inform the UI about any modifications of [ea, ea+size)
Definition kernwin.hpp:6353
THREAD_SAFE int cancel_thread_exec_requests(qthread_t tid)
Try to cancel asynchronous exec requests created by the specified thread.
Definition kernwin.hpp:4820
THREAD_SAFE const char const char int deflt
Definition kernwin.hpp:7747
bool is_ida_library(char *path=nullptr, size_t pathsize=0, void **handle=nullptr)
Definition kernwin.hpp:1382
TWidget * create_empty_widget(const char *title, int icon=-1)
Create an empty widget, serving as a container for custom user widgets.
Definition kernwin.hpp:5988
idaman DEPRECATED void ida_export ida_checkmem(const char *file, int line)
bool display_copyright_warning()
Display copyright warning (ui_copywarn).
Definition kernwin.hpp:6976
uint64 tif_cursor_t
A location in a tinfo_t.
Definition kernwin.hpp:1882
tcc_renderer_type_t get_view_renderer_type(TWidget *v)
Get the type of renderer currently in use in the given view (ui_get_renderer_type)
Definition kernwin.hpp:5960
struct __qtimer_t * qtimer_t
Timer opaque handle.
bool get_user_input_event(input_event_t *out)
Get the current user input event (mouse button press, key press, ...) It is sometimes desirable to be...
Definition kernwin.hpp:5884
bool detach_action_from_popup(TWidget *widget, const char *name)
Remove a previously-registered action, from the list of 'permanent' context menu actions for this wid...
Definition kernwin.hpp:5586
mbox_kind_t
see <loader.hpp>
Definition kernwin.hpp:38
@ mbox_warning
Definition kernwin.hpp:41
@ mbox_wait
Definition kernwin.hpp:48
@ mbox_info
Definition kernwin.hpp:40
@ mbox_internal
internal error
Definition kernwin.hpp:39
@ mbox_error
Definition kernwin.hpp:42
@ mbox_readerror
Definition kernwin.hpp:45
@ mbox_filestruct
Definition kernwin.hpp:47
@ mbox_hide
Definition kernwin.hpp:49
@ mbox_writeerror
Definition kernwin.hpp:46
@ mbox_replace
Definition kernwin.hpp:50
@ mbox_feedback
Definition kernwin.hpp:44
@ mbox_nomem
Definition kernwin.hpp:43
bool get_action_checked(const char *name, bool *checked)
Get an action's checked state (ui_get_action_attr).
Definition kernwin.hpp:5783
choose_type_t
List chooser types.
Definition kernwin.hpp:56
@ chtype_generic
the generic choose() function
Definition kernwin.hpp:57
@ chtype_func
see choose_func()
Definition kernwin.hpp:63
@ chtype_enum
see choose_enum()
Definition kernwin.hpp:69
@ chtype_idatil
see choose_til()
Definition kernwin.hpp:66
@ chtype_srcp
see choose_srcp()
Definition kernwin.hpp:67
@ chtype_name
see choose_name()
Definition kernwin.hpp:60
@ chtype_struct
see choose_struct()
Definition kernwin.hpp:68
@ chtype_enum_by_value_and_size
see choose_enum_by_value()
Definition kernwin.hpp:70
@ chtype_stkvar_xref
see choose_stkvar_xref()
Definition kernwin.hpp:61
@ chtype_xref
see choose_xref()
Definition kernwin.hpp:62
@ chtype_entry
see choose_entry()
Definition kernwin.hpp:59
@ chtype_segm
see choose_segm()
Definition kernwin.hpp:64
@ chtype_strpath
see choose_struc_path()
Definition kernwin.hpp:65
@ chtype_idasgn
see choose_idasgn()
Definition kernwin.hpp:58
DEPRECATED bool del_idc_hotkey(const char *hotkey)
Definition kernwin.hpp:8579
const synced_group_t * get_synced_group(const TWidget *w)
Get the group of widgets/registers this view is synchronized with.
Definition kernwin.hpp:4852
tcc_place_type_t get_viewer_place_type(TWidget *viewer)
Get the type of place_t instances a viewer uses & creates (ui_get_viewer_place_type).
Definition kernwin.hpp:6162
int hist
Definition kernwin.hpp:7879
bool get_highlight(qstring *out_str, TWidget *viewer, uint32 *out_flags, uint32 flags=0)
Get the highlighted identifier in the viewer (ui_get_highlight_2).
Definition kernwin.hpp:6317
bool sync_sources(const sync_source_t &what, const sync_source_t &with, bool sync)
[Un]synchronize sources
Definition kernwin.hpp:6654
bool is_action_enabled(action_state_t s)
Check if the given action state is one of AST_ENABLE*.
Definition kernwin.hpp:2930
void analyzer_options()
Allow the user to set analyzer options. (show a dialog box) (ui_analyzer_options)
Definition kernwin.hpp:4895
bool attach_action_to_popup(TWidget *widget, TPopupMenu *popup_handle, const char *name, const char *popuppath=nullptr, int flags=0)
Insert a previously-registered action into the widget's popup menu (ui_attach_action_to_popup).
Definition kernwin.hpp:5567
int idaapi buttoncb_t(int button_code, form_actions_t &fa)
Callback.
Definition kernwin.hpp:7722
action_state_t
Action states - returned by action_handler_t::update()
Definition kernwin.hpp:2910
@ AST_ENABLE_ALWAYS
enable action and do not call action_handler_t::update() anymore
Definition kernwin.hpp:2911
@ AST_ENABLE_FOR_WIDGET
enable action for the current widget.
Definition kernwin.hpp:2916
@ AST_DISABLE
analog of AST_ENABLE
Definition kernwin.hpp:2924
@ AST_DISABLE_FOR_IDB
analog of AST_ENABLE_FOR_IDB
Definition kernwin.hpp:2922
@ AST_DISABLE_ALWAYS
disable action and do not call action_handler_t::action() anymore
Definition kernwin.hpp:2921
@ AST_DISABLE_FOR_WIDGET
analog of AST_ENABLE_FOR_WIDGET
Definition kernwin.hpp:2923
@ AST_ENABLE
enable action - call action_handler_t::update() when anything changes
Definition kernwin.hpp:2919
@ AST_ENABLE_FOR_IDB
enable action for the current idb.
Definition kernwin.hpp:2913
THREAD_SAFE execute_sync_availability_t set_execute_sync_availability(qthread_t tid, execute_sync_availability_t availability)
Set the availability of the execute_sync functionality for the given thread.
Definition kernwin.hpp:4838
const char * get_curline()
Get current line from the disassemble window (ui_get_curline).
Definition kernwin.hpp:4933
action_ctx_base_t action_update_ctx_t
Instances of this class will be filled with information that is commonly used by actions when they ne...
Definition kernwin.hpp:3149
void idaapi custom_viewer_location_changed_t(TWidget *v, const lochist_entry_t *was, const lochist_entry_t *now, const locchange_md_t &md, void *ud)
The viewer's location (i.e., place, or cursor) changed.
Definition kernwin.hpp:4229
DEPRECATED void get_user_strlist_options(strwinsetup_t *out)
Definition kernwin.hpp:8575
bool register_action(const action_desc_t &desc)
Create a new action (ui_register_action).
Definition kernwin.hpp:5141
void refresh_idaview_anyway()
Refresh all disassembly views (ui_refresh), forces an immediate refresh.
Definition kernwin.hpp:4890
bool get_output_cursor(int *x, int *y)
Get coordinates of the output window's cursor (ui_get_output_cursor).
Definition kernwin.hpp:4926
qvector< simpleline_t > strvec_t
A collection of simple lines to populate a custom view.
Definition kernwin.hpp:1732
bool idaapi enable_chooser_item_attrs(const char *chooser_caption, bool enable)
Enable item-specific attributes for chooser items (ui_enable_chooser_item_attrs).
Definition kernwin.hpp:6898
bool get_action_state(const char *name, action_state_t *state)
Get an action's state (ui_get_action_attr).
Definition kernwin.hpp:5761
bool register_and_attach_to_menu(const char *menupath, const char *name, const char *label, const char *shortcut, int flags, action_handler_t *handler, void *owner, int action_desc_t_flags)
Helper.
Definition kernwin.hpp:5304
qvector< chooser_row_info_t > chooser_row_info_vec_t
Definition kernwin.hpp:3131
void msg_clear()
Clear the "Output" window.
Definition kernwin.hpp:5996
idaman NORETURN AS_PRINTF(1, 0) void ida_export verror(const char *format
See error()
idaman size_t ida_export hexplace_t__ea2str(char *buf, size_t bufsize, const hexplace_gen_t *hg, ea_t ea)
int twidget_type_t
Window types
Definition kernwin.hpp:2652
idaman void ida_export register_loc_converter2(const char *p1, const char *p2, lochist_entry_cvt2_t *cvt)
Register a converter, that will be used for the following reasons:
void close_widget(TWidget *widget, int options)
Close widget (ui_close_widget, only gui version).
Definition kernwin.hpp:5346
qvector< const twinline_t * > section_lines_refs_t
Definition kernwin.hpp:2287
ushort lookup_key_code(int key, int shift, bool is_qt)
Get shortcut code previously created by ui_get_key_code.
Definition kernwin.hpp:4957
void(idaapi *range_marker)(ea_t ea
Pointer to range marker function (for idaviews and hexviews) This pointer is initialized by setup_ran...
void gen_disasm_text(text_t &text, ea_t ea1, ea_t ea2, bool truncate_lines)
Generate disassembly text for a range.
Definition kernwin.hpp:4996
bool get_custom_viewer_location(lochist_entry_t *out, TWidget *custom_viewer, bool mouse=false)
Definition kernwin.hpp:5522
THREAD_SAFE void hide_wait_box()
Hide the "Please wait dialog box".
Definition kernwin.hpp:6946
navaddr_type_t
Definition kernwin.hpp:3825
@ nat_cod
Definition kernwin.hpp:3828
@ nat_err
Definition kernwin.hpp:3832
@ nat_last
Definition kernwin.hpp:3838
@ nat_hlo
Definition kernwin.hpp:3837
@ nat_cur
Definition kernwin.hpp:3834
@ nat_ext
Definition kernwin.hpp:3831
@ nat_gap
Definition kernwin.hpp:3833
@ nat_lum
Definition kernwin.hpp:3836
@ nat_und
Definition kernwin.hpp:3830
@ nat_auto
Definition kernwin.hpp:3835
@ nat_dat
Definition kernwin.hpp:3829
@ nat_lib
Definition kernwin.hpp:3826
@ nat_fun
Definition kernwin.hpp:3827
bool get_chooser_rows(chooser_row_info_vec_t *out, const char *chooser_caption, size_t what)
Get the chooser contents corresponding to the rows indicated by "what".
Definition kernwin.hpp:6881
qvector< twinline_t > text_t
A group of lines in a text window.
Definition kernwin.hpp:2178
void idaapi custom_viewer_close_t(TWidget *cv, void *ud)
Custom viewer is being destroyed.
Definition kernwin.hpp:4101
bool get_output_curline(qstring *buf, bool mouse)
Get current line of output window (ui_get_output_curline).
Definition kernwin.hpp:5895
custom_viewer_handler_id_t
Custom viewer & code viewer handler types.
Definition kernwin.hpp:3869
@ CDVH_LINES_ALIGNMENT
see set_code_viewer_lines_alignment()
Definition kernwin.hpp:3890
@ CDVH_LINES_CLICK
see code_viewer_lines_click_t
Definition kernwin.hpp:3883
@ CVH_KEYDOWN
see custom_viewer_keydown_t
Definition kernwin.hpp:3871
@ CDVH_USERDATA
see set_code_viewer_user_data()
Definition kernwin.hpp:3881
@ CDVH_LINES_POPUP
see code_viewer_lines_click_t
Definition kernwin.hpp:3885
@ CDVH_LINES_DRAWICON
see code_viewer_lines_icon_t
Definition kernwin.hpp:3886
@ CDVH_SRCVIEW
see set_code_viewer_is_source()
Definition kernwin.hpp:3882
@ CVH_CLICK
see custom_viewer_click_t
Definition kernwin.hpp:3876
@ CVH_DBLCLICK
see custom_viewer_dblclick_t
Definition kernwin.hpp:3873
@ CDVH_LINES_RADIX
see set_code_viewer_lines_radix()
Definition kernwin.hpp:3889
@ CVH_USERDATA
Definition kernwin.hpp:3870
@ CDVH_LINES_LINENUM
see code_viewer_lines_linenum_t
Definition kernwin.hpp:3887
@ CDVH_LINES_ICONMARGIN
see set_code_viewer_lines_icon_margin()
Definition kernwin.hpp:3888
@ CDVH_LINES_DBLCLICK
see code_viewer_lines_click_t
Definition kernwin.hpp:3884
@ CVH_POPUP
see custom_viewer_popup_t
Definition kernwin.hpp:3872
@ CVH_CURPOS
see custom_viewer_curpos_t
Definition kernwin.hpp:3874
@ CVH_MOUSEMOVE
see custom_viewer_mouse_moved_t
Definition kernwin.hpp:3879
@ CVH_HELP
see custom_viewer_help_t
Definition kernwin.hpp:3878
@ CVH_CLOSE
see custom_viewer_close_t
Definition kernwin.hpp:3875
@ CVH_QT_AWARE
see set_custom_viewer_qt_aware()
Definition kernwin.hpp:3877
void free_custom_icon(int icon_id)
Free an icon loaded with load_custom_icon() (ui_free_custom_icon).
Definition kernwin.hpp:5048
idaman int ida_export l_compare(const place_t *t1, const place_t *t2)
compare places and their lnnums
bool result
Definition kernwin.hpp:7890
bool attach_dynamic_action_to_popup(TWidget *unused, TPopupMenu *popup_handle, const action_desc_t &desc, const char *popuppath=nullptr, int flags=0, qstring *buf=nullptr)
Create & insert an action into the widget's popup menu (ui_attach_dynamic_action_to_popup).
Definition kernwin.hpp:5603
bool idaapi custom_viewer_click_t(TWidget *cv, int shift, void *ud)
The user clicked.
Definition kernwin.hpp:4083
const place_t * get_place_class_template(int id)
See get_place_class()
Definition kernwin.hpp:1993
void destroy_custom_viewer(TWidget *custom_viewer)
Destroy custom ida viewer.
Definition kernwin.hpp:5485
int code
Definition kernwin.hpp:7770
void refresh_idaview()
Refresh marked windows (ui_refreshmarked)
Definition kernwin.hpp:4884
bool close_chooser(const char *title)
Close a non-modal chooser (ui_close_chooser).
Definition kernwin.hpp:4977
idaman size_t const char * format
Definition kernwin.hpp:1357
DECLARE_LINEARRAY_HELPERS(idaman) class linearray_t
The group of lines corresponding to a single place within a view.
Definition kernwin.hpp:2194
int input_event_modifiers_t
Definition kernwin.hpp:3908
int cpidx_t
Definition kernwin.hpp:2434
bool get_action_icon(const char *name, int *icon)
Get an action's icon (ui_get_action_attr).
Definition kernwin.hpp:5750
define_place_exported_functions(idaplace_t) class idaplace_t define_place_exported_functions(hexplace_t) struct outctx_base_t
A location in a disassembly view.
void beep(beep_t beep_type=beep_default)
Issue a beeping sound (ui_beep).
Definition kernwin.hpp:6967
uint32 idaapi nav_colorizer_t(ea_t ea, asize_t nbytes, void *ud)
Navigation band colorizer function.
Definition kernwin.hpp:3853
bool place_t__deserialize(place_t *_this, const uchar **pptr, const uchar *end)
Definition kernwin.hpp:8561
bool get_ea_viewer_history_info(int *nback, int *nfwd, TWidget *v)
Get information about what's in the history (ui_ea_viewer_history_info).
Definition kernwin.hpp:5461
size_t max_size
Definition kernwin.hpp:7958
idaman NORETURN va_list va
Definition kernwin.hpp:1349
void idaapi custom_viewer_popup_t(TWidget *cv, void *ud)
The user right clicked. See ui_populating_widget_popup, too.
Definition kernwin.hpp:4073
int get_icon_id_by_name(const char *icon_name)
Retrieve the id of the icon by name (ui_get_icon_id_by_name).
Definition kernwin.hpp:5027
vnomem(format, va)
void * get_chooser_obj(const char *chooser_caption)
Get the underlying object of the specified chooser (ui_get_chooser_obj).
Definition kernwin.hpp:6857
bool is_place_class_ea_capable(int id)
See get_place_class()
Definition kernwin.hpp:2000
THREAD_SAFE bool is_msg_inited()
Can we use msg() functions?
Definition kernwin.hpp:4879
bool set_highlight(TWidget *viewer, const char *str, int flags)
Set the highlighted identifier in the viewer (ui_set_highlight).
Definition kernwin.hpp:6329
bool is_idaq()
Are we running inside IDA Qt?
Definition kernwin.hpp:5547
unsigned __int64 uint64
Definition llong.hpp:13
__int64 int64
Definition llong.hpp:14
uchar type_t
In serialized form, a type is represented by a byte sequence.
Definition nalt.hpp:1317
Definition kernwin.hpp:2021
idaman size_t const char time_t t
Definition pro.h:602
unsigned short uint16
unsigned 16 bit value
Definition pro.h:346
int bool
Definition pro.h:329
unsigned int uint32
unsigned 32 bit value
Definition pro.h:348
uint64 asize_t
Definition pro.h:423
uint32 bgcolor_t
background color in RGB
Definition pro.h:5012
qvector< size_t > sizevec_t
vector of sizes
Definition pro.h:2767
adiff_t sval_t
signed value used by the processor.
Definition pro.h:446
idaman THREAD_SAFE char *ida_export qstrncpy(char *dst, const char *src, size_t dstsize)
A safer strncpy - makes sure that there is a terminating zero.
int64 adiff_t
Definition pro.h:424
uint64 ea_t
Definition pro.h:421
int int32
signed 32 bit value
Definition pro.h:347
idaman THREAD_SAFE bool ida_export qsem_free(qsemaphore_t sem)
Free a semaphore.
unsigned char uchar
unsigned 8 bit value
Definition pro.h:337
THREAD_SAFE void qswap(T &a, T &b)
Swap 2 objects of the same type using memory copies.
Definition pro.h:1715
idaman size_t bufsize
Definition pro.h:600
uint64 sel_t
Definition pro.h:422
idaman THREAD_SAFE uint32 ida_export unpack_dd(const uchar **pptr, const uchar *end)
unpack a double word, see unpack_db()
unsigned int uint
unsigned 32 bit value
Definition pro.h:339
size_t diffpos_t
Definition pro.h:479
uval_t inode_t
The inode_t type is the specialization specific inode number.
Definition pro.h:464
uint64 flags64_t
64-bit flags for each address
Definition pro.h:5009
ptrdiff_t ssize_t
Signed size_t - used to check for size overflows when the counter becomes negative.
Definition pro.h:381
unsigned short ushort
unsigned 16 bit value
Definition pro.h:338
ea_t tid_t
type id (for enums, structs, etc)
Definition pro.h:5010
unsigned char uint8
unsigned 8 bit value
Definition pro.h:344
_qstring< char > qstring
regular string
Definition pro.h:3694
qvector< qstring > qstrvec_t
vector of strings
Definition pro.h:3697
Timer opaque handle.
Definition kernwin.hpp:5095
Definition kernwin.hpp:4500
twinpos_t to
end of selection
Definition kernwin.hpp:4502
void reset()
Definition kernwin.hpp:4505
twinpos_t from
start of selection
Definition kernwin.hpp:4501
Maintain information about the current state of the UI.
Definition kernwin.hpp:4518
ea_t cur_ea
the current EA of the position in the view
Definition kernwin.hpp:4572
const char * regname
register name (if widget_type == BWN_CPUREGS and context menu opened on register)
Definition kernwin.hpp:4582
bool has_flag(uint32 flag) const
Check if the given flag is set.
Definition kernwin.hpp:4570
const char * action
action name
Definition kernwin.hpp:4565
til_type_ref_t * type_ref
a reference to the current type (if 'widget' is a type listing widget; nullptr otherwise)
Definition kernwin.hpp:4592
TWidget * focus
The focused widget in case it is not the 'form' itself (e.g., the 'quick filter' input in choosers....
Definition kernwin.hpp:4584
interactive_graph_t * graph
the current graph (if in a graph view)
Definition kernwin.hpp:4586
uval_t cur_value
the possible address, or value the cursor is positioned on
Definition kernwin.hpp:4573
qstring widget_title
title of current widget
Definition kernwin.hpp:4561
func_t * cur_fchunk
the current function chunk
Definition kernwin.hpp:4576
action_ctx_base_cur_sel_t cur_sel
the currently selected range. also see ACF_HAS_SELECTION
Definition kernwin.hpp:4580
segment_t * cur_seg
the current segment
Definition kernwin.hpp:4578
uint32 cur_flags
Current address information. see Action context property bits.
Definition kernwin.hpp:4567
screen_graph_selection_t * graph_selection
the current graph selection (if in a graph view)
Definition kernwin.hpp:4587
const selection_item_t * hovered
the current item being hovered (if in a graph view)
Definition kernwin.hpp:4588
action_ctx_base_t()
Constructor.
Definition kernwin.hpp:4520
chooser_base_t * chooser
the underlying chooser_base_t (if 'widget' is a chooser widget)
Definition kernwin.hpp:4562
twidget_type_t widget_type
type of current widget
Definition kernwin.hpp:4560
TWidget * widget
Definition kernwin.hpp:4559
sizevec_t chooser_selection
current chooser selection (0-based)
Definition kernwin.hpp:4563
dirtree_selection_t * dirtree_selection
the current dirtree_t selection (if applicable)
Definition kernwin.hpp:4590
func_t * cur_func
the current function
Definition kernwin.hpp:4575
void reset()
Invalidate all context info.
Definition kernwin.hpp:4536
Describe an action to be registered (see register_action())
Definition kernwin.hpp:4650
const char * tooltip
an optional tooltip for the action
Definition kernwin.hpp:4667
action_handler_t * handler
the action handler, for activating/updating.
Definition kernwin.hpp:4659
const char * shortcut
an optional shortcut definition. E.g., "Ctrl+Enter"
Definition kernwin.hpp:4666
const void * owner
either the plugin_t, or plugmod_t responsible for registering the action.
Definition kernwin.hpp:4662
int icon
an optional icon ID to use
Definition kernwin.hpp:4668
int flags
See Action flags.
Definition kernwin.hpp:4689
Manages the behavior of a registered action.
Definition kernwin.hpp:4615
virtual action_state_t idaapi update(action_update_ctx_t *ctx)=0
Update an action.
virtual int idaapi activate(action_activation_ctx_t *ctx)=0
Activate an action.
action_handler_t(int _f=0)
Constructor.
Definition kernwin.hpp:4619
Information about an installed add-on (e.g. a plugin)
Definition kernwin.hpp:8035
addon_info_t()
Constructor.
Definition kernwin.hpp:8047
const char * name
Definition kernwin.hpp:8038
const char * id
Definition kernwin.hpp:8037
size_t cb
Definition kernwin.hpp:8036
size_t custom_size
Definition kernwin.hpp:8044
const char * url
Definition kernwin.hpp:8041
const char * producer
Definition kernwin.hpp:8039
const char * freeform
Definition kernwin.hpp:8042
const char * version
Definition kernwin.hpp:8040
const void * custom_data
Definition kernwin.hpp:8043
Chooser object. chooser.
Definition kernwin.hpp:3176
int icon
default icon
Definition kernwin.hpp:3211
bool can_sort() const
Definition kernwin.hpp:3360
bool can_edit() const
Definition kernwin.hpp:3309
int width
(in chars)
Definition kernwin.hpp:3195
void init_popup_names(const char *const default_popup_names[NSTDPOPUPS])
Definition kernwin.hpp:3428
void set_ask_item_attrs(bool enable)
enable or disable generation of ui_get_chooser_item_attrs events
Definition kernwin.hpp:3342
int x1
Definition kernwin.hpp:3193
virtual size_t idaapi get_count() const =0
get the number of elements in the chooser
uint16 flags2
Extended chooser flags
Definition kernwin.hpp:3183
bool ask_item_attrs() const
should chooser generate ui_get_chooser_item_attrs events?
Definition kernwin.hpp:3333
bool can_del() const
Definition kernwin.hpp:3308
bool can_refresh() const
Definition kernwin.hpp:3310
int columns
number of columns
Definition kernwin.hpp:3201
uint8 version
version of the class
Definition kernwin.hpp:3181
bool can_ins() const
is an operation allowed?
Definition kernwin.hpp:3307
int y1
Definition kernwin.hpp:3194
bool should_rename_trigger_edit() const
Definition kernwin.hpp:3364
uint get_builtin_number() const
get number of the built-in chooser
Definition kernwin.hpp:3337
int y0
Definition kernwin.hpp:3192
cbres_t
return value of ins(), del(), edit(), enter(), refresh() callbacks
Definition kernwin.hpp:3416
@ NOTHING_CHANGED
Definition kernwin.hpp:3417
@ SELECTION_CHANGED
Definition kernwin.hpp:3419
@ ALL_CHANGED
Definition kernwin.hpp:3418
bool is_quick_filter_visible_initially() const
Definition kernwin.hpp:3352
virtual const void * get_obj_id(size_t *len) const
get the id of the chooser data.
Definition kernwin.hpp:3289
uint32 flags
Generic chooser flags
Definition kernwin.hpp:3184
bool has_widget_lifecycle() const
should chooser object be deleted when the widget gets destroyed?
Definition kernwin.hpp:3329
virtual bool idaapi init()
initialize the chooser and populate it.
Definition kernwin.hpp:3374
virtual void idaapi get_row(qstrvec_t *out, int *out_icon, chooser_item_attrs_t *out_attrs, size_t n) const =0
get a description of an element.
bool has_inode_to_index() const
Definition kernwin.hpp:3370
bool is_lazy_loaded() const
Definition kernwin.hpp:3368
int deflt_col
Column that will have focus.
Definition kernwin.hpp:3246
int height
(in chars)
Definition kernwin.hpp:3196
virtual ea_t idaapi get_ea(size_t) const
get the address of an element.
Definition kernwin.hpp:3403
bool is_force_default() const
should selection of the already opened non-modal chooser be changed?
Definition kernwin.hpp:3335
bool can_filter() const
Definition kernwin.hpp:3362
@ POPUP_INS
Definition kernwin.hpp:3236
@ POPUP_REFRESH
Definition kernwin.hpp:3236
@ NSTDPOPUPS
Definition kernwin.hpp:3236
@ POPUP_EDIT
Definition kernwin.hpp:3236
@ POPUP_DEL
Definition kernwin.hpp:3236
bool is_dirtree_persisted() const
Definition kernwin.hpp:3366
qstring popup_names[NSTDPOPUPS]
array of custom labels of the standard actions.
Definition kernwin.hpp:3244
chooser_base_t(uint32 flags_=0, int columns_=0, const int *widths_=nullptr, const char *const *header_=nullptr, const char *title_=nullptr, uint16 flags2_=0)
Definition kernwin.hpp:3248
const char *const * header
header line; contains the tooltips, and column name for each of 'columns' columns.
Definition kernwin.hpp:3205
int x0
screen position, Functions: generic list choosers
Definition kernwin.hpp:3191
const int * widths
column widths
Definition kernwin.hpp:3202
const char * title
menu title (includes ptr to help).
Definition kernwin.hpp:3198
Chooser item attributes.
Definition kernwin.hpp:3086
bgcolor_t color
item color
Definition kernwin.hpp:3091
void reset()
Definition kernwin.hpp:3096
int flags
Chooser item property bits
Definition kernwin.hpp:3090
int cb
size of this structure.
Definition kernwin.hpp:3087
chooser_item_attrs_t()
Definition kernwin.hpp:3092
The chooser object with multi-selection.
Definition kernwin.hpp:3605
virtual size_t idaapi inode_to_index(inode_t) const newapi
Map an a dirtree_t inode to the index This will be used only if CH_HAS_DIRTREE and CH2_HAS_INODE2INDE...
Definition kernwin.hpp:3739
virtual cbres_t idaapi del(sizevec_t *) new api
User deleted elements.
Definition kernwin.hpp:3650
virtual cbres_t idaapi ins(sizevec_t *) new api
User asked to insert an element.
Definition kernwin.hpp:3642
virtual inode_t idaapi index_to_inode(size_t) const newapi
Map an item index to a dirtree_t inode This is necessary only if CH_HAS_DIRTREE is specified.
Definition kernwin.hpp:3694
virtual cbres_t idaapi refresh(sizevec_t *) new api
The chooser needs to be refreshed.
Definition kernwin.hpp:3675
chooser_multi_t(uint32 flags_=0, int columns_=0, const int *widths_=nullptr, const char *const *header_=nullptr, const char *title_=nullptr, uint16 flags2_=0)
Definition kernwin.hpp:3606
typedef cbres_t(idaapi chooser_multi_t::*cb_t)(sizevec_t *sel)
Type of ins(), del(), edit(), enter(), refresh() callbacks.
virtual diffpos_t idaapi index_to_diffpos(size_t) const newapi
Map an item index to a diffpos_t This is necessary only if CH_HAS_DIFF is specified.
Definition kernwin.hpp:3700
virtual bool idaapi get_stdact_descs(chooser_stdact_desc_t *[NSTDPOPUPS]) new api
Get the description of the standard chooser actions.
Definition kernwin.hpp:3711
virtual dirtree_t *idaapi get_dirtree() new api
get the dirtree_t that will be used to present a tree-like structure to the user (see CH_HAS_DIRTREE)
Definition kernwin.hpp:3688
virtual bool idaapi do_lazy_load_dir(dirtree_t *, const qstring &) new api
Callback for lazy-loaded, dirtree-based choosers; the function will be called when a folder is expand...
Definition kernwin.hpp:3726
Row data returned by get_chooser_rows().
Definition kernwin.hpp:3113
chooser_item_attrs_t attrs
styling attributes
Definition kernwin.hpp:3115
bool operator!=(const chooser_row_info_t &other) const
Definition kernwin.hpp:3125
int icon
icon number
Definition kernwin.hpp:3116
qstrvec_t texts
texts, one per chooser column
Definition kernwin.hpp:3114
Definition kernwin.hpp:3151
virtual action_state_t idaapi ucb(action_update_ctx_t *)
the update callback, see action_handler_t::update() When the update callback is called from the choos...
Definition kernwin.hpp:3168
int icon
Definition kernwin.hpp:3155
const char * label
see action_desc_t
Definition kernwin.hpp:3153
int version
to support the backward compatibility
Definition kernwin.hpp:3152
chooser_stdact_desc_t(const char *_label=nullptr, const char *_tooltip=nullptr, int _icon=-1)
Definition kernwin.hpp:3157
const char * tooltip
Definition kernwin.hpp:3154
Return value of ins(), del(), edit(), enter(), refresh() callbacks.
Definition kernwin.hpp:3446
The chooser object without multi-selection.
Definition kernwin.hpp:3443
virtual inode_t idaapi index_to_inode(size_t) const newapi
Map an item index to a dirtree_t inode This is necessary only if CH_HAS_DIRTREE is specified.
Definition kernwin.hpp:3537
virtual cbret_t idaapi refresh(ssize_t n) new api
The chooser needs to be refreshed.
Definition kernwin.hpp:3518
virtual diffpos_t idaapi index_to_diffpos(size_t) const newapi
Map an item index to a diffpos_t This is necessary only if CH_HAS_DIFF is specified.
Definition kernwin.hpp:3543
virtual cbret_t idaapi del(size_t) new api
User deleted an element.
Definition kernwin.hpp:3494
virtual cbret_t idaapi ins(ssize_t) new api
User asked to insert an element.
Definition kernwin.hpp:3488
chooser_t(uint32 flags_=0, int columns_=0, const int *widths_=nullptr, const char *const *header_=nullptr, const char *title_=nullptr, uint16 flags2_=0)
Definition kernwin.hpp:3454
virtual size_t idaapi inode_to_index(inode_t) const newapi
Map an a dirtree_t inode to the index This will be used only if CH_HAS_DIRTREE and CH2_HAS_INODE2INDE...
Definition kernwin.hpp:3582
virtual cbret_t idaapi enter(size_t n) new api
User pressed the enter key.
Definition kernwin.hpp:3507
virtual dirtree_t *idaapi get_dirtree() new api
get the dirtree_t that will be used to present a tree-like structure to the user (see CH_HAS_DIRTREE)
Definition kernwin.hpp:3531
virtual bool idaapi get_stdact_descs(chooser_stdact_desc_t *[NSTDPOPUPS]) new api
Get the description of the standard chooser actions.
Definition kernwin.hpp:3554
virtual bool idaapi do_lazy_load_dir(dirtree_t *, const qstring &) new api
Callback for lazy-loaded, dirtree-based choosers; the function will be called when a folder is expand...
Definition kernwin.hpp:3569
typedef cbret_t(idaapi chooser_t::*cb_t)(size_t n)
Type of ins(), del(), edit(), enter(), refresh() callbacks.
virtual cbret_t idaapi edit(size_t) new api
User asked to edit an element.
Definition kernwin.hpp:3500
Command line interpreter.
Definition kernwin.hpp:4326
qstrvec_t qstrvec_t * out_docs
Definition kernwin.hpp:4382
int * p_x
Definition kernwin.hpp:4357
const char * lname
long name (displayed in the menu)
Definition kernwin.hpp:4335
const char * sname
short name (displayed on the button)
Definition kernwin.hpp:4334
qstrvec_t * out_hints
Definition kernwin.hpp:4381
qstrvec_t qstrvec_t int int const char int x
Definition kernwin.hpp:4386
int int * p_sellen
Definition kernwin.hpp:4358
const char * hint
hint for the input line
Definition kernwin.hpp:4336
int int int int shift
Definition kernwin.hpp:4360
int int int * p_vk_key
Definition kernwin.hpp:4359
qstrvec_t qstrvec_t int int * out_match_end
Definition kernwin.hpp:4384
qstrvec_t qstrvec_t int * out_match_start
Definition kernwin.hpp:4383
qstrvec_t qstrvec_t int int const char * line
Definition kernwin.hpp:4385
Definition dirtree.hpp:177
Execute code in the main thread - to be used with execute_sync().
Definition kernwin.hpp:4426
qsemaphore_t sem
semaphore to communicate with the main thread.
Definition kernwin.hpp:4437
ssize_t code
temporary location, used internally
Definition kernwin.hpp:4436
virtual ssize_t idaapi execute()=0
Callback to be executed.
Functions available from formchgcb_t.
Definition kernwin.hpp:7535
virtual int idaapi get_focused_field()=0
Get currently focused input field.
virtual bool is_dialog_button_enabled(dlgbtn_t btn)=0
dlgbtn_t
Definition kernwin.hpp:7650
@ dbt_cancel
Definition kernwin.hpp:7652
@ dbt_no
Definition kernwin.hpp:7653
@ dbt_yes
Definition kernwin.hpp:7651
virtual bool idaapi enable_field(int field_id, bool enable)=0
Enable or disable an input field.
virtual bool idaapi get_tab_attribute(void *out, int fid, int tab, tab_attr_t attr)=0
virtual bool idaapi _set_field_value(int field_id, const void *buf)=0
Set value of an input field.
virtual bool idaapi set_field_label(int fid, const qstring &text)=0
Set the label text of an input field.
bool set_tab_enabled(int fid, int tab, bool enabled)
Definition kernwin.hpp:7691
virtual bool idaapi set_tab_attribute(int fid, int tab, tab_attr_t attr, const void *in)=0
bool set_tab_visible(int fid, int tab, bool visible)
Definition kernwin.hpp:7683
virtual bool idaapi _get_str_field_value(int field_id, char *buf, const size_t bufsize)=0
Get value of an UTF-8 string input field.
virtual void swap_combobox_choices(int fid, qstrvec_t &items)=0
bool is_tab_visible(bool *out, int fid, int tab)
Definition kernwin.hpp:7687
tab_attr_t
Definition kernwin.hpp:7676
@ ta_enabled
Definition kernwin.hpp:7679
@ ta_visible
Definition kernwin.hpp:7678
@ ta_unknown
Definition kernwin.hpp:7677
DEF_FIELD_METHOD(radiobutton, ushort) DEF_FIELD_METHOD(rbgroup
virtual bool idaapi show_field(int field_id, bool display)=0
Show or hide an input field.
virtual void idaapi close(int close_normally)=0
Close the form.
virtual bool idaapi move_field(int field_id, int x, int y, int w, int h)=0
Move/Resize an input field.
virtual void *idaapi get_ud()=0
Retrieve the user data specified through %*.
virtual void idaapi refresh_field(int field_id)=0
Refresh a field.
bool is_tab_enabled(bool *out, int fid, int tab)
Definition kernwin.hpp:7695
virtual bool enable_dialog_button(dlgbtn_t btn, bool enabled)=0
virtual bool idaapi set_focused_field(int field_id)=0
Set currently focused input field.
ushort ushort sizevec_t int qstring DEF_STR_FIELD_METHOD(label) DEF_STR_FIELD_METHOD(string) DEF_STR_FIELD_METHOD(path) DEF_FIELD_METHOD(string
Definition kernwin.hpp:1788
virtual void get_encoding(qstring *out) const =0
virtual data_kind_t get_data_kind() const =0
virtual int get_bytes_per_item() const =0
virtual bool is_edited_byte(ea_t ea, uint64 *out_value=nullptr) const =0
virtual ea_t get_cur_item_ea() const =0
virtual byte_kind_t get_byte_value(ea_t ea, uint64 *out_value, bool *out_edited) const =0
virtual int get_item_width(ea_t ea) const =0
virtual int get_line_len(ea_t ea) const =0
virtual bool is_editing_text() const =0
virtual void get_cur_item_text(qstring *out) const =0
virtual bool has_central_separator() const =0
data_kind_t
Definition kernwin.hpp:1791
@ dk_float
Definition kernwin.hpp:1792
@ dk_addr_text
Definition kernwin.hpp:1795
@ dk_addr_names
Definition kernwin.hpp:1794
@ dk_int
Definition kernwin.hpp:1793
virtual bool show_text() const =0
bool is_addr_kind() const
Definition kernwin.hpp:1834
virtual bool is_curitem_changed() const =0
int_format_t
Definition kernwin.hpp:1798
@ if_hex
Definition kernwin.hpp:1799
@ if_signed
Definition kernwin.hpp:1800
@ if_unsigned
Definition kernwin.hpp:1801
virtual int get_alignment() const =0
virtual int get_bitness() const =0
byte_kind_t
Definition kernwin.hpp:1805
@ BK_VALID
Definition kernwin.hpp:1806
@ BK_NOVALUE
Definition kernwin.hpp:1808
@ BK_INVALIDADDR
Definition kernwin.hpp:1807
virtual bool show_segaddr() const =0
virtual int_format_t get_int_format() const =0
virtual bool is_editing() const =0
virtual int get_items_per_line() const =0
Definition kernwin.hpp:4300
A representation of a user input.
Definition kernwin.hpp:4283
int cb
size marker
Definition kernwin.hpp:4284
input_event_shortcut_data_t shortcut
Definition kernwin.hpp:4308
input_event_mouse_data_t mouse
Definition kernwin.hpp:4310
input_event_t()
Definition kernwin.hpp:4313
input_event_keyboard_data_t keyboard
Definition kernwin.hpp:4309
Definition kernwin.hpp:2340
line_rendering_output_entry_t(const twinline_t *_line, uint32 _flags=0, bgcolor_t _bg_color=0)
Definition kernwin.hpp:2363
const twinline_t * line
Definition kernwin.hpp:2341
bool operator==(const line_rendering_output_entry_t &r) const
Definition kernwin.hpp:2373
bool is_bg_color_key() const
Definition kernwin.hpp:2370
uint32 flags
line_rendering_output_entry_t flags
Definition kernwin.hpp:2342
bool is_bg_color_empty() const
Definition kernwin.hpp:2369
bool operator!=(const line_rendering_output_entry_t &r) const
Definition kernwin.hpp:2383
bgcolor_t bg_color
Definition kernwin.hpp:2358
int cpx
number of char to start from, valid if LROEF_CPS_RANGE
Definition kernwin.hpp:2360
int nchars
chars count, valid if LROEF_CPS_RANGE
Definition kernwin.hpp:2361
Definition kernwin.hpp:2438
bool is_closed() const
Definition kernwin.hpp:2449
cplen_t length
Definition kernwin.hpp:2440
bool is_open() const
Definition kernwin.hpp:2448
bool contains(cpidx_t x) const
Definition kernwin.hpp:2443
bool operator==(const line_section_t &r) const
Definition kernwin.hpp:2452
cpidx_t start
Definition kernwin.hpp:2439
bool valid() const
Definition kernwin.hpp:2450
Definition kernwin.hpp:2391
void clear()
Definition kernwin.hpp:2400
uint32 flags
Definition kernwin.hpp:2393
line_rendering_output_entries_refs_t entries
Definition kernwin.hpp:2392
Holds (live) data about a location being displayed in a listing.
Definition kernwin.hpp:2622
List of loaders.
Definition loader.hpp:226
Definition ua.hpp:720
Definition idp.hpp:2143
Definition idp.hpp:2085
Ignores range_marker during the lifetime of the object.
Definition kernwin.hpp:6371
range_marker_suspender_t()
Definition kernwin.hpp:6373
Vector of range_t instances.
Definition range.hpp:93
Definition moves.hpp:113
Information about a position relative to the renderer.
Definition kernwin.hpp:3951
short sx
the number of chars that are scrolled (flat mode only)
Definition kernwin.hpp:3967
short cy
the Y coords of the character.
Definition kernwin.hpp:3963
short cx
the X coords of the character in the current line.
Definition kernwin.hpp:3958
int node
the node, or -1 if the current renderer is not a graph renderer.
Definition kernwin.hpp:3955
renderer_pos_info_t()
Constructor.
Definition kernwin.hpp:3953
Definition graph.hpp:458
Definition moves.hpp:60
Element of a graph selection - could be a node or edge layout point.
Definition graph.hpp:424
The values of the segment registers are kept as address ranges.
Definition segregs.hpp:40
Map strings to integer values - see strarray()
Definition kernwin.hpp:8143
Structure to keep string list parameters.
Definition strlist.hpp:27
Definition kernwin.hpp:2083
Definition kernwin.hpp:2468
color_t tag
Definition kernwin.hpp:2474
struct tagged_line_section_t::@234363117142122123010107076233017075243326343142 byte_offsets
bool operator!=(const tagged_line_section_t &r) const
Definition kernwin.hpp:2485
int text_end
Definition kernwin.hpp:2472
bool valid_in(const qstring &in) const
Definition kernwin.hpp:2495
int text_start
Definition kernwin.hpp:2471
tagged_line_section_t()
Definition kernwin.hpp:2476
bool valid() const
Definition kernwin.hpp:2487
Definition kernwin.hpp:2527
const tagged_line_section_t * nearest_at(cpidx_t x, color_t tag=0) const
Definition kernwin.hpp:2551
void sections_at(tagged_line_sections_t *out, cpidx_t x, color_t tag=0) const
Definition kernwin.hpp:2536
Multi line text control, used to embed a text control in a form.
Definition kernwin.hpp:3751
uint16 flags
Text control property bits
Definition kernwin.hpp:3754
uint16 tabsize
how many spaces a single tab will indent
Definition kernwin.hpp:3768
size_t cb
size of this structure
Definition kernwin.hpp:3752
textctrl_info_t()
Constructor.
Definition kernwin.hpp:3769
Type Information Library.
Definition typeinf.hpp:725
Definition typeinf.hpp:6710
Information about a mouse action within a view.
Definition kernwin.hpp:3991
view_event_state_t state
contains information about what buttons are CURRENTLY pressed on the keyboard and mouse.
Definition kernwin.hpp:4000
renderer_pos_info_t renderer_pos
position where event was generated, relative to the renderer
Definition kernwin.hpp:4008
vme_button_t button
represents which mouse button was responsible for generating the event.
Definition kernwin.hpp:4005
Callui return codes.
Definition kernwin.hpp:322
char i8
Definition kernwin.hpp:324
ushort u16
Definition kernwin.hpp:329
uchar u8
Definition kernwin.hpp:328
bool cnd
Definition kernwin.hpp:323
plugin_t * pluginptr
Definition kernwin.hpp:336
char * cptr
Definition kernwin.hpp:331
short i16
Definition kernwin.hpp:326
void * vptr
Definition kernwin.hpp:332
uint32 u32
Definition kernwin.hpp:330
sreg_range_t * sraptr
Definition kernwin.hpp:337
int32 i32
Definition kernwin.hpp:327
func_t * fptr
Definition kernwin.hpp:334
int i
Definition kernwin.hpp:325
segment_t * segptr
Definition kernwin.hpp:335
ssize_t ssize
Definition kernwin.hpp:333
Abstraction of location in flat view/graph views (out of 'view_mouse_event_t' to make it easy for SWi...
Definition kernwin.hpp:3982