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-2026 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;
35#endif // SWIG
36
53
54
76
77
78enum beep_t
79{
81};
82
83
84// Notify UI about various events. The kernel will call this function
85// when something interesting for the UI happens.
86// The UI should avoid calling the kernel from this callback.
87
88class func_t;
89class segment_t;
90struct sreg_range_t;
91class plugin_t;
92struct plugmod_t;
93struct procmod_t;
94class minsn_t;
95class idc_value_t;
96class linput_t;
97class snapshot_t;
98class tinfo_t;
99struct til_t;
100struct jvalue_t;
101
110
120
129
130//-------------------------------------------------------------------------
137#define SETMENU_POSMASK 0x3
138#define SETMENU_INS 0x0
139#define SETMENU_APP 0x1
140#define SETMENU_FIRST 0x2
141#define SETMENU_ENSURE_SEP 0x8
143
147#define CREATETB_ADV 0x1
149
150//-------------------------------------------------------------------------
154#define HIF_IDENTIFIER 0x1
155#define HIF_REGISTER 0x2
156#define HIF_LOCKED 0x4
157#define HIF_NOCASE 0x8
158
159 // bits 27-31 reserved
160#define HIF_USE_SLOT (1 << 27)
161#define HIF_SLOT_SHIFT 28
162#define HIF_GET_SLOT(flags) (((flags) >> HIF_SLOT_SHIFT) & 0x7)
163
164 // convenience constants
165 // (not a macro HIF_SLOT(n) because SWIG won't pick it up for IDAPython)
166#define HIF_SLOT_0 (HIF_USE_SLOT | (0 << HIF_SLOT_SHIFT))
167#define HIF_SLOT_1 (HIF_USE_SLOT | (1 << HIF_SLOT_SHIFT))
168#define HIF_SLOT_2 (HIF_USE_SLOT | (2 << HIF_SLOT_SHIFT))
169#define HIF_SLOT_3 (HIF_USE_SLOT | (3 << HIF_SLOT_SHIFT))
170#define HIF_SLOT_4 (HIF_USE_SLOT | (4 << HIF_SLOT_SHIFT))
171#define HIF_SLOT_5 (HIF_USE_SLOT | (5 << HIF_SLOT_SHIFT))
172#define HIF_SLOT_6 (HIF_USE_SLOT | (6 << HIF_SLOT_SHIFT))
173#define HIF_SLOT_7 (HIF_USE_SLOT | (7 << HIF_SLOT_SHIFT))
175
176#define REG_HINTS_MARKER SCOLOR_ON "\x7F"
177#define REG_HINTS_MARKER_LEN 2
178#define SRCDBG_HINTS_MARKER SCOLOR_ON "\x7E"
179#define SRCDBG_HINTS_MARKER_LEN 2
180
181
185#define CDVF_NOLINES 0x0001
186#define CDVF_LINEICONS 0x0002
187#define CDVF_STATUSBAR 0x0004
189
193#define IDCHK_OK 0
194#define IDCHK_ARG -1
195#define IDCHK_KEY -2
196#define IDCHK_MAX -3
198
202#define WCLS_SAVE 0x1
203#define WCLS_NO_CONTEXT 0x2
204#define WCLS_DONT_SAVE_SIZE 0x4
205#define WCLS_DELETE_LATER 0x8
206#define WCLS_CLOSE_LATER WCLS_DELETE_LATER
208
212#define DP_LEFT 0x0001
213#define DP_TOP 0x0002
214#define DP_RIGHT 0x0004
215#define DP_BOTTOM 0x0008
216#define DP_INSIDE 0x0010
217#define DP_TAB 0x0040
220#define DP_BEFORE 0x0020
222#define DP_FLOATING 0x0080
223#define DP_SZHINT 0x0100
227
231#define SVF_COPY_LINES 0x0000
232#define SVF_LINES_BYPTR 0x0001
234
238#define CVNF_LAZY (1 << 0)
241#define CVNF_JUMP (1 << 1)
243#define CVNF_ACT (1 << 2)
249
254//
255#define WOPN_RESTORE 0x00000004u
258#define WOPN_PERSIST 0x00000040u
259#define WOPN_CLOSED_BY_ESC 0x00000080u
260#define WOPN_NOT_CLOSED_BY_ESC 0x00000100u
261#define WOPN_DP_MASK 0x0FFF0000u
262#define WOPN_DP_SHIFT 16
263#define WOPN_DP_LEFT (DP_LEFT << WOPN_DP_SHIFT)
265#define WOPN_DP_TOP (DP_TOP << WOPN_DP_SHIFT)
267#define WOPN_DP_RIGHT (DP_RIGHT << WOPN_DP_SHIFT)
269#define WOPN_DP_BOTTOM (DP_BOTTOM << WOPN_DP_SHIFT)
271#define WOPN_DP_INSIDE (DP_INSIDE << WOPN_DP_SHIFT)
273#define WOPN_DP_TAB (DP_TAB << WOPN_DP_SHIFT)
277#define WOPN_DP_BEFORE (DP_BEFORE << WOPN_DP_SHIFT)
280#define WOPN_DP_FLOATING (DP_FLOATING << WOPN_DP_SHIFT)
282#define WOPN_DP_SZHINT (DP_SZHINT << WOPN_DP_SHIFT)
286#define WOPN_DP_INSIDE_BEFORE (WOPN_DP_INSIDE | WOPN_DP_BEFORE)
287#define WOPN_DP_TAB_BEFORE (WOPN_DP_TAB | WOPN_DP_BEFORE)
288#define WOPN_GET_DP(v) (((v) & WOPN_DP_MASK) >> WOPN_DP_SHIFT)
290
293#define RENADDR_IDA 0
294#define RENADDR_HR 1
299
303#define CVLF_USE_MOUSE 0x1
305
306#ifndef SWIG
310union callui_t
311{
312 bool cnd;
313 char i8;
314 int i;
315 short i16;
316 int32 i32;
317 uchar u8;
318 ushort u16;
338};
339
340//-------------------------------------------------------------------------
347};
348
350/// (See convenience functions like get_screen_ea())
351/// Events marked as 'cb:' are designed to be callbacks and should not
352/// be used in callui(). The user may hook to ::HT_UI events to catch them
356 ui_null = 0,
357
358 ui_range,
362
371
375
376 ui_suspend,
382 ui_resume,
387
394
396
398
400
402
403 ui_saving,
407
416
418
419 ui_refresh,
420
421 ui_choose,
427
429
431
432 ui_setidle,
435
442
443 ui_beep,
444
446
447 ui_msg,
451
457
459
463
465
472 ui_ask_str,
476 ui_ask_seg,
484
486
488
490
492
497 ui_noabort,
511
517
519
524
526
530
532
533 ui_is_idaq,
547
549
551
566
571
578
586
589
592
595
598
600
630
633
641
647
653
655
670
672
681
685
687
689
694
702
706
718
725
727
730
732
734
736
738
739 ui_addons,
743
759
761
773
775
777
784 ui_jumpto,
794
796
798
801
803
805
814
817
820
823
826
829
832
835
838
841
844
855
873
885
888
890
893
896
904
909
912
918
921
924
933
942
956
959
963
972
975
989
995
1000
1001 ui_obsolete_get_custom_viewer_location, // ui_get_custom_viewer_location_2
1002
1007
1014
1018
1021
1029
1035
1038
1041
1043
1049
1061
1065
1068
1070
1072
1074
1077
1098
1099 ui_serve,
1101
1102
1103 ui_last,
1104
1105 ui_dbg_begin = 1000,
1236 // trace management
1248 // breakpoint management (new codes were introduced in v6.3)
1260 // calluis for creating traces from scratch (added in 6.4)
1275 // added in 6.6
1279 // added in 6.7
1291 // added in 7.1
1295 // source-level debugging
1303
1324 // added in 7.7
1327 // added in 9.1
1340 // Debugging notifications
1341#ifdef _DEBUG
1343#endif
1346
1347//--------------------------------------------------------------------------
1348
1349
1352
1353idaman callui_t ida_export_data (idaapi*callui)(ui_notification_t what,...);
1354
1355
1361
1362idaman int ida_export init_database(int argc, const char *const *argv, int *newfile);
1363
1364
1367
1368idaman void ida_export term_database();
1369
1370
1372
1373idaman NORETURN AS_PRINTF(1, 0) void ida_export verror(const char *format, va_list va);
1374
1375
1378idaman AS_PRINTF(3, 0) void ida_export vshow_hex(
1379 const void *dataptr,
1380 size_t len,
1381 const char *format,
1382 va_list va);
1383
1384
1386
1387idaman AS_PRINTF(4, 0) void ida_export vshow_hex_file(
1388 linput_t *li,
1390 size_t count,
1391 const char *format,
1392 va_list va);
1393
1394
1395#endif // SWIG
1399inline ssize_t get_kernel_version(char *buf, size_t bufsize)
1400{
1401 return callui(ui_get_kernel_version, buf, bufsize).ssize;
1402}
1403
1404// Return true if this is ida running as library
1405const int64 IDALIB_API_MAGIC = 0x001DA11B00000000LL;
1406inline bool is_ida_library(char *path = nullptr, size_t pathsize = 0, void** handle = nullptr)
1407{
1408 return callui(ui_broadcast, IDALIB_API_MAGIC, path, pathsize, handle).ssize > 0;
1409}
1410
1411//--------------------------------------------------------------------------
1412// K E R N E L S E R V I C E S F O R U I
1413//--------------------------------------------------------------------------
1415// Generating text for the disassembly, enum, and structure windows.
1416
1419
1441class place_t
1442{
1443public:
1444 int lnnum;
1445 place_t() {}
1446 place_t(int ln) : lnnum(ln) {}
1448
1449
1450 /// This description is used on the status bar.
1451 /// \param vout the output buffer
1452 /// \param ud pointer to user-defined context data. Is supplied by ::linearray_t
1453 virtual void idaapi print(qstring *vout, void *ud) const = 0;
1455 /// Map the location to a number.
1456 /// This mapping is used to draw the vertical scrollbar.
1457 /// \param ud pointer to user-defined context data. Is supplied by ::linearray_t
1458 virtual uval_t idaapi touval(void *ud) const = 0;
1459
1462 virtual place_t *idaapi clone() const = 0;
1463
1465 virtual void idaapi copyfrom(const place_t *from) = 0;
1466
1476 virtual place_t *idaapi makeplace(void *ud, uval_t x, int lnnum) const= 0;
1477
1479 virtual int idaapi compare(const place_t *t2) const = 0;
1480
1487 virtual void idaapi adjust(void *ud) = 0;
1492 virtual bool idaapi prev(void *ud) = 0;
1493
1497 virtual bool idaapi next(void *ud) = 0;
1498
1502 virtual bool idaapi beginning(void *ud) const = 0;
1503
1507 virtual bool idaapi ending(void *ud) const = 0;
1508
1518 virtual int idaapi generate(
1519 qstrvec_t *out,
1520 int *out_deflnnum,
1521 color_t *out_pfx_color,
1522 bgcolor_t *out_bgcolor,
1523 void *ud,
1524 int maxsize) const = 0;
1525
1530 virtual void idaapi serialize(bytevec_t *out) const = 0;
1531
1538 virtual bool idaapi deserialize(const uchar **pptr, const uchar *end) = 0;
1542 virtual int idaapi id() const = 0;
1543
1550 virtual const char *idaapi name() const = 0;
1554 virtual ea_t idaapi toea() const { return BADADDR; }
1555
1559 virtual bool idaapi rebase(const segm_move_infos_t & /*infos*/ ) { return true; }
1560
1572 virtual place_t *idaapi enter(uint32 * /*out_flags*/) const { return nullptr; }
1573
1576 virtual void idaapi leave(uint32 /*flags*/) const {}
1577
1589 virtual int idaapi compare2(const place_t *t2, void * /*ud*/) const { return compare(t2); }
1590
1602 virtual bool idaapi equals(const place_t *t2, void *ud) const
1603 {
1604 return compare2(t2, ud) == 0;
1605 }
1606};
1607
1608#define DEFAULT_PLACE_LNNUM -1
1609#define MAX_PLACE_LNNUM INT_MAX
1610
1611/// compare places and their lnnums
1612idaman int ida_export l_compare(const place_t *t1, const place_t *t2);
1613idaman int ida_export l_compare2(const place_t *t1, const place_t *t2, void *ud);
1614idaman bool ida_export l_equals(const place_t *t1, const place_t *t2, void *ud);
1615
1616#ifndef SWIG
1617
1618//--------------------------------------------------------------------------
1620#define define_place_exported_functions(classname) \
1621class classname; \
1622idaman void ida_export classname ## __print(const classname *, qstring *, void*); \
1623idaman uval_t ida_export classname ## __touval(const classname *, void*); \
1624idaman place_t * ida_export classname ## __clone(const classname *); \
1625idaman void ida_export classname ## __copyfrom(classname *, const place_t*); \
1626idaman place_t * ida_export classname ## __makeplace(const classname *, void*, uval_t, int); \
1627idaman int ida_export classname ## __compare(const classname *, const place_t*); \
1628idaman int ida_export classname ## __compare2(const classname *, const place_t*, void*); \
1629idaman bool ida_export classname ## __equals(const classname *, const place_t*, void*); \
1630idaman void ida_export classname ## __adjust(classname *, void*); \
1631idaman bool ida_export classname ## __prev(classname *, void*); \
1632idaman bool ida_export classname ## __next(classname *, void*); \
1633idaman bool ida_export classname ## __beginning(const classname *, void*); \
1634idaman bool ida_export classname ## __ending(const classname *, void*); \
1635idaman int ida_export classname ## __generate( \
1636 const classname *, \
1637 qstrvec_t*, \
1638 int*, \
1639 color_t*, \
1640 bgcolor_t*, \
1641 void*, \
1642 int); \
1643idaman void ida_export classname ## __serialize(const classname *, bytevec_t *out); \
1644idaman bool ida_export classname ## __deserialize(classname *, const uchar **, const uchar *); \
1645idaman int ida_export classname ## __id(const classname *); \
1646idaman const char *ida_export classname ## __name(const classname *); \
1647idaman ea_t ida_export classname ## __toea(const classname *); \
1648idaman place_t * ida_export classname ## __enter(const classname *, uint32 *); \
1649idaman void ida_export classname ## __leave(const classname *, uint32); \
1650idaman bool ida_export classname ## __rebase(classname *, const segm_move_infos_t &);
1651
1652
1654#define define_place_virtual_functions(class) \
1655 virtual void idaapi print(qstring *buf, void *ud) const override \
1656 { class ## __print(this, buf, ud); } \
1657 virtual uval_t idaapi touval(void *ud) const override \
1658 { return class ## __touval(this, ud); } \
1659 virtual place_t *idaapi clone() const override \
1660 { return class ## __clone(this); } \
1661 virtual void idaapi copyfrom(const place_t *from) override \
1662 { class ## __copyfrom(this, from); } \
1663 virtual place_t *idaapi makeplace( \
1664 void *ud, \
1665 uval_t x, \
1666 int _lnnum) const override \
1667 { return class ## __makeplace(this,ud,x,_lnnum); } \
1668 virtual int idaapi compare(const place_t *t2) const override \
1669 { return class ## __compare(this, t2); } \
1670 virtual void idaapi adjust(void *ud) override \
1671 { class ## __adjust(this,ud); } \
1672 virtual bool idaapi prev(void *ud) override \
1673 { return class ## __prev(this,ud); } \
1674 virtual bool idaapi next(void *ud) override \
1675 { return class ## __next(this,ud); } \
1676 virtual bool idaapi beginning(void *ud) const override \
1677 { return class ## __beginning(this,ud); } \
1678 virtual bool idaapi ending(void *ud) const override \
1679 { return class ## __ending(this,ud); } \
1680 virtual int idaapi generate( \
1681 qstrvec_t *_out, \
1682 int *_out_lnnum, \
1683 color_t *_out_pfx_color, \
1684 bgcolor_t *_out_bg_color, \
1685 void *_ud, \
1686 int _max) const override \
1687 { \
1688 return class ## __generate( \
1689 this, _out, _out_lnnum, _out_pfx_color, \
1690 _out_bg_color, _ud, _max); \
1691 } \
1692 virtual void idaapi serialize(bytevec_t *out) const override \
1693 { class ## __serialize(this, out); } \
1694 virtual bool idaapi deserialize( \
1695 const uchar **pptr, \
1696 const uchar *end) override \
1697 { return class ## __deserialize(this, pptr, end); } \
1698 virtual int idaapi id() const override \
1699 { return class ## __id(this); } \
1700 virtual const char * idaapi name() const override \
1701 { return class ## __name(this); } \
1702 virtual ea_t idaapi toea() const override \
1703 { return class ## __toea(this); } \
1704 virtual place_t *idaapi enter(uint32 *out_flags) const override \
1705 { return class ## __enter(this, out_flags); } \
1706 virtual void idaapi leave(uint32 flags) const override \
1707 { return class ## __leave(this, flags); } \
1708 virtual bool idaapi rebase(const segm_move_infos_t &infos) override \
1709 { return class ## __rebase(this, infos); } \
1710 virtual int idaapi compare2(const place_t *t2, void *ud) const override \
1711 { return class ## __compare2(this, t2, ud); } \
1712 virtual bool idaapi equals(const place_t *t2, void *ud) const override \
1713 { return class ## __equals(this, t2, ud); }
1714
1716
1717
1718#endif // SWIG
1719
1720//--------------------------------------------------------------------------
1721
1740
1742struct simpleline_t
1743{
1744 qstring line;
1745 color_t color = 1;
1746 bgcolor_t bgcolor = DEFCOLOR;
1747 simpleline_t() {}
1748 simpleline_t(color_t c, const char *str) : line(str), color(c) {}
1749 simpleline_t(const char *str) : line(str) {}
1750 simpleline_t(const qstring &str) : line(str) {}
1751 DEFINE_MEMORY_ALLOCATION_FUNCS()
1752};
1753
1758
1760class simpleline_place_t : public place_t
1761{
1762public:
1763 uint32 n;
1764 simpleline_place_t() { n = 0; lnnum = 0; }
1765 simpleline_place_t(int _n) { n = _n; lnnum = 0; }
1767};
1770//--------------------------------------------------------------------------
1771// user defined data for linearray_t: use ptr to result of calc_default_idaplace_flags()
1772#ifndef SWIG
1774#endif // SWIG
1775/// A location in a disassembly view
1776class idaplace_t : public place_t
1777{
1778public:
1779 ea_t ea;
1780 idaplace_t() {}
1781 idaplace_t(ea_t x, int ln) : place_t(ln), ea(x) {}
1783};
1784
1785//-------------------------------------------------------------------------
1787#ifndef SWIG
1789struct outctx_base_t;
1790struct hexplace_gen_t;
1791class hexview_t;
1792idaman void ida_export hexplace_t__out_one_item(
1793 const hexplace_t *_this,
1794 outctx_base_t &ctx,
1795 const hexplace_gen_t *hg,
1796 int itemno,
1797 color_t *color,
1798 color_t patch_or_edit);
1799idaman size_t ida_export hexplace_t__ea2str(
1800 char *buf,
1801 size_t bufsize,
1802 const hexplace_gen_t *hg,
1803 ea_t ea);
1804#endif // SWIG
1805
1806#define HEXPLACE_COLOR_EDITED COLOR_SYMBOL
1807#define HEXPLACE_COLOR_PATCHED COLOR_VOIDOP
1808#define HEXPLACE_COLOR_SHOWSPACES COLOR_RESERVED1
1809
1810// A helper, used as 'userdata' for generating lines in a hexplace_t
1811struct hexplace_gen_t
1812{
1813 // data format to display
1814 enum data_kind_t
1815 {
1816 dk_float,
1817 dk_int,
1821 };
1822 enum int_format_t
1824 if_hex,
1828 // result of get_byte_value()
1830 {
1831 BK_VALID, // has a valid value
1832 BK_INVALIDADDR, // address is invalid
1833 BK_NOVALUE, // address is valid but contains no value
1836 virtual bool is_editing() const = 0;
1837 virtual bool is_editing_text() const = 0;
1838 virtual bool is_curitem_changed() const = 0;
1839 virtual bool is_edited_byte(ea_t ea, uint64 *out_value=nullptr) const = 0;
1842 uint64 *out_value,
1843 bool *out_edited) const = 0;
1844 virtual void get_encoding(qstring *out) const = 0;
1845 virtual ea_t get_cur_item_ea() const = 0;
1846 virtual void get_cur_item_text(qstring *out) const = 0;
1847 virtual int get_alignment() const = 0;
1848 virtual int get_line_len(ea_t ea) const = 0;
1849 virtual int get_items_per_line() const = 0;
1850 virtual int get_bytes_per_item() const = 0;
1851 virtual int get_item_width(ea_t ea) const = 0;
1852 virtual data_kind_t get_data_kind() const = 0;
1853 virtual int_format_t get_int_format() const = 0;
1854 virtual bool has_central_separator() const = 0;
1855 virtual bool show_text() const = 0;
1856 virtual bool show_segaddr() const = 0;
1857 virtual int get_bitness() const = 0;
1861 qnotused(out);
1862 return false;
1867 return k == dk_addr_names || k == dk_addr_text || k == dk_addr_deref;
1869 static bool can_show_text(data_kind_t k)
1870 {
1871 return k == dk_float || k == dk_int;
1872 }
1873 bool is_addr_kind() const
1876 return is_addr_kind(k);
1877 }
1879
1880//-------------------------------------------------------------------------
1881// class to represent lines in a hex dump window
1882// one line consists of hv->grid.items_per_line items
1883// each item is hv->grid.bytes_per_item bytes for 8-bit bytes or one "wide" byte
1884class hexplace_t : public idaplace_t
1885{
1886protected:
1887 ea_t sol; // EA at start-of-line
1888public:
1889 hexplace_t(ea_t _ea, int ln) : idaplace_t(_ea, ln), sol(_ea) {}
1891
1892 void out_one_item(
1894 const hexplace_gen_t *hg,
1895 int itemno,
1896 color_t *color,
1897 color_t patch_or_edit) const
1899 hexplace_t__out_one_item(this, ctx, hg, itemno, color, patch_or_edit);
1900 }
1902 // convert ea to text
1903 // use seg:off if segment base is not zero
1904 // otherwise print just the address
1905 static size_t ea2str(char *buf, size_t bufsize, const hexplace_gen_t *hg, ea_t ea)
1906 {
1907 return hexplace_t__ea2str(buf, bufsize, hg, ea);
1908 }
1909
1910};
1911
1912//--------------------------------------------------------------------------
1913#ifndef SWIG
1915#endif // SWIG
1916typedef uchar type_t;
1917typedef uval_t uval_t;
1918
1919//-------------------------------------------------------------------------
1920
1921typedef uint64 tif_cursor_t;
1922struct til_type_ref_t;
1923class segment_info_t;
1924class func_entry_info_t;
1925class fchunk_info_t;
1926#define TIF_CURSOR_HEADER tif_cursor_t(-2)
1927#define TIF_CURSOR_FOOTER tif_cursor_t(-1)
1928
1929inline bool is_tif_cursor_header(tif_cursor_t c) { return c == TIF_CURSOR_HEADER; }
1930inline bool is_tif_cursor_footer(tif_cursor_t c) { return c == TIF_CURSOR_FOOTER; }
1931inline bool is_tif_cursor_index(tif_cursor_t c) { return c != TIF_CURSOR_HEADER && c != TIF_CURSOR_FOOTER; }
1932
1933//-------------------------------------------------------------------------
1934class tiplace_t : public place_t
1935{
1936public:
1937 uint32 ordinal = 0;
1938 tif_cursor_t cursor = TIF_CURSOR_HEADER;
1941 tiplace_t(uint32 ord, tif_cursor_t c, int _lnnum) : ordinal(ord), cursor(c)
1942 {
1943 lnnum = _lnnum;
1944 }
1945 bool valid_ord() const { return ordinal != 0; }
1946 void reset() { ordinal = 0; cursor = TIF_CURSOR_HEADER; lnnum = 0; }
1948 bool is_header() const { return cursor == TIF_CURSOR_HEADER; }
1949 bool is_footer() const { return cursor == TIF_CURSOR_FOOTER; }
1950 bool is_index() const { return cursor < TIF_CURSOR_HEADER; }
1951
1952 void set_header() { cursor = TIF_CURSOR_HEADER; }
1953 void set_footer() { cursor = TIF_CURSOR_FOOTER; }
1956
1964 virtual uint64 calc_udm_offset(const void *ud, ssize_t *p_udmidx=nullptr, int *p_bitoff=nullptr) const newapi;
1965
1969 virtual void set_index_by_offset(void *ud, uint64 offset) newapi;
1970
1974 virtual type_t get_kind(const void *ud) const newapi;
1975
1980 virtual bool fill_type_ref(til_type_ref_t *out, const void *ud) const newapi;
1981};
1982
1983//-------------------------------------------------------------------------
1984#define PCF_EA_CAPABLE 0x00000001
1985#define PCF_MAKEPLACE_ALLOCATES 0x00000002
1990
1991//-------------------------------------------------------------------------
1992idaman int ida_export internal_register_place_class(
1993 const place_t *tmplate,
1994 int flags,
1995 const plugin_t *owner,
1996 int sdk_version);
1997
1998
1999//-------------------------------------------------------------------------
2013inline int register_place_class(
2014 const place_t *tmplate,
2015 int flags,
2016 const plugin_t *owner)
2017{
2018 return internal_register_place_class(tmplate, flags, owner, IDA_SDK_VERSION);
2019}
2020
2021//-------------------------------------------------------------------------
2022/// Get information about a previously-registered place_t class.
2023/// See also register_place_class().
2024/// \param out_flags output flags (can be nullptr)
2025/// \param out_sdk_version sdk version the place was created with (can be nullptr)
2026/// \param id place class ID
2027/// \return the place_t template, or nullptr if not found
2028idaman const place_t *ida_export get_place_class(
2029 int *out_flags,
2030 int *out_sdk_version,
2031 int id);
2032
2033//-------------------------------------------------------------------------
2035inline const place_t *get_place_class_template(int id)
2036{
2037 return get_place_class(nullptr, nullptr, id);
2038}
2039
2040//-------------------------------------------------------------------------
2042inline bool is_place_class_ea_capable(int id)
2043{
2044 int flags;
2045 if ( get_place_class(&flags, nullptr, id) == nullptr )
2046 return false;
2047 return (flags & PCF_EA_CAPABLE) != 0;
2048}
2049
2050//-------------------------------------------------------------------------
2051/// Get the place class ID for the place that has been registered as 'name'.
2052/// \param name the class name
2053/// \return the place class ID, or -1 if not found
2054idaman int ida_export get_place_class_id(const char *name);
2055
2056#ifndef __UI__
2057 // A TWidget represents any user-facing widget present in IDA.
2058 // E.g., "IDA View-*", "Hex View-*", "Imports", "General registers", ...
2059 class TWidget;
2060#else
2061 #ifdef __QT__
2062 namespace QT
2064 class QWidget;
2065 };
2066 typedef QT::QWidget TWidget;
2067 #else
2068 class TView;
2069 typedef TView TWidget;
2070 #endif
2071#endif
2072
2073//-------------------------------------------------------------------------
2074class sync_source_t
2076 uchar storage[16];
2077
2078 const TWidget **get_widget_ptr_storage() const
2079 {
2080 return (const TWidget **) &storage[sizeof(storage) - sizeof(TWidget *)];
2081 }
2082
2083public:
2084 sync_source_t();
2085 sync_source_t(const TWidget *_view)
2086 {
2087 memset(storage, 0, sizeof(storage));
2088 *get_widget_ptr_storage() = _view;
2089 storage[0] = '\0';
2090 }
2091 sync_source_t(const char *_regname)
2092 {
2093 QASSERT(1716, _regname[0] != '\0');
2094 memset(storage, 0, sizeof(storage));
2095 ::qstrncpy((char *) storage, _regname, sizeof(storage));
2096 }
2097
2098 bool operator==(const sync_source_t &_o) const
2099 {
2100 return memcmp(storage, _o.storage, sizeof(storage)) == 0;
2101 }
2102 bool operator!=(const sync_source_t &_o) const
2103 {
2104 return !((*this) == _o);
2105 }
2106
2107 bool is_register() const { return storage[0] != '\0'; }
2108 bool is_widget() const { return !is_register(); }
2109 const TWidget *get_widget() const
2110 {
2111 QASSERT(1717, is_widget());
2112 return *get_widget_ptr_storage();
2113 }
2114 const char *get_register() const
2115 {
2116 QASSERT(1718, is_register());
2117 return (const char *) storage;
2119};
2120DECLARE_TYPE_AS_MOVABLE(sync_source_t);
2121CASSERT(sizeof(sync_source_t) == 16);
2122typedef qvector<sync_source_t> sync_source_vec_t;
2124struct synced_group_t : public sync_source_vec_t
2125{
2126 bool has_widget(const TWidget *v) const { return has(sync_source_t((TWidget *) v)); }
2127 bool has_register(const char *r) const { return has(sync_source_t(r)); }
2128 bool has(const sync_source_t &ss) const { return find(ss) != end(); }
2131//-------------------------------------------------------------------------
2133/// with another place type, to be used with the view 'view'. Typically
2134/// used when views are synchronized.
2135/// The 'renderer_info_t' part of 'dst' will be pre-filled with
2136/// the current renderer_info_t of 'view', while the 'place_t' instance
2137/// will always be nullptr.
2138enum lecvt_code_t
2139{
2140 LECVT_CANCELED = -1,
2141 LECVT_ERROR = 0,
2142 LECVT_OK = 1,
2143};
2144
2145#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)
2146typedef lecvt_code_t idaapi lochist_entry_cvt2_t(
2147 lochist_entry_t *dst,
2148 const lochist_entry_t &src,
2149 TWidget *view,
2150 uint32 flags);
2153
2156typedef int idaapi til_tinfo_predicate_t(uint32 ord, const tinfo_t &type, void *ud);
2157
2158//-------------------------------------------------------------------------
2182idaman void ida_export register_loc_converter2(
2183 const char *p1,
2184 const char *p2,
2186
2187//-------------------------------------------------------------------------
2194 const char *p1,
2195 const char *p2);
2196
2197
2198
2199//----------------------------------------------------------------------
2201class twinpos_t
2203public:
2204 place_t *at;
2205 int x;
2206 twinpos_t(place_t *t=nullptr, int x0=0) { at=t; x=x0; }
2207 DEFINE_MEMORY_ALLOCATION_FUNCS()
2208};
2209
2210/// A line in a text window
2211class twinline_t
2212{
2213public:
2215 qstring line;
2216 color_t prefix_color;
2217 bgcolor_t bg_color;
2218 bool is_default = false;
2219 twinline_t(place_t *t=nullptr, color_t pc=1, bgcolor_t bc=DEFCOLOR)
2220 : at(t), prefix_color(pc), bg_color(bc) {}
2221 DEFINE_MEMORY_ALLOCATION_FUNCS()
2222};
2228#ifndef SWIG
2229
2230
2231#define DECLARE_LINEARRAY_HELPERS(decl) \
2232decl void ida_export linearray_t_ctr(linearray_t *, void *ud); \
2233decl void ida_export linearray_t_dtr(linearray_t *); \
2234decl int ida_export linearray_t_set_place(linearray_t *, const place_t *new_at); \
2235decl void ida_export linearray_t_copy_from(linearray_t *, const linearray_t *src); \
2236decl bool ida_export linearray_t_beginning(const linearray_t *); \
2237decl bool ida_export linearray_t_ending(const linearray_t *); \
2238decl const qstring *ida_export linearray_t_down(linearray_t *); \
2239decl const qstring *ida_export linearray_t_up(linearray_t *);
2240
2241class linearray_t;
2243#else
2244# define DECLARE_LINEARRAY_HELPERS(decl)
2245#endif // SWIG
2246
2248class linearray_t
2249{
2252 qstrvec_t lines; // lines corresponding to the current place_t
2253 place_t *at;
2254 void *ud; // user defined data (UD)
2255 // its meaning depends on the place_t used
2256 color_t prefix_color; // prefix color
2257 bgcolor_t bg_color; // background color
2258 qstring extra; // the last line of the previous location after moving down
2259 int dlnnum; // default line number (if unknown, -1)
2260 int max_lines; // max number of lines to generate
2261
2262 int getlines();
2263 void cleanup();
2264 int _set_place(const place_t *new_at);
2265 const qstring *_down();
2266 const qstring *_up();
2267 void _copy_from(const linearray_t *src);
2268
2269public:
2270
2271 linearray_t(void *_ud) { linearray_t_ctr(this, _ud); }
2272 ~linearray_t() { linearray_t_dtr(this); }
2273 DEFINE_MEMORY_ALLOCATION_FUNCS()
2274
2275
2282 int set_place(const place_t *new_at) { return linearray_t_set_place(this, new_at); }
2283
2286 void copy_from(const linearray_t *src) { linearray_t_copy_from(this, src); }
2287
2291 place_t *get_place() const { return at; }
2292
2295 bgcolor_t get_bg_color() const { return bg_color; }
2296
2299 bgcolor_t get_pfx_color() const { return prefix_color; }
2300
2303 int get_dlnnum() const { return dlnnum; }
2304
2307 int get_linecnt() const { return int(lines.size()); }
2308
2310 void *userdata() const { return ud; }
2311
2313 void set_userdata(void *userd) { ud = userd; }
2314
2316 bool beginning() const { return linearray_t_beginning(this); }
2317
2318 // Are we at the end?
2319 bool ending() const { return linearray_t_ending(this); }
2320
2323 const qstring *down() { return linearray_t_down(this); }
2324
2327 const qstring *up() { return linearray_t_up(this); }
2328
2331 void set_max_lines(int n) { max_lines = n; }
2332};
2333
2334//-------------------------------------------------------------------------
2335typedef qvector<const twinline_t*> section_lines_refs_t;
2336typedef qvector<section_lines_refs_t> sections_lines_refs_t;
2337
2338//-------------------------------------------------------------------------
2341struct lines_rendering_input_t
2342{
2343 int cb = sizeof(*this);
2344 sections_lines_refs_t sections_lines;
2346 const synced_group_t *sync_group = nullptr;
2349};
2351//-------------------------------------------------------------------------
2357//
2358#define CK_TRACE 80
2359#define CK_TRACE_OVL 81
2360#define CK_EXTRA1 82
2361#define CK_EXTRA2 83
2362#define CK_EXTRA3 84
2363#define CK_EXTRA4 85
2364#define CK_EXTRA5 86
2365#define CK_EXTRA6 87
2366#define CK_EXTRA7 88
2367#define CK_EXTRA8 89
2368#define CK_EXTRA9 90
2369#define CK_EXTRA10 91
2370#define CK_EXTRA11 92
2371#define CK_EXTRA12 93
2372#define CK_EXTRA13 94
2373#define CK_EXTRA14 95
2374#define CK_EXTRA15 96
2375#define CK_EXTRA16 97
2376
2378
2382#define LROEF_MASK 0x00FFFFFF
2383#define LROEF_FULL_LINE 0x00000000
2384#define LROEF_CPS_RANGE 0x00000001
2386
2388{
2389 const twinline_t *line;
2390 uint32 flags;
2391
2392 // 0x00000000: nothing
2393 // 0xAABBGGRR: where AA is 0: BBGGRR contains a key (CK_*) to a color property
2394 // 0xAABBGGRR: where AA is !0: 0xAABBGGRR is the background color, with alpha value, to be applied to that line
2395 //
2396 // The 'bg_color' specified here, will be applied on top of the background
2397 // color that was computed for 'line', which itself can be:
2398 // - none (i.e., the default background color),
2399 // - a possible value stored in the IDB (see 'set_item_color()'),
2400 // - a value provided by processor_t::ev_get_bg_color
2401 // The value provided here should typically be partly transparent
2402 // so that it doesn't obstruct the computed background color
2403 // (the best, by far, is to stick to CK_* keys: their corresponding
2404 // colors typically have partial translucency, and each theme can
2405 // customize them.)
2407
2408 int cpx;
2409 int nchars;
2410
2411 line_rendering_output_entry_t(const twinline_t *_line, uint32 _flags=0, bgcolor_t _bg_color=0)
2412 : line(_line), flags(_flags), bg_color(_bg_color), cpx(-1), nchars(-1) {}
2413
2414 line_rendering_output_entry_t(const twinline_t *_line, int _cpx, int _nchars, uint32 _flags, bgcolor_t _bg_color)
2415 : line(_line), flags(_flags|LROEF_CPS_RANGE), bg_color(_bg_color), cpx(_cpx), nchars(_nchars) {}
2416
2417 bool is_bg_color_empty() const { return bg_color == 0; }
2418 bool is_bg_color_key() const { return (bg_color & 0xFF000000) == 0 && !is_bg_color_empty(); }
2419 bool is_bg_color_direct() const { return (bg_color & 0xFF000000) != 0; }
2422 {
2423 bool ok = (flags & LROEF_MASK) == (r.flags & LROEF_MASK)
2424 && line == r.line
2425 && bg_color == r.bg_color;
2426 if ( ok && (flags & LROEF_CPS_RANGE) != 0 )
2427 ok = cpx == r.cpx && nchars == r.nchars;
2428 return ok;
2429 }
2431 bool operator!=(const line_rendering_output_entry_t &r) const
2432 { return !(*this == r); }
2433};
2434DECLARE_TYPE_AS_MOVABLE(line_rendering_output_entry_t);
2435typedef qvector<line_rendering_output_entry_t*> line_rendering_output_entries_refs_t;
2436
2437//-------------------------------------------------------------------------
2438struct lines_rendering_output_t
2439{
2442
2445 clear();
2446 }
2448 void clear()
2450 for ( size_t i = 0, n = entries.size(); i < n; ++i )
2451 delete entries[i];
2453
2454 bool operator==(const lines_rendering_output_t &r) const
2455 {
2456 if ( flags != r.flags )
2457 return false;
2458 const size_t n = entries.size();
2459 if ( n != r.entries.size() )
2460 return false;
2461 for ( size_t i = 0; i < n; ++i )
2462 if ( *entries[i] != *r.entries[i] )
2463 return false;
2464 return true;
2465 }
2466
2467 bool operator!=(const lines_rendering_output_t &r) const
2468 { return !(*this == r); }
2469
2470 void swap(lines_rendering_output_t &r)
2471 {
2472 qswap(flags, r.flags);
2473 entries.swap(r.entries);
2474 }
2475};
2477//-------------------------------------------------------------------------
2478// Represents a range in a line to be displayed in a listing (or graph).
2479// All coordinates are in codepoints (i.e., not UTF-8 bytes); color
2480// tags are ignored.
2481// In other words, coordinates are in "real, visible" glyphs.
2482typedef int cpidx_t; // codepoint index
2483typedef int cplen_t; // codepoint length
2485struct line_section_t
2486{
2487 cpidx_t start = -1;
2488 cplen_t length = -1;
2489
2490
2491 bool contains(cpidx_t x) const
2493 return x >= start && x < start + length;
2495
2496 bool is_open() const { return length < 0; }
2497 bool is_closed() const { return !is_open(); }
2498 bool valid() const { return is_closed(); }
2499
2500 bool operator==(const line_section_t &r) const { return start == r.start && length == r.length; }
2501 bool operator!=(const line_section_t &r) const { return !(*this == r); }
2502};
2503DECLARE_TYPE_AS_MOVABLE(line_section_t);
2504typedef qvector<line_section_t> line_sections_t;
2506//-------------------------------------------------------------------------
2508#ifndef SWIG
2511idaman THREAD_SAFE ea_t ida_export tagged_line_section_t_get_addr(
2513 const qstring &line);
2514#endif // SWIG
2515
2516//-------------------------------------------------------------------------
2517// A tagged section in a line.
2518// Note: multiple sections with different tags can overlap.
2519// For example, the portion of text `[ebp+char_in_main]`:
2520// <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>
2521// ^________________________________________________________________________________________________________________________________________________________________^ // a `COLOR_OPND1` section
2522// ^_________________________^ // a `COLOR_SYMBOL` section
2523// ^____________________^ // a `COLOR_REG` section
2524// etc...
2526{
2527 struct
2528 {
2529 int text_start = -1; // points right after <on><tag>
2530 int text_end = -1; // points right before <off><tag>
2531 } byte_offsets;
2532 color_t tag = 0;
2533
2535
2536 bool operator==(const tagged_line_section_t &r) const
2537 {
2539 && tag == r.tag
2542 }
2543 bool operator!=(const tagged_line_section_t &r) const { return !(*this == r); }
2544
2545 bool valid() const
2546 {
2547 return line_section_t::valid()
2548 && tag > 0
2549 && byte_offsets.text_start > -1
2550 && byte_offsets.text_end >= byte_offsets.text_start;
2551 }
2553 bool valid_in(const qstring &in) const
2555 return valid()
2556 && byte_offsets.text_start <= in.length()
2557 && byte_offsets.text_end <= in.length();
2558 }
2559
2560 bool substr(
2561 qstring *out,
2562 const qstring &in,
2563 const tagged_line_section_t *end = nullptr) const
2564 {
2565 bool ok = valid_in(in);
2566 if ( ok )
2567 {
2568 out->qclear();
2569 int e = byte_offsets.text_end;
2570 if ( end != nullptr && end->byte_offsets.text_start < e )
2571 e = end->byte_offsets.text_start;
2572 out->append(in.c_str() + byte_offsets.text_start,
2573 e - byte_offsets.text_start);
2574 }
2575 return ok;
2576 }
2577
2582 ea_t get_addr(const qstring &line) const
2583 {
2584 return tagged_line_section_t_get_addr(this, line);
2585 }
2586
2587};
2588DECLARE_TYPE_AS_MOVABLE(tagged_line_section_t);
2589typedef qvector<tagged_line_section_t> tagged_line_section_vec_t;
2590
2591//-------------------------------------------------------------------------
2592// The list of tagged sections corresponding to a line of text in a listing
2594{
2595 const tagged_line_section_t *first(color_t tag) const
2596 {
2597 for ( const auto &one : *this )
2598 if ( one.tag == tag )
2599 return &one;
2600 return nullptr;
2601 }
2605 color_t tag) const
2606 {
2607 for ( const auto &one : *this )
2608 if ( one.byte_offsets.text_start > anchor.byte_offsets.text_start
2609 && one.tag == tag )
2610 return &one;
2611 return nullptr;
2613
2614 void sections_at(
2616 cpidx_t x,
2617 color_t tag=0) const
2618 {
2619 for ( const auto &one : *this )
2620 if ( one.contains(x) && (tag == 0 || one.tag == tag) )
2621 out->push_back(one);
2622 }
2624 // For example, '// XREF: __loff_t/r _IO_FILE/r'
2625 // <on><xref>// XREF: <on><addr:FF001BAC>__loff_t/r <on><addr:FF001BC9>_IO_FILE/r<off><dref>
2626 // ^___ r1 ________________________________________________________________________________^
2627 // ^ r2 ^ r3
2628 // innermost_at(<any p>) --> r1 (because r2 and r3 are zero-length)
2630 cpidx_t x,
2631 color_t tag=0) const
2632 {
2633 const tagged_line_section_t *nearest = nullptr;
2634 for ( const auto &one : *this )
2635 {
2636 if ( one.contains(x)
2637 && (tag == 0 || one.tag == tag)
2638 && (nearest == nullptr || one.start >= nearest->start) )
2639 {
2640 nearest = &one;
2641 }
2642 }
2643 return nearest;
2644 }
2645
2646#ifndef NO_OBSOLETE_FUNCS
2648 DEPRECATED const tagged_line_section_t *nearest_at(
2649 cpidx_t x,
2650 color_t tag=0) const
2651 {
2652 return innermost_at(x, tag);
2653 }
2654#endif
2655
2656 // For example, '// XREF: __loff_t/r _IO_FILE/r'
2657 // <on><xref>// XREF: <on><addr:FF001BAC>__loff_t/r <on><addr:FF001BC9>_IO_FILE/r<off><dref>
2658 // ^___ r1 ________________________________________________________________________________^
2659 // ^ p1 ^ r2 ^ p2 ^ r3 ^ p3
2660 // nearest_before(r1, p1, COLOR_ADDR) --> nullptr
2661 // nearest_before(r1, p2, COLOR_ADDR) --> r2 (zero-length)
2662 // nearest_before(r1, p3, COLOR_ADDR) --> r3 (zero-length)
2663 // nearest_after (r1, p1, COLOR_ADDR) --> r2 (zero-length)
2664 // nearest_after (r1, p2, COLOR_ADDR) --> r3 (zero-length)
2665 // nearest_after (r1, p3, COLOR_ADDR) --> nullptr
2667 const tagged_line_section_t &range,
2668 cpidx_t start,
2669 color_t tag=0) const
2670 {
2671 const tagged_line_section_t *nearest = nullptr;
2672 for ( const auto &one : *this )
2673 {
2674 if ( range.contains(one.start)
2675 && one.start <= start
2676 && (tag == 0 || one.tag == tag)
2677 && (nearest == nullptr
2678 || one.start > nearest->start
2679 || one.byte_offsets.text_start > nearest->byte_offsets.text_start) )
2680 {
2681 nearest = &one;
2682 }
2683 }
2684 return nearest;
2685 }
2686 const tagged_line_section_t *nearest_after(
2687 const tagged_line_section_t &range,
2688 cpidx_t start,
2689 color_t tag=0) const
2690 {
2691 const tagged_line_section_t *nearest = nullptr;
2692 for ( const auto &one : *this )
2693 {
2694 if ( range.contains(one.start)
2695 && one.start > start
2696 && (tag == 0 || one.tag == tag)
2697 && (nearest == nullptr || one.start < nearest->start) )
2698 {
2699 nearest = &one;
2700 }
2701 }
2702 return nearest;
2703 }
2704};
2705
2711struct listing_location_t
2712{
2713 int cb = sizeof(*this);
2714
2715 const lochist_entry_t *loc = nullptr;
2716 const qstring *text = nullptr;
2717 const tagged_line_sections_t *tagged_sections = nullptr;
2718};
2719
2721inline builtin_widgets_mask_t builtin_widget_mask_from_id(int bwn) { TB_QASSERT(3446, bwn >= 0); return uint128(1) << bwn; }
2727
2728idaman void ida_export mark_builtin_widgets(builtin_widgets_mask_t mask, bool dirty=true);
2734
2735inline void mark_builtin_widget_by_id(int bwn, bool dirty=true)
2736{
2738}
2739
2743
2745
2748
2750
2751inline bool is_builtin_widget_dirty(int bwn)
2752{
2753 TB_QASSERT(3448, bwn <= 62); // attempt detecting ID-vs-mask confusion
2756 return (mask & builtin_widget_mask_from_id(bwn)) != 0;
2757}
2758
2759
2760//-------------------------------------------------------------------------
2761typedef int twidget_type_t;
2762
2766#define BWN_UNKNOWN -1
2767#define BWN_EXPORTS 0
2768#define BWN_IMPORTS 1
2769#define BWN_NAMES 2
2770#define BWN_FUNCS 3
2771#define BWN_STRINGS 4
2772#define BWN_SEGS 5
2773#define BWN_SEGREGS 6
2774#define BWN_SELS 7
2775#define BWN_SIGNS 8
2776#define BWN_TILS 9
2777#define BWN_TITREE 10
2778#define BWN_RESERVED_1 11
2779#define BWN_PROBS 12
2780#define BWN_BPTS 13
2781#define BWN_THREADS 14
2782#define BWN_MODULES 15
2783#define BWN_TRACE 16
2784#define BWN_CALL_STACK 17
2785#define BWN_XREFS 18
2786#define BWN_SEARCH 19
2787#define BWN_FRAME 25
2788#define BWN_NAVBAND 26
2789#define BWN_DISASM 27
2790#define BWN_HEXVIEW 28
2791#define BWN_NOTEPAD 29
2792#define BWN_OUTPUT 30
2793#define BWN_CLI 31
2794#define BWN_WATCH 32
2795#define BWN_LOCALS 33
2796#define BWN_STKVIEW 34
2797#define BWN_CHOOSER 35
2798#define BWN_SHORTCUTCSR 36
2799#define BWN_SHORTCUTWIN 37
2800#define BWN_CPUREGS 38
2801#define BWN_SO_STRUCTS 39
2802#define BWN_SO_OFFSETS 40
2803#define BWN_CMDPALCSR 41
2804#define BWN_CMDPALWIN 42
2805#define BWN_SNIPPETS 43
2806#define BWN_CUSTVIEW 44
2807#define BWN_ADDRWATCH 45
2808#define BWN_PSEUDOCODE 46
2809#define BWN_RESERVED_2 47
2810#define BWN_RESERVED_3 48
2811#define BWN_MDVIEWCSR 49
2812#define BWN_DISASM_ARROWS 50
2813#define BWN_CV_LINE_INFOS 51
2814#define BWN_SRCPTHMAP_CSR 52
2815#define BWN_SRCPTHUND_CSR 53
2816#define BWN_UNDOHIST 54
2817#define BWN_SNIPPETS_TREE 55
2818#define BWN_SCRIPTS_CSR 56
2819#define BWN_BOOKMARKS 57
2820#define BWN_TILIST 58
2821#define BWN_TIL_VIEW 59
2822#define BWN_TYPE_EDITOR 60
2823#define BWN_MICROCODE 61
2824#define BWN_XREF_TREE 62
2825#define BWN_TEAMS_VAULT_FILES 63 // the 'Vault files' chooser
2826#define BWN_TEAMS_COMMITS 64 // the 'Commits' chooser
2827#define BWN_TEAMS_LOCAL_FILES 65 // the 'Local files' dirtree
2828#define BWN_TEAMS_WORKLISTS 66 // the 'Worklists' chooser
2829#define BWN_TEAMS_SITES 67 // the 'Sites' chooser
2830#define BWN_TEAMS_USERS 68 // the 'Users' chooser
2831#define BWN_TEAMS_FILE_HISTORY 69 // the file history chooser
2832#define BWN_TEAMS_COMMIT_FILES 70 // the commit files embedded chooser
2833#define BWN_TEAMS_EXT_ASSOCS 71 // the file extension associations embedded chooser
2834#define BWN_TEAMS_OPENED_FILES 72 // the opened files embedded chooser
2835#define BWN_TEAMS_VAULT_FILE_PICKER 73 // the opened files embedded chooser
2836#define BWN_DSC_INDEX 74
2837#define BWN_DSC_SYMBOLS 75
2838#define BWN_DSC_STRINGS 76
2839#define BWN_XREF_GRAPH 77
2840#define BWN_GIT_REPOS 78 // the git 'Manage Repositories' chooser
2841#define BWN_XREF_GRAPH_MANAGER 79
2842#define BWN_RECENT_SCRIPTS_TREE 80
2843#define BWN_EXAMPLE_SCRIPTS_TREE 81
2844#define BWN_SEARCH_SCRIPTS_TREE 82
2845#define BWN_PATHFINDER 83
2846
2847#define BWN_SNIPPETS_CSR BWN_SNIPPETS_TREE // bw-compat
2848
2849
2851
2855#define IWID_EXPORTS builtin_widget_mask_from_id(BWN_EXPORTS )
2856#define IWID_IMPORTS builtin_widget_mask_from_id(BWN_IMPORTS )
2857#define IWID_NAMES builtin_widget_mask_from_id(BWN_NAMES )
2858#define IWID_FUNCS builtin_widget_mask_from_id(BWN_FUNCS )
2859#define IWID_STRINGS builtin_widget_mask_from_id(BWN_STRINGS )
2860#define IWID_SEGS builtin_widget_mask_from_id(BWN_SEGS )
2861#define IWID_SEGREGS builtin_widget_mask_from_id(BWN_SEGREGS )
2862#define IWID_SELS builtin_widget_mask_from_id(BWN_SELS )
2863#define IWID_SIGNS builtin_widget_mask_from_id(BWN_SIGNS )
2864#define IWID_TILS builtin_widget_mask_from_id(BWN_TILS )
2865#define IWID_TITREE builtin_widget_mask_from_id(BWN_TITREE )
2866#define IWID_RESERVED_1 builtin_widget_mask_from_id(BWN_RESERVED_1 )
2867#define IWID_PROBS builtin_widget_mask_from_id(BWN_PROBS )
2868#define IWID_BPTS builtin_widget_mask_from_id(BWN_BPTS )
2869#define IWID_THREADS builtin_widget_mask_from_id(BWN_THREADS )
2870#define IWID_MODULES builtin_widget_mask_from_id(BWN_MODULES )
2871#define IWID_TRACE builtin_widget_mask_from_id(BWN_TRACE )
2872#define IWID_CALL_STACK builtin_widget_mask_from_id(BWN_CALL_STACK )
2873#define IWID_XREFS builtin_widget_mask_from_id(BWN_XREFS )
2874#define IWID_SEARCH builtin_widget_mask_from_id(BWN_SEARCH )
2875#define IWID_FRAME builtin_widget_mask_from_id(BWN_FRAME )
2876#define IWID_NAVBAND builtin_widget_mask_from_id(BWN_NAVBAND )
2877#define IWID_DISASM builtin_widget_mask_from_id(BWN_DISASM )
2878#define IWID_HEXVIEW builtin_widget_mask_from_id(BWN_HEXVIEW )
2879#define IWID_NOTEPAD builtin_widget_mask_from_id(BWN_NOTEPAD )
2880#define IWID_OUTPUT builtin_widget_mask_from_id(BWN_OUTPUT )
2881#define IWID_CLI builtin_widget_mask_from_id(BWN_CLI )
2882#define IWID_WATCH builtin_widget_mask_from_id(BWN_WATCH )
2883#define IWID_LOCALS builtin_widget_mask_from_id(BWN_LOCALS )
2884#define IWID_STKVIEW builtin_widget_mask_from_id(BWN_STKVIEW )
2885#define IWID_CHOOSER builtin_widget_mask_from_id(BWN_CHOOSER )
2886#define IWID_SHORTCUTCSR builtin_widget_mask_from_id(BWN_SHORTCUTCSR )
2887#define IWID_SHORTCUTWIN builtin_widget_mask_from_id(BWN_SHORTCUTWIN )
2888#define IWID_CPUREGS builtin_widget_mask_from_id(BWN_CPUREGS )
2889#define IWID_SO_STRUCTS builtin_widget_mask_from_id(BWN_SO_STRUCTS )
2890#define IWID_SO_OFFSETS builtin_widget_mask_from_id(BWN_SO_OFFSETS )
2891#define IWID_CMDPALCSR builtin_widget_mask_from_id(BWN_CMDPALCSR )
2892#define IWID_CMDPALWIN builtin_widget_mask_from_id(BWN_CMDPALWIN )
2893#define IWID_SNIPPETS builtin_widget_mask_from_id(BWN_SNIPPETS )
2894#define IWID_CUSTVIEW builtin_widget_mask_from_id(BWN_CUSTVIEW )
2895#define IWID_ADDRWATCH builtin_widget_mask_from_id(BWN_ADDRWATCH )
2896#define IWID_PSEUDOCODE builtin_widget_mask_from_id(BWN_PSEUDOCODE )
2897#define IWID_RESERVED_2 builtin_widget_mask_from_id(BWN_RESERVED_2 )
2898#define IWID_RESERVED_3 builtin_widget_mask_from_id(BWN_RESERVED_3 )
2899#define IWID_MDVIEWCSR builtin_widget_mask_from_id(BWN_MDVIEWCSR )
2900#define IWID_DISASM_ARROWS builtin_widget_mask_from_id(BWN_DISASM_ARROWS)
2901#define IWID_CV_LINE_INFOS builtin_widget_mask_from_id(BWN_CV_LINE_INFOS)
2902#define IWID_SRCPTHMAP_CSR builtin_widget_mask_from_id(BWN_SRCPTHMAP_CSR)
2903#define IWID_SRCPTHUND_CSR builtin_widget_mask_from_id(BWN_SRCPTHUND_CSR)
2904#define IWID_UNDOHIST builtin_widget_mask_from_id(BWN_UNDOHIST )
2905#define IWID_SNIPPETS_TREE builtin_widget_mask_from_id(BWN_SNIPPETS_TREE)
2906#define IWID_SCRIPTS_CSR builtin_widget_mask_from_id(BWN_SCRIPTS_CSR )
2907#define IWID_BOOKMARKS builtin_widget_mask_from_id(BWN_BOOKMARKS )
2908#define IWID_TILIST builtin_widget_mask_from_id(BWN_TILIST )
2909#define IWID_TIL_VIEW builtin_widget_mask_from_id(BWN_TIL_VIEW )
2910#define IWID_TYPE_EDITOR builtin_widget_mask_from_id(BWN_TYPE_EDITOR )
2911#define IWID_MICROCODE builtin_widget_mask_from_id(BWN_MICROCODE )
2912#define IWID_XREF_TREE builtin_widget_mask_from_id(BWN_XREF_TREE )
2913#define IWID_TEAMS_VAULT_FILES builtin_widget_mask_from_id(BWN_TEAMS_VAULT_FILES)
2914#define IWID_TEAMS_COMMITS builtin_widget_mask_from_id(BWN_TEAMS_COMMITS)
2915#define IWID_TEAMS_LOCAL_FILES builtin_widget_mask_from_id(BWN_TEAMS_LOCAL_FILES)
2916#define IWID_TEAMS_WORKLISTS builtin_widget_mask_from_id(BWN_TEAMS_WORKLISTS)
2917#define IWID_TEAMS_SITES builtin_widget_mask_from_id(BWN_TEAMS_SITES)
2918#define IWID_TEAMS_USERS builtin_widget_mask_from_id(BWN_TEAMS_USERS)
2919#define IWID_TEAMS_FILE_HISTORY builtin_widget_mask_from_id(BWN_TEAMS_FILE_HISTORY)
2920#define IWID_TEAMS_COMMIT_FILES builtin_widget_mask_from_id(BWN_TEAMS_COMMIT_FILES)
2921#define IWID_TEAMS_EXT_ASSOCS builtin_widget_mask_from_id(BWN_TEAMS_EXT_ASSOCS)
2922#define IWID_TEAMS_OPENED_FILES builtin_widget_mask_from_id(BWN_TEAMS_OPENED_FILES)
2923#define IWID_TEAMS_VAULT_FILE_PICKER builtin_widget_mask_from_id(BWN_TEAMS_VAULT_FILE_PICKER)
2924#define IWID_DSC_INDEX builtin_widget_mask_from_id(BWN_DSC_INDEX)
2925#define IWID_DSC_SYMBOLS builtin_widget_mask_from_id(BWN_DSC_SYMBOLS)
2926#define IWID_DSC_STRINGS builtin_widget_mask_from_id(BWN_DSC_STRINGS)
2927#define IWID_XREF_GRAPH builtin_widget_mask_from_id(BWN_XREF_GRAPH)
2928#define IWID_GIT_REPOS builtin_widget_mask_from_id(BWN_GIT_REPOS)
2929#define IWID_XREF_GRAPH_MANAGER builtin_widget_mask_from_id(BWN_XREF_GRAPH_MANAGER)
2930#define IWID_RECENT_SCRIPTS_TREE builtin_widget_mask_from_id(BWN_RECENT_SCRIPTS_TREE)
2931#define IWID_EXAMPLE_SCRIPTS_TREE builtin_widget_mask_from_id(BWN_EXAMPLE_SCRIPTS_TREE)
2932#define IWID_SEARCH_SCRIPTS_TREE builtin_widget_mask_from_id(BWN_SEARCH_SCRIPTS_TREE)
2933#define IWID_PATHFINDER builtin_widget_mask_from_id(BWN_PATHFINDER)
2936#define IWID_ANY_SCRIPTS_PART (IWID_SNIPPETS \
2937 | IWID_SNIPPETS_TREE \
2938 | IWID_RECENT_SCRIPTS_TREE \
2939 | IWID_EXAMPLE_SCRIPTS_TREE \
2940 | IWID_SEARCH_SCRIPTS_TREE)
2941
2942#define IWID_ANY_LISTING (IWID_DISASM|IWID_HEXVIEW|IWID_TILIST|IWID_FRAME|IWID_PSEUDOCODE|IWID_CUSTVIEW)
2943#define IWID_EA_LISTING (IWID_DISASM|IWID_HEXVIEW|IWID_PSEUDOCODE)
2944#define IWID_TEAMS_FILES_WIDGETS (IWID_TEAMS_WORKLISTS|IWID_TEAMS_VAULT_FILES|IWID_TEAMS_LOCAL_FILES|IWID_TEAMS_FILE_HISTORY)
2945
2946
2947#define IWID_ALL (uint128(0)-1)
2948
2949#define IWID_SNIPPETS_CSR IWID_SNIPPETS_TREE // bw-compat
2950
2952
2954
2956{
2957 return t == BWN_CHOOSER
2958 || (t >= BWN_EXPORTS && t <= BWN_SEARCH && t != BWN_FUNCS && t != BWN_TITREE && t != BWN_NAMES && t != BWN_IMPORTS && t != BWN_BPTS)
2959 || t == BWN_SHORTCUTCSR
2960 || t == BWN_CMDPALCSR
2961 || t == BWN_MDVIEWCSR
2962 || t == BWN_SRCPTHMAP_CSR
2963 || t == BWN_SRCPTHUND_CSR
2964 || t == BWN_UNDOHIST
2965 || t == BWN_GIT_REPOS;
2966}
2967
2968inline bool is_teams_widget(twidget_type_t t)
2969{
2970 return t >= BWN_TEAMS_VAULT_FILES && t <= BWN_TEAMS_OPENED_FILES;
2971}
2972
2973//---------------------------------------------------------------------------
2974// D E B U G G I N G F U N C T I O N S
2975//---------------------------------------------------------------------------
2976
2977/// Controls debug messages - combination of \ref IDA_DEBUG_
2979
2981
2983#define IDA_DEBUG_DREFS 0x00000001
2984#define IDA_DEBUG_OFFSET 0x00000002
2985#define IDA_DEBUG_FLIRT 0x00000004
2986#define IDA_DEBUG_IDP 0x00000008
2987#define IDA_DEBUG_LDR 0x00000010
2988#define IDA_DEBUG_PLUGIN 0x00000020
2989#define IDA_DEBUG_IDS 0x00000040
2990#define IDA_DEBUG_CONFIG 0x00000080
2991#define IDA_DEBUG_CHECKMEM 0x00000100
2992#define IDA_DEBUG_LICENSE 0x00000200
2993#define IDA_DEBUG_DEMANGLE 0x00000400
2994#define IDA_DEBUG_QUEUE 0x00000800
2995#define IDA_DEBUG_ROLLBACK 0x00001000
2996#define IDA_DEBUG_ALREADY 0x00002000
2997#define IDA_DEBUG_TIL 0x00004000
2998#define IDA_DEBUG_NOTIFY 0x00008000
2999#define IDA_DEBUG_DEBUGGER 0x00010000
3000#define IDA_DEBUG_APPCALL 0x00020000
3001#define IDA_DEBUG_SRCDBG 0x00040000
3002#define IDA_DEBUG_ACCESSIBILITY 0x00080000
3003#define IDA_DEBUG_NETWORK 0x00100000
3004#define IDA_DEBUG_INTERNET IDA_DEBUG_NETWORK
3005#define IDA_DEBUG_SIMPLEX 0x00200000
3006#define IDA_DEBUG_DBGINFO 0x00400000
3007#define IDA_DEBUG_LUMINA 0x00800000
3008#define IDA_DEBUG_THEMES 0x01000000
3009#define IDA_DEBUG_REGEX 0x02000000
3010#define IDA_DEBUG_SUBPROC 0x04000000
3011#define IDA_DEBUG_RANGECB 0x08000000
3012#define IDA_DEBUG_ALWAYS 0xFFFFFFFF
3014
3015
3016#ifndef SWIG
3017
3023
3024AS_PRINTF(1, 2) inline int ida_deb(const char *format, ...)
3025{
3026 va_list va;
3027 va_start(va, format);
3028 int nbytes = callui(ui_msg, format, va).i;
3029 va_end(va);
3030 return nbytes;
3031}
3032
3033#define deb(ida_debug_bits, ...) \
3034 do \
3035 { \
3036 if ( (debug & (ida_debug_bits)) != 0 ) \
3037 ida_deb(__VA_ARGS__); \
3038 } while ( false )
3039
3041
3042AS_PRINTF(3, 4) inline void show_hex(
3043 const void *dataptr,
3044 size_t len,
3045 const char *format,
3046 ...)
3047{
3048 va_list va;
3050 vshow_hex(dataptr, len, format, va);
3052}
3053
3054
3056
3057AS_PRINTF(4, 5) inline void show_hex_file(
3058 linput_t *li,
3060 size_t count,
3061 const char *format,
3062 ...)
3063{
3064 va_list va;
3067 va_end(va);
3068}
3069#endif // SWIG
3070
3071//-------------------------------------------------------------------------
3072// U I S E R V I C E F U N C T I O N S
3073//-------------------------------------------------------------------------
3074
3076enum action_state_t
3077{
3079
3082
3102//-------------------------------------------------------------------------
3108#define CH_MODAL 0x00000001
3110
3114#define CH_KEEP 0x00000002
3117#define CH_MULTI 0x00000004
3119#define CH_MULTI_EDIT 0x00000008
3123#define CH_NOBTNS 0x00000010
3125#define CH_ATTRS 0x00000020
3126#define CH_UNUSED 0x00000040
3129#define CH_FORCE_DEFAULT 0x00000080
3131#define CH_CAN_INS 0x00000100
3133#define CH_CAN_DEL 0x00000200
3135#define CH_CAN_EDIT 0x00000400
3137#define CH_CAN_REFRESH 0x00000800
3138
3140#define CH_QFLT 0x00001000
3141#define CH_QFTYP_SHIFT 13
3142#define CH_QFTYP_DEFAULT 0
3143#define CH_QFTYP_NORMAL (1 << CH_QFTYP_SHIFT)
3144#define CH_QFTYP_WHOLE_WORDS (2 << CH_QFTYP_SHIFT)
3145#define CH_QFTYP_REGEX (3 << CH_QFTYP_SHIFT)
3146#define CH_QFTYP_FUZZY (4 << CH_QFTYP_SHIFT)
3147#define CH_QFTYP_MASK (0x7 << CH_QFTYP_SHIFT)
3148
3150#define CH_NO_STATUS_BAR 0x00010000
3151
3153#define CH_RESTORE 0x00020000
3154
3157#define CH_RENAME_IS_EDIT 0x00040000
3158
3159#define OBSOLETE_CH_BUILTIN_SHIFT 19
3160#define OBSOLETE_CH_BUILTIN(id) ((id+1) << OBSOLETE_CH_BUILTIN_SHIFT)
3162#define OBSOLETE_CH_BUILTIN_MASK (0x3F << OBSOLETE_CH_BUILTIN_SHIFT)
3163
3164#define OBSOLETE_CH_HAS_DIRTREE 0x02000000 // Deprecated
3165#define OBSOLETE_CH_TM_NO_TREE 0x00000000 // Deprecated
3166#define OBSOLETE_CH_TM_FOLDERS_ONLY 0x04000000 // Deprecated
3167#define OBSOLETE_CH_TM_FULL_TREE 0x08000000 // Deprecated
3168#define OBSOLETE_CH_TM_SHIFT 26 // Deprecated
3169#define OBSOLETE_CH_TM_MASK (0x3 << OBSOLETE_CH_TM_SHIFT) // Deprecated
3170
3172#define CH_HAS_DIFF 0x10000000
3173
3175#define CH_NO_SORT 0x20000000
3176
3178#define CH_NO_FILTER 0x40000000
3179
3180#define OBSOLETE_CH_NON_PERSISTED_TREE 0x80000000
3182
3186#define OBSOLETE_CH2_LAZY_LOADED 0x0001 // Deprecated
3187#define OBSOLETE_CH2_HAS_INODE2INDEX 0x0002 // Deprecated
3189
3193#define CHCOL_PLAIN 0x00000000
3194#define CHCOL_PATH 0x00010000
3199#define CHCOL_HEX 0x00020000
3200#define CHCOL_DEC 0x00030000
3201#define CHCOL_EA 0x00040000
3202#define CHCOL_FNAME 0x00050000
3209#define CHCOL_SIZE 0x00060000
3212#define CHCOL_TIMESTAMP 0x00070000
3216#define CHCOL_FORMAT 0x000F0000
3217
3218#define CHCOL_DEFHIDDEN 0x00100000
3219#define CHCOL_DRAGHINT 0x00200000
3223#define OBSOLETE_CHCOL_INODENAME 0x00400000 // Deprecated
3224#define CHCOL_CHECKBOX 0x00800000
3230
3231
3235#define CHITEM_BOLD 0x0001
3236#define CHITEM_ITALIC 0x0002
3237#define CHITEM_UNDER 0x0004
3238#define CHITEM_STRIKE 0x0008
3239#define CHITEM_GRAY 0x0010
3240#define CHITEM_CHKST_MASK 0x0060
3243#define CHITEM_CHKST_UNCHECKED 0x0000
3244#define CHITEM_CHKST_PARTIAL 0x0020
3245#define CHITEM_CHKST_CHECKED 0x0040
3247
3251#define CHOOSER_NOMAINMENU "NOMAINMENU\n"
3252#define CHOOSER_NOSTATUSBAR "NOSTATUSBAR\n"
3254
3255class dirtree_t;
3256
3259{
3260 int cb;
3263 int flags;
3264 bgcolor_t color;
3266 : cb(sizeof(chooser_item_attrs_t)),
3268 color(DEFCOLOR) {}
3269 void reset()
3270 {
3271 cb = sizeof(chooser_item_attrs_t);
3273 color = DEFCOLOR;
3275 bool operator==(const chooser_item_attrs_t &other) const
3276 {
3277 return cb == other.cb
3278 && flags == other.flags
3279 && color == other.color;
3280 }
3281};
3282DECLARE_TYPE_AS_MOVABLE(chooser_item_attrs_t);
3283
3284
3284/// Row data returned by get_chooser_rows().
3285struct chooser_row_info_t
3286{
3287 qstrvec_t texts;
3288 chooser_item_attrs_t attrs;
3289 int icon = -1;
3290
3291 // needed by pywraps
3292 bool operator==(const chooser_row_info_t &other) const
3293 {
3294 return texts == other.texts
3295 && attrs == other.attrs
3296 && icon == other.icon;
3298 bool operator!=(const chooser_row_info_t &other) const
3299 {
3300 return !(*this == other);
3302};
3303DECLARE_TYPE_AS_MOVABLE(chooser_row_info_t);
3304typedef qvector<chooser_row_info_t> chooser_row_info_vec_t;
3305
3307
3307///@{
3308#define GCRF_HIGH_BIT (0x8000000000000000ULL) // used to be:
3309 // (size_t(1) << (8 * sizeof(size_t) - 1))
3310 // but SWIG won't swallow the expression
3311#define GCRF_HEADER (GCRF_HIGH_BIT | 0)
3312#define GCRF_SELECTION (GCRF_HIGH_BIT | 1)
3313#define GCRF_CURRENT (GCRF_HIGH_BIT | 2)
3314#define GCRF_ALL (GCRF_HIGH_BIT | 3)
3316
3319#define GCIF_SELECTION 0x1
3320#define GCIF_CURRENT 0x2
3322
3325{
3326 iqm_bwn,
3327 iqm_ctx,
3328};
3329
3331{
3338
3339/// actions", so there is some confusion in the naming.
3340struct action_ctx_base_t;
3343{
3344 int version = 1;
3345 const char *label;
3346 const char *tooltip;
3347 int icon;
3348
3350 const char *_label = nullptr,
3351 const char *_tooltip = nullptr,
3352 int _icon = -1)
3353 : label(_label), tooltip(_tooltip), icon(_icon) {}
3358 /// be sure that ctx.source.chooser is a valid pointer to chooser_base_t
3359 /// and that there are selected items for the Delete and Edit actions.
3360 virtual action_state_t idaapi ucb(action_update_ctx_t * /*ctx*/)
3361 {
3362 return AST_ENABLE_FOR_WIDGET;
3364};
3365
3367struct chooser_base_t
3368{
3369#ifdef SWIG
3370 %immutable;
3371#endif
3372protected:
3373 uint8 version = 5;
3374 // 4: extended storage for builtin id from 6 bits to 8
3375 // 5: added checked() for CHCOL_CHECKBOX support
3377 uint8 flags2;
3380
3381public:
3382 // TODO reduce to 4 values
3383 // embedded chooser: width, height. Other values are ignored.
3384 // qt: y1 == -2 => minimal height (and centered)
3385 // Other values are ignored.
3386 int x0 = -1;
3387 int y0 = -1;
3388 int x1 = -1;
3389 int y1 = -1;
3390 int width = 0;
3391 int height = 0;
3392
3393 const char *title;
3397 const int *widths;
3400 const char *const *header;
3406 int icon = -1;
3407
3416 // Context | 1 | 2 | 3
3417 // ---------------------------
3418 // NO_SELECTION | X | X | X
3419 // EMPTY_CHOOSER | X | |
3420 // ALREADY_EXISTS | X | |
3422 static constexpr ssize_t NO_SELECTION = -1;
3423 static constexpr ssize_t EMPTY_CHOOSER = -2;
3425 static constexpr ssize_t ALREADY_EXISTS = -3;
3428 static constexpr ssize_t NO_ATTR = -4;
3430
3441 int deflt_col = 0;
3442
3444 uint32 flags_ = 0,
3445 int columns_ = 0,
3446 const int *widths_ = nullptr,
3447 const char *const *header_ = nullptr,
3448 const char *title_ = nullptr,
3449 uint8 flags2_ = 0,
3450 twidget_type_t widget_type_ = BWN_UNKNOWN)
3451 : flags2(flags2_),
3452 builtin_id(widget_type_),
3453 flags(flags_),
3454 title(title_),
3455 columns(columns_),
3456 widths(widths_),
3457 header(header_)
3458 {
3459 auto old_builtin_id = ((flags & OBSOLETE_CH_BUILTIN_MASK) >> OBSOLETE_CH_BUILTIN_SHIFT) - 1;
3460
3461 if ( old_builtin_id != BWN_UNKNOWN )
3462 {
3463 QASSERT(3449, builtin_id == BWN_UNKNOWN);
3464 builtin_id = old_builtin_id;
3465
3466 flags &= ~OBSOLETE_CH_BUILTIN_MASK;
3467 }
3468
3469 QASSERT(3450, static_cast<int32_t>(static_cast<int8_t>(widget_type_)) == widget_type_);
3470 }
3471 virtual ~chooser_base_t() {}
3472 DEFINE_MEMORY_ALLOCATION_FUNCS()
3473
3474 // called when the corresponding widget is destroyed.
3475 //
3476 // In some rare cases where multiple chooser_base_t instance can
3477 // be backed by the same data (\sa get_obj_id), and a second instance
3478 // is created while the first is already displayed (therefore making
3479 // that second instance a duplicate), the second instance will be
3480 // destroyed through this method (and chooser_base_t::ALREADY_EXISTS
3481 // will be returned from choose().)
3482 void call_destructor()
3483 {
3484 if ( has_widget_lifecycle() )
3485 delete this;
3486 }
3487
3492 virtual void *get_chooser_obj() { return this; }
3493
3496
3499 virtual const void *get_obj_id(size_t *len) const
3500 {
3501 // return the unique id
3502 *len = 0;
3503 return nullptr;
3504 }
3505
3507 bool is_same(const chooser_base_t *other) const
3509 size_t len1;
3510 const void *id1 = get_obj_id(&len1);
3511 size_t len2;
3512 const void *id2 = other->get_obj_id(&len2);
3513 return len1 == len2 && len1 != 0 && memcmp(id1, id2, len1) == 0;
3514 }
3515
3516 /// is an operation allowed?
3517 bool can_ins() const { return (flags & CH_CAN_INS ) != 0; }
3518 bool can_del() const { return (flags & CH_CAN_DEL ) != 0; }
3519 bool can_edit() const { return (flags & CH_CAN_EDIT ) != 0; }
3520 bool can_refresh() const { return (flags & CH_CAN_REFRESH) != 0; }
3521
3523 bool popup_allowed(int stdact_idx) const
3524 {
3525 switch ( stdact_idx )
3527 case POPUP_INS: return can_ins();
3528 case POPUP_DEL: return can_del();
3529 case POPUP_EDIT: return can_edit();
3530 case POPUP_REFRESH: return can_refresh();
3531 default: return false;
3533 }
3534 bool is_status_bar_hidden() const { return (flags & CH_NO_STATUS_BAR) != 0; }
3535 bool should_restore_geometry() const { return (flags & CH_RESTORE) != 0; }
3537 bool is_modal() const { return (flags & CH_MODAL) != 0; }
3539 bool has_widget_lifecycle() const { return (flags & CH_KEEP) == 0; }
3541 bool is_multi() const { return (flags & CH_MULTI) != 0; }
3543 bool ask_item_attrs() const { return (flags & CH_ATTRS) != 0; }
3545 bool is_force_default() const { return (flags & CH_FORCE_DEFAULT) != 0; }
3549 auto old_id = ((flags & OBSOLETE_CH_BUILTIN_MASK) >> OBSOLETE_CH_BUILTIN_SHIFT) - 1;
3550 if ( version < 4 )
3551 return old_id;
3552 QASSERT(3451, old_id == -1);
3553 return (signed char) builtin_id;
3556 void set_ask_item_attrs(bool enable)
3557 {
3558 if ( enable )
3559 flags |= CH_ATTRS;
3560 else
3561 flags &= ~CH_ATTRS;
3562 }
3563 // check chooser version
3564 void check_version(uint32 ver) const { QASSERT(40217, version >= ver); }
3565 // should the quick filter be visible at startup?
3566 bool is_quick_filter_visible_initially() const { return (flags & CH_QFLT) != 0; }
3567 // what mode should the quick filter initially be put in?
3568 int get_quick_filter_initial_mode() const { return flags & CH_QFTYP_MASK; }
3569 // does the chooser have the ability to participate in a diff/merge workflow?
3570 bool has_diff_capability() const { return (flags & CH_HAS_DIFF) != 0; }
3571 // does chooser have sorting abilities?
3572 bool can_sort() const { return (flags & CH_NO_SORT) == 0; }
3573 // does chooser have filtering abilities?
3574 bool can_filter() const { return (flags & CH_NO_FILTER) == 0; }
3575 // should renaming trigger the 'edit' callback?
3576 bool should_rename_trigger_edit() const { return (flags & CH_RENAME_IS_EDIT) != 0; }
3577 // is the chooser lazy-loaded?
3578 bool is_lazy_loaded() const { return version >= 3 && (flags2 & 0x0001) != 0; }
3579 // chooser_implement inode2index
3580
3583 virtual bool idaapi init() { return true; }
3584
3586 virtual size_t idaapi get_count() const = 0;
3594 virtual void idaapi get_row(
3596 int *out_icon,
3597 chooser_item_attrs_t *out_attrs,
3598 size_t n) const = 0;
3599
3600
3612 virtual ea_t idaapi get_ea(size_t /*n*/) const { return BADADDR; }
3613
3615 enum cbres_t
3616 {
3617 NOTHING_CHANGED,
3618 ALL_CHANGED,
3619 SELECTION_CHANGED,
3620 };
3623 virtual void idaapi closed() {}
3625protected:
3626 // the default labels of the standard actions are different for the qt-
3627 // and txt-versions of the chooser
3628 void init_popup_names(const char *const default_popup_names[NSTDPOPUPS])
3629 {
3630 for ( int i = 0; i < NSTDPOPUPS; ++i )
3631 if ( popup_names[i].empty() )
3632 popup_names[i] = default_popup_names[i];
3633 }
3634#ifdef SWIG
3635 %mutable;
3636#endif
3638
3639#ifndef SWIG
3640
3642struct chooser_t : public chooser_base_t
3643{
3645 struct cbret_t
3646 {
3647 ssize_t idx;
3648 cbres_t changed;
3649 cbret_t() : idx(NO_SELECTION), changed(NOTHING_CHANGED) {}
3650 cbret_t(ssize_t idx_, cbres_t changed_ = ALL_CHANGED)
3651 : idx(idx_), changed(changed_) {}
3652 };
3653
3654 chooser_t(uint32 flags_ = 0,
3655 int columns_ = 0,
3656 const int *widths_ = nullptr,
3657 const char *const *header_ = nullptr,
3658 const char *title_ = nullptr,
3659 uint8 flags2_ = 0,
3660 twidget_type_t widget_type_ = BWN_UNKNOWN)
3662 (flags_ & ~CH_MULTI),
3663 columns_, widths_, header_,
3664 title_,
3665 flags2_,
3666 widget_type_) {}
3667
3672 //lint -sem(chooser_t::choose,custodial(t))
3673 inline ssize_t choose(ssize_t deflt = 0);
3674
3676
3680 virtual ssize_t idaapi get_item_index(const void *item_data) const newapi
3681 {
3682 // no calculation when `item_data` already is an index
3683 return *(const ssize_t *)item_data;
3684 }
3685
3687 typedef cbret_t (idaapi chooser_t::*cb_t)(size_t n);
3688
3689 /// User asked to insert an element.
3690 virtual cbret_t idaapi ins(ssize_t /*n*/) newapi { return cbret_t(); }
3691
3694
3696 virtual cbret_t idaapi del(size_t /*n*/) newapi { return cbret_t(); }
3697
3702 virtual cbret_t idaapi edit(size_t /*n*/) newapi { return cbret_t(); }
3703
3709 virtual cbret_t idaapi enter(size_t n) newapi
3710 {
3712 return cbret_t(ssize_t(n), changed);
3713 }
3714
3718 /// (as it may change during refresh)
3719 /// changed what is changed
3720 virtual cbret_t idaapi refresh(ssize_t n) newapi
3721 {
3722 return cbret_t(n, ALL_CHANGED);
3723 }
3724
3728 virtual void idaapi select(ssize_t /*n*/) const newapi {}
3731 virtual dirtree_t *idaapi get_dirtree() newapi { return nullptr; }
3732
3733
3734 virtual inode_t idaapi index_to_inode(size_t /*n*/) const newapi { return inode_t(BADADDR); }
3735
3740 virtual diffpos_t idaapi index_to_diffpos(size_t /*n*/) const newapi { return diffpos_t(-1); }
3741
3751 virtual bool idaapi get_stdact_descs(
3752 chooser_stdact_desc_t * /*descs*/[NSTDPOPUPS]) newapi
3753 {
3754 return false;
3755 }
3756
3760 /// given dirtree's link() or mkdir() methods to add the folder contents.
3761 /// \note The dirtree is chdir()-positioned to the directory being loaded,
3762 /// so relative paths (like simple filenames) may be useful.
3763 /// \param dt dirtree used to fill the directory in
3764 /// \param dir_path an absolute dirtree path to this directory
3765 /// \return success
3766 virtual bool idaapi do_lazy_load_dir(
3767 dirtree_t * /*dt*/,
3768 const qstring & /*dir_path*/) newapi
3769 {
3770 return false;
3771 }
3772
3775 /// Implementing this function will result in increase overall performance
3776 /// especially for big choosers.
3777 /// \param inode inode of the item
3778 /// \return the index
3779 virtual size_t idaapi inode_to_index(inode_t /*inode*/) const newapi { return size_t(-1); }
3780
3781
3789 virtual cbret_t idaapi checked(size_t /*n*/, int /*check_state*/) newapi
3790 {
3791 return cbret_t();
3792 }
3793
3794protected:
3795 ssize_t new_sel_after_del(size_t n) const
3796 {
3797 size_t cnt = get_count();
3798 // assert: n < cnt
3799 return n + 1 < cnt
3800 ? ssize_t(n + 1)
3801 : ssize_t(n - 1); // the last item deleted => no selection
3802 }
3803 ssize_t adjust_last_item(size_t n) const
3805 size_t cnt = get_count();
3806 if ( cnt == 0 )
3807 return NO_SELECTION;
3808 // take in account deleting of the last item(s)
3809 return ssize_t(n < cnt ? n : cnt - 1);
3810 }
3811};
3814struct chooser_multi_t : public chooser_base_t
3815{
3817 uint32 flags_ = 0,
3818 int columns_ = 0,
3819 const int *widths_ = nullptr,
3820 const char *const *header_ = nullptr,
3821 const char *title_ = nullptr,
3822 uint8 flags2_ = 0,
3823 twidget_type_t widget_type_ = BWN_UNKNOWN)
3825 flags_ | CH_MULTI,
3826 columns_, widths_, header_,
3827 title_,
3828 flags2_,
3829 widget_type_) {}
3830
3835 //lint -sem(chooser_multi_t::choose,custodial(t))
3836 inline ssize_t choose(const sizevec_t &deflt = sizevec_t());
3837
3839
3842 virtual void idaapi get_item_index(
3843 sizevec_t *sel,
3844 const void *item_data) const newapi
3845 {
3846 // no calculation when `item_data` already is a vector
3847 *sel = *(const sizevec_t *)item_data;
3848 }
3849
3851 typedef cbres_t (idaapi chooser_multi_t::*cb_t)(sizevec_t *sel);
3852
3854 virtual cbres_t idaapi ins(sizevec_t * /*sel*/) newapi
3855 {
3856 return NOTHING_CHANGED;
3857 }
3858
3862 virtual cbres_t idaapi del(sizevec_t * /*sel*/) newapi
3864 return NOTHING_CHANGED;
3865 }
3866
3867
3870 virtual cbres_t idaapi edit(sizevec_t * /*sel*/) newapi
3872 return NOTHING_CHANGED;
3873 }
3874
3875
3878 virtual cbres_t idaapi enter(sizevec_t *sel) newapi
3880 return cbres_t(callui(ui_chooser_default_enter, this, sel).i);
3881 }
3882
3883
3887 virtual cbres_t idaapi refresh(sizevec_t * /*sel*/) newapi
3888 {
3889 return ALL_CHANGED;
3890 }
3891
3895 virtual void idaapi select(const sizevec_t &/*sel*/) const newapi {}
3900 virtual dirtree_t *idaapi get_dirtree() newapi { return nullptr; }
3901
3906 virtual inode_t idaapi index_to_inode(size_t /*n*/) const newapi { return inode_t(BADADDR); }
3907
3912 virtual diffpos_t idaapi index_to_diffpos(size_t /*n*/) const newapi { return diffpos_t(-1); }
3913
3923 virtual bool idaapi get_stdact_descs(
3924 chooser_stdact_desc_t * /*descs*/[NSTDPOPUPS]) newapi
3925 {
3926 return false;
3927 }
3928
3932 /// given dirtree's link() or mkdir() methods to add the folder contents.
3933 /// \note The dirtree is chdir()-positioned to the directory being loaded,
3934 /// so relative paths (like simple filenames) may be useful.
3935 /// \param dt dirtree used to fill the directory in
3936 /// \param dir_path an absolute dirtree path to this directory
3937 /// \return success
3938 virtual bool idaapi do_lazy_load_dir(
3939 dirtree_t * /*dt*/,
3940 const qstring & /*dir_path*/) newapi
3941 {
3942 return false;
3943 }
3944
3947 /// Implementing this function will result in increase overall performance
3948 /// especially for big choosers.
3949 /// \param inode inode of the item
3950 /// \return the index
3951 virtual size_t idaapi inode_to_index(inode_t /*inode*/) const newapi { return size_t(-1); }
3952
3953
3961 virtual cbres_t idaapi checked(size_t /*n*/, int /*check_state*/) newapi
3962 {
3963 return NOTHING_CHANGED;
3964 }
3965
3966protected:
3967 // used in the del() callback to iterate
3968 static bool next_item_to_del(sizevec_t *sel);
3969 ssize_t new_sel_after_del(const sizevec_t &sel) const;
3970 void adjust_last_item(sizevec_t *sel, size_t n) const;
3971};
3972
3973
3974
3975struct textctrl_info_t
3976{
3977 size_t cb;
3978 qstring text;
3981
3983#define TXTF_AUTOINDENT 0x0001
3984#define TXTF_ACCEPTTABS 0x0002
3985#define TXTF_READONLY 0x0004
3986#define TXTF_SELECTED 0x0008
3987#define TXTF_MODIFIED 0x0010
3988#define TXTF_FIXEDFONT 0x0020
3989#define TXTF_LINENUMBERS 0x0040
3990#define TXTF_HTML 0x0080
3993 uint16 tabsize;
3994 textctrl_info_t(): cb(sizeof(textctrl_info_t)), flags(0), tabsize(0) {}
3995};
3996
4000
4001
4005
4026
4027//lint -sem(choose,custodial(1))
4028ssize_t choose(chooser_base_t *ch, const void *def_item);
4029
4031{
4032 // chooser uses the default implementation of the get_item_index()
4033 // callback
4034 return ::choose(this, &deflt);
4035}
4036
4038{
4039 // chooser uses the default implementation of the get_item_index()
4040 // callback
4041 return ::choose(this, &deflt);
4042}
4043
4045
4046#endif // SWIG
4047
4048//-------------------------------------------------------------------------
4049enum navaddr_type_t
4050{
4051 nat_lib = 0,
4052 nat_fun,
4053 nat_cod,
4054 nat_dat,
4055 nat_und,
4056 nat_ext,
4057 nat_err,
4059 nat_cur,
4060 nat_auto, // auto-analysis cursor color
4061 nat_lum, // related to lumina
4062 nat_hlo, // highlight outline
4074
4077
4078typedef uint32 idaapi nav_colorizer_t(ea_t ea, asize_t nbytes, void *ud);
4079
4080
4082
4083inline void set_nav_colorizer(
4084 nav_colorizer_t **out_was_func,
4085 void **out_was_ud,
4086 nav_colorizer_t *func,
4087 void *ud)
4088{
4089 callui(ui_set_nav_colorizer, out_was_func, out_was_ud, func, ud);
4090}
4091
4092/// Custom viewer & code viewer handler types
4094{
4096 CVH_KEYDOWN,
4097 CVH_POPUP,
4098 CVH_DBLCLICK,
4099 CVH_CURPOS,
4100 CVH_CLOSE,
4101 CVH_CLICK,
4128#define VES_SHIFT (1 << 0)
4129#define VES_ALT (1 << 1)
4130#define VES_CTRL (1 << 2)
4131#define VES_MOUSE_LEFT (1 << 3)
4132#define VES_MOUSE_RIGHT (1 << 4)
4133#define VES_MOUSE_MIDDLE (1 << 5)
4134#define VES_META (1 << 7)
4135typedef int input_event_modifiers_t;
4137
4138//-------------------------------------------------------------------------
4141{
4150 msg_click,
4156
4157 msg_dblclick,
4163
4164 msg_closed,
4167
4168 msg_keydown,
4174
4175//-------------------------------------------------------------------------
4178{
4180 renderer_pos_info_t() : node(-1), cx(-1), cy(-1), sx(-1) {}
4181
4182 int node;
4183
4184
4185 short cx;
4186 ///< When in graph mode: X coords of the character in 'node'. \n
4187 ///< When in flat mode: X coords of the character in the line, w/o \n
4188 ///< taking scrolling into consideration.
4190 short cy;
4193
4194 short sx;
4195
4196 bool operator == (const renderer_pos_info_t &r) const
4197 { return node == r.node && cx == r.cx && cy == r.cy && sx == r.sx; }
4198 bool operator != (const renderer_pos_info_t &r) const
4199 { return !(*this == r); }
4200};
4201
4202//-------------------------------------------------------------------------
4204
4205//-------------------------------------------------------------------------
4207
4207/// (out of 'view_mouse_event_t' to make it easy for SWiG to wrap)
4209{
4210 ea_t ea;
4211 const selection_item_t *item;
4213};
4214
4215
4223
4224 typedef view_mouse_event_location_t location_t;
4225 location_t location;
4237
4238//-------------------------------------------------------------------------
4242{
4245
4248
4249 view_keydown,
4250 ///< \param view (TWidget *)
4251 ///< \param key (int)
4252 ///< \param state (::view_event_state_t)
4253
4254 view_click,
4257
4261
4262 view_curpos,
4264
4265 view_created,
4268 view_close,
4270
4279
4285
4290
4291#ifndef SWIG
4292
4294
4295typedef bool idaapi custom_viewer_keydown_t(TWidget *cv, int vk_key, int shift, void *ud);
4296
4297
4299
4300typedef void idaapi custom_viewer_popup_t(TWidget *cv, void *ud);
4301
4302
4305typedef void idaapi custom_viewer_mouse_moved_t(TWidget *cv, int shift, view_mouse_event_t *e, void *ud);
4306
4307
4310typedef bool idaapi custom_viewer_click_t(TWidget *cv, int shift, void *ud);
4311
4312
4315typedef bool idaapi custom_viewer_dblclick_t(TWidget *cv, int shift, void *ud);
4316
4317
4322
4323typedef void idaapi custom_viewer_curpos_t(TWidget *cv, void *ud);
4325
4327
4328typedef void idaapi custom_viewer_close_t(TWidget *cv, void *ud);
4329
4330
4331// obsolete
4333typedef int idaapi obsolete_custom_viewer_help_t(TWidget *cv, void *ud);
4334
4335
4339
4340typedef bool idaapi custom_viewer_help_t(qstring *out, TWidget *cv, void *ud);
4341
4369
4370typedef void idaapi custom_viewer_adjust_place_t(TWidget *v, lochist_entry_t *loc, void *ud);
4371
4372
4397
4398typedef int idaapi custom_viewer_get_place_xcoord_t(TWidget *v, const place_t *pline, const place_t *pitem, void *ud);
4399
4400
4402{
4404 lcr_goto,
4405 lcr_user_switch, // user pressed <Space>
4406 lcr_auto_switch, // automatic switch
4408 lcr_navigate, // navigate back & forward
4409 lcr_scroll, // user used scrollbars
4410 lcr_internal, // misc. other reasons
4411};
4413#define LCMD_SYNC (1 << 0)
4414class locchange_md_t // location change metadata
4416protected:
4420 uchar reserved;
4421
4422public:
4424 : cb(sizeof(*this)), r(uchar(_reason)), f(_sync ? LCMD_SYNC : 0), reserved(0) {}
4425 locchange_reason_t reason() const { return locchange_reason_t(r); }
4426 bool is_sync() const { return (f & LCMD_SYNC) != 0; }
4428CASSERT(sizeof(locchange_md_t) == sizeof(uint32));
4430
4433/// This gives the view the possibility of declining the move.
4434/// Reasons for this can be:
4435/// - the location cannot be displayed,
4436/// - going there requires a long-running operation, that can be
4437/// canceled by the user (e.g., in case of the hexrays plugins:
4438/// during decompilation of the target function.)
4439/// - ...
4440///
4441/// This is called before the new location is committed to the view's history.
4442///
4443/// return
4444/// 0 if the move is accepted
4445/// != 0 otherwise
4446
4447typedef int idaapi custom_viewer_can_navigate_t(
4448 TWidget *v,
4449 const lochist_entry_t *now,
4450 const locchange_md_t &md,
4451 void *ud);
4452
4453
4455
4457 TWidget *v,
4458 const lochist_entry_t *was,
4459 const lochist_entry_t *now,
4460 const locchange_md_t &md,
4461 void *ud);
4462
4463
4464// Code viewer handlers for the lineinfo widget located to the left of the text.
4468
4469typedef void idaapi code_viewer_lines_click_t(TWidget *c, const place_t *p, int pos, int shift, void *ud);
4470
4471
4483
4484typedef int idaapi code_viewer_lines_icon_t(TWidget *cv, const place_t *p, int *pos, void *ud);
4485
4486
4488
4489typedef bool idaapi code_viewer_lines_linenum_t(TWidget *cv, const place_t *p, uval_t *num, void *ud);
4490
4494 pcs_none = 0,
4495 pcs_expanded,
4497};
4499
4501/// Called by the UI for each visible line to draw the fold indicator.
4502/// \param cv pointer to the code viewer (nullptr for custom data viewers)
4503/// \param p the line position in the code viewer
4504/// \param ud user data registered with the callbacks
4505/// \return the line's fold state
4506/// \note Must be paired with ::code_viewer_fold_toggle_t.
4507
4508typedef place_collapsible_state_t idaapi code_viewer_fold_state_t(TWidget *cv, const place_t *p, void *ud);
4509
4510
4518
4519typedef bool idaapi code_viewer_fold_toggle_t(TWidget *cv, const place_t *p, void *ud);
4520
4521#endif // SWIG
4522
4523//-------------------------------------------------------------------------
4525{
4526 iek_unknown = 0,
4534
4535//-------------------------------------------------------------------------
4541 int cb;
4542 input_event_kind_t kind;
4543 input_event_modifiers_t modifiers;
4544 TWidget *target;
4545 void *source;
4546
4547 struct input_event_shortcut_data_t
4549 const char *action_name;
4553 int key;
4554 char text[8];
4555 };
4557 {
4558 int x;
4559 int y;
4561 };
4563 union
4564 {
4571 {
4572 memset(this, 0, sizeof(*this));
4573 cb = sizeof(*this);
4577//------------------------------------------------------------------------
4578struct cli_completion_t
4580 qstring text;
4581 qstring hint;
4582 qstring doc;
4583};
4586
4587//-------------------------------------------------------------------------
4588struct cli_completions_t
4590 size_t cb = sizeof(cli_completions_t);
4592 int match_start = -1;
4593 int match_end = -1;
4595 size_t size() const { return entries.size(); }
4596 bool empty() const { return entries.empty(); }
4598 void clear()
4600 entries.clear();
4603 };
4606 {
4610 }
4611};
4612
4613
4614/// Provides functionality for the command line (located at the bottom of the main window).
4615/// Only GUI version of IDA supports CLIs.
4616struct cli_t
4617{
4618 size_t size;
4619 int32 flags;
4620
4621
4623#define CLIF_QT_AWARE 1
4625 const char *sname;
4626 const char *lname;
4627 const char *hint;
4634 bool (idaapi *execute_line)(const char *line);
4646 bool (idaapi *keydown)(
4647 qstring *line,
4648 int *p_x,
4649 int *p_sellen,
4650 int *p_vk_key,
4651 int shift);
4652
4654 bool (idaapi *find_completions)(
4655 qstrvec_t *out_completions,
4660 const char *line,
4661 int x);
4662
4671 bool (idaapi *find_completions_ex)(
4672 cli_completions_t *out,
4673 const char *line,
4674 int x,
4675 size_t max_results);
4676};
4677
4678//---------------------------------------------------------------------------
4682#define MFF_FAST 0x0000
4685
4686#define MFF_READ 0x0001
4693
4694#define MFF_WRITE 0x0002
4700
4701#define MFF_NOWAIT 0x0004
4711
4712
4714struct exec_request_t
4715{
4717 enum { MFF_MAGIC = 0x12345678 };
4718
4720 bool valid() const
4721 {
4722 return (code & ~7) == MFF_MAGIC && (sem != nullptr || (code & MFF_NOWAIT) != 0);
4724
4725 ssize_t code = 0;
4726 qsemaphore_t sem = nullptr;
4732 virtual ssize_t idaapi execute() = 0;
4733
4735 virtual ~exec_request_t() { qsem_free(sem); sem = nullptr; code = 0; }
4736};
4737
4738//---------------------------------------------------------------------------
4742{
4743public:
4746
4747 virtual bool idaapi run() = 0;
4748 virtual ~ui_request_t() {}
4749};
4755class ui_requests_t : public qlist<ui_request_t *>
4757 DECLARE_UNCOPYABLE(ui_requests_t)
4758public:
4759 ui_requests_t() {}
4761 {
4762 for ( iterator p=begin(); p != end(); ++p )
4763 delete *p;
4765};
4766
4768typedef void idaapi ss_restore_cb_t(const char *errmsg, void *ud);
4769
4773#define UIJMP_ACTIVATE 0x0001
4774#define UIJMP_DONTPUSH 0x0002
4775
4776#define UIJMP_VIEWMASK 0x000C
4777#define UIJMP_ANYVIEW 0x0000
4778#define UIJMP_IDAVIEW 0x0004
4779#define UIJMP_IDAVIEW_NEW 0x0008
4781
4784struct dirtree_selection_t;
4785
4786//-------------------------------------------------------------------------
4787// Current selection
4789{
4790 twinpos_t from;
4791 twinpos_t to;
4792
4793 action_ctx_base_cur_sel_t() { reset(); }
4794 void reset()
4795 {
4796 from.at = nullptr;
4797 from.x = -1;
4798 to.at = nullptr;
4799 to.x = -1;
4801};
4803//-------------------------------------------------------------------------
4806struct action_ctx_base_t
4807{
4810 {
4811 reset();
4812 }
4813
4815/// used by action_ctx_base_t::cur_flags
4816///@{
4817#define ACF_HAS_SELECTION (1 << 0)
4818#define ACF_XTRN_EA (1 << 1)
4819#define ACF_HAS_FIELD_DIRTREE_SELECTION (1 << 2)
4820#define ACF_HAS_SOURCE (1 << 3)
4821#define ACF_HAS_TYPE_REF (1 << 4)
4822
4823
4825 void reset()
4826 {
4827 widget = nullptr;
4828 widget_type = BWN_UNKNOWN;
4829 widget_title.clear();
4830 chooser = nullptr;
4831 chooser_selection.clear();
4832 action = nullptr;
4833
4835 cur_flags = ACF_HAS_FIELD_DIRTREE_SELECTION | ACF_HAS_SOURCE | ACF_HAS_TYPE_REF;
4836 cur_ea = BADADDR;
4837 cur_value = BADADDR;
4838 cur_func = cur_fchunk = nullptr;
4839 cur_seg = nullptr;
4840 cur_sel.reset();
4841 regname = nullptr;
4842 focus = nullptr;
4843 graph = nullptr;
4844 graph_selection = nullptr;
4845 dirtree_selection = nullptr;
4846 type_ref = nullptr;
4847 cur_seg_info = nullptr;
4848 cur_func_info = nullptr;
4849 cur_fchunk_info = nullptr;
4850 }
4851 TWidget *widget;
4852 twidget_type_t widget_type;
4853 qstring widget_title;
4854 chooser_base_t *chooser;
4855 sizevec_t chooser_selection;
4856
4857 const char *action;
4858
4859 uint32 cur_flags;
4862 bool has_flag(uint32 flag) const { return (cur_flags & flag) == flag; }
4869 func_t *cur_func;
4875
4876 const char *regname;
4877
4882 const selection_item_t *hovered;
4888 segment_info_t *cur_seg_info;
4892
4893//-------------------------------------------------------------------------
4900//-------------------------------------------------------------------------
4901
4906
4907#define AHF_VERSION 1
4908#define AHF_VERSION_MASK 0xFF
4909
4910//-------------------------------------------------------------------------
4912struct action_handler_t
4913{
4914 int flags;
4915
4917 action_handler_t(int _f = 0) : flags(_f) { flags |= AHF_VERSION; }
4918
4921 /// It is called when the action is triggered, from a menu, from
4922 /// a popup menu, from the toolbar, or programmatically.
4923 /// \return non-zero: all IDA windows will be refreshed
4924 virtual int idaapi activate(action_activation_ctx_t *ctx) = 0;
4925
4936 virtual action_state_t idaapi update(action_update_ctx_t *ctx) = 0;
4937
4939 virtual ~action_handler_t() {}
4940
4941 // Action handles may be allocated by a plugin and deleted by the kernel.
4942 // Therefore it is a good idea to unify the memory allocation methods.
4943 DEFINE_MEMORY_ALLOCATION_FUNCS();
4944};
4947struct action_desc_t
4949 int cb;
4950 const char *name;
4953
4954 const char *label;
4960 const void *owner;
4964 const char *shortcut;
4965 const char *tooltip;
4966 int icon;
4967
4971#define ADF_OWN_HANDLER 0x01
4974#define ADF_NO_UNDO 0x02
4976#define ADF_OT_MASK 0x0C
4977#define ADF_OT_PLUGIN 0x00
4978#define ADF_OT_PLUGMOD 0x04
4979#define ADF_OT_PROCMOD 0x08
4980#define ADF_GLOBAL 0x10
4982#define ADF_NO_HIGHLIGHT 0x20
4984#define ADF_CHECKABLE 0x40
4985#define ADF_CHECKED 0x80
4987 int flags;
4988};
4989
4990
4993#define ACTION_DESC_LITERAL_PLUGMOD(name, label, handler, plgmod, shortcut, tooltip, icon) \
4994 { sizeof(action_desc_t), name, label, handler, plgmod, shortcut, tooltip, icon, ADF_OT_PLUGMOD }
4995
4998#define ACTION_DESC_LITERAL_PROCMOD(name, label, handler, prcmod, shortcut, tooltip, icon) \
4999 { sizeof(action_desc_t), name, label, handler, prcmod, shortcut, tooltip, icon, ADF_OT_PROCMOD }
5000
5002#define ACTION_DESC_LITERAL_OWNER(name, label, handler, owner, shortcut, tooltip, icon, flags) \
5003 { sizeof(action_desc_t), name, label, handler, owner, shortcut, tooltip, icon, flags }
5004
5006#define DYNACTION_DESC_LITERAL(label, handler, shortcut, tooltip, icon) \
5007 { sizeof(action_desc_t), nullptr, label, handler, nullptr, shortcut, tooltip, icon, ADF_OWN_HANDLER }
5008
5010enum action_attr_t
5011{
5012 AA_NONE,
5013 AA_LABEL,
5014 AA_SHORTCUT,
5015 AA_TOOLTIP,
5016 AA_ICON,
5017 AA_STATE,
5018 AA_CHECKABLE,
5023#ifndef SWIG
5024// Handlers to be used with create_custom_viewer()
5027 int cb;
5028public:
5030 custom_viewer_keydown_t *_keyboard = nullptr,
5031 custom_viewer_popup_t *_popup = nullptr,
5032 custom_viewer_mouse_moved_t *_mouse_moved = nullptr,
5033 custom_viewer_click_t *_click = nullptr,
5034 custom_viewer_dblclick_t *_dblclick = nullptr,
5035 custom_viewer_curpos_t *_curpos = nullptr,
5036 custom_viewer_close_t *_close = nullptr,
5037 custom_viewer_help_t *_help = nullptr,
5038 custom_viewer_adjust_place_t *_adjust_place = nullptr,
5039 custom_viewer_get_place_xcoord_t *_get_place_xcoord = nullptr,
5040 custom_viewer_location_changed_t *_location_changed = nullptr,
5041 custom_viewer_can_navigate_t *_can_navigate = nullptr,
5042 code_viewer_fold_state_t *_fold_state = nullptr,
5043 code_viewer_fold_toggle_t *_fold_toggle = nullptr)
5044 : cb(sizeof(*this)),
5045 keyboard(_keyboard),
5046 popup(_popup),
5047 mouse_moved(_mouse_moved),
5048 click(_click),
5049 dblclick(_dblclick),
5050 curpos(_curpos),
5051 close(_close),
5052 obsolete_help(nullptr),
5053 adjust_place(_adjust_place),
5054 get_place_xcoord(_get_place_xcoord),
5055 location_changed(_location_changed),
5056 can_navigate(_can_navigate),
5057 help(_help),
5058 fold_state(_fold_state),
5059 fold_toggle(_fold_toggle)
5060 {}
5061 custom_viewer_keydown_t *keyboard;
5062 custom_viewer_popup_t *popup;
5063 custom_viewer_mouse_moved_t *mouse_moved;
5064 custom_viewer_click_t *click;
5065 custom_viewer_dblclick_t *dblclick;
5066 custom_viewer_curpos_t *curpos;
5067 custom_viewer_close_t *close;
5068 obsolete_custom_viewer_help_t *obsolete_help;
5069 custom_viewer_adjust_place_t *adjust_place;
5077 int size() const { return cb; }
5079#endif // SWIG
5082#ifndef __UI__ // Not for the UI
5084// Convenience functions offered by the user interface
5085
5088
5089THREAD_SAFE inline int execute_ui_requests(ui_requests_t *reqs)
5090{
5091 return callui(ui_execute_ui_requests_list, reqs).i;
5092}
5093
5094
5098/// \return a request id: a unique number that can be used to cancel the request
5099
5100THREAD_SAFE inline int execute_ui_requests(ui_request_t *req, ...)
5101{
5102 va_list va;
5103 va_start(va, req);
5104 int req_id = callui(ui_execute_ui_requests, req, va).i;
5105 va_end(va);
5106 return req_id;
5107}
5108
5114
5115THREAD_SAFE inline bool cancel_exec_request(int req_id)
5116{
5117 return callui(ui_execute_sync_ctl, esctl_cancel_request, req_id).cnd;
5118}
5119
5120
5125THREAD_SAFE inline int cancel_thread_exec_requests(qthread_t tid)
5126{
5128}
5129
5130
5134/// Setting it to `esa_unavailable` will cause the existing requests for
5135/// this thread to be cancelled.
5136/// Setting it to `esa_release` will clear the status for this thread, and
5137/// should be issued right before a call to `qthread_free` is issued.
5138///
5139/// \param tid thread id
5140/// \param availability the availability
5141/// \return the previous availability
5142
5144 qthread_t tid,
5145 execute_sync_availability_t availability)
5146{
5147 auto i = callui(ui_execute_sync_ctl, esctl_set_availability, tid, availability).i;
5149}
5150
5151
5152/// Get the group of widgets/registers
5153/// this view is synchronized with
5154/// \param w the widget
5155/// \return the group of widgets/registers, or nullptr
5156
5157inline const synced_group_t *get_synced_group(const TWidget *w)
5158{
5159 return (synced_group_t *) callui(ui_get_synced_group, w).vptr;
5160}
5161
5166/// \return success
5167
5168inline bool jumpto(ea_t ea, int opnum=-1, int uijmp_flags=UIJMP_ACTIVATE)
5169{
5170 return callui(ui_jumpto, ea, opnum, uijmp_flags).cnd;
5171}
5172
5173
5177/// \retval 0 esc was pressed
5178
5179inline bool banner(int wait) { return callui(ui_banner, wait).cnd; }
5180
5181
5183
5184THREAD_SAFE inline bool is_msg_inited() { return callui(ui_is_msg_inited).cnd; }
5185
5186
5189inline void refresh_idaview() { callui(ui_refreshmarked); }
5190
5191
5194
5195inline void refresh_idaview_anyway() { callui(ui_refresh); }
5196
5197
5199
5201
5202
5205inline ea_t get_screen_ea() { ea_t ea; callui(ui_screenea, &ea); return ea; }
5206
5207
5210inline int get_opnum() { return callui(ui_get_opnum).i; }
5211
5212
5220inline bool get_cursor(int *x, int *y) { return callui(ui_get_cursor, x, y).cnd; }
5221
5222
5230
5231inline bool get_output_cursor(int *x, int *y) { return callui(ui_get_output_cursor, x, y).cnd; }
5232
5233
5237
5238inline const char *get_curline() { return callui(ui_get_curline).cptr; }
5239
5242
5243inline void open_url(const char *url) { callui(ui_open_url, url); }
5244
5245
5248
5249inline ea_t get_hexdump_ea(int hexdump_num) { ea_t ea; callui(ui_hexdumpea, &ea, hexdump_num); return ea; }
5250
5251
5253
5254inline ushort get_key_code(const char *keyname) { return callui(ui_get_key_code, keyname).i16; }
5255
5256
5261
5262inline ushort lookup_key_code(int key, int shift, bool is_qt) { return callui(ui_lookup_key_code, key, shift, is_qt).i16; }
5264
5267
5268inline void refresh_navband(bool force) { callui(ui_refresh_navband, force); }
5269
5270
5274
5275inline bool refresh_chooser(const char *title) { return callui(ui_refresh_chooser, title).cnd; }
5276
5281
5282inline bool close_chooser(const char *title) { return callui(ui_close_chooser, title).cnd; }
5283
5286
5287inline void install_command_interpreter(const cli_t *cp) { callui(ui_install_cli, cp, true); }
5288
5289
5292inline void remove_command_interpreter(const cli_t *cp) { callui(ui_install_cli, cp, false); }
5293
5294
5300
5301inline 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); }
5302
5303
5312
5313THREAD_SAFE inline ssize_t execute_sync(exec_request_t &req, int reqf) { return callui(ui_execute_sync, &req, reqf).ssize; }
5314
5315
5325
5326inline 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)
5327{
5328 return callui(ui_set_dock_pos, src_ctrl, dest_ctrl, orient, left, top, right, bottom).cnd;
5329}
5330
5334
5335inline int get_icon_id_by_name(const char *icon_name) { return callui(ui_get_icon_id_by_name, icon_name).i; }
5336
5339
5341
5342inline int load_custom_icon(const char *file_name) { return callui(ui_load_custom_icon_file, file_name).i; }
5343
5350
5351inline int load_custom_icon(const void *ptr, unsigned int len, const char *format) { return callui(ui_load_custom_icon, ptr, len, format).i; }
5352
5353
5355
5356inline void free_custom_icon(int icon_id) { callui(ui_free_custom_icon, icon_id); }
5357
5358
5363
5364inline bool process_ui_action(const char *name, int flags=0, void *param=nullptr)
5366 return callui(ui_process_action, name, flags, param).cnd;
5367}
5368
5369
5373/// - out: filename, id
5374/// \param err_msg optional error msg buffer
5375/// \return success
5376
5377inline bool take_database_snapshot(
5378 snapshot_t *ss,
5379 qstring *err_msg)
5380{
5381 return callui(ui_take_database_snapshot, ss, err_msg).cnd;
5382}
5383
5384
5386/// Note: This call is asynchronous. When it is completed, the callback will be triggered.
5387/// \param ss snapshot instance (see build_snapshot_tree())
5388/// \param cb A callback that will be triggered with a nullptr string.
5389/// on success and an actual error message on failure.
5390/// \param ud user data passed to be passed to the callback
5391/// \return false if restoration could not be started (snapshot file was not found). \n
5392/// If the returned value is True then check if the operation succeeded from the callback.
5393
5394inline bool restore_database_snapshot(
5395 const snapshot_t *ss,
5396 ss_restore_cb_t *cb,
5397 void *ud)
5398{
5399 return callui(ui_restore_database_snapshot, ss, cb, ud).cnd;
5400}
5401
5403typedef struct __qtimer_t {} *qtimer_t;
5404
5405
5410
5416
5417THREAD_SAFE inline qtimer_t register_timer(
5418 int interval_ms,
5419 int (idaapi *callback)(void *ud),
5420 void *ud)
5421{
5422 return (qtimer_t)(callui(ui_register_timer, interval_ms, callback, ud).vptr);
5423}
5424
5425
5426/// Unregister a timer (::ui_unregister_timer).
5427/// GUI-only: in headless builds (idalib/idat) this always returns false
5428/// \param t handle to a registered timer
5429/// \return success
5430
5431THREAD_SAFE inline bool unregister_timer(qtimer_t t)
5432{
5433 return callui(ui_unregister_timer, t).cnd;
5434}
5435
5436
5440/// whenever something is queued for the main thread
5441/// (execute_sync requests from worker threads), dispatches the
5442/// queued work, then sleeps again. Returns when stop_serving() is called
5443/// In GUI mode this is a no-op because Qt's own event loop
5444/// already serves this role. Must be called from the main thread.
5445
5446inline void serve()
5447{
5449}
5450
5451
5455/// in GUI mode.
5456
5457THREAD_SAFE inline void stop_serving()
5458{
5460}
5461
5462//-------------------------------------------------------------------------
5463
5466/// to menu items (attach_action_to_menu()), or to popup menus
5467/// (attach_action_to_popup()).
5468///
5469/// Because the actions will need to call the handler's activate() and
5470/// update() methods at any time, you shouldn't build your action handler
5471/// on the stack.
5472///
5473/// Please see the SDK's "ht_view" plugin for an example how
5474/// to register actions.
5475/// \param desc action to register
5476/// \return success
5477
5478inline bool register_action(const action_desc_t &desc)
5479{
5480 return callui(ui_register_action, &desc).cnd;
5481}
5482
5483
5488inline bool unregister_action(const char *name)
5489{
5490 return callui(ui_unregister_action, name).cnd;
5491}
5492
5493
5496inline void get_registered_actions(qstrvec_t *out)
5499}
5500
5501
5505/// \param before if non-nullptr, the toolbar before which the new toolbar will be inserted
5506/// \param flags a combination of \ref CREATETB_, to determine toolbar position
5507/// \return success
5508inline bool create_toolbar(
5509 const char *name,
5510 const char *label,
5511 const char *before = nullptr,
5512 int flags = 0)
5513{
5514 return callui(ui_create_toolbar, name, label, before, flags).cnd;
5515}
5516
5521inline bool delete_toolbar(const char *name)
5522{
5523 return callui(ui_delete_toolbar, name).cnd;
5524}
5525
5526
5530/// the menu should be positioned.
5531/// First, IDA will try and resolve the corresponding menu by its name.
5532/// If such an existing menu is found and is present in the menubar,
5533/// then the new menu will be inserted in the menubar before it.
5534/// Otherwise, IDA will try to resolve 'menupath' as it would for
5535/// attach_action_to_menu() and, if found, add the new menu like so:
5536/// \code
5537/// // The new 'My menu' submenu will appear in the 'Comments' submenu
5538/// // before the 'Enter comment..." command
5539/// create_menu("(...)", "My menu", "Edit/Comments/Enter comment...");
5540/// \endcode
5541/// or
5542/// \code
5543/// // The new 'My menu' submenu will appear at the end of the
5544/// // 'Comments' submenu.
5545/// create_menu("(...)", "My menu", "Edit/Comments/");
5546/// \endcode
5547/// If the above fails, the new menu will be appended to the menubar.
5548/// \param name name of menu (must be unique)
5549/// \param label label of menu
5550/// \param menupath where should the menu be inserted
5551/// \return success
5552inline bool create_menu(
5553 const char *name,
5554 const char *label,
5555 const char *menupath=nullptr)
5556{
5557 return callui(ui_create_menu, name, label, menupath).cnd;
5558}
5559
5564inline bool delete_menu(const char *name)
5565{
5566 return callui(ui_delete_menu, name).cnd;
5567}
5568
5569
5572/// If you want to modify the debugger menu, do it at the ui_debugger_menu_change
5573/// event (ida might destroy your menu item if you do it elsewhere).
5574/// \param menupath path to the menu item after or before which the insertion will take place. \n
5575/// - Example: Debug/StartProcess
5576/// - Whitespace, punctuation are ignored.
5577/// - It is allowed to specify only the prefix of the menu item.
5578/// - Comparison is case insensitive.
5579/// - menupath may start with the following prefixes:
5580/// - [S] - modify the main menu of the structure window
5581/// - [E] - modify the main menu of the enum window
5582/// \param name the action name
5583/// \param flags a combination of \ref SETMENU_, to determine menu item position
5584/// \return success
5585
5586inline bool attach_action_to_menu(
5587 const char *menupath,
5588 const char *name,
5589 int flags=0)
5590{
5591 return callui(ui_attach_action_to_menu, menupath, name, flags).cnd;
5592}
5593
5599
5600inline bool detach_action_from_menu(
5601 const char *menupath,
5602 const char *name)
5603{
5604 return callui(ui_detach_action_from_menu, menupath, name).cnd;
5605}
5606
5607
5608/// Attach an action to an existing toolbar (::ui_attach_action_to_toolbar).
5609/// \param toolbar_name the name of the toolbar
5610/// \param name the action name
5611/// \return success
5612
5613inline bool attach_action_to_toolbar(
5614 const char *toolbar_name,
5615 const char *name)
5616{
5617 return callui(ui_attach_action_to_toolbar, toolbar_name, name).cnd;
5618}
5619
5620
5621/// Detach an action from the toolbar (::ui_detach_action_from_toolbar).
5622/// \param toolbar_name the name of the toolbar
5623/// \param name the action name
5624/// \return success
5625
5626inline bool detach_action_from_toolbar(
5627 const char *toolbar_name,
5628 const char *name)
5629{
5630 return callui(ui_detach_action_from_toolbar, toolbar_name, name).cnd;
5631}
5632
5633
5634/// Helper.
5635///
5636/// You are not encouraged to use this, as it mixes flags for
5637/// both register_action(), and attach_action_to_menu().
5638///
5639/// The only reason for its existence is to make it simpler
5640/// to port existing plugins to the new actions API.
5641
5642inline bool register_and_attach_to_menu(
5643 const char *menupath,
5644 const char *name,
5645 const char *label,
5646 const char *shortcut,
5647 int flags,
5648 action_handler_t *handler,
5649 void *owner,
5650 int action_desc_t_flags)
5651{
5652 action_desc_t desc = ACTION_DESC_LITERAL_OWNER(name, label, handler, owner, shortcut, nullptr, -1, action_desc_t_flags);
5653 if ( !register_action(desc) )
5654 return false;
5655 if ( !attach_action_to_menu(menupath, name, (flags & SETMENU_POSMASK)) )
5656 {
5658 return false;
5659 }
5660 return true;
5661}
5662
5663//------------------------------------------------------------------------
5664// Get VCL global variables
5665class TPopupMenu;
5666
5670
5673
5674inline void display_widget(TWidget *widget, uint32 options, const char *dest_ctrl=nullptr)
5675{
5676 callui(ui_display_widget, widget, options, dest_ctrl);
5677}
5678
5679
5682/// \param options \ref WIDGET_CLOSE
5683
5684inline void close_widget(TWidget *widget, int options)
5685{
5686 callui(ui_close_widget, widget, options);
5687}
5688
5689
5692/// \param take_focus give focus to given widget
5693
5694inline void activate_widget(TWidget *widget, bool take_focus)
5695{
5696 callui(ui_activate_widget, widget, take_focus);
5697}
5698
5699
5702/// \param caption title of tab, or window title if widget is not tabbed
5703/// \return pointer to the TWidget, nullptr if none is found
5704
5705inline TWidget *find_widget(const char *caption)
5706{
5707 return (TWidget *) callui(ui_find_widget, caption).vptr;
5708}
5709
5710
5712
5714{
5715 return (TWidget *) callui(ui_get_current_widget).vptr;
5716}
5717
5718
5720
5722{
5723 return twidget_type_t(callui(ui_get_widget_type, widget).i);
5724}
5725
5726
5728
5729inline bool get_widget_title(qstring *buf, TWidget *widget)
5730{
5731 return callui(ui_get_widget_title, buf, widget).cnd;
5732}
5733
5737/// \param maxplace last location of the viewer
5738/// \param curplace set current location
5739/// \param rinfo renderer information (can be nullptr)
5740/// \param ud user data for the viewer
5741/// \param cvhandlers handlers for the viewer (can be nullptr)
5742/// \param cvhandlers_ud pointer to arbitrary user data; it will be passed to cvhandlers
5743/// \param parent widget to hold viewer
5744/// \return pointer to resulting viewer
5745
5747 const char *title,
5748 const place_t *minplace,
5749 const place_t *maxplace,
5750 const place_t *curplace,
5751 const renderer_info_t *rinfo,
5752 void *ud,
5753 const custom_viewer_handlers_t *cvhandlers,
5754 void *cvhandlers_ud,
5755 TWidget *parent = nullptr)
5756{
5757 return (TWidget*) callui(
5758 ui_create_custom_viewer, title, minplace,
5759 maxplace, curplace, rinfo, ud, cvhandlers, cvhandlers_ud, parent).vptr;
5760}
5761
5762
5769
5770inline bool custom_viewer_jump(
5771 TWidget *v,
5772 const lochist_entry_t &loc,
5773 uint32 flags=0)
5774{
5775 return callui(ui_custom_viewer_jump, v, &loc, flags).cnd;
5776}
5777
5785
5786inline bool ea_viewer_history_push_and_jump(TWidget *v, ea_t ea, int x, int y, int lnnum)
5787{
5788 return callui(ui_ea_viewer_history_push_and_jump, v, ea, x, y, lnnum).cnd;
5789}
5790
5791
5794/// \param[out] nfwd number of available forward steps
5795/// \param v ea viewer
5796/// \retval false if the given ea viewer does not exist
5797/// \retval true otherwise
5798
5799inline bool get_ea_viewer_history_info(int *nback, int *nfwd, TWidget *v)
5800{
5801 return callui(ui_ea_viewer_history_info, nback, nfwd, v).cnd;
5802}
5803
5804
5806
5807inline void refresh_custom_viewer(TWidget *custom_viewer)
5808{
5809 callui(ui_refresh_custom_viewer, custom_viewer);
5810}
5811
5812
5814
5815inline void repaint_custom_viewer(TWidget *custom_viewer)
5816{
5817 callui(ui_repaint_qwidget, custom_viewer);
5818}
5819
5820
5822
5823inline void destroy_custom_viewer(TWidget *custom_viewer)
5824{
5825 callui(ui_destroy_custom_viewer, custom_viewer);
5826}
5827
5828
5831/// \param place target position
5832/// \param x desired cursor position (column)
5833/// \param y desired cursor position (line)
5834/// \return success
5835
5836inline bool jumpto(TWidget *custom_viewer, place_t *place, int x, int y)
5837{
5838 return callui(ui_jump_in_custom_viewer, custom_viewer, place, x, y).cnd;
5839}
5840
5841
5844/// See also the more complete get_custom_viewer_location()
5845///
5846/// \param custom_viewer view
5847/// \param mouse mouse position (otherwise cursor position)
5848/// \param[out] x x coordinate
5849/// \param[out] y y coordinate
5850
5852 TWidget *custom_viewer,
5853 bool mouse,
5854 int *x,
5855 int *y)
5856{
5857 return (place_t *)callui(ui_get_curplace, custom_viewer, mouse, x, y).vptr;
5858}
5860inline bool get_custom_viewer_location(
5861 lochist_entry_t *out,
5862 TWidget *custom_viewer,
5863 bool mouse=false)
5864{
5865 return callui(ui_obsolete_get_custom_viewer_location, out, custom_viewer, mouse).cnd;
5866}
5867
5868//-------------------------------------------------------------------------
5874inline bool get_custom_viewer_location(
5875 listing_location_t *out,
5876 TWidget *custom_viewer,
5877 uint32 flags=0)
5878{
5879 return callui(ui_get_custom_viewer_location_2, out, custom_viewer, flags).cnd;
5880}
5881
5884
5885inline bool is_idaq()
5886{
5887 return callui(ui_is_idaq).cnd;
5888}
5889
5890
5893/// \param widget target widget
5894/// \param popup_handle target popup menu
5895/// - if non-nullptr, the action is added to this popup
5896/// menu invocation (i.e., 'single-shot')
5897/// - if nullptr, the action is added to a list of actions
5898/// that should always be present in context menus for this widget
5899/// (i.e., 'permanent'.)
5900/// \param name action name
5901/// \param popuppath can be nullptr
5902/// \param flags a combination of SETMENU_ flags (see \ref SETMENU_)
5903/// \return success
5904
5905inline bool attach_action_to_popup(
5906 TWidget *widget,
5907 TPopupMenu *popup_handle,
5908 const char *name,
5909 const char *popuppath = nullptr,
5910 int flags=0)
5911{
5912 return callui(ui_attach_action_to_popup, widget, popup_handle, name, popuppath, flags).cnd;
5914
5915
5922
5923
5924inline bool detach_action_from_popup(TWidget *widget, const char *name)
5925{
5926 return callui(ui_detach_action_from_popup, widget, name).cnd;
5927}
5928
5929
5932/// will be 'delete'd when the action is unregistered.
5933/// \param unused deprecated; should be nullptr
5934/// \param popup_handle target popup
5935/// \param desc created with #DYNACTION_DESC_LITERAL
5936/// \param popuppath can be nullptr
5937/// \param flags a combination of SETMENU_ constants (see \ref SETMENU_)
5938/// \param buf a buffer, to retrieve the generated action name - can be nullptr
5939/// \return success
5940
5942 TWidget *unused,
5943 TPopupMenu *popup_handle,
5944 const action_desc_t &desc,
5945 const char *popuppath = nullptr,
5946 int flags = 0,
5947 qstring *buf = nullptr)
5948{
5950 popup_handle, &desc, popuppath, flags, buf).cnd;
5951}
5952
5956
5960
5961
5962inline bool update_action_label(const char *name, const char *label)
5963{
5964 return callui(ui_update_action_attr, name, AA_LABEL, label).cnd;
5965}
5966
5967
5970/// \param shortcut new shortcut
5971/// \return success
5972
5973inline bool update_action_shortcut(const char *name, const char *shortcut)
5974{
5975 return callui(ui_update_action_attr, name, AA_SHORTCUT, shortcut).cnd;
5976}
5977
5978
5981/// \param tooltip new tooltip
5982/// \return success
5983
5984inline bool update_action_tooltip(const char *name, const char *tooltip)
5985{
5986 return callui(ui_update_action_attr, name, AA_TOOLTIP, tooltip).cnd;
5987}
5988
5989
5992/// \param icon new icon id
5993/// \return success
5994
5995inline bool update_action_icon(const char *name, int icon)
5996{
5997 return callui(ui_update_action_attr, name, AA_ICON, &icon).cnd;
5998}
5999
6000
6003/// \param state new state
6004/// \return success
6005
6006inline bool update_action_state(const char *name, action_state_t state)
6007{
6008 return callui(ui_update_action_attr, name, AA_STATE, &state).cnd;
6009}
6010
6011
6014/// \param checkable new checkability
6015/// \return success
6016
6017inline bool update_action_checkable(const char *name, bool checkable)
6018{
6019 return callui(ui_update_action_attr, name, AA_CHECKABLE, &checkable).cnd;
6020}
6021
6022
6025/// \param checked new checked state
6026/// \return success
6027
6028inline bool update_action_checked(const char *name, bool checked)
6029{
6030 return callui(ui_update_action_attr, name, AA_CHECKED, &checked).cnd;
6031}
6032
6033
6036/// \param visible new visibility
6037/// \return success
6038
6039inline bool update_action_visibility(const char *name, bool visible)
6040{
6041 return callui(ui_update_action_attr, name, AA_VISIBILITY, &visible).cnd;
6042}
6043
6045
6047/// Convenience functions for ::ui_get_action_attr
6048//{
6049
6051
6054
6055inline bool get_action_label(qstring *label, const char *name)
6056{
6057 return callui(ui_get_action_attr, name, AA_LABEL, label).cnd;
6058}
6059
6060
6063/// \param name the action name
6064/// \return success
6065
6066inline bool get_action_shortcut(qstring *shortcut, const char *name)
6067{
6068 return callui(ui_get_action_attr, name, AA_SHORTCUT, shortcut).cnd;
6069}
6070
6071
6074/// \param name the action name
6075/// \return success
6076
6077inline bool get_action_tooltip(qstring *tooltip, const char *name)
6078{
6079 return callui(ui_get_action_attr, name, AA_TOOLTIP, tooltip).cnd;
6080}
6081
6082
6085/// \param[out] icon the icon id
6086/// \return success
6087
6088inline bool get_action_icon(const char *name, int *icon)
6089{
6090 return callui(ui_get_action_attr, name, AA_ICON, icon).cnd;
6091}
6092
6093
6096/// \param[out] state the action's state
6097/// \return success
6098
6099inline bool get_action_state(const char *name, action_state_t *state)
6100{
6101 return callui(ui_get_action_attr, name, AA_STATE, state).cnd;
6102}
6103
6104
6107/// \param[out] checkable the action's checkability
6108/// \return success
6109
6110inline bool get_action_checkable(const char *name, bool *checkable)
6111{
6112 return callui(ui_get_action_attr, name, AA_CHECKABLE, checkable).cnd;
6113}
6114
6115
6118/// \param[out] checked the action's checked state
6119/// \return success
6120
6121inline bool get_action_checked(const char *name, bool *checked)
6122{
6123 return callui(ui_get_action_attr, name, AA_CHECKED, checked).cnd;
6124}
6125
6126
6129/// \param[out] visibility the action's visibility
6130/// \return success
6131
6132inline bool get_action_visibility(const char *name, bool *visibility)
6133{
6134 return callui(ui_get_action_attr, name, AA_VISIBILITY, visibility).cnd;
6135}
6136
6138
6140/// Convenience functions for ::ui_set_custom_viewer_handler
6141///@{
6142
6144
6145
6146inline void set_custom_viewer_handlers(
6147 TWidget *custom_viewer,
6148 const custom_viewer_handlers_t *cvh,
6149 void *cvh_ud)
6150{
6151 callui(ui_set_custom_viewer_handlers, custom_viewer, cvh, cvh_ud);
6152}
6153
6161
6162inline void *set_custom_viewer_handler(
6163 TWidget *custom_viewer,
6164 custom_viewer_handler_id_t handler_id,
6165 void *handler_or_data)
6166{
6167 return callui(ui_set_custom_viewer_handler, custom_viewer, handler_id,
6168 handler_or_data).vptr;
6169}
6171
6173
6174inline bool set_custom_viewer_qt_aware(TWidget *custom_viewer)
6175{
6176 return callui(ui_set_custom_viewer_handler, custom_viewer, CVH_QT_AWARE).cnd;
6177}
6178
6180
6181
6182/// Get current line of custom viewer (::ui_get_custom_viewer_curline).
6183/// The returned line contains color codes
6184///
6185/// See also the more powerful get_custom_viewer_location()
6186///
6187/// \param custom_viewer view
6188/// \param mouse mouse position (otherwise cursor position)
6189/// \return pointer to contents of current line
6190
6191inline const char *get_custom_viewer_curline(TWidget *custom_viewer, bool mouse)
6192{
6193 return callui(ui_get_custom_viewer_curline, custom_viewer, mouse).cptr;
6194}
6195
6196
6199/// \param pline a place corresponding to the line
6200/// \param pitem a place corresponding to the item
6201/// \retval -1 if 'pitem' is not included in the line
6202/// \retval -2 if 'pitem' points at the entire line
6203/// \retval >= 0 for the X coordinate within the pline, where pitem points
6204
6206 TWidget *custom_viewer,
6207 const place_t *pline,
6208 const place_t *pitem)
6209{
6210 return callui(ui_get_custom_viewer_place_xcoord, custom_viewer, pline, pitem).i;
6211}
6212
6220
6221
6222inline bool get_user_input_event(
6223 input_event_t *out)
6224{
6225 return callui(ui_get_user_input_event, out).cnd;
6226}
6227
6230/// \param mouse current for mouse pointer?
6231/// \return false if output contains no text
6232
6233inline bool get_output_curline(qstring *buf, bool mouse)
6234{
6235 return callui(ui_get_output_curline, buf, mouse).cnd;
6236}
6237
6238
6241/// \return true if there is a selection
6242
6243inline bool get_output_selected_text(qstring *buf)
6244{
6245 return callui(ui_get_output_selected_text, buf).cnd;
6246}
6247
6248
6250
6252{
6253 return (TWidget *)callui(ui_get_current_viewer).vptr;
6254}
6255
6256
6259/// \return the viewer, if found
6260
6261inline TWidget *get_last_widget(builtin_widgets_mask_t mask=IWID_ALL)
6262{
6263 return (TWidget *)callui(ui_get_last_widget, low(mask), high(mask)).vptr;
6264}
6265
6269/// Note: changes will not apply! It is the caller's job to apply the resulting out_tif and out_name.
6270/// \param[out] errbuf (::qstring *) the output string for errors
6271/// \param[out] out_tif (tinfo_t *) tif for created type
6272/// \param[out] out_name (::qstring *) new name of type
6273/// \param func_ea (::ea_t) function start address
6274/// \param tif (tinfo_t *) current function type
6275/// \param name (const char *) function name
6276/// \return true if new type created successfully
6277
6278inline bool prompt_function_prototype(qstring *errbuf, tinfo_t *out_tif, qstring *out_name, ea_t func_ea, tinfo_t *tif, const char *name)
6279{
6280 return callui(ui_prompt_function_prototype, errbuf, out_tif, out_name, func_ea, tif, name).cnd;
6281}
6282
6283
6286/// \param[out] errbuf - (::qstring *) the output string for errors
6287/// \param[out] out_tif - (tinfo_t *) tif for created type
6288/// \param[out] out_name - (::qstring *) new name of type
6289/// \param pfn - (func_t *) editing function
6290/// \param tif - (tinfo_t *) current function type
6291/// \param name - (const char *) function name
6292/// \return true if new type created successfully
6293
6294DEPRECATED inline bool prompt_function_prototype_ex(qstring *errbuf, tinfo_t *out_tif, qstring *out_name, func_t *pfn, tinfo_t *tif, const char *name)
6295{
6296 return callui(ui_obsolete_prompt_function_prototype_2, errbuf, out_tif, out_name, pfn, tif, name).cnd;
6297}
6298
6302/// \param out sections storage
6303/// \param line input line
6304/// \return success
6305inline bool parse_tagged_line_sections(tagged_line_sections_t *out, const char *line)
6306{
6307 return callui(ui_parse_tagged_line_sections, out, line).cnd;
6308}
6309
6310
6311
6317}
6318
6319
6321
6326
6327
6329
6331 TWidget *custom_viewer,
6332 const place_t *minplace,
6333 const place_t *maxplace)
6334{
6335 callui(ui_set_custom_viewer_range, custom_viewer, minplace, maxplace);
6336}
6337
6341
6342inline TWidget *create_empty_widget(const char *title, int icon = -1)
6343{
6344 return (TWidget *) callui(ui_create_empty_widget, title, icon).vptr;
6345}
6346
6347
6349
6350inline void msg_clear()
6351{
6353}
6354
6355
6358/// An empty path means that the user will be prompted for
6359/// the destination and, if the file already exists, the user
6360/// will be asked to confirm before overriding its contents.
6361/// Upon return, 'path' will contain the path that the user
6362/// chose.
6363/// \return success
6364
6365inline bool msg_save(qstring &path)
6366{
6367 return callui(ui_msg_save, &path).cnd;
6368}
6369
6370
6373/// \param out Output storage
6374/// \param count The number of lines to retrieve. -1 means: all
6375
6376inline void msg_get_lines(qstrvec_t *out, int count=-1)
6377{
6379}
6380
6381
6384/// this function will return nullptr even if it is currently shown.
6385/// \return TWidget * the active modal widget, or nullptr
6386
6388{
6389 return (TWidget *) callui(ui_get_active_modal_widget).vptr;
6390}
6391
6392
6396inline int get_navband_pixel(bool *out_is_vertical, ea_t ea)
6397{
6398 return callui(ui_navband_pixel, out_is_vertical, ea).i;
6399}
6400
6401
6403
6404inline ea_t get_navband_ea(int pixel)
6405{
6406 ea_t ea = BADADDR;
6407 callui(ui_navband_ea, &ea, pixel);
6408 return ea;
6409}
6410
6411
6412/// Get the system-specific window ID (GUI version only)
6413/// \param name name of the window (nullptr means the main IDA window)
6414/// \return the low-level window ID
6415
6416inline void *get_window_id(const char *name=nullptr)
6417{
6418 return callui(ui_get_window_id, name).vptr;
6419}
6420
6421
6423
6424inline bool is_idaview(TWidget *v)
6425{
6426 return callui(ui_is_idaview, v).cnd;
6427}
6428
6429
6432/// \param[out] p1 start of selection
6433/// \param[out] p2 end of selection
6434/// \retval false no range is selected
6435/// \retval true ok, start and end are filled
6436
6437inline bool read_selection(TWidget *v, twinpos_t *p1, twinpos_t *p2)
6438{
6439 return callui(ui_read_selection, v, p1, p2).cnd;
6440}
6441
6442
6445/// \param v view, nullptr means the last active window
6446/// containing addresses
6447/// \param[out] ea1 start ea
6448/// \param[out] ea2 end ea
6449/// \retval 0 no range is selected \n
6450/// \retval 1 ok, start ea and end ea are filled
6451
6452inline bool read_range_selection(TWidget *v, ea_t *ea1, ea_t *ea2)
6453{
6454 return callui(ui_read_range_selection, v, ea1, ea2).cnd;
6455}
6456
6457
6459
6461
6462
6464
6472
6474 TWidget *custview,
6475 int flags = 0,
6476 TWidget *parent = nullptr)
6477{
6478 return (TWidget*)callui(ui_create_code_viewer, custview, flags, parent).vptr;
6479}
6480
6487
6488inline void *set_code_viewer_handler(
6489 TWidget *code_viewer,
6490 custom_viewer_handler_id_t handler_id,
6491 void *handler_or_data)
6492{
6493 return callui(ui_set_custom_viewer_handler, code_viewer, handler_id,
6494 handler_or_data).vptr;
6495}
6497
6499
6500inline bool set_code_viewer_user_data(TWidget *code_viewer, void *ud)
6501{
6502 return callui(ui_set_custom_viewer_handler, code_viewer, CDVH_USERDATA, ud).cnd;
6503}
6504
6505
6507
6508inline void *get_viewer_user_data(TWidget *viewer)
6509{
6510 return callui(ui_get_viewer_user_data, viewer).vptr;
6511}
6512
6513
6515
6520
6521
6526 TWidget *code_viewer,
6527 code_viewer_lines_click_t *click_handler,
6528 code_viewer_lines_click_t *popup_handler,
6529 code_viewer_lines_click_t *dblclick_handler,
6530 code_viewer_lines_icon_t *drawicon_handler,
6531 code_viewer_lines_linenum_t *linenum_handler)
6532{
6533 callui(ui_set_code_viewer_line_handlers, code_viewer, click_handler,
6534 popup_handler, dblclick_handler, drawicon_handler, linenum_handler);
6535}
6536
6537
6539
6540inline bool set_code_viewer_lines_icon_margin(TWidget *code_viewer, int margin)
6541{
6542 return callui(ui_set_custom_viewer_handler, code_viewer, CDVH_LINES_ICONMARGIN, margin).cnd;
6543}
6544
6545
6547
6548inline bool set_code_viewer_lines_alignment(TWidget *code_viewer, int align)
6549{
6550 return callui(ui_set_custom_viewer_handler, code_viewer, CDVH_LINES_ALIGNMENT, align).cnd;
6551}
6552
6553
6555
6556inline bool set_code_viewer_lines_radix(TWidget *code_viewer, int radix)
6557{
6558 return callui(ui_set_custom_viewer_handler, code_viewer, CDVH_LINES_RADIX, radix).cnd;
6559}
6560
6561
6563
6564inline bool set_code_viewer_is_source(TWidget *code_viewer)
6565{
6566 return callui(ui_set_custom_viewer_handler, code_viewer, CDVH_SRCVIEW).cnd;
6567}
6568
6569
6572/// - if nullptr, the default size is returned.
6573
6574inline int get_tab_size(const char *path)
6575{
6576 return callui(ui_get_tab_size, path).i;
6577}
6578
6579
6581
6582THREAD_SAFE inline void clr_cancelled() { callui(ui_clr_cancelled); }
6583
6584
6586
6587THREAD_SAFE inline void set_cancelled() { callui(ui_set_cancelled); }
6588
6589
6593
6594THREAD_SAFE inline bool user_cancelled() { return callui(ui_test_cancelled).cnd; }
6596
6608
6609inline bool ui_load_new_file(
6610 qstring *temp_file,
6611 qstring *filename,
6612 linput_t **pli,
6613 ushort neflags,
6614 load_info_t **ploaders)
6615{
6616 return callui(ui_load_file, temp_file, filename, pli, neflags, ploaders).cnd;
6618
6619
6626
6627inline bool ui_run_debugger(
6628 const char *dbgopts,
6629 const char *exename,
6630 int argc,
6631 const char *const *argv)
6632{
6633 return callui(ui_run_dbg, dbgopts, exename, argc, argv).cnd;
6634}
6636
6642
6643inline bool load_dbg_dbginfo(
6644 const char *path,
6645 linput_t *li=nullptr,
6646 ea_t base=BADADDR,
6647 bool verbose=false)
6648{
6649 return callui(ui_dbg_load_dbg_dbginfo, path, li, base, verbose).cnd;
6650}
6652
6657
6658inline int add_idc_hotkey(const char *hotkey, const char *idcfunc)
6659{
6660 return callui(ui_add_idckey, hotkey, idcfunc).i;
6661}
6662
6663
6666/// \param viewer the viewer
6667/// \param out_flags storage for the flags (see \ref HIF_)
6668/// \param flags input flags; optionally specify a highlight slot (0-7)
6669/// \return false if no identifier is highlighted
6670
6671inline bool get_highlight(qstring *out_str, TWidget *viewer, uint32 *out_flags, uint32 flags=0)
6672{
6673 return callui(ui_get_highlight_2, out_str, viewer, out_flags, flags).cnd;
6674}
6675
6676
6679/// \param str the text to match, or nullptr to remove current
6680/// \param flags combination of HIF_... bits (see \ref HIF_)
6681/// \return false if an error occurred
6682
6683inline bool set_highlight(TWidget *viewer, const char *str, int flags)
6684{
6685 return callui(ui_set_highlight, viewer, str, flags).cnd;
6686}
6687
6688
6689#ifndef SWIG
6691/// This pointer is initialized by setup_range_marker()
6692
6693extern void (idaapi*range_marker)(ea_t ea, asize_t size);
6694
6695
6697
6698inline void setup_range_marker()
6699{
6700 void *ptr = callui(ui_get_range_marker).vptr;
6701 if ( ptr != nullptr )
6702 range_marker = reinterpret_cast<void (idaapi*)(ea_t, asize_t)>(ptr);
6703}
6704
6707inline void mark_range_for_refresh(ea_t ea, asize_t size)
6708{
6709 if ( range_marker != nullptr )
6710 range_marker(ea, size);
6711}
6712
6713
6716inline void mark_all_eaviews_for_refresh()
6717{
6718 if ( range_marker != nullptr )
6719 range_marker(0, BADADDR);
6720}
6721
6725{
6726 void (idaapi *backup)(ea_t ea, asize_t size);
6728 {
6729 backup = range_marker;
6730 range_marker = nullptr;
6731 }
6733 {
6734 range_marker = backup;
6736 }
6737};
6738#endif // SWIG
6739
6744
6745
6746
6748
6750{
6751 return (TWidget *) callui(ui_open_builtin, BWN_EXPORTS, ea).vptr;
6752}
6753
6754
6757/// \return pointer to resulting window
6758
6760{
6761 return (TWidget *) callui(ui_open_builtin, BWN_IMPORTS, ea).vptr;
6762}
6763
6764
6767/// \return pointer to resulting window
6768
6769inline TWidget *open_names_window(ea_t ea)
6770{
6771 return (TWidget *) callui(ui_open_builtin, BWN_NAMES, ea).vptr;
6772}
6773
6774
6777/// \return pointer to resulting window
6778
6779inline TWidget *open_funcs_window(ea_t ea)
6780{
6781 return (TWidget *) callui(ui_open_builtin, BWN_FUNCS, ea).vptr;
6782}
6783
6784
6787/// \param selstart,selend only display strings that occur within this range
6788/// \return pointer to resulting window
6789
6790inline TWidget *open_strings_window(ea_t ea, ea_t selstart=BADADDR, ea_t selend=BADADDR)
6791{
6792 return (TWidget *) callui(ui_open_builtin, BWN_STRINGS, ea, selstart, selend).vptr;
6793}
6794
6795
6798/// \return pointer to resulting window
6799
6801{
6802 return (TWidget *) callui(ui_open_builtin, BWN_SEGS, ea).vptr;
6803}
6804
6805
6808/// \return pointer to resulting window
6809
6811{
6812 return (TWidget *) callui(ui_open_builtin, BWN_SEGREGS, ea).vptr;
6813}
6814
6815
6820{
6821 return (TWidget *) callui(ui_open_builtin, BWN_SELS, 0).vptr;
6822}
6823
6824
6829{
6830 return (TWidget *) callui(ui_open_builtin, BWN_SIGNS, 0).vptr;
6831}
6832
6833
6837inline TWidget *open_tils_window()
6838{
6839 return (TWidget *) callui(ui_open_builtin, BWN_TILS, 0).vptr;
6840}
6841
6842
6845/// \param cursor cursor to the type member
6846/// \return pointer to resulting window
6847
6848inline TWidget *open_loctypes_window(int ordinal, const tif_cursor_t *cursor=nullptr)
6849{
6850 return (TWidget *) callui(ui_open_builtin2, BWN_TITREE, ordinal, cursor).vptr;
6851}
6852
6856/// \return pointer to resulting window
6857
6858inline TWidget *open_til_view_window(tinfo_t *tif, const tif_cursor_t *cursor=nullptr)
6859{
6860 return (TWidget *) callui(ui_open_builtin2, BWN_TIL_VIEW, tif, cursor).vptr;
6861}
6862
6868{
6869 return (TWidget *) callui(ui_open_builtin, BWN_PROBS, ea).vptr;
6870}
6871
6872
6875/// \return pointer to resulting window
6876
6877inline TWidget *open_bpts_window(ea_t ea)
6878{
6879 return (TWidget *) callui(ui_open_builtin, BWN_BPTS, ea).vptr;
6880}
6881
6882
6887{
6888 return (TWidget *) callui(ui_open_builtin, BWN_THREADS, 0).vptr;
6889}
6890
6891
6896{
6897 return (TWidget *) callui(ui_open_builtin, BWN_MODULES, 0).vptr;
6898}
6899
6900
6904inline TWidget *open_trace_window()
6905{
6906 return (TWidget *) callui(ui_open_builtin, BWN_TRACE, 0).vptr;
6907}
6908
6909
6913inline TWidget *open_stack_window()
6914{
6915 return (TWidget *) callui(ui_open_builtin, BWN_CALL_STACK, 0).vptr;
6916}
6917
6918
6921/// \return pointer to resulting window
6922
6923inline TWidget *open_xrefs_window(ea_t ea)
6924{
6925 return (TWidget *) callui(ui_open_builtin, BWN_XREFS, ea).vptr;
6926}
6927
6928
6931/// \param offset offset where the cursor is placed
6932/// \return pointer to resulting window if 'func_ea' is a valid function and the window was displayed, \n
6933/// nullptr otherwise
6934
6935inline TWidget *open_frame_window_ea(ea_t func_ea, uval_t offset)
6936{
6937 return (TWidget *) callui(ui_open_builtin2, BWN_FRAME, func_ea, offset).vptr;
6938}
6939
6940
6943/// \param pfn function to analyze
6944/// \param offset offset where the cursor is placed
6945/// \return pointer to resulting window if 'pfn' is a valid function and the window was displayed, \n
6946/// nullptr otherwise
6947
6948DEPRECATED inline TWidget *open_frame_window(func_t *pfn, uval_t offset)
6949{
6950 return (TWidget *) callui(ui_open_builtin, BWN_FRAME, pfn, offset).vptr;
6951}
6952
6953
6956/// \param zoom sets the navband zoom level
6957/// \return pointer to resulting window
6958
6959inline TWidget *open_navband_window(ea_t ea, int zoom)
6960{
6961 return (TWidget *) callui(ui_open_builtin, BWN_NAVBAND, ea, zoom).vptr;
6962}
6963
6964
6967/// \param ranges if != nullptr, then display a flow chart with the specified ranges
6968/// \return pointer to resulting window
6969
6970inline TWidget *open_disasm_window(const char *window_title, const rangevec_t *ranges=nullptr)
6971{
6972 return (TWidget *) callui(ui_open_builtin, BWN_DISASM, window_title, BADADDR, ranges, 0).vptr;
6973}
6974
6975
6978/// \return pointer to resulting window
6979
6980inline TWidget *open_hexdump_window(const char *window_title)
6981{
6982 return (TWidget *) callui(ui_open_builtin, BWN_HEXVIEW, window_title, BADADDR, 0).vptr;
6983}
6984
6985
6990{
6991 return (TWidget *) callui(ui_open_builtin, BWN_NOTEPAD, 0).vptr;
6992}
6993
6994
6997/// this can be an IDAView, or Enums view, etc.
6998/// \return pointer to resulting window
6999
7001{
7002 return (TWidget *) callui(ui_open_builtin, BWN_BOOKMARKS, w, 0).vptr;
7003}
7004
7006
7008/// \param what
7009/// \param with
7010/// \param sync
7011/// \return success
7012inline bool sync_sources(
7013 const sync_source_t &what,
7014 const sync_source_t &with,
7015 bool sync)
7016{
7017 return callui(ui_sync_sources, &what, &with, sync).cnd;
7018}
7019
7024
7025
7027
7028
7029inline char *choose_idasgn()
7030{
7031 return callui(ui_choose, chtype_idasgn).cptr;
7032}
7033
7034
7037/// \retval true 'buf' was filled with the name of the selected til
7038/// \retval false otherwise
7039
7040inline bool choose_til(qstring *buf)
7041{
7042 return callui(ui_choose, chtype_idatil, buf).cnd;
7043}
7044
7045
7048/// \return ea of selected entry point, #BADADDR if none selected
7049
7050inline ea_t choose_entry(const char *title)
7051{
7052 ea_t ea;
7053 callui(ui_choose, chtype_entry, &ea, title);
7054 return ea;
7055}
7056
7057
7058/// Choose a name (::ui_choose, ::chtype_name).
7059/// \param title chooser title
7060/// \return ea of selected name, #BADADDR if none selected
7061
7062inline ea_t choose_name(const char *title)
7063{
7064 ea_t ea;
7065 callui(ui_choose, chtype_name, &ea, title);
7066 return ea;
7067}
7068
7069
7070/// Choose an xref to a stack variable (::ui_choose, ::chtype_stkvar_xref_ea).
7071/// \param func_ea function start address
7072/// \param stkvar_tid frame variable TID
7073/// \return ea of the selected xref, BADADDR if none selected
7074
7075inline ea_t choose_stkvar_xref_ea(ea_t func_ea, tid_t stkvar_tid)
7076{
7077 ea_t ea;
7078 callui(ui_choose, chtype_stkvar_xref_ea, &ea, func_ea, stkvar_tid);
7079 return ea;
7080}
7081
7082
7083/// \deprecated Use choose_stkvar_xref_ea() for safer access.
7084/// Choose an xref to a stack variable (::ui_choose, ::chtype_stkvar_xref).
7085/// \param pfn function
7086/// \param srkvar_tid frame variable TID
7087/// \return ea of the selected xref, BADADDR if none selected
7088
7089DEPRECATED inline ea_t choose_stkvar_xref(func_t *pfn, tid_t srkvar_tid)
7090{
7091 ea_t ea;
7092 callui(ui_choose, chtype_stkvar_xref, &ea, pfn, srkvar_tid);
7093 return ea;
7094}
7095
7096
7097/// Choose an xref to an address (::ui_choose, ::chtype_xref).
7098/// \param to referenced address
7099/// \return ea of selected xref, BADADDR if none selected
7100
7101inline ea_t choose_xref(ea_t to)
7102{
7103 ea_t ea;
7104 callui(ui_choose, chtype_xref, &ea, to);
7105 return ea;
7106}
7107
7108
7109/// Choose an enum (::ui_choose, ::chtype_enum).
7110/// \param[out] out the selected enum type
7111/// \param title chooser title
7112/// \param default_ord ordinal of enum to select by default
7113/// \retval true the selected type is in OUT
7114/// \retval false nothing was selected
7115
7116inline bool choose_enum(tinfo_t *out, const char *title, uint32 default_ord)
7117{
7118 return callui(ui_choose, chtype_enum, out, title, default_ord).cnd;
7119}
7120
7121
7124/// ask if the user would like to import a standard enum.
7125/// \param[out] out the selected enum type
7126/// \param title chooser title
7127/// \param default_ord ordinal of enum to select by default
7128/// \param value value to search for
7129/// \param nbytes size of value
7130/// \param[out] serial serial number of imported enum member, if one was found
7131/// \retval true the selected type is in OUT
7132/// \retval false nothing was selected
7133
7134inline bool choose_enum_by_value(
7135 tinfo_t *out,
7136 const char *title,
7137 uint32 default_ord,
7138 uint64 value,
7139 int nbytes,
7140 uchar *serial)
7141{
7142 return callui(ui_choose, chtype_enum_by_value_and_size, out, default_ord, title, value, nbytes, serial).cnd;
7143}
7144
7149
7150inline ea_t choose_func_ea(const char *title, ea_t default_ea)
7151{
7152 return callui(ui_choose, chtype_func_ea, title, default_ea).ea;
7153}
7154
7155
7158/// \param title chooser title
7159/// \param default_ea ea of function to select by default
7160/// \return pointer to function that was selected, nullptr if none selected
7161
7162inline func_t *choose_func(const char *title, ea_t default_ea)
7163{
7164 return callui(ui_choose, chtype_func, title, default_ea).fptr;
7165}
7166
7167
7170/// \param title chooser title
7171/// \param default_ea ea of segment to select by default
7172/// \return pointer to segment that was selected, nullptr if none selected
7173
7174inline segment_t *choose_segm(const char *title, ea_t default_ea)
7175{
7176 return callui(ui_choose, chtype_segm, title, default_ea).segptr;
7177}
7178
7179
7182/// \param default_ea ea of segment to select by default
7183/// \return pointer to segment that was selected, nullptr if none selected
7184
7185inline ea_t choose_segment(const char *title, ea_t default_ea)
7186{
7187 return callui(ui_choose, chtype_segment, title, default_ea).ea;
7188}
7189
7190
7193/// \param[in] title chooser title
7194/// \retval true the selected type is in OUT
7195/// \retval false nothing was selected
7196
7197inline bool choose_struct(tinfo_t *out, const char *title)
7198{
7199 return callui(ui_choose, chtype_struct, out, title).cnd;
7200}
7201
7202
7205/// \return pointer to segment register range of selected change point, nullptr if none selected
7206
7207inline sreg_range_t *choose_srcp(const char *title)
7208{
7209 return callui(ui_choose, chtype_srcp, title).sraptr;
7210}
7211
7213
7214#ifndef SWIG
7217
7218inline int choose_struc_path(
7219 const char *title,
7220 tid_t strid,
7221 uval_t offset,
7222 adiff_t delta,
7223 bool appzero,
7224 tid_t *path)
7225{
7226 return callui(ui_choose, chtype_strpath, title, strid,
7227 offset, delta, appzero, path).i;
7228}
7229
7230
7231
7232
7235
7236//lint -sem(choose,custodial(1))
7237inline ssize_t choose(chooser_base_t *ch, const void *def_item)
7238{
7239 return callui(ui_choose, chtype_generic, ch, def_item).ssize;
7240}
7241
7242#endif // SWIG
7243
7244
7245/// Get the underlying object of the specified chooser (::ui_get_chooser_obj).
7246///
7247/// This attempts to find the chooser by its title and, if found, returns
7248/// the result of calling its chooser_base_t::get_chooser_obj() method.
7249///
7250/// \note This is object is chooser-specific.
7251/// \return the object that was used to create the chooser
7252
7253inline void *get_chooser_obj(const char *chooser_caption)
7254{
7255 return callui(ui_get_chooser_obj, chooser_caption).vptr;
7256}
7257
7261/// See also get_chooser_rows().
7262
7263inline bool get_chooser_data(
7264 qstrvec_t *out,
7265 const char *chooser_caption,
7266 int n)
7267{
7268 return callui(ui_get_chooser_data, out, chooser_caption, n).cnd;
7269}
7270
7271/// Get the chooser contents corresponding to the rows indicated by "what".
7272/// \param out A vector of chooser_row_info_t, one entry per returned row.
7273/// \param chooser_caption The caption that identifies the desired chooser.
7274/// \param what Either one of the GCRF_ flags, or a row index.
7275/// \return Success.
7276
7277inline bool get_chooser_rows(
7279 const char *chooser_caption,
7280 size_t what)
7281{
7282 return callui(ui_get_chooser_rows, out, chooser_caption, what).cnd;
7283}
7284
7292
7293
7294inline bool idaapi enable_chooser_item_attrs(const char *chooser_caption, bool enable)
7295{
7296 return callui(ui_enable_chooser_item_attrs, chooser_caption, enable).cnd;
7297}
7298
7299
7301
7302THREAD_SAFE AS_PRINTF(1, 0) inline void show_wait_box_v(const char *format, va_list va)
7303{
7305}
7306
7307
7331THREAD_SAFE AS_PRINTF(1, 2) inline void show_wait_box(const char *format, ...)
7332{
7333 va_list va;
7334 va_start(va, format);
7336 va_end(va);
7337}
7338
7339
7341
7342THREAD_SAFE inline void hide_wait_box()
7344 // stupid watcom requires va_list should not be nullptr
7345 callui(ui_mbox, mbox_hide, nullptr, &callui);
7346}
7347
7348
7351THREAD_SAFE AS_PRINTF(1, 2) inline void replace_wait_box(const char *format, ...)
7352{
7353 va_list va;
7354 va_start(va, format);
7356 va_end(va);
7357}
7358
7359
7362
7363inline void beep(beep_t beep_type=beep_default)
7364{
7365 callui(ui_beep, beep_type);
7366}
7367
7368
7372inline bool display_copyright_warning()
7373{
7374 return callui(ui_copywarn).cnd;
7375}
7376
7377#endif // __UI__ END OF UI SERVICE FUNCTIONS
7378
7379
7380/// Show a message box asking to send the input file to support@hex-rays.com.
7381/// \param format the reason why the input file is bad
7382
7383THREAD_SAFE AS_PRINTF(1, 2) inline void ask_for_feedback(const char *format, ...)
7384{
7385 va_list va;
7386 va_start(va, format);
7388 va_end(va);
7389}
7390
7391
7397
7398AS_PRINTF(2, 3) inline bool ask_addr(ea_t *addr, const char *format, ...)
7399{
7400 va_list va;
7401 va_start(va, format);
7402 bool ok = callui(ui_ask_addr, addr, format, va).cnd;
7403 va_end(va);
7404 return ok;
7405}
7407
7415
7416AS_PRINTF(2, 3) inline bool ask_seg(sel_t *sel, const char *format, ...)
7417{
7418 va_list va;
7419 va_start(va, format);
7420 bool ok = callui(ui_ask_seg, sel, format, va).cnd;
7421 va_end(va);
7422 return ok;
7423}
7424
7425
7434
7435AS_PRINTF(2, 3) inline bool ask_long(sval_t *value, const char *format, ...)
7436{
7437 va_list va;
7438 va_start(va, format);
7439 bool ok = callui(ui_ask_long, value, format, va).cnd;
7440 va_end(va);
7441 return ok;
7442}
7443
7444
7445//---------------------------------------------------------------------------
7446// 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
7447//---------------------------------------------------------------------------
7448
7454
7455idaman bool ida_export_data batch;
7456
7457
7460
7461idaman int ida_export_data errorexit;
7462
7470THREAD_SAFE AS_PRINTF(1, 2) NORETURN inline void error(const char *format, ...)
7471{
7472 va_list va;
7473 va_start(va, format);
7474 verror(format, va);
7475 // NOTREACHED
7476}
7477
7478
7487
7488THREAD_SAFE AS_PRINTF(1, 0) inline ssize_t vwarning(const char *format, va_list va)
7489{
7490 return callui(ui_mbox, mbox_warning, format, va).ssize;
7491}
7492
7493THREAD_SAFE AS_PRINTF(1, 2) inline ssize_t warning(const char *format, ...)
7494{
7495 va_list va;
7496 va_start(va, format);
7497 ssize_t rc = vwarning(format, va);
7498 va_end(va);
7499 return rc;
7500}
7501
7502
7511
7512THREAD_SAFE AS_PRINTF(1, 0) inline ssize_t vinfo(const char *format, va_list va)
7513{
7514 return callui(ui_mbox, mbox_info, format, va).ssize;
7515}
7516
7517THREAD_SAFE AS_PRINTF(1, 2) inline ssize_t info(const char *format, ...)
7518{
7519 va_list va;
7520 va_start(va, format);
7521 ssize_t rc = vinfo(format, va);
7522 va_end(va);
7523 return rc;
7524}
7525
7526
7530
7531THREAD_SAFE AS_PRINTF(1, 0) NORETURN inline void vnomem(const char *format, va_list va)
7532{
7534 // NOTREACHED
7535 abort(); // to suppress compiler warning or error
7536}
7537
7538THREAD_SAFE AS_PRINTF(1, 2) NORETURN inline void nomem(const char *format, ...)
7539{
7540 va_list va;
7541 va_start(va, format);
7542 vnomem(format, va);
7543 // NOTREACHED
7544}
7545
7546
7556
7557THREAD_SAFE AS_PRINTF(1, 0) inline int vmsg(const char *format, va_list va)
7558{
7559 return callui(ui_msg, format, va).i;
7560}
7561
7562THREAD_SAFE AS_PRINTF(1, 2) inline int msg(const char *format, ...)
7563{
7564 va_list va;
7565 va_start(va, format);
7566 int nbytes = vmsg(format, va);
7567 va_end(va);
7568 return nbytes;
7569}
7570
7600
7601inline bool open_ida_link(const char *uri) { return callui(ui_open_ida_link, uri).cnd; }
7602
7603#ifndef SWIG
7604
7890//----------------------------------------------------------------------
7891// F O R M S - C O M P L E X D I A L O G B O X E S
7892//----------------------------------------------------------------------
7893
7895
7896inline int vask_form(const char *format, va_list va)
7897{
7898 return callui(ui_ask_form, format, va).i;
7899}
7900
7904/// \param form dialog box as a string. see \ref FORM_C
7905/// \retval 0 no memory to display or form syntax error
7906/// (a warning is displayed in this case).
7907/// the user pressed the 'No' button (if the form has it) or
7908/// the user cancelled the dialog otherwise.
7909/// all variables retain their original values.
7910/// \retval 1 ok, all input fields are filled and validated.
7911/// \retval -1 the form has the 'No' button and the user cancelled the dialog
7912
7913inline int ask_form(const char *form, ...)
7914{
7915 va_list va;
7916 va_start(va, form);
7917 int code = vask_form(form, va);
7918 va_end(va);
7919 return code;
7920}
7922
7928
7929inline TWidget *vopen_form(const char *format, uint32 flags, va_list va)
7930{
7931 return (TWidget *)callui(ui_open_form, format, flags, va).vptr;
7932}
7933
7934
7937/// - by pressing the small 'x' in the window title
7938/// - by calling form_actions_t::close() from the form callback
7939/// (\ref form_actions_t)
7940///
7941/// \note pressing the 'Yes/No/Cancel' buttons does not close the modeless
7942/// form, except if the form callback explicitly calls close().
7943/// \param form dialog box as a string. see \ref FORM_C
7944/// \param flags \ref WIDGET_OPEN
7945/// \return handle to the form or nullptr.
7946/// the handle can be used with TWidget functions: close_widget()/activate_widget()/etc
7947
7948inline TWidget *open_form(const char *form, uint32 flags, ...)
7949{
7950 va_list va;
7951 va_start(va, flags);
7952 TWidget *widget = vopen_form(form, flags, va);
7953 va_end(va);
7954 return widget;
7955}
7958
7959
7962struct form_actions_t
7963{
7964
7966 virtual bool idaapi _get_field_value(int field_id, void *buf) = 0;
7967
7970 virtual bool idaapi _set_field_value(int field_id, const void *buf) = 0;
7971
7974 virtual bool idaapi enable_field(int field_id, bool enable) = 0;
7975
7978 virtual bool idaapi show_field(int field_id, bool display) = 0;
7979
7983 virtual bool idaapi move_field(int field_id, int x, int y, int w, int h) = 0;
7984
7987 virtual int idaapi get_focused_field() = 0;
7988
7991 virtual bool idaapi set_focused_field(int field_id) = 0;
7992
7994 virtual void idaapi refresh_field(int field_id) = 0;
7997 virtual void idaapi close(int close_normally) = 0;
7998
8000 virtual void *idaapi get_ud() = 0;
8001
8004 virtual bool idaapi _get_str_field_value(int field_id, char *buf, const size_t bufsize) = 0;
8008#define DEF_SET_METHOD(NAME, TYPE) \
8009 bool idaapi set_ ## NAME ## _value(int field_id, const TYPE *val) \
8010 { \
8011 return _set_field_value(field_id, val); \
8014#define DEF_FIELD_METHOD(NAME, TYPE) \
8015 bool idaapi get_ ## NAME ## _value(int field_id, TYPE *val) \
8016 { \
8017 return _get_field_value(field_id, val); \
8018 } \
8019 DEF_SET_METHOD(NAME, TYPE)
8021#define DEF_STR_FIELD_METHOD(NAME ) \
8022 bool idaapi get_ ## NAME ## _value(int field_id, char *buf, const size_t bufsize) \
8023 { \
8024 return _get_str_field_value(field_id, buf, bufsize); \
8025 } \
8026 DEF_SET_METHOD(NAME, char)
8027
8028 // get/set value of radio button (r, R)
8029 DEF_FIELD_METHOD(radiobutton, ushort)
8030 // get/set value of radio button group
8031 DEF_FIELD_METHOD(rbgroup, ushort)
8032 // get/set value of check box (c, C)
8033 DEF_FIELD_METHOD(checkbox, ushort)
8034 // get/set value of check box group
8035 DEF_FIELD_METHOD(cbgroup, ushort)
8036 // get/set value of color control (K)
8038 // get/set embedded chooser selected items (E)
8039 DEF_FIELD_METHOD(chooser, sizevec_t)
8040 // get/set value of editable combo box (b when field 'width' >0)
8042 // get/set selected item of read-only combo box (b when field 'width' ==0)
8043 DEF_FIELD_METHOD(combobox, int)
8044 // get/set value of multiline text input control (t)
8046 // get/set text of buttons
8047 DEF_FIELD_METHOD(button, qstring)
8048 // get/set value of dynamic label (%)
8050 // get/set string value (X, F, f)
8051 DEF_STR_FIELD_METHOD(string)
8052 // get/set path value (F, f)
8054 // get/set string value (q, I, y, p)
8055 DEF_FIELD_METHOD(string, qstring)
8056 // get/set identifier value (I)
8058 // get/set value of segment (S)
8059 DEF_FIELD_METHOD(segment, sel_t)
8060 // get/set signed value (n, D, O, Y, H)
8061 DEF_FIELD_METHOD(signed, sval_t)
8062 // get/set unsigned value (N, M)
8063 DEF_FIELD_METHOD(unsigned, uval_t)
8064 // get/set value of default base (usually hex) number (l)
8066 // get/set value of default base (usually hex) number (L)
8068 // get/set address value ($)
8070 // get/set tabbed widget current tab
8071 DEF_FIELD_METHOD(current_tab, int)
8072
8073#undef DEF_FIELD_METHOD
8074#undef DEF_SET_METHOD
8075#undef DEF_STR_FIELD_METHOD
8076
8078 {
8079 dbt_yes,
8080 dbt_cancel,
8081 dbt_no
8082 };
8083
8084 // Enable or disable a standard dialog button (Yes, Cancel, None)
8085 virtual bool enable_dialog_button(dlgbtn_t btn, bool enabled) = 0;
8086
8087 // Get state of a standard button
8088 virtual bool is_dialog_button_enabled(dlgbtn_t btn) = 0;
8090 // Update the list of available options for a combobox (b)
8091 //
8092 // Note: the contents of the `qstrvec_t` that was passed to ask_form/open_form will be modified
8093 virtual void swap_combobox_choices(int fid, qstrvec_t &items) = 0;
8094
8100 virtual bool idaapi set_field_label(int fid, const qstring &text) = 0;
8102 // Update tab attribute
8103 enum tab_attr_t
8104 {
8105 ta_unknown = 0,
8106 ta_visible,
8107 ta_enabled,
8109 virtual bool idaapi set_tab_attribute(int fid, int tab, tab_attr_t attr, const void *in) = 0;
8110 virtual bool idaapi get_tab_attribute(void *out, int fid, int tab, tab_attr_t attr) = 0;
8111 inline bool set_tab_visible(int fid, int tab, bool visible)
8112 {
8113 return set_tab_attribute(fid, tab, ta_visible, &visible);
8115 inline bool is_tab_visible(bool *out, int fid, int tab)
8116 {
8117 return get_tab_attribute(out, fid, tab, ta_visible);
8119 inline bool set_tab_enabled(int fid, int tab, bool enabled)
8120 {
8121 return set_tab_attribute(fid, tab, ta_enabled, &enabled);
8122 }
8123 inline bool is_tab_enabled(bool *out, int fid, int tab)
8124 {
8125 return get_tab_attribute(out, fid, tab, ta_enabled);
8126 }
8128
8129
8131
8131/// The callback will be also called before displaying the form and as soon
8132/// as the user presses the 'Yes/No/Cancel' buttons or closes the window.
8133/// The callback will be called for both modal and modeless window.
8134/// \param field_id id of the modified field or a special field id \ref CB_
8135/// \param fa helper class with useful virtual functions
8136/// \retval 0 continue editing
8137/// \retval >0 form will be closed
8138/// \note the return value is used by IDA only for modal forms, and only for
8139/// the following special field ids: CB_CLOSE, CB_YES, CB_NO, CB_CANCEL
8140/// (for modeless forms CB_CLOSE is also used).
8141
8142typedef int idaapi formchgcb_t(int field_id, form_actions_t &fa);
8143
8144
8149
8150typedef int idaapi buttoncb_t(int button_code, form_actions_t &fa);
8151
8152
8153#endif // SWIG
8154
8155//---------------------------------------------------------------------------
8156// Y E S / N O D I A L O G B O X
8157//---------------------------------------------------------------------------
8162#define ASKBTN_YES 1
8163#define ASKBTN_NO 0
8164#define ASKBTN_CANCEL -1
8165#define ASKBTN_BTN1 1
8166#define ASKBTN_BTN2 0
8167#define ASKBTN_BTN3 -1
8169
8170
8171THREAD_SAFE AS_PRINTF(5, 0) inline int vask_buttons(
8172 const char *Yes,
8173 const char *No,
8174 const char *Cancel,
8175 int deflt,
8176 const char *format,
8177 va_list va)
8178{
8180}
8183AS_PRINTF(2, 0) inline int vask_yn(int deflt, const char *format, va_list va)
8184{
8185 return vask_buttons(nullptr, nullptr, nullptr, deflt, format, va);
8186}
8187
8188
8193
8194AS_PRINTF(2, 3) inline int ask_yn(int deflt, const char *format, ...)
8195{
8196 va_list va;
8197 va_start(va, format);
8198 int code = vask_yn(deflt, format, va);
8199 va_end(va);
8200 return code;
8201}
8202
8203
8217
8218AS_PRINTF(5, 6) inline int ask_buttons(
8219 const char *Yes,
8220 const char *No,
8221 const char *Cancel,
8222 int deflt,
8223 const char *format,
8224 ...)
8225{
8226 va_list va;
8227 va_start(va, format);
8228 int code = vask_buttons(Yes, No, Cancel, deflt, format, va);
8229 va_end(va);
8230 return code;
8231}
8232
8233//------------------------------------------------------------------------
8234/* Format of dialog box (actually they are multiline strings
8235 delimited by newline characters)
8236
8237 The very first line of dialog box can specify a dialog box
8238 title if the following line appears:
8239
8240 TITLE title string
8241
8242
8243 Then, the next line may contain an icon to display
8244 in the GUI version (ignored by the text version):
8245
8246 ICON NONE (no icon)
8247 INFO (information icon)
8248 QUESTION (question icon)
8249 WARNING (warning icon)
8250 ERROR (error icon)
8251
8252
8253 Then, the next line may contain a 'Don't display this message again'
8254 checkbox. If this checkbox is selected and the user didn't select cancel,
8255 the button he selected is saved and automatically returned.
8256
8257 AUTOHIDE NONE (no checkbox)
8258 DATABASE (return value is saved to database)
8259 REGISTRY (return value is saved to Windows registry or idareg.cfg
8260 if non-Windows version)
8261 SESSION (return value is saved for the current IDA session)
8262 It is possible to append "*" to the AUTOHIDE keywords to have this checkbox
8263 initially checked. For example: "AUTOHIDE REGISTRY*"
8264
8265 To hide the cancel button the following keyword can be used:
8266
8267 HIDECANCEL
8268
8269 To hide the No button (e.g., when only Yes/Cancel semantics are wanted),
8270 the following keyword can be used:
8271
8272 HIDENO
8273
8274 To enable rich text (i.e., HTML) in the Qt version of IDA,
8275 the following keyword can be used:
8276
8277 RICHTEXT
8278
8279 Please note that the user still can cancel the dialog box by pressing Esc
8280 or clicking on the 'close window' button.
8281
8282 Finally, if the dialog box is kept in IDA.HLP, the following may appear
8283 to add a Help button (this defines help context for the whole dialog box):
8284
8285 @hlpMessageName[]
8286
8287
8288 Each keyword should be alone on a line.
8289
8290 Next, a format string must be specified.
8291 To center message lines in the text version, start them with '\3' character
8292 (currently ignored in the GUI version).
8293*/
8294
8295//---------------------------------------------------------------------------
8296// A S K S T R I N G O F T E X T
8297//---------------------------------------------------------------------------
8298
8310
8311AS_PRINTF(3, 0) inline bool vask_str(
8312 qstring *str,
8313 int hist,
8314 const char *format,
8315 va_list va)
8316{
8317 return callui(ui_ask_str, str, hist, format, va).cnd;
8318}
8319
8320AS_PRINTF(3, 4) inline bool ask_str(qstring *str, int hist, const char *format, ...)
8322 va_list va;
8323 va_start(va, format);
8324 bool result = vask_str(str, hist, format, va);
8325 va_end(va);
8326 return result;
8327}
8328
8332#define HIST_SEG 1
8333#define HIST_CMT 2
8334#define HIST_SRCH 3
8335#define HIST_IDENT 4
8336#define HIST_FILE 5
8337#define HIST_TYPE 6
8338#define HIST_CMD 7
8339#define HIST_DIR 8
8340#define HIST_IDENT2 9
8342
8343
8350
8351AS_PRINTF(2, 3) inline bool ask_ident(qstring *str, const char *format, ...)
8352{
8353 va_list va;
8354 va_start(va, format);
8355 bool result = vask_str(str, HIST_IDENT, format, va);
8356 va_end(va);
8357 return result;
8358}
8359
8366
8367AS_PRINTF(2, 3) inline bool ask_ident2(qstring *str, const char *format, ...)
8368{
8369 va_list va;
8370 va_start(va, format);
8371 bool result = vask_str(str, HIST_IDENT2, format, va);
8372 va_end(va);
8373 return result;
8374}
8375
8376
8377
8389
8390AS_PRINTF(4, 0) inline bool vask_text(
8391 qstring *answer,
8392 size_t max_size,
8393 const char *defval,
8394 const char *format,
8395 va_list va)
8396{
8397 return callui(ui_ask_text, answer, max_size, defval, format, va).cnd;
8398}
8399
8400AS_PRINTF(4, 5) inline bool ask_text(
8402 size_t max_size,
8403 const char *defval,
8404 const char *format,
8405 ...)
8406{
8407 va_list va;
8408 va_start(va, format);
8409 bool result = vask_text(answer, max_size, defval, format, va);
8410 va_end(va);
8411 return result;
8412}
8413
8414
8415//---------------------------------------------------------------------------
8416// 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.
8417//---------------------------------------------------------------------------
8418
8438
8439AS_PRINTF(3, 0) inline char *vask_file(
8440 bool for_saving,
8441 const char *defval,
8442 const char *format,
8443 va_list va)
8444{
8445 return callui(ui_ask_file, for_saving, defval, format, va).cptr;
8446}
8447
8448
8449AS_PRINTF(3, 4) inline char *ask_file(
8450 bool for_saving,
8451 const char *defval,
8452 const char *format,
8453 ...)
8454{
8455 va_list va;
8456 va_start(va, format);
8457 char *answer = vask_file(for_saving, defval, format, va);
8458 va_end(va);
8459 return answer;
8460}
8461
8462
8463//---------------------------------------------------------------------------
8464// A D D - O N S
8465//---------------------------------------------------------------------------
8466
8468struct addon_info_t
8469{
8470 size_t cb; //< size of this structure
8471 const char *id; //< product code, e.g. "com.hexrays.hexx86w". Must be unique
8472 const char *name; //< descriptive name, e.g. "Hex-Rays x86 Decompiler (Windows)"
8473 const char *producer; //< e.g. "Hex-Rays SA"
8474 const char *version; //< version string, e.g. 1.5.110408
8475 const char *url; //< URL of the product http://www.hex-rays.com/decompiler.shtml
8476 const char *freeform; //< any string, e.g. "Copyright (c) 2007-2026 Hex-Rays"
8477 const void *custom_data; //< custom data (license ID etc). Can be nullptr. Not displayed in UI.
8482 : cb(sizeof(addon_info_t)),
8483 id(nullptr),
8484 name(nullptr),
8485 producer(nullptr),
8486 version(nullptr),
8487 url(nullptr),
8488 freeform(nullptr),
8489 custom_data(nullptr),
8490 custom_size(0)
8491 {}
8492};
8493
8494#ifndef __UI__
8495
8499
8500
8501
8504
8505inline int register_addon(const addon_info_t *info)
8506{
8507 return callui(ui_addons, 0, info).i;
8508}
8509
8510
8512
8513inline int addon_count()
8514{
8515 return callui(ui_addons, 1).i;
8516}
8517
8518
8521/// NB: all pointers are invalidated by next call to register_addon or get_addon_info
8522/// \return false if not found
8523
8524inline bool get_addon_info(const char *id, addon_info_t *info)
8525{
8526 return callui(ui_addons, 2, id, info).cnd;
8527}
8528
8529
8532/// NB: all pointers are invalidated by next call to register_addon or get_addon_info
8533/// \return false if index is out of range
8534
8535inline bool get_addon_info_idx(int index, addon_info_t *info)
8536{
8537 return callui(ui_addons, 3, index, info).cnd;
8538}
8539
8541
8542#endif
8544//---------------------------------------------------------------------------
8545// S T R I N G F U N C T I O N S
8546//---------------------------------------------------------------------------
8547
8550
8557
8558idaman THREAD_SAFE char *ida_export add_spaces(char *str, size_t bufsize, ssize_t len);
8559
8560
8564
8565idaman THREAD_SAFE char *ida_export trim(char *str);
8567
8570
8571idaman THREAD_SAFE const char *ida_export skip_spaces(const char *ptr);
8572inline char *skip_spaces(char *ptr)
8573 { return CONST_CAST(char*)(skip_spaces((const char *)ptr)); }
8574
8576struct strarray_t
8577{
8578 int code;
8579 const char *text;
8581
8582
8584/// Passed as 'flags' parameter to qcleanline()
8585///@{
8586#define CLNL_RTRIM (1 << 0)
8587#define CLNL_LTRIM (1 << 1)
8588#define CLNL_FINDCMT (1 << 2)
8589
8590#define CLNL_TRIM (CLNL_RTRIM|CLNL_LTRIM)
8592
8603
8604idaman THREAD_SAFE ssize_t ida_export qcleanline(
8605 qstring *buf,
8606 char cmt_char='\0',
8607 uint32 flags=CLNL_TRIM|CLNL_FINDCMT);
8608
8609
8613
8614idaman THREAD_SAFE const char *ida_export strarray(const strarray_t *array, size_t array_size, int code);
8615
8616
8618
8619idaman size_t ida_export ea2str(char *buf, size_t bufsize, ea_t ea);
8620
8621//---------------------------------------------------------------------------
8622// C O N V E R S I O N S
8623//---------------------------------------------------------------------------
8629inline bool ea2str(qstring *out, ea_t ea)
8630{
8631 char tmp[MAXSTR];
8632 if ( ea2str(tmp, sizeof(tmp), ea) <= 0 )
8633 return false;
8634 *out = tmp;
8635 return true;
8636}
8638
8645
8654
8655idaman bool ida_export str2ea(ea_t *out, const char *str, ea_t screen_ea=BADADDR);
8656
8657
8664
8665idaman bool ida_export str2ea_ex(ea_t *out, const char *str, ea_t screen_ea=BADADDR, int flags=0);
8666
8670#define S2EAOPT_NOCALC 0x00000001
8672
8680
8681idaman bool ida_export atoea(ea_t *out, const char *str);
8682
8683#ifndef SWIG
8684
8686
8687idaman size_t ida_export stoa(qstring *out, ea_t from, sel_t seg);
8688
8693
8694idaman int ida_export atos(sel_t *seg, const char *str);
8696
8697#define MAX_NUMBUF (128+8)
8698
8699
8704
8705idaman size_t ida_export b2a_width(int nbytes, int radix);
8706
8707
8715
8716idaman size_t ida_export b2a32(char *buf, size_t bufsize, uint32 x, int nbytes, int radix);
8717
8718
8720
8721idaman size_t ida_export b2a64(char *buf, size_t bufsize, uint64 x, int nbytes, int radix);
8722
8723
8730
8731idaman size_t ida_export btoa_width(int nbytes, flags64_t flag, int n);
8732
8733
8736
8737idaman size_t ida_export btoa32(char *buf, size_t bufsize, uint32 x, int radix=0);
8738
8741
8742idaman size_t ida_export btoa64(char *buf, size_t bufsize, uint64 x, int radix=0);
8743
8744
8746
8747idaman size_t ida_export btoa128(char *buf, size_t bufsize, uint128 x, int radix=0);
8748
8749#ifdef __EA64__
8750#define b2a b2a64
8751#define btoa btoa64
8752#define atob atob64
8753#else
8754#define b2a b2a32
8755#define btoa btoa32
8756#define atob atob32
8757#endif
8758
8759
8764
8765idaman size_t ida_export numop2str(
8766 char *buf,
8767 size_t bufsize,
8768 ea_t ea,
8769 int n,
8770 uint64 x,
8771 int nbytes,
8772 int radix=0);
8774
8778
8779idaman bool ida_export atob32(uint32 *x, const char *str);
8780
8781
8783
8784idaman bool ida_export atob64(uint64 *x, const char *str); // returns 1-ok
8785
8786
8795
8796idaman size_t ida_export pretty_print_size(char *buf, size_t bufsize, uint64 value);
8797
8803
8804idaman bool ida_export parse_pretty_size(uint64 *out, const char *in);
8805
8806
8813idaman void ida_export append_disp(qstring *buf, adiff_t disp, bool tag=true);
8814
8815
8825
8826idaman THREAD_SAFE int ida_export r50_to_asc(char *p, const ushort *r, int k);
8827
8828
8830
8831int THREAD_SAFE asc_to_r50(ushort *r, const char *p, int k);
8832
8833
8836
8837//----------------------------------------------------------------------------
8839#define IS_BUTTONCB_T(v) (std::is_same<decltype(v), buttoncb_t>::value)
8840#define IS_FORMCHGCB_T(v) (std::is_same<decltype(v), formchgcb_t>::value)
8841#define IS_TEXTCTRL_INFO_T(v) (std::is_base_of<textctrl_info_t, std::remove_reference<decltype(v)>::type>::value)
8842#define IS_CHOOSER_BASE_T(v) (std::is_base_of<chooser_base_t, std::remove_reference<decltype(v)>::type>::value)
8843
8845
8846#endif // SWIG
8847
8848//----------------------------------------------------------------------------
8854#define IK_CANCEL 0x03
8855#define IK_BACK 0x08
8856#define IK_TAB 0x09
8857#define IK_CLEAR 0x0C
8858#define IK_RETURN 0x0D
8859#define IK_SHIFT 0x10
8860#define IK_CONTROL 0x11
8861#define IK_MENU 0x12
8862#define IK_PAUSE 0x13
8863#define IK_CAPITAL 0x14
8864#define IK_KANA 0x15
8865#define IK_ESCAPE 0x1B
8866#define IK_MODECHANGE 0x1F
8867#define IK_SPACE 0x20
8868#define IK_PRIOR 0x21
8869#define IK_NEXT 0x22
8870#define IK_END 0x23
8871#define IK_HOME 0x24
8872#define IK_LEFT 0x25
8873#define IK_UP 0x26
8874#define IK_RIGHT 0x27
8875#define IK_DOWN 0x28
8876#define IK_SELECT 0x29
8877#define IK_PRINT 0x2A
8878#define IK_EXECUTE 0x2B
8879#define IK_SNAPSHOT 0x2C
8880#define IK_INSERT 0x2D
8881#define IK_DELETE 0x2E
8882#define IK_HELP 0x2F
8883#define IK_LWIN 0x5B
8884#define IK_RWIN 0x5C
8885#define IK_APPS 0x5D
8886#define IK_SLEEP 0x5F
8887#define IK_NUMPAD0 0x60
8888#define IK_NUMPAD1 0x61
8889#define IK_NUMPAD2 0x62
8890#define IK_NUMPAD3 0x63
8891#define IK_NUMPAD4 0x64
8892#define IK_NUMPAD5 0x65
8893#define IK_NUMPAD6 0x66
8894#define IK_NUMPAD7 0x67
8895#define IK_NUMPAD8 0x68
8896#define IK_NUMPAD9 0x69
8897#define IK_MULTIPLY 0x6A
8898#define IK_ADD 0x6B
8899#define IK_SEPARATOR 0x6C
8900#define IK_SUBTRACT 0x6D
8901#define IK_DECIMAL 0x6E
8902#define IK_DIVIDE 0x6F
8903#define IK_F1 0x70
8904#define IK_F2 0x71
8905#define IK_F3 0x72
8906#define IK_F4 0x73
8907#define IK_F5 0x74
8908#define IK_F6 0x75
8909#define IK_F7 0x76
8910#define IK_F8 0x77
8911#define IK_F9 0x78
8912#define IK_F10 0x79
8913#define IK_F11 0x7A
8914#define IK_F12 0x7B
8915#define IK_F13 0x7C
8916#define IK_F14 0x7D
8917#define IK_F15 0x7E
8918#define IK_F16 0x7F
8919#define IK_F17 0x80
8920#define IK_F18 0x81
8921#define IK_F19 0x82
8922#define IK_F20 0x83
8923#define IK_F21 0x84
8924#define IK_F22 0x85
8925#define IK_F23 0x86
8926#define IK_F24 0x87
8927#define IK_NUMLOCK 0x90
8928#define IK_SCROLL 0x91
8929#define IK_OEM_FJ_MASSHOU 0x93
8930#define IK_OEM_FJ_TOUROKU 0x94
8931#define IK_LSHIFT 0xA0
8932#define IK_RSHIFT 0xA1
8933#define IK_LCONTROL 0xA2
8934#define IK_RCONTROL 0xA3
8935#define IK_LMENU 0xA4
8936#define IK_RMENU 0xA5
8937#define IK_BROWSER_BACK 0xA6
8938#define IK_BROWSER_FORWARD 0xA7
8939#define IK_BROWSER_REFRESH 0xA8
8940#define IK_BROWSER_STOP 0xA9
8941#define IK_BROWSER_SEARCH 0xAA
8942#define IK_BROWSER_FAVORITES 0xAB
8943#define IK_BROWSER_HOME 0xAC
8944#define IK_VOLUME_MUTE 0xAD
8945#define IK_VOLUME_DOWN 0xAE
8946#define IK_VOLUME_UP 0xAF
8947#define IK_MEDIA_NEXT_TRACK 0xB0
8948#define IK_MEDIA_PREV_TRACK 0xB1
8949#define IK_MEDIA_STOP 0xB2
8950#define IK_MEDIA_PLAY_PAUSE 0xB3
8951#define IK_LAUNCH_MAIL 0xB4
8952#define IK_LAUNCH_MEDIA_SELECT 0xB5
8953#define IK_LAUNCH_APP1 0xB6
8954#define IK_LAUNCH_APP2 0xB7
8955#define IK_OEM_1 0xBA
8956#define IK_OEM_PLUS 0xBB
8957#define IK_OEM_COMMA 0xBC
8958#define IK_OEM_MINUS 0xBD
8959#define IK_OEM_PERIOD 0xBE
8960#define IK_OEM_2 0xBF
8961#define IK_OEM_3 0xC0
8962#define IK_OEM_4 0xDB
8963#define IK_OEM_5 0xDC
8964#define IK_OEM_6 0xDD
8965#define IK_OEM_7 0xDE
8966#define IK_OEM_102 0xE2
8967#define IK_PLAY 0xFA
8968#define IK_ZOOM 0xFB
8969#define IK_OEM_CLEAR 0xFE
8971
8974enum cb_id
8975{
8976 CB_INIT = -1,
8977 CB_YES = -2, // the user pressed 'Yes' button
8978 CB_CLOSE = -3, // the form is closed by the window manager
8979 // (usually by pressing the small 'x' at the title)
8980 CB_INVISIBLE = -4, // corresponds to ui_widget_invisible
8981 CB_DESTROYING = -5, // the actual widget tree is being destroyed
8982 CB_NO = -6, // the user pressed 'No' button
8983 CB_CANCEL = -7, // the user pressed 'Cancel' button or Esc
8987#ifndef SWIG
8988//-------------------------------------------------------------------------
8989inline void place_t__serialize(const place_t *_this, bytevec_t *out)
8991 out->pack_dd(_this->lnnum);
8992}
8993
8994//-------------------------------------------------------------------------
8995inline bool place_t__deserialize(place_t *_this, const uchar **pptr, const uchar *end)
8996{
8997 if ( *pptr >= end )
8998 return false;
8999 _this->lnnum = unpack_dd(pptr, end);
9000 return true;
9001}
9002#endif
9004#ifndef NO_OBSOLETE_FUNCS
9006#define ACTION_DESC_LITERAL(name, label, handler, shortcut, tooltip, icon)\
9007 { sizeof(action_desc_t), name, label, handler, &PLUGIN, shortcut, tooltip, icon, ADF_OT_PLUGIN }
9008
9009DEPRECATED inline void get_user_strlist_options(strwinsetup_t *out)
9010{
9012}
9013DEPRECATED inline bool del_idc_hotkey(const char *hotkey)
9014{
9015 return callui(ui_obsolete_del_idckey, hotkey).cnd;
9016}
9017DEPRECATED inline TWidget *open_calls_window(ea_t ea)
9018{
9019 return (TWidget *) callui(ui_open_builtin, BWN_RESERVED_1, ea).vptr;
9020}
9021DEPRECATED inline bool prompt_function_prototype(qstring *errbuf, tinfo_t *out_tif, func_t *pfn, tinfo_t *tif, const char *name)
9022{
9023 return callui(ui_obsolete_prompt_function_prototype, errbuf, out_tif, pfn, tif, name).cnd;
9024}
9025idaman DEPRECATED void ida_export ida_checkmem(const char *file, int line);
9026
9027idaman DEPRECATED void ida_export request_refresh(uint64 mask, bool cnd=true);
9028idaman DEPRECATED bool ida_export is_refresh_requested(uint64 mask);
9029# ifndef SWIG
9030idaman DEPRECATED uint64 ida_export get_dirty_infos();
9031# endif // SWIG
9032
9033#endif
9034
9035#endif // __KERNWIN_HPP
void qclear(void)
Clear qstring but do not free memory yet.
Definition pro.h:3243
size_t length(void) const
Get number of chars in this qstring (not including terminating zero)
Definition pro.h:3199
_qstring & append(qchar c)
Append c to the end of the qstring.
Definition pro.h:3569
const qchar * c_str(void) const
Convert the qstring to a char *.
Definition pro.h:3246
Vector of bytes (use for dynamic memory)
Definition pro.h:3850
void pack_dd(uint32 x)
Pack a dword and append the result to the bytevec.
Definition pro.h:3882
Definition kernwin.hpp:5035
custom_viewer_mouse_moved_t * mouse_moved
Definition kernwin.hpp:5072
custom_viewer_keydown_t * keyboard
Definition kernwin.hpp:5070
custom_viewer_click_t * click
Definition kernwin.hpp:5073
code_viewer_fold_state_t * fold_state
Definition kernwin.hpp:5083
custom_viewer_location_changed_t * location_changed
Definition kernwin.hpp:5080
custom_viewer_get_place_xcoord_t * get_place_xcoord
Definition kernwin.hpp:5079
custom_viewer_popup_t * popup
Definition kernwin.hpp:5071
custom_viewer_dblclick_t * dblclick
Definition kernwin.hpp:5074
custom_viewer_can_navigate_t * can_navigate
Definition kernwin.hpp:5081
custom_viewer_adjust_place_t * adjust_place
Definition kernwin.hpp:5078
custom_viewer_close_t * close
Definition kernwin.hpp:5076
custom_viewer_curpos_t * curpos
Definition kernwin.hpp:5075
obsolete_custom_viewer_help_t * obsolete_help
Definition kernwin.hpp:5077
custom_viewer_help_t * help
Definition kernwin.hpp:5082
code_viewer_fold_toggle_t * fold_toggle
Definition kernwin.hpp:5084
Directory tree.
Definition dirtree.hpp:315
Describes a function chunk (entry or tail).
Definition funcs.hpp:1535
Describes a function entry chunk.
Definition funcs.hpp:1597
A function is a set of continuous ranges of addresses with characteristics.
Definition funcs.hpp:106
Definition kernwin.hpp:1894
hexplace_t(ea_t _ea, int ln)
Definition kernwin.hpp:1898
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:1901
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:1914
ea_t sol
Definition kernwin.hpp:1896
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:4424
uchar reserved
Definition kernwin.hpp:4429
locchange_md_t(locchange_reason_t _reason, bool _sync)
Definition kernwin.hpp:4432
uchar r
Definition kernwin.hpp:4427
uchar f
Definition kernwin.hpp:4428
bool is_sync() const
Definition kernwin.hpp:4435
uchar cb
Definition kernwin.hpp:4426
Microinstruction class insn.
Definition hexrays.hpp:3702
Denotes a displayed line.
Definition kernwin.hpp:1451
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:1453
virtual int idaapi compare2(const place_t *t2, void *) const
Compare two locations except line numbers (lnnum).
Definition kernwin.hpp:1598
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:1568
virtual ea_t idaapi toea() const
Map the location to an ea_t.
Definition kernwin.hpp:1563
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:1581
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:1611
place_t()
Constructor.
Definition kernwin.hpp:1454
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:1585
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:1462
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:4115
Reimplementation of vector class from STL.
Definition pro.h:2262
void swap(qvector< T > &r) noexcept
Replace all attributes of this qvector with that of 'r', and vice versa.
Definition pro.h:2634
bool empty(void) const
Does the qvector have 0 elements?
Definition pro.h:2495
void push_back(T &&x)
Append a new element to the end the qvector with a move semantics.
Definition pro.h:2432
size_t size(void) const
Get the number of elements in the qvector.
Definition pro.h:2494
Describes a program segment.
Definition segment.hpp:408
A location in a view populated by a strvec_t.
Definition kernwin.hpp:1770
uint32 n
line number
Definition kernwin.hpp:1772
simpleline_place_t()
Constructor.
Definition kernwin.hpp:1773
define_place_virtual_functions(simpleline_place_t)
Snapshot attributes.
Definition loader.hpp:893
Definition kernwin.hpp:2084
bool is_widget() const
Definition kernwin.hpp:2117
bool is_register() const
Definition kernwin.hpp:2116
Primary mechanism for managing type information.
Definition typeinf.hpp:3077
Definition kernwin.hpp:1944
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:1946
tiplace_t()
Definition kernwin.hpp:1949
bool is_footer() const
Definition kernwin.hpp:1958
bool is_header() const
Definition kernwin.hpp:1957
bool is_index() const
Definition kernwin.hpp:1959
void reset()
Definition kernwin.hpp:1955
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:1947
define_place_virtual_functions(tiplace_t)
void set_header()
Definition kernwin.hpp:1961
bool valid_ord() const
Definition kernwin.hpp:1954
void set_footer()
Definition kernwin.hpp:1962
A line in a text window.
Definition kernwin.hpp:2221
color_t prefix_color
line prefix color
Definition kernwin.hpp:2225
twinline_t(place_t *t=nullptr, color_t pc=1, bgcolor_t bc=DEFCOLOR)
Definition kernwin.hpp:2228
bgcolor_t bg_color
line background color
Definition kernwin.hpp:2226
place_t * at
location in view
Definition kernwin.hpp:2223
A position in a text window.
Definition kernwin.hpp:2211
place_t * at
location in view
Definition kernwin.hpp:2213
Base class for defining UI requests.
Definition kernwin.hpp:4751
List of UI requests.
Definition kernwin.hpp:4765
Definition llong.hpp:68
cb_id
Definition kernwin.hpp:8983
@ CB_INIT
Definition kernwin.hpp:8984
@ CB_DESTROYING
Definition kernwin.hpp:8989
@ CB_NO
Definition kernwin.hpp:8990
@ CB_CANCEL
Definition kernwin.hpp:8991
@ CB_INVISIBLE
Definition kernwin.hpp:8988
@ CB_CLOSE
Definition kernwin.hpp:8986
@ CB_YES
Definition kernwin.hpp:8985
int vask_form(const char *format, va_list va)
See ask_form()
Definition kernwin.hpp:7904
int ask_form(const char *form,...)
Display a dialog box and wait for the user.
Definition kernwin.hpp:7921
TWidget * vopen_form(const char *format, uint32 flags, va_list va)
Create and/or activate dockable modeless form (ui_open_form).
Definition kernwin.hpp:7937
TWidget * open_form(const char *form, uint32 flags,...)
Display a dockable modeless dialog box and return a handle to it.
Definition kernwin.hpp:7956
static constexpr ssize_t EMPTY_CHOOSER
the chooser has no data and cannot be displayed
Definition kernwin.hpp:3432
static constexpr ssize_t ALREADY_EXISTS
the non-modal chooser with the same data is already open
Definition kernwin.hpp:3434
static constexpr ssize_t NO_ATTR
reserved for IDAPython
Definition kernwin.hpp:3437
static constexpr ssize_t NO_SELECTION
there is no selected item
Definition kernwin.hpp:3431
ssize_t choose(ssize_t deflt=0)
Display a generic list chooser and allow the user to select an item.
Definition kernwin.hpp:4039
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:7245
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:4046
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 zeros.
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:1004
int code
Definition fpro.h:88
idaman size_t n
Definition pro.h:1000
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:8543
int register_addon(const addon_info_t *info)
Register an add-on.
Definition kernwin.hpp:8513
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:8532
int addon_count()
Get number of installed addons.
Definition kernwin.hpp:8521
ea_t choose_segment(const char *title, ea_t default_ea)
Choose a segment (ui_choose, chtype_segment).
Definition kernwin.hpp:7193
func_t * choose_func(const char *title, ea_t default_ea)
Definition kernwin.hpp:7170
ea_t choose_name(const char *title)
Choose a name (ui_choose, chtype_name).
Definition kernwin.hpp:7070
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:7142
bool choose_struct(tinfo_t *out, const char *title)
Choose a structure (ui_choose, chtype_struct).
Definition kernwin.hpp:7205
DEPRECATED ea_t choose_stkvar_xref(func_t *pfn, tid_t srkvar_tid)
Definition kernwin.hpp:7097
sreg_range_t * choose_srcp(const char *title)
Choose a segment register change point (ui_choose, chtype_srcp).
Definition kernwin.hpp:7215
bool choose_til(qstring *buf)
Choose a type library (ui_choose, chtype_idatil).
Definition kernwin.hpp:7048
char * choose_idasgn()
Choose a signature (ui_choose, chtype_idasgn).
Definition kernwin.hpp:7037
ea_t choose_xref(ea_t to)
Choose an xref to an address (ui_choose, chtype_xref).
Definition kernwin.hpp:7109
ea_t choose_stkvar_xref_ea(ea_t func_ea, tid_t stkvar_tid)
Choose an xref to a stack variable (ui_choose, chtype_stkvar_xref_ea).
Definition kernwin.hpp:7083
ea_t choose_entry(const char *title)
Choose an entry point (ui_choose, chtype_entry).
Definition kernwin.hpp:7058
segment_t * choose_segm(const char *title, ea_t default_ea)
Choose a segment (ui_choose, chtype_segm).
Definition kernwin.hpp:7182
bool choose_enum(tinfo_t *out, const char *title, uint32 default_ord)
Choose an enum (ui_choose, chtype_enum).
Definition kernwin.hpp:7124
ea_t choose_func_ea(const char *title, ea_t default_ea)
Choose a function (ui_choose, chtype_func_ea).
Definition kernwin.hpp:7158
TWidget * open_threads_window()
Open the threads window (ui_open_builtin).
Definition kernwin.hpp:6894
TWidget * open_imports_window(ea_t ea)
Open the exports window (ui_open_builtin).
Definition kernwin.hpp:6767
TWidget * open_segments_window(ea_t ea)
Open the segments window (ui_open_builtin).
Definition kernwin.hpp:6808
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:6798
TWidget * open_tils_window()
Open the type libraries window (ui_open_builtin).
Definition kernwin.hpp:6845
TWidget * open_hexdump_window(const char *window_title)
Open a hexdump view (ui_open_builtin).
Definition kernwin.hpp:6988
TWidget * open_exports_window(ea_t ea)
Open the exports window (ui_open_builtin).
Definition kernwin.hpp:6757
TWidget * open_problems_window(ea_t ea)
Open the problems window (ui_open_builtin).
Definition kernwin.hpp:6875
TWidget * open_xrefs_window(ea_t ea)
Open the cross references window (ui_open_builtin).
Definition kernwin.hpp:6931
TWidget * open_bpts_window(ea_t ea)
Open the breakpoints window (ui_open_builtin).
Definition kernwin.hpp:6885
TWidget * open_navband_window(ea_t ea, int zoom)
Open the navigation band window (ui_open_builtin).
Definition kernwin.hpp:6967
TWidget * open_names_window(ea_t ea)
Open the names window (ui_open_builtin).
Definition kernwin.hpp:6777
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:6866
DEPRECATED TWidget * open_frame_window(func_t *pfn, uval_t offset)
Definition kernwin.hpp:6956
TWidget * open_signatures_window()
Open the signatures window (ui_open_builtin).
Definition kernwin.hpp:6836
TWidget * open_funcs_window(ea_t ea)
Open the 'Functions' window (ui_open_builtin).
Definition kernwin.hpp:6787
TWidget * open_bookmarks_window(TWidget *w)
Open the bookmarks window (ui_open_builtin).
Definition kernwin.hpp:7008
TWidget * open_stack_window()
Open the call stack window (ui_open_builtin).
Definition kernwin.hpp:6921
TWidget * open_selectors_window()
Open the selectors window (ui_open_builtin).
Definition kernwin.hpp:6827
TWidget * open_notepad_window()
Open the notepad window (ui_open_builtin).
Definition kernwin.hpp:6997
TWidget * open_modules_window()
Open the modules window (ui_open_builtin).
Definition kernwin.hpp:6903
TWidget * open_loctypes_window(int ordinal, const tif_cursor_t *cursor=nullptr)
Open the local types window (ui_open_builtin2).
Definition kernwin.hpp:6856
TWidget * open_segregs_window(ea_t ea)
Open the segment registers window (ui_open_builtin).
Definition kernwin.hpp:6818
TWidget * open_trace_window()
Open the tracing window (ui_open_builtin).
Definition kernwin.hpp:6912
TWidget * open_disasm_window(const char *window_title, const rangevec_t *ranges=nullptr)
Open a disassembly view (ui_open_builtin).
Definition kernwin.hpp:6978
TWidget * open_frame_window_ea(ea_t func_ea, uval_t offset)
Open the frame window for the given function (ui_open_builtin2).
Definition kernwin.hpp:6943
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:6182
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:6170
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:6496
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:6508
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:6548
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:6556
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:6154
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:6572
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:6564
bool update_action_shortcut(const char *name, const char *shortcut)
Update an action's shortcut (ui_update_action_attr).
Definition kernwin.hpp:5981
bool update_action_icon(const char *name, int icon)
Update an action's icon (ui_update_action_attr).
Definition kernwin.hpp:6003
bool update_action_visibility(const char *name, bool visible)
Update an action's visibility (ui_update_action_attr).
Definition kernwin.hpp:6047
bool update_action_state(const char *name, action_state_t state)
Update an action's state (ui_update_action_attr).
Definition kernwin.hpp:6014
bool update_action_tooltip(const char *name, const char *tooltip)
Update an action's tooltip (ui_update_action_attr).
Definition kernwin.hpp:5992
bool update_action_checked(const char *name, bool checked)
Update an action's checked state (ui_update_action_attr).
Definition kernwin.hpp:6036
bool update_action_checkable(const char *name, bool checkable)
Update an action's checkability (ui_update_action_attr).
Definition kernwin.hpp:6025
bool update_action_label(const char *name, const char *label)
Update an action's label (ui_update_action_attr).
Definition kernwin.hpp:5970
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:7705
const tinfo_t & type
Definition hexrays.hpp:7698
bool get_action_label(qstring *label, const char *name)
Get an action's label (ui_get_action_attr).
Definition kernwin.hpp:6063
void activate_widget(TWidget *widget, bool take_focus)
Activate widget (only gui version) (ui_activate_widget).
Definition kernwin.hpp:5702
idaman int64 size_t count
Definition kernwin.hpp:1399
char * answer
Definition kernwin.hpp:8465
int nbytes
Definition kernwin.hpp:3037
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:2598
execute_sync_availability_t
Definition kernwin.hpp:341
@ esa_app_unavailable
Definition kernwin.hpp:346
@ esa_available
Definition kernwin.hpp:343
@ esa_release
Definition kernwin.hpp:345
@ esa_unavailable
Definition kernwin.hpp:344
@ esa_unknown
Definition kernwin.hpp:342
bool ok
Definition kernwin.hpp:7410
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:5859
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:5754
void serve()
Block the main thread, dispatching queued requests as they arrive (ui_serve).
Definition kernwin.hpp:5455
uval_t uval_t
Definition kernwin.hpp:1926
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:4498
TWidget * get_current_viewer()
Get current ida viewer (idaview or custom viewer) (ui_get_current_viewer)
Definition kernwin.hpp:6259
ea_t get_screen_ea()
Get the address at the screen cursor (ui_screenea)
Definition kernwin.hpp:5214
bool is_teams_widget(twidget_type_t t)
Definition kernwin.hpp:2977
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:6384
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:6338
bool get_action_checkable(const char *name, bool *checkable)
Get an action's checkability (ui_get_action_attr).
Definition kernwin.hpp:6118
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:4456
bool process_ui_action(const char *name, int flags=0, void *param=nullptr)
Processes a UI action by name.
Definition kernwin.hpp:5373
void unmark_selection()
Unmark selection (ui_unmarksel)
Definition kernwin.hpp:6468
bool delete_menu(const char *name)
Delete an existing menu.
Definition kernwin.hpp:5572
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:6651
bool get_action_tooltip(qstring *tooltip, const char *name)
Get an action's tooltip (ui_get_action_attr).
Definition kernwin.hpp:6085
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:6460
lecvt_code_t
Converts from an entry with a given place type, to another entry, with another place type,...
Definition kernwin.hpp:2148
@ LECVT_OK
Definition kernwin.hpp:2151
@ LECVT_ERROR
Definition kernwin.hpp:2150
@ LECVT_CANCELED
Definition kernwin.hpp:2149
void repaint_custom_viewer(TWidget *custom_viewer)
Repaint the given widget immediately (ui_repaint_qwidget)
Definition kernwin.hpp:5823
bool is_tif_cursor_header(tif_cursor_t c)
Definition kernwin.hpp:1938
idaman DEPRECATED uint64 ida_export get_dirty_infos()
THREAD_SAFE bool unregister_timer(qtimer_t t)
Unregister a timer (ui_unregister_timer).
Definition kernwin.hpp:5440
void place_t__serialize(const place_t *_this, bytevec_t *out)
Definition kernwin.hpp:8997
vshow_hex(dataptr, len, format, va)
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:5794
int register_place_class(const place_t *tmplate, int flags, const plugin_t *owner)
Register information about a place_t class.
Definition kernwin.hpp:2022
ea_t get_hexdump_ea(int hexdump_num)
Get the current address in a hex view.
Definition kernwin.hpp:5258
void idaapi custom_viewer_curpos_t(TWidget *cv, void *ud)
Deprecated.
Definition kernwin.hpp:4332
void * get_window_id(const char *name=nullptr)
Get the system-specific window ID (GUI version only)
Definition kernwin.hpp:6424
qvector< cpidx_t > cpidxvec_t
Definition kernwin.hpp:2493
int cplen_t
Definition kernwin.hpp:2492
ssize_t rc
Definition kernwin.hpp:7505
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:6199
THREAD_SAFE void set_cancelled()
Set "Cancelled" flag (ui_set_cancelled)
Definition kernwin.hpp:6595
bool refresh_chooser(const char *title)
Mark a non-modal custom chooser for a refresh (ui_refresh_chooser).
Definition kernwin.hpp:5284
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:5594
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:5621
void remove_command_interpreter(const cli_t *cp)
Remove command line interpreter (ui_install_cli)
Definition kernwin.hpp:5301
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:7271
input_event_kind_t
Definition kernwin.hpp:4534
@ iek_mouse_wheel
Definition kernwin.hpp:4541
@ iek_key_release
Definition kernwin.hpp:4538
@ iek_shortcut
Definition kernwin.hpp:4536
@ iek_mouse_button_press
Definition kernwin.hpp:4539
@ iek_key_press
Definition kernwin.hpp:4537
@ iek_mouse_button_release
Definition kernwin.hpp:4540
@ iek_unknown
Definition kernwin.hpp:4535
idaman uint32 ida_export_data debug
Controls debug messages - combination of IDA debug bits.
Definition kernwin.hpp:2987
lecvt_code_t idaapi lochist_entry_cvt2_t(lochist_entry_t *dst, const lochist_entry_t &src, TWidget *view, uint32 flags)
Definition kernwin.hpp:2155
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:6404
verror(format, va)
idaman void ida_export term_database()
The database termination function.
tcc_renderer_type_t
TWidget renderer type.
Definition kernwin.hpp:104
@ TCCRT_GRAPH
graph view
Definition kernwin.hpp:107
@ TCCRT_INVALID
invalid
Definition kernwin.hpp:105
@ TCCRT_FLAT
flat view
Definition kernwin.hpp:106
@ TCCRT_PROXIMITY
proximity view
Definition kernwin.hpp:108
THREAD_SAFE bool user_cancelled()
Test the cancellation flag (ui_test_cancelled).
Definition kernwin.hpp:6602
item_query_method_t
Item type to retrieve through ui_get_selected_items.
Definition kernwin.hpp:3334
@ iqm_bwn
Definition kernwin.hpp:3335
@ iqm_ctx
Definition kernwin.hpp:3336
void get_registered_actions(qstrvec_t *out)
Get a list of all currently-registered actions.
Definition kernwin.hpp:5505
qvector< line_rendering_output_entry_t * > line_rendering_output_entries_refs_t
Definition kernwin.hpp:2444
TWidget * create_code_viewer(TWidget *custview, int flags=0, TWidget *parent=nullptr)
Create a code viewer (ui_create_code_viewer).
Definition kernwin.hpp:6481
beep_t
< Beep types
Definition kernwin.hpp:79
@ beep_default
Definition kernwin.hpp:80
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:4493
uint128 builtin_widgets_mask_t
Definition kernwin.hpp:2729
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:6213
bool prompt_function_prototype(qstring *errbuf, tinfo_t *out_tif, qstring *out_name, ea_t func_ea, tinfo_t *tif, const char *name)
Open function prototype editor to edit function type and create new type (ui_prompt_function_prototyp...
Definition kernwin.hpp:6286
THREAD_SAFE void clr_cancelled()
Clear "Cancelled" flag (ui_clr_cancelled)
Definition kernwin.hpp:6590
void display_widget(TWidget *widget, uint32 options, const char *dest_ctrl=nullptr)
Display a widget, dock it if not done before.
Definition kernwin.hpp:5682
bool read_selection(TWidget *v, twinpos_t *p1, twinpos_t *p2)
Get the selected range boundaries (ui_read_selection).
Definition kernwin.hpp:6445
va_end(va)
int idaapi formchgcb_t(int field_id, form_actions_t &fa)
Callback.
Definition kernwin.hpp:8150
const int64 IDALIB_API_MAGIC
Definition kernwin.hpp:1414
THREAD_SAFE const char * No
Definition kernwin.hpp:8181
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:6635
msg_notification_t
Notification codes for events in the message window.
Definition kernwin.hpp:4150
@ msg_closed
View closed.
Definition kernwin.hpp:4173
@ msg_click
Click event.
Definition kernwin.hpp:4159
@ msg_activated
The message window is activated.
Definition kernwin.hpp:4151
@ msg_keydown
Key down event.
Definition kernwin.hpp:4177
@ msg_deactivated
The message window is deactivated.
Definition kernwin.hpp:4155
@ msg_dblclick
Double click event.
Definition kernwin.hpp:4166
int add_idc_hotkey(const char *hotkey, const char *idcfunc)
Add hotkey for IDC function (ui_add_idckey).
Definition kernwin.hpp:6666
ui_notification_t
Events marked as 'ui:' should be used as a parameter to callui().
Definition kernwin.hpp:364
@ debug_obsolete_assert_thread_waitready
Definition kernwin.hpp:1351
@ ui_dbg_get_trace_file_desc
Definition kernwin.hpp:1250
@ ui_unlock_range_refresh
ui: Unlock the ui_range refreshes.
Definition kernwin.hpp:516
@ ui_debugger_menu_change
cb: debugger menu modification detected
Definition kernwin.hpp:546
@ ui_close_chooser
ui: see close_chooser()
Definition kernwin.hpp:437
@ ui_msg_get_lines
ui: see msg_get_lines()
Definition kernwin.hpp:950
@ ui_enable_chooser_item_attrs
ui: see enable_chooser_item_attrs()
Definition kernwin.hpp:701
@ ui_get_chooser_rows
ui: see get_chooser_rows()
Definition kernwin.hpp:1059
@ ui_set_renderer_type
ui: see set_view_renderer_type()
Definition kernwin.hpp:813
@ ui_dbg_request_add_bpt
Definition kernwin.hpp:1262
@ ui_dbg_request_enable_bpt
Definition kernwin.hpp:1233
@ ui_display_widget
ui: see display_widget()
Definition kernwin.hpp:983
@ ui_dbg_get_reg_val
Definition kernwin.hpp:1207
@ ui_choose
ui: Allow the user to choose an object.
Definition kernwin.hpp:430
@ ui_execute_sync_ctl
ui: see cancel_thread_exec_requests(), cancel_exec_request(), set_execute_sync_availability()
Definition kernwin.hpp:697
@ ui_dbg_request_step_over
Definition kernwin.hpp:1135
@ ui_destroying_plugmod
cb: The plugin object is about to be destroyed
Definition kernwin.hpp:1020
@ ui_dbg_get_bptloc_string
Definition kernwin.hpp:1220
@ ui_updated_actions
cb: IDA is done updating actions.
Definition kernwin.hpp:861
@ ui_dbg_get_local_var
Definition kernwin.hpp:1307
@ ui_destroy_custom_viewer
ui: see destroy_custom_viewer()
Definition kernwin.hpp:599
@ ui_updating_actions
cb: IDA is about to update all actions.
Definition kernwin.hpp:854
@ ui_dbg_set_trace_platform
Definition kernwin.hpp:1282
@ ui_install_custom_optype_menu
ui: install/remove custom operand type menu item.
Definition kernwin.hpp:722
@ ui_get_tab_size
ui: see get_tab_size()
Definition kernwin.hpp:783
@ ui_dbg_del_vmod
Definition kernwin.hpp:1216
@ ui_dbg_get_insn_tev_reg_val_i
Definition kernwin.hpp:1323
@ ui_current_widget_changed
cb: The currently-active TWidget changed.
Definition kernwin.hpp:908
@ ui_get_registered_actions
ui: see get_registered_actions()
Definition kernwin.hpp:931
@ ui_get_active_modal_widget
ui: see get_active_modal_widget()
Definition kernwin.hpp:966
@ ui_banner
ui: see banner()
Definition kernwin.hpp:439
@ ui_dbg_add_tev
Definition kernwin.hpp:1271
@ ui_is_idaview
ui: see is_idaview()
Definition kernwin.hpp:610
@ ui_prompt_function_prototype
ui: open Function Prototype Editor and return new type and new name for function
Definition kernwin.hpp:1087
@ ui_saving
cb: The kernel is flushing its buffers to the disk.
Definition kernwin.hpp:412
@ ui_dbg_set_insn_trace_options
Definition kernwin.hpp:1160
@ ui_lock_range_refresh
ui: Lock the ui_range refreshes.
Definition kernwin.hpp:510
@ ui_dbg_wait_for_next_event
Definition kernwin.hpp:1183
@ ui_dbg_get_reg_val_i
Definition kernwin.hpp:1325
@ ui_finish_populating_widget_popup
cb: IDA is about to be done populating the context menu for a widget.
Definition kernwin.hpp:883
@ ui_dbg_get_tev_event
Definition kernwin.hpp:1255
@ ui_dbg_set_trace_file_desc
Definition kernwin.hpp:1249
@ ui_unregister_action
ui: see unregister_action()
Definition kernwin.hpp:830
@ ui_dbg_edit_manual_regions
Definition kernwin.hpp:1204
@ ui_dbg_retrieve_exceptions
Definition kernwin.hpp:1188
@ ui_dbg_add_call_tev
Definition kernwin.hpp:1273
@ ui_dbg_add_path_mapping
Definition kernwin.hpp:1309
@ ui_execute_sync
ui: see execute_sync()
Definition kernwin.hpp:695
@ ui_ea_viewer_history_info
ui: see get_ea_viewer_history_info()
Definition kernwin.hpp:824
@ ui_dbg_request_del_bpt
Definition kernwin.hpp:1235
@ ui_dbg_save_trace_file
Definition kernwin.hpp:1247
@ ui_dbg_register_provider
Definition kernwin.hpp:1212
@ ui_dbg_begin
debugger callgates. should not be used directly, see dbg.hpp for details
Definition kernwin.hpp:1114
@ ui_beep
ui: see beep()
Definition kernwin.hpp:452
@ ui_dbg_read_memory
Definition kernwin.hpp:1225
@ ui_get_ea_hint
cb: ui wants to display a simple hint for an address.
Definition kernwin.hpp:581
@ ui_dbg_getn_thread
Definition kernwin.hpp:1129
@ ui_get_widget_config
cb: retrieve the widget configuration (it will be passed back at ui_create_desktop_widget-,...
Definition kernwin.hpp:999
@ ui_dbg_request_attach_process
Definition kernwin.hpp:1176
@ ui_dbg_step_until_ret
Definition kernwin.hpp:1138
@ ui_dbg_compare_bpt_locs
Definition kernwin.hpp:1217
@ ui_open_ida_link
ui: see open_ida_link()
Definition kernwin.hpp:1084
@ ui_addons
ui: see Functions: add-ons
Definition kernwin.hpp:748
@ ui_get_custom_viewer_curline
ui: see get_custom_viewer_curline()
Definition kernwin.hpp:605
@ ui_obsolete_get_highlight
now ui_get_highlight_2
Definition kernwin.hpp:940
@ ui_obsolete_del_idckey
ui: see ui_del_idckey()
Definition kernwin.hpp:491
@ ui_get_cursor
ui: see get_cursor()
Definition kernwin.hpp:500
@ ui_restore_database_snapshot
ui: see restore_database_snapshot()
Definition kernwin.hpp:763
@ ui_dbg_update_bpt
Definition kernwin.hpp:1263
@ ui_refresh_navband
ui: see refresh_navband()
Definition kernwin.hpp:544
@ ui_dbg_request_continue_process
Definition kernwin.hpp:1125
@ ui_dbg_write_register
Definition kernwin.hpp:1228
@ ui_set_mappings
ui: Show current memory mappings and allow the user to change them.
Definition kernwin.hpp:943
@ ui_dbg_get_running_notification
Definition kernwin.hpp:1117
@ ui_register_timer
ui: see register_timer()
Definition kernwin.hpp:756
@ ui_dbg_add_insn_tev
Definition kernwin.hpp:1272
@ ui_dbg_suspend_thread
Definition kernwin.hpp:1191
@ ui_dbg_is_valid_trace_file
Definition kernwin.hpp:1248
@ ui_dbg_set_reg_val_i
Definition kernwin.hpp:1326
@ ui_dbg_request_del_oldbpt
Definition kernwin.hpp:1144
@ ui_dbg_add_bpt
Definition kernwin.hpp:1261
@ ui_set_nav_colorizer
ui: see set_nav_colorizer()
Definition kernwin.hpp:982
@ ui_dbg_load_dbg_dbginfo
Definition kernwin.hpp:1289
@ ui_genfile_callback
cb: handle html generation.
Definition kernwin.hpp:521
@ ui_msg_save
ui: see msg_save()
Definition kernwin.hpp:949
@ ui_suspend
cb: Suspend graphical interface.
Definition kernwin.hpp:385
@ ui_lookup_key_code
ui: see lookup_key_code()
Definition kernwin.hpp:735
@ ui_dbg_srcdbg_step_into
Definition kernwin.hpp:1313
@ ui_dbg_set_bptloc_string
Definition kernwin.hpp:1219
@ ui_dbg_request_run_to
Definition kernwin.hpp:1137
@ ui_dbg_request_suspend_process
Definition kernwin.hpp:1123
@ ui_dbg_set_func_trace_options
Definition kernwin.hpp:1166
@ ui_gen_disasm_text
ui: see gen_disasm_text()
Definition kernwin.hpp:680
@ ui_obsolete_set_nav_colorizer
Definition kernwin.hpp:938
@ ui_ask_addr
ui: see ask_addr()
Definition kernwin.hpp:483
@ ui_set_code_viewer_line_handlers
ui: see set_code_viewer_line_handlers()
Definition kernwin.hpp:766
@ ui_dbg_clear_trace
Definition kernwin.hpp:1148
@ ui_dbg_set_manual_regions
Definition kernwin.hpp:1199
@ ui_get_user_input_event
ui: see get_user_input_event()
Definition kernwin.hpp:1048
@ ui_get_output_curline
ui: see get_output_curline()
Definition kernwin.hpp:806
@ ui_dbg_get_reg_value_type
Definition kernwin.hpp:1173
@ ui_widget_closing
TWidget is about to close.
Definition kernwin.hpp:569
@ ui_dbg_set_process_state
Definition kernwin.hpp:1197
@ ui_dbg_suspend_process
Definition kernwin.hpp:1122
@ ui_dbg_get_local_vars
Definition kernwin.hpp:1308
@ ui_read_range_selection
ui: see read_range_selection()
Definition kernwin.hpp:406
@ ui_dbg_request_select_thread
Definition kernwin.hpp:1131
@ ui_dbg_define_exception
Definition kernwin.hpp:1190
@ ui_last
the last notification code
Definition kernwin.hpp:1112
@ ui_create_empty_widget
ui: see create_empty_widget()
Definition kernwin.hpp:945
@ ui_refresh_choosers
cb: The list (chooser) window contents have been changed (names, signatures, etc).
Definition kernwin.hpp:372
@ ui_dbg_is_insn_trace_enabled
Definition kernwin.hpp:1156
@ ui_dbg_set_event_cond
Definition kernwin.hpp:1231
@ ui_create_desktop_widget
cb: create a widget, to be placed in the widget tree (at desktop-creation time.)
Definition kernwin.hpp:973
@ ui_activate_widget
ui: see activate_widget()
Definition kernwin.hpp:557
@ ui_dbg_run_requests
Definition kernwin.hpp:1115
@ ui_dbg_get_ip_val
Definition kernwin.hpp:1206
@ ui_get_current_viewer
ui: see get_current_viewer()
Definition kernwin.hpp:608
@ ui_set_custom_viewer_mode
ui: switch between graph/text modes.
Definition kernwin.hpp:673
@ ui_dbg_step_into
Definition kernwin.hpp:1132
@ ui_dbg_get_bpt
Definition kernwin.hpp:1259
@ ui_dbg_add_bpt_tev
Definition kernwin.hpp:1275
@ ui_dbg_enable_manual_regions
Definition kernwin.hpp:1200
@ ui_get_window_id
ui: see get_window_id()
Definition kernwin.hpp:971
@ ui_dbg_set_suspend_on_event
Definition kernwin.hpp:1345
@ ui_get_range_marker
ui: Get pointer to function.
Definition kernwin.hpp:728
@ ui_get_key_code
ui: see get_key_code()
Definition kernwin.hpp:534
@ ui_dbg_get_tev_type
Definition kernwin.hpp:1266
@ ui_get_current_widget
ui: see get_current_widget()
Definition kernwin.hpp:561
@ ui_setidle
ui: Set a function to call at idle times.
Definition kernwin.hpp:441
@ ui_populating_widget_popup
cb: IDA is populating the context menu for a widget.
Definition kernwin.hpp:865
@ ui_unrecognized_config_directive
ui: Possibly handle an extra config directive, passed through '-d' or '-D'.
Definition kernwin.hpp:797
@ ui_dbg_get_first_module
Definition kernwin.hpp:1179
@ ui_dbg_find_bpt
Definition kernwin.hpp:1260
@ ui_screen_ea_changed
cb: The "current address" changed
Definition kernwin.hpp:960
@ ui_resume
cb: Resume the suspended graphical interface.
Definition kernwin.hpp:391
@ ui_take_database_snapshot
ui: see take_database_snapshot()
Definition kernwin.hpp:760
@ ui_dbg_set_remote_debugger
Definition kernwin.hpp:1186
@ ui_dbg_add_vmod
Definition kernwin.hpp:1215
@ ui_dbg_add_debug_event
Definition kernwin.hpp:1276
@ ui_dbg_request_detach_process
Definition kernwin.hpp:1178
@ ui_dbg_set_resume_mode
Definition kernwin.hpp:1290
@ ui_dbg_request_set_step_trace_options
Definition kernwin.hpp:1155
@ ui_dbg_internal_appcall
Definition kernwin.hpp:1221
@ ui_dbg_select_thread
Definition kernwin.hpp:1130
@ ui_dbg_get_tev_info
Definition kernwin.hpp:1169
@ ui_execute_ui_requests
ui: see execute_ui_requests(ui_request_t, ...)
Definition kernwin.hpp:750
@ ui_dbg_enable_func_trace
Definition kernwin.hpp:1163
@ ui_dbg_get_process_options
Definition kernwin.hpp:1195
@ ui_dbg_get_tev_tid
Definition kernwin.hpp:1267
@ ui_execute_ui_requests_list
ui: see execute_ui_requests(ui_requests_t)
Definition kernwin.hpp:753
@ ui_set_custom_viewer_handler
ui: see set_custom_viewer_handler().
Definition kernwin.hpp:657
@ ui_custom_viewer_jump
ui: set the current location, and have the viewer display it
Definition kernwin.hpp:922
@ ui_dbg_get_insn_tev_reg_result_i
Definition kernwin.hpp:1324
@ ui_dbg_del_bpt
Definition kernwin.hpp:1234
@ ui_detach_action_from_toolbar
ui: see detach_action_from_toolbar()
Definition kernwin.hpp:851
@ ui_dbg_get_thread_qty
Definition kernwin.hpp:1128
@ ui_dbg_srcdbg_step_until_ret
Definition kernwin.hpp:1317
@ ui_ea_viewer_history_push_and_jump
ui: see ea_viewer_history_push_and_jump()
Definition kernwin.hpp:821
@ ui_idcstop
cb: Stop of IDC engine work.
Definition kernwin.hpp:381
@ ui_dbg_set_process_options
Definition kernwin.hpp:1201
@ ui_dbg_request_add_oldbpt
Definition kernwin.hpp:1142
@ ui_attach_action_to_toolbar
ui: see attach_action_to_toolbar()
Definition kernwin.hpp:848
@ ui_open_builtin2
ui: open a window of a built-in type.
Definition kernwin.hpp:1066
@ ui_dbg_get_memory_info
Definition kernwin.hpp:1229
@ ui_dbg_request_enable_oldbpt
Definition kernwin.hpp:1146
@ ui_jump_in_custom_viewer
ui: see jumpto()
Definition kernwin.hpp:602
@ ui_dbg_request_enable_bblk_trace
Definition kernwin.hpp:1241
@ ui_get_curline
ui: see get_curline()
Definition kernwin.hpp:502
@ ui_idcstart
cb: Start of IDC engine work.
Definition kernwin.hpp:377
@ ui_set_highlight
ui: see set_highlight()
Definition kernwin.hpp:941
@ ui_run_dbg
ui: see ui_run_debugger()
Definition kernwin.hpp:498
@ ui_dbg_graph_trace
Definition kernwin.hpp:1253
@ ui_dbg_store_exceptions
Definition kernwin.hpp:1189
@ ui_obsolete_prompt_function_prototype_2
Definition kernwin.hpp:1082
@ ui_dbg_is_func_trace_enabled
Definition kernwin.hpp:1162
@ ui_dbg_attach_process
Definition kernwin.hpp:1175
@ ui_mbox
ui: Show a message box.
Definition kernwin.hpp:461
@ ui_read_selection
ui: see read_selection()
Definition kernwin.hpp:404
@ ui_obsolete_get_custom_viewer_location
Definition kernwin.hpp:1010
@ ui_delete_menu
ui: see delete_menu()
Definition kernwin.hpp:937
@ ui_dbg_del_thread
Definition kernwin.hpp:1278
@ ui_dbg_internal_get_sreg_base
Definition kernwin.hpp:1223
@ ui_sync_sources
ui: [un]synchronize sources
Definition kernwin.hpp:992
@ ui_dbg_srcdbg_request_step_until_ret
Definition kernwin.hpp:1318
@ ui_dbg_run_to_backwards
Definition kernwin.hpp:1343
@ ui_dbg_request_step_over_backwards
Definition kernwin.hpp:1342
@ ui_dbg_step_into_backwards
Definition kernwin.hpp:1339
@ ui_dbg_exit_process
Definition kernwin.hpp:1126
@ ui_dbg_get_call_tev_callee
Definition kernwin.hpp:1170
@ ui_get_synced_group
ui: see get_synced_group()
Definition kernwin.hpp:1028
@ ui_broadcast
cb: broadcast call
Definition kernwin.hpp:397
@ ui_dbg_get_sp_val
Definition kernwin.hpp:1205
@ ui_is_idaq
ui: see is_idaq()
Definition kernwin.hpp:542
@ ui_open_builtin
ui: open a window of a built-in type. see Functions: open built-in windows
Definition kernwin.hpp:663
@ ui_dbg_diff_trace_file
Definition kernwin.hpp:1252
@ ui_plugin_loaded
cb: The plugin was loaded in memory.
Definition kernwin.hpp:900
@ ui_dbg_enable_step_trace
Definition kernwin.hpp:1151
@ ui_dbg_request_exit_process
Definition kernwin.hpp:1127
@ ui_get_highlight_2
ui: see get_highlight()
Definition kernwin.hpp:1051
@ ui_dbg_get_tev_qty
Definition kernwin.hpp:1168
@ ui_dbg_request_set_insn_trace_options
Definition kernwin.hpp:1161
@ ui_obsolete_display_widget
Definition kernwin.hpp:554
@ ui_get_action_attr
ui: see Functions: get action attributes
Definition kernwin.hpp:898
@ ui_dbg_is_bblk_trace_enabled
Definition kernwin.hpp:1239
@ ui_dbg_get_module_info
Definition kernwin.hpp:1302
@ ui_copywarn
ui: see display_copyright_warning()
Definition kernwin.hpp:504
@ ui_create_source_viewer
ui: Create new source viewer.
Definition kernwin.hpp:771
@ ui_dbg_internal_set_elang
Definition kernwin.hpp:1286
@ ui_dbg_change_bptlocs
Definition kernwin.hpp:1298
@ ui_parse_tagged_line_sections
ui: see parse_tagged_line_sections()
Definition kernwin.hpp:1075
@ ui_dbg_step_over_backwards
Definition kernwin.hpp:1341
@ ui_dbg_get_reg_info
Definition kernwin.hpp:1328
@ ui_dbg_enable_oldbpt
Definition kernwin.hpp:1145
@ ui_dbg_unregister_provider
Definition kernwin.hpp:1213
@ ui_null
Definition kernwin.hpp:365
@ ui_dbg_map_source_path
Definition kernwin.hpp:1236
@ ui_attach_action_to_menu
ui: see attach_action_to_menu()
Definition kernwin.hpp:833
@ ui_dbg_get_process_state
Definition kernwin.hpp:1119
@ ui_saved
cb: The kernel has saved the database.
Definition kernwin.hpp:417
@ ui_delete_toolbar
ui: see delete_toolbar()
Definition kernwin.hpp:935
@ ui_dbg_continue_process
Definition kernwin.hpp:1124
@ ui_dbg_get_bpt_group
Definition kernwin.hpp:1297
@ ui_analyzer_options
ui: see analyzer_options()
Definition kernwin.hpp:494
@ ui_create_code_viewer
ui: see create_code_viewer()
Definition kernwin.hpp:746
@ ui_refresh_custom_viewer
ui: see refresh_custom_viewer()
Definition kernwin.hpp:596
@ ui_load_file
ui: see ui_load_new_file()
Definition kernwin.hpp:496
@ ui_dbg_write_memory
Definition kernwin.hpp:1226
@ ui_dbg_collect_stack_trace
Definition kernwin.hpp:1301
@ ui_dbg_del_oldbpt
Definition kernwin.hpp:1143
@ ui_dbg_get_insn_tev_reg_mem
Definition kernwin.hpp:1256
@ ui_unregister_timer
ui: see unregister_timer()
Definition kernwin.hpp:758
@ ui_dbg_set_trace_size
Definition kernwin.hpp:1147
@ ui_dbg_start_process
Definition kernwin.hpp:1120
@ ui_install_custom_datatype_menu
ui: install/remove custom data type menu item.
Definition kernwin.hpp:716
@ ui_open_url
ui: see open_url()
Definition kernwin.hpp:527
@ ui_dbg_get_trace_dynamic_register_set
Definition kernwin.hpp:1331
@ ui_ask_form
ui: see ask_form()/open_form()
Definition kernwin.hpp:477
@ ui_widget_invisible
TWidget is being closed.
Definition kernwin.hpp:576
@ ui_obsolete_action_ctx_base_ctl
Definition kernwin.hpp:1080
@ ui_dbg_get_trace_platform
Definition kernwin.hpp:1283
@ ui_dbg_bring_to_front
Definition kernwin.hpp:1181
@ ui_dbg_set_bptloc_group
Definition kernwin.hpp:1292
@ ui_hexdumpea
ui: Return the current address in a hex view.
Definition kernwin.hpp:529
@ ui_dbg_request_clear_trace
Definition kernwin.hpp:1149
@ ui_dbg_srcdbg_request_step_over
Definition kernwin.hpp:1316
@ ui_get_renderer_type
ui: see get_view_renderer_type()
Definition kernwin.hpp:811
@ ui_dbg_modify_source_paths
Definition kernwin.hpp:1238
@ ui_get_item_hint
cb: ui wants to display multiline hint for an item.
Definition kernwin.hpp:588
@ ui_dbg_get_bpt_tev_ea
Definition kernwin.hpp:1172
@ ui_dbg_get_trace_base_address
Definition kernwin.hpp:1268
@ ui_get_chooser_item_attrs
cb: get item-specific attributes for a chooser.
Definition kernwin.hpp:704
@ ui_dbg_continue_backwards
Definition kernwin.hpp:1337
@ ui_dbg_get_grp_bpts
Definition kernwin.hpp:1296
@ ui_update_action_attr
ui: see Functions: update actions
Definition kernwin.hpp:895
@ ui_dbg_internal_get_elang
Definition kernwin.hpp:1285
@ ui_dbg_request_resume_thread
Definition kernwin.hpp:1194
@ ui_obsolete_prompt_function_prototype
Definition kernwin.hpp:1073
@ ui_dbg_request_step_into
Definition kernwin.hpp:1133
@ ui_get_widget_title
ui: see get_widget_title()
Definition kernwin.hpp:914
@ ui_dbg_get_current_source_line
Definition kernwin.hpp:1311
@ ui_dbg_map_source_file_path
Definition kernwin.hpp:1237
@ ui_dbg_get_srcinfo_provider
Definition kernwin.hpp:1305
@ ui_dbg_request_set_func_trace_options
Definition kernwin.hpp:1167
@ ui_dbg_getn_bpt
Definition kernwin.hpp:1258
@ ui_dbg_resume_thread
Definition kernwin.hpp:1193
@ ui_dbg_request_set_resume_mode
Definition kernwin.hpp:1291
@ ui_update_file_history
ui: manipulate the file history
Definition kernwin.hpp:1024
@ ui_dbg_get_insn_tev_reg_val
Definition kernwin.hpp:1210
@ ui_dbg_get_tev_ea
Definition kernwin.hpp:1265
@ ui_dbg_check_bpt
Definition kernwin.hpp:1196
@ ui_dbg_get_ret_tev_return
Definition kernwin.hpp:1171
@ ui_dbg_request_suspend_thread
Definition kernwin.hpp:1192
@ ui_close_widget
ui: see close_widget()
Definition kernwin.hpp:555
@ ui_jumpto
ui: see jumpto(ea_t, int, int)
Definition kernwin.hpp:793
@ ui_dbg_get_tev_memory_info
Definition kernwin.hpp:1254
@ 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:952
@ ui_set_widget_config
cb: set the widget configuration
Definition kernwin.hpp:1005
@ ui_dbg_add_ret_tev
Definition kernwin.hpp:1274
@ ui_test_cancelled
ui: see user_cancelled()
Definition kernwin.hpp:471
@ ui_dbg_add_thread
Definition kernwin.hpp:1277
@ ui_dbg_end
Definition kernwin.hpp:1347
@ ui_register_action
ui: see register_action()
Definition kernwin.hpp:827
@ ui_dbg_hide_all_bpts
Definition kernwin.hpp:1203
@ ui_dbg_read_registers
Definition kernwin.hpp:1227
@ ui_add_idckey
ui: see add_idc_hotkey()
Definition kernwin.hpp:489
@ ui_ask_file
ui: see ask_file()
Definition kernwin.hpp:475
@ ui_refresh_chooser
ui: see refresh_chooser()
Definition kernwin.hpp:661
@ ui_obsolete_dbg_save_bpts
Definition kernwin.hpp:1218
@ ui_about_to_exit
cb: IDA is exiting.
Definition kernwin.hpp:1097
@ ui_dbg_enable_bptgrp
Definition kernwin.hpp:1334
@ ui_dbg_enable_bpt
Definition kernwin.hpp:1232
@ ui_detach_action_from_menu
ui: see detach_action_from_menu()
Definition kernwin.hpp:836
@ ui_dbg_add_oldbpt
Definition kernwin.hpp:1141
@ ui_set_dock_pos
ui: see set_dock_pos()
Definition kernwin.hpp:712
@ ui_range
cb: The disassembly range has been changed ( idainfo::min_ea ... idainfo::max_ea).
Definition kernwin.hpp:367
@ ui_dbg_list_bptgrps
Definition kernwin.hpp:1293
@ ui_set_cancelled
ui: see set_cancelled()
Definition kernwin.hpp:469
@ ui_dbg_request_enable_step_trace
Definition kernwin.hpp:1152
@ ui_open_form
ui: see vopen_form()
Definition kernwin.hpp:795
@ ui_dbg_enable_insn_trace
Definition kernwin.hpp:1157
@ ui_get_viewer_place_type
ui: see get_viewer_place_type()
Definition kernwin.hpp:818
@ ui_dbg_get_insn_tev_reg_result
Definition kernwin.hpp:1211
@ ui_dbg_set_trace_dynamic_register_set
Definition kernwin.hpp:1330
@ ui_attach_dynamic_action_to_popup
ui: see attach_dynamic_action_to_popup()
Definition kernwin.hpp:845
@ ui_get_widget_type
ui: see get_widget_type()
Definition kernwin.hpp:906
@ ui_postprocess_action
cb: an ida ui action has been handled
Definition kernwin.hpp:671
@ ui_ready_to_run
cb: all UI elements have been initialized.
Definition kernwin.hpp:651
@ ui_dbg_getn_thread_name
Definition kernwin.hpp:1320
@ ui_repaint_qwidget
ui: see repaint_custom_viewer()
Definition kernwin.hpp:785
@ ui_ask_text
ui: see ask_text()
Definition kernwin.hpp:479
@ ui_dbg_get_step_trace_options
Definition kernwin.hpp:1153
@ ui_refresh
ui: see refresh_idaview_anyway()
Definition kernwin.hpp:428
@ ui_plugin_unloading
cb: The plugin is about to be unloaded
Definition kernwin.hpp:903
@ ui_refreshmarked
ui: see refresh_idaview()
Definition kernwin.hpp:426
@ ui_dbg_get_event_cond
Definition kernwin.hpp:1230
@ ui_obsolete_get_user_strlist_options
ui: see get_user_strlist_options()
Definition kernwin.hpp:916
@ ui_create_custom_viewer
ui: see create_custom_viewer()
Definition kernwin.hpp:919
@ ui_serve
ui: see serve()
Definition kernwin.hpp:1108
@ ui_get_output_selected_text
ui: see get_output_selected_text()
Definition kernwin.hpp:808
@ ui_process_action
ui: see process_ui_action()
Definition kernwin.hpp:744
@ ui_dbg_load_debugger
Definition kernwin.hpp:1187
@ ui_database_closed
cb: The database has been closed.
Definition kernwin.hpp:445
@ ui_dbg_request_step_into_backwards
Definition kernwin.hpp:1340
@ ui_msg_clear
ui: see msg_clear()
Definition kernwin.hpp:948
@ ui_dbg_get_next_module
Definition kernwin.hpp:1180
@ ui_dbg_set_reg_val
Definition kernwin.hpp:1208
@ ui_navband_ea
ui: see get_navband_ea()
Definition kernwin.hpp:970
@ ui_widget_visible
TWidget is displayed on the screen.
Definition kernwin.hpp:564
@ ui_clr_cancelled
ui: see clr_cancelled()
Definition kernwin.hpp:467
@ ui_noabort
ui: Disable 'abort' menu item - the database was not compressed.
Definition kernwin.hpp:506
@ ui_dbg_get_func_trace_options
Definition kernwin.hpp:1165
@ ui_dbg_get_current_source_file
Definition kernwin.hpp:1310
@ ui_obsolete_refresh_custom_code_viewer
Definition kernwin.hpp:769
@ ui_dbg_get_debug_event
Definition kernwin.hpp:1184
@ ui_dbg_request_continue_backwards
Definition kernwin.hpp:1338
@ ui_obsolete_get_last_widget
Definition kernwin.hpp:1071
@ ui_create_menu
ui: see create_menu()
Definition kernwin.hpp:936
@ ui_dbg_internal_cleanup_appcall
Definition kernwin.hpp:1222
@ ui_dbg_load_trace_file
Definition kernwin.hpp:1246
@ ui_dbg_request_set_reg_val
Definition kernwin.hpp:1209
@ ui_create_toolbar
ui: see create_toolbar()
Definition kernwin.hpp:934
@ ui_dbg_enable_bblk_trace
Definition kernwin.hpp:1240
@ ui_get_icon_id_by_name
ui: see get_icon_id_by_name()
Definition kernwin.hpp:1063
@ ui_dbg_request_start_process
Definition kernwin.hpp:1121
@ ui_get_chooser_data
ui: see get_chooser_data()
Definition kernwin.hpp:939
@ ui_ask_str
ui: see ask_str()
Definition kernwin.hpp:481
@ ui_choose_bookmark
ui: modal chooser (legacy)
Definition kernwin.hpp:1039
@ ui_stop_serving
ui: see stop_serving()
Definition kernwin.hpp:1109
@ ui_dbg_add_many_tevs
Definition kernwin.hpp:1279
@ ui_dbg_set_trace_base_address
Definition kernwin.hpp:1270
@ ui_preprocess_action
cb: ida ui is about to handle a user action.
Definition kernwin.hpp:665
@ ui_database_inited
cb: database initialization has completed.
Definition kernwin.hpp:643
@ ui_dbg_srcdbg_request_step_into
Definition kernwin.hpp:1314
@ ui_detach_action_from_popup
ui: see detach_action_from_popup()
Definition kernwin.hpp:842
@ ui_load_custom_icon
ui: see load_custom_icon(const void *, unsigned int, const char *)
Definition kernwin.hpp:740
@ ui_custom_viewer_set_userdata
ui: Change place_t user data for a custom view.
Definition kernwin.hpp:787
@ ui_get_output_cursor
ui: see get_output_cursor()
Definition kernwin.hpp:804
@ ui_dbg_srcdbg_step_over
Definition kernwin.hpp:1315
@ ui_dbg_clear_requests_queue
Definition kernwin.hpp:1118
@ ui_load_custom_icon_file
ui: see load_custom_icon(const char *)
Definition kernwin.hpp:737
@ ui_desktop_applied
cb: a desktop has been applied
Definition kernwin.hpp:1034
@ ui_initing_database
cb: database initialization has started.
Definition kernwin.hpp:1012
@ ui_msg
ui: Show a message in the message window.
Definition kernwin.hpp:456
@ ui_get_opnum
ui: see get_opnum()
Definition kernwin.hpp:714
@ ui_dbg_is_step_trace_enabled
Definition kernwin.hpp:1150
@ ui_navband_pixel
ui: see get_navband_pixel()
Definition kernwin.hpp:969
@ ui_get_custom_viewer_hint
cb: ui wants to display a hint for a viewer (idaview or custom).
Definition kernwin.hpp:612
@ ui_ask_long
ui: see ask_long()
Definition kernwin.hpp:487
@ ui_dbg_get_manual_regions
Definition kernwin.hpp:1198
@ ui_dbg_handle_debug_event
Definition kernwin.hpp:1214
@ ui_ask_buttons
ui: see ask_yn() and ask_buttons()
Definition kernwin.hpp:473
@ ui_dbg_run_to
Definition kernwin.hpp:1136
@ ui_find_widget
ui: see find_widget()
Definition kernwin.hpp:559
@ ui_dbg_for_all_bpts
Definition kernwin.hpp:1264
@ ui_dbg_request_enable_func_trace
Definition kernwin.hpp:1164
@ ui_dbg_detach_process
Definition kernwin.hpp:1177
@ ui_show_rename_dialog
ui: undocumented
Definition kernwin.hpp:1031
@ ui_dbg_request_run_to_backwards
Definition kernwin.hpp:1344
@ ui_dbg_request_set_bblk_trace_options
Definition kernwin.hpp:1244
@ ui_dbg_set_step_trace_options
Definition kernwin.hpp:1154
@ ui_get_lines_rendering_info
cb: get lines rendering information
Definition kernwin.hpp:985
@ ui_setup_plugins_menu
ui: setup plugins submenu
Definition kernwin.hpp:536
@ ui_screenea
ui: see get_screen_ea()
Definition kernwin.hpp:410
@ ui_get_viewer_user_data
ui: see get_viewer_user_data()
Definition kernwin.hpp:815
@ ui_dbg_set_highlight_trace_options
Definition kernwin.hpp:1281
@ ui_dbg_del_bptgrp
Definition kernwin.hpp:1295
@ ui_dbg_rename_bptgrp
Definition kernwin.hpp:1294
@ ui_destroying_procmod
cb: The processor module is about to be destroyed
Definition kernwin.hpp:1017
@ ui_ask_seg
ui: see ask_seg()
Definition kernwin.hpp:485
@ ui_get_chooser_obj
ui: see get_chooser_obj()
Definition kernwin.hpp:699
@ ui_get_custom_viewer_place_xcoord
ui: see get_custom_viewer_place_xcoord()
Definition kernwin.hpp:1045
@ ui_set_custom_viewer_range
ui: set_custom_viewer_range()
Definition kernwin.hpp:640
@ ui_dbg_get_bpt_qty
Definition kernwin.hpp:1140
@ ui_dbg_set_debugger_options
Definition kernwin.hpp:1185
@ ui_attach_action_to_popup
ui: see attach_action_to_popup()
Definition kernwin.hpp:839
@ ui_dbg_get_current_thread
Definition kernwin.hpp:1182
@ ui_unmarksel
ui: see unmark_selection()
Definition kernwin.hpp:408
@ ui_dbg_set_bblk_trace_options
Definition kernwin.hpp:1243
@ ui_dbg_internal_ioctl
Definition kernwin.hpp:1224
@ ui_dbg_get_insn_trace_options
Definition kernwin.hpp:1159
@ ui_get_last_widget
ui: see get_last_widget()
Definition kernwin.hpp:1078
@ ui_dbg_bin_search
Definition kernwin.hpp:1321
@ ui_free_custom_icon
ui: see free_custom_icon()
Definition kernwin.hpp:742
@ ui_is_msg_inited
ui: see is_msg_inited()
Definition kernwin.hpp:454
@ ui_set_custom_viewer_handlers
ui: see set_custom_viewer_handlers()
Definition kernwin.hpp:928
@ ui_dbg_request_step_until_ret
Definition kernwin.hpp:1139
@ ui_dbg_choose_trace_file
Definition kernwin.hpp:1251
@ ui_dbg_get_processes
Definition kernwin.hpp:1174
@ ui_dbg_request_enable_insn_trace
Definition kernwin.hpp:1158
@ ui_dbg_set_bpt_group
Definition kernwin.hpp:1280
@ ui_dbg_get_running_request
Definition kernwin.hpp:1116
@ ui_get_curplace
ui: see get_custom_viewer_place(). See also ui_get_custom_viewer_location
Definition kernwin.hpp:552
@ ui_get_custom_viewer_location_2
ui: see get_custom_viewer_location()
Definition kernwin.hpp:1053
@ ui_install_cli
ui: see: install_command_interpreter(), remove_command_interpreter()
Definition kernwin.hpp:691
@ ui_get_kernel_version
ui: see get_kernel_version()
Definition kernwin.hpp:540
@ ui_strchoose
ui: undocumented
Definition kernwin.hpp:979
@ ui_dbg_get_global_var
Definition kernwin.hpp:1306
@ ui_dbg_get_bblk_trace_options
Definition kernwin.hpp:1242
@ ui_dbg_step_over
Definition kernwin.hpp:1134
@ ui_gen_idanode_text
cb: generate disassembly text for a node.
Definition kernwin.hpp:682
@ ui_dbg_is_busy
Definition kernwin.hpp:1202
bool unregister_action(const char *name)
Delete a previously-registered action (ui_unregister_action).
Definition kernwin.hpp:5497
bool is_chooser_widget(twidget_type_t t)
Does the given widget type specify a chooser widget?
Definition kernwin.hpp:2964
bool get_output_selected_text(qstring *buf)
Returns selected text from output window (ui_get_output_selected_text).
Definition kernwin.hpp:6251
THREAD_SAFE ssize_t execute_sync(exec_request_t &req, int reqf)
Execute code in the main thread.
Definition kernwin.hpp:5322
bool idaapi custom_viewer_keydown_t(TWidget *cv, int vk_key, int shift, void *ud)
The user has pressed a key.
Definition kernwin.hpp:4304
place_collapsible_state_t
Collapsible state of a line/place in a UI that supports folding.
Definition kernwin.hpp:4502
@ pcs_expanded
foldable and currently expanded
Definition kernwin.hpp:4504
@ pcs_none
not foldable
Definition kernwin.hpp:4503
@ pcs_collapsed
foldable and currently collapsed
Definition kernwin.hpp:4505
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:5426
int get_opnum()
Get current operand number, -1 means no operand (ui_get_opnum)
Definition kernwin.hpp:5219
idaman int64 pos
Definition kernwin.hpp:1398
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:2345
THREAD_SAFE void stop_serving()
Ask the serve() loop to return (ui_stop_serving).
Definition kernwin.hpp:5466
input_event_modifiers_t view_event_state_t
Definition kernwin.hpp:4145
vme_button_t
Represents mouse button for view_mouse_event_t objects.
Definition kernwin.hpp:123
@ VME_LEFT_BUTTON
left mouse button
Definition kernwin.hpp:125
@ VME_UNKNOWN
unknown mouse button
Definition kernwin.hpp:124
@ VME_RIGHT_BUTTON
right mouse button
Definition kernwin.hpp:126
@ VME_MID_BUTTON
middle mouse button
Definition kernwin.hpp:127
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:4407
bool jumpto(ea_t ea, int opnum=-1, int uijmp_flags=UIJMP_ACTIVATE)
Jump to the specified address (ui_jumpto).
Definition kernwin.hpp:5177
place_collapsible_state_t idaapi code_viewer_fold_state_t(TWidget *cv, const place_t *p, void *ud)
Report the fold state for a line.
Definition kernwin.hpp:4517
int get_tab_size(const char *path)
Get the size of a tab in spaces (ui_get_tab_size).
Definition kernwin.hpp:6582
show_wait_box_v(format, va)
execute_sync_ctl_t
Definition kernwin.hpp:351
@ esctl_cancel_thread_requests
Definition kernwin.hpp:354
@ esctl_none
Definition kernwin.hpp:352
@ esctl_set_availability
Definition kernwin.hpp:355
@ esctl_cancel_request
Definition kernwin.hpp:353
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:6533
bool idaapi custom_viewer_dblclick_t(TWidget *cv, int shift, void *ud)
The user double clicked.
Definition kernwin.hpp:4324
bool take_database_snapshot(snapshot_t *ss, qstring *err_msg)
Take a database snapshot (ui_take_database_snapshot).
Definition kernwin.hpp:5386
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:5560
TWidget * find_widget(const char *caption)
Find widget with the specified caption (only gui version) (ui_find_widget).
Definition kernwin.hpp:5713
int idaapi obsolete_custom_viewer_help_t(TWidget *cv, void *ud)
Definition kernwin.hpp:4342
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:5229
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:6617
DEPRECATED TWidget * open_calls_window(ea_t ea)
Definition kernwin.hpp:9025
void refresh_custom_viewer(TWidget *custom_viewer)
Refresh custom ida viewer (ui_refresh_custom_viewer)
Definition kernwin.hpp:5815
void refresh_navband(bool force)
Refresh navigation band if changed (ui_refresh_navband).
Definition kernwin.hpp:5277
ea_t get_navband_ea(int pixel)
Translate the pixel position on the navigation band, into an address.
Definition kernwin.hpp:6412
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:4478
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.
qvector< uint32 > ordvec_t
Definition kernwin.hpp:1766
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:5335
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:5517
void * get_viewer_user_data(TWidget *viewer)
Get the user data from a custom viewer (ui_get_viewer_user_data)
Definition kernwin.hpp:6516
void setup_range_marker()
Initialize pointer to idaview marker.
Definition kernwin.hpp:6706
bool restore_database_snapshot(const snapshot_t *ss, ss_restore_cb_t *cb, void *ud)
Restore a database snapshot.
Definition kernwin.hpp:5403
idaman size_t len
Definition kernwin.hpp:1389
THREAD_SAFE int execute_ui_requests(ui_requests_t *reqs)
Execute a list of UI requests (ui_execute_ui_requests_list).
Definition kernwin.hpp:5098
size_t const char * defval
Definition kernwin.hpp:8401
void install_command_interpreter(const cli_t *cp)
Install command line interpreter (ui_install_cli)
Definition kernwin.hpp:5296
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:4907
bool msg_save(qstring &path)
Save the "Output" window contents into a file.
Definition kernwin.hpp:6373
void idaapi ss_restore_cb_t(const char *errmsg, void *ud)
Snapshot restoration completion callback. see restore_database_snapshot()
Definition kernwin.hpp:4777
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:4379
idaman void ida_export mark_builtin_widgets(builtin_widgets_mask_t mask, bool dirty=true)
Request a refresh of a builtin widgets.
idaman int ida_export l_compare2(const place_t *t1, const place_t *t2, void *ud)
idaman int ida_export_data errorexit
Exiting because of a fatal error?
Definition kernwin.hpp:7469
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:4092
bool delete_toolbar(const char *name)
Delete an existing toolbar.
Definition kernwin.hpp:5530
view_notification_t
Notification codes sent by the UI for IDAView or custom viewer events.
Definition kernwin.hpp:4251
@ view_switched
A view's renderer has changed.
Definition kernwin.hpp:4280
@ view_mouse_moved
The mouse moved on the view.
Definition kernwin.hpp:4295
@ view_mouse_over
The user moved the mouse over (or out of) a node or an edge.
Definition kernwin.hpp:4284
@ view_activated
A view is activated.
Definition kernwin.hpp:4252
@ view_dblclick
Double click event.
Definition kernwin.hpp:4267
@ view_deactivated
A view is deactivated.
Definition kernwin.hpp:4255
@ view_created
A view is being created.
Definition kernwin.hpp:4274
@ view_close
View closed.
Definition kernwin.hpp:4277
@ view_loc_changed
The location for the view has changed (can be either the place_t, the renderer_info_t,...
Definition kernwin.hpp:4289
@ view_click
Click event.
Definition kernwin.hpp:4263
@ view_curpos
Cursor position changed.
Definition kernwin.hpp:4271
@ view_keydown
Key down event.
Definition kernwin.hpp:4258
bool is_tif_cursor_index(tif_cursor_t c)
Definition kernwin.hpp:1940
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:5634
TWidget * get_active_modal_widget()
Get the current, active modal TWidget instance.
Definition kernwin.hpp:6395
THREAD_SAFE const char const char * Cancel
Definition kernwin.hpp:8182
THREAD_SAFE bool cancel_exec_request(int req_id)
Try to cancel an asynchronous exec request (ui_cancel_exec_request).
Definition kernwin.hpp:5124
twidget_type_t get_widget_type(TWidget *widget)
Get the type of the TWidget * (ui_get_widget_type).
Definition kernwin.hpp:5729
asize_t size
Definition kernwin.hpp:6701
int load_custom_icon(const char *file_name)
Load an icon from a file (ui_load_custom_icon_file).
Definition kernwin.hpp:5351
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:5778
void mark_all_eaviews_for_refresh()
Tell UI to refresh all idaviews and hexviews.
Definition kernwin.hpp:6724
action_attr_t
Codes for getting/setting action attributes.
Definition kernwin.hpp:5020
@ AA_VISIBILITY
see update_action_visibility()
Definition kernwin.hpp:5029
@ AA_NONE
no effect
Definition kernwin.hpp:5021
@ AA_CHECKED
see update_action_checked()
Definition kernwin.hpp:5028
@ AA_ICON
see update_action_icon()
Definition kernwin.hpp:5025
@ AA_CHECKABLE
see update_action_checkable()
Definition kernwin.hpp:5027
@ AA_TOOLTIP
see update_action_tooltip()
Definition kernwin.hpp:5024
@ AA_LABEL
see update_action_label()
Definition kernwin.hpp:5022
@ AA_SHORTCUT
see update_action_shortcut()
Definition kernwin.hpp:5023
@ AA_STATE
see update_action_state()
Definition kernwin.hpp:5026
qvector< sync_source_t > sync_source_vec_t
Definition kernwin.hpp:2131
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:5737
idaman DEPRECATED void ida_export request_refresh(uint64 mask, bool cnd=true)
qvector< line_section_t > line_sections_t
Definition kernwin.hpp:2513
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:4349
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:1408
idaman void ida_export get_builtin_widgets_state(builtin_widgets_mask_t *out)
Get the "dirty" state for all builtin widgets.
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:4314
bool is_tif_cursor_footer(tif_cursor_t c)
Definition kernwin.hpp:1939
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:7226
QT::QWidget TWidget
Definition kernwin.hpp:2075
ushort get_key_code(const char *keyname)
Get keyboard key code by its name (ui_get_key_code)
Definition kernwin.hpp:5263
idaman bool ida_export_data batch
If this variable is set, then dialog boxes will not appear on the screen.
Definition kernwin.hpp:7463
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:6074
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:6313
tcc_place_type_t
TWidget place_t type.
Definition kernwin.hpp:113
@ TCCPT_PLACE
place_t
Definition kernwin.hpp:115
@ TCCPT_INVALID
invalid
Definition kernwin.hpp:114
@ TCCPT_SIMPLELINE_PLACE
simpleline_place_t
Definition kernwin.hpp:116
@ TCCPT_TIPLACE
tiplace_t
Definition kernwin.hpp:118
@ TCCPT_IDAPLACE
idaplace_t
Definition kernwin.hpp:117
TWidget * get_current_widget()
Get a pointer to the current widget (ui_get_current_widget).
Definition kernwin.hpp:5721
bool banner(int wait)
Show a banner dialog box (ui_banner).
Definition kernwin.hpp:5188
bool is_idaview(TWidget *v)
Is the given custom view an idaview? (ui_is_idaview)
Definition kernwin.hpp:6432
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:5608
bool get_action_visibility(const char *name, bool *visibility)
Get an action's visibility (ui_get_action_attr).
Definition kernwin.hpp:6140
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:6330
locchange_reason_t
Definition kernwin.hpp:4411
@ lcr_jump
Definition kernwin.hpp:4416
@ lcr_unknown
Definition kernwin.hpp:4412
@ lcr_internal
Definition kernwin.hpp:4419
@ lcr_auto_switch
Definition kernwin.hpp:4415
@ lcr_scroll
Definition kernwin.hpp:4418
@ lcr_user_switch
Definition kernwin.hpp:4414
@ lcr_goto
Definition kernwin.hpp:4413
@ lcr_navigate
Definition kernwin.hpp:4417
bool open_ida_link(const char *uri)
Open a resource using URL-style navigation with ida:// scheme.
Definition kernwin.hpp:7609
void open_url(const char *url)
Open the given url (ui_open_url)
Definition kernwin.hpp:5252
void mark_range_for_refresh(ea_t ea, asize_t size)
Inform the UI about any modifications of [ea, ea+size)
Definition kernwin.hpp:6715
THREAD_SAFE int cancel_thread_exec_requests(qthread_t tid)
Try to cancel asynchronous exec requests created by the specified thread.
Definition kernwin.hpp:5134
THREAD_SAFE const char const char int deflt
Definition kernwin.hpp:8183
bool is_ida_library(char *path=nullptr, size_t pathsize=0, void **handle=nullptr)
Definition kernwin.hpp:1415
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:6350
idaman DEPRECATED void ida_export ida_checkmem(const char *file, int line)
bool display_copyright_warning()
Display copyright warning (ui_copywarn).
Definition kernwin.hpp:7380
uint64 tif_cursor_t
A location in a tinfo_t.
Definition kernwin.hpp:1930
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:6322
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:6230
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:5932
mbox_kind_t
see <dbg.hpp>
Definition kernwin.hpp:39
@ mbox_warning
Definition kernwin.hpp:42
@ mbox_wait
Definition kernwin.hpp:49
@ mbox_info
Definition kernwin.hpp:41
@ mbox_internal
internal error
Definition kernwin.hpp:40
@ mbox_error
Definition kernwin.hpp:43
@ mbox_readerror
Definition kernwin.hpp:46
@ mbox_filestruct
Definition kernwin.hpp:48
@ mbox_hide
Definition kernwin.hpp:50
@ mbox_writeerror
Definition kernwin.hpp:47
@ mbox_replace
Definition kernwin.hpp:51
@ mbox_feedback
Definition kernwin.hpp:45
@ mbox_nomem
Definition kernwin.hpp:44
bool get_action_checked(const char *name, bool *checked)
Get an action's checked state (ui_get_action_attr).
Definition kernwin.hpp:6129
choose_type_t
List chooser types.
Definition kernwin.hpp:57
@ chtype_generic
the generic choose() function
Definition kernwin.hpp:58
@ chtype_func
see choose_func(),
Definition kernwin.hpp:64
@ chtype_enum
see choose_enum()
Definition kernwin.hpp:70
@ chtype_idatil
see choose_til()
Definition kernwin.hpp:67
@ chtype_func_ea
see choose_func_ea()
Definition kernwin.hpp:74
@ chtype_srcp
see choose_srcp()
Definition kernwin.hpp:68
@ chtype_name
see choose_name()
Definition kernwin.hpp:61
@ chtype_struct
see choose_struct()
Definition kernwin.hpp:69
@ chtype_stkvar_xref_ea
see choose_stkvar_xref_ea()
Definition kernwin.hpp:73
@ chtype_enum_by_value_and_size
see choose_enum_by_value()
Definition kernwin.hpp:71
@ chtype_stkvar_xref
see choose_stkvar_xref(),
Definition kernwin.hpp:62
@ chtype_xref
see choose_xref()
Definition kernwin.hpp:63
@ chtype_segment
see choose_segment()
Definition kernwin.hpp:72
@ chtype_entry
see choose_entry()
Definition kernwin.hpp:60
@ chtype_segm
see choose_segm(),
Definition kernwin.hpp:65
@ chtype_strpath
see choose_struc_path()
Definition kernwin.hpp:66
@ chtype_idasgn
see choose_idasgn()
Definition kernwin.hpp:59
DEPRECATED bool del_idc_hotkey(const char *hotkey)
Definition kernwin.hpp:9021
const synced_group_t * get_synced_group(const TWidget *w)
Get the group of widgets/registers this view is synchronized with.
Definition kernwin.hpp:5166
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:6524
int hist
Definition kernwin.hpp:8321
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:6679
bool sync_sources(const sync_source_t &what, const sync_source_t &with, bool sync)
[Un]synchronize sources
Definition kernwin.hpp:7020
bool is_action_enabled(action_state_t s)
Check if the given action state is one of AST_ENABLE*.
Definition kernwin.hpp:3106
void analyzer_options()
Allow the user to set analyzer options. (show a dialog box) (ui_analyzer_options)
Definition kernwin.hpp:5209
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:5913
int idaapi buttoncb_t(int button_code, form_actions_t &fa)
Callback.
Definition kernwin.hpp:8158
idaman DEPRECATED bool ida_export is_refresh_requested(uint64 mask)
action_state_t
Action states - returned by action_handler_t::update()
Definition kernwin.hpp:3086
@ AST_ENABLE_ALWAYS
enable action and do not call action_handler_t::update() anymore
Definition kernwin.hpp:3087
@ AST_ENABLE_FOR_WIDGET
enable action for the current widget.
Definition kernwin.hpp:3092
@ AST_DISABLE
analog of AST_ENABLE
Definition kernwin.hpp:3100
@ AST_DISABLE_FOR_IDB
analog of AST_ENABLE_FOR_IDB
Definition kernwin.hpp:3098
@ AST_DISABLE_ALWAYS
disable action and do not call action_handler_t::action() anymore
Definition kernwin.hpp:3097
@ AST_DISABLE_FOR_WIDGET
analog of AST_ENABLE_FOR_WIDGET
Definition kernwin.hpp:3099
@ AST_ENABLE
enable action - call action_handler_t::update() when anything changes
Definition kernwin.hpp:3095
@ AST_ENABLE_FOR_IDB
enable action for the current idb.
Definition kernwin.hpp:3089
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:5152
const char * get_curline()
Get current line from the disassemble window (ui_get_curline).
Definition kernwin.hpp:5247
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:3350
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:4465
DEPRECATED void get_user_strlist_options(strwinsetup_t *out)
Definition kernwin.hpp:9017
bool register_action(const action_desc_t &desc)
Create a new action (ui_register_action).
Definition kernwin.hpp:5487
void refresh_idaview_anyway()
Refresh all disassembly views (ui_refresh), forces an immediate refresh.
Definition kernwin.hpp:5204
bool get_output_cursor(int *x, int *y)
Get coordinates of the output window's cursor (ui_get_output_cursor).
Definition kernwin.hpp:5240
qvector< simpleline_t > strvec_t
A collection of simple lines to populate a custom view.
Definition kernwin.hpp:1765
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:7302
bool get_action_state(const char *name, action_state_t *state)
Get an action's state (ui_get_action_attr).
Definition kernwin.hpp:6107
bool is_builtin_widget_dirty(int bwn)
Get the "dirty" state for a single builtin widget.
Definition kernwin.hpp:2760
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:5650
TWidget * get_last_widget(builtin_widgets_mask_t mask=IWID_ALL)
Get last ida viewer (idaview or custom viewer) (ui_get_last_widget)
Definition kernwin.hpp:6269
qvector< chooser_row_info_t > chooser_row_info_vec_t
Definition kernwin.hpp:3313
void msg_clear()
Clear the "Output" window.
Definition kernwin.hpp:6358
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:2770
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:5692
qvector< const twinline_t * > section_lines_refs_t
Definition kernwin.hpp:2344
ushort lookup_key_code(int key, int shift, bool is_qt)
Get shortcut code previously created by ui_get_key_code.
Definition kernwin.hpp:5271
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:5310
bool get_custom_viewer_location(lochist_entry_t *out, TWidget *custom_viewer, bool mouse=false)
Definition kernwin.hpp:5868
THREAD_SAFE void hide_wait_box()
Hide the "Please wait dialog box".
Definition kernwin.hpp:7350
navaddr_type_t
Definition kernwin.hpp:4059
@ nat_cod
Definition kernwin.hpp:4062
@ nat_err
Definition kernwin.hpp:4066
@ nat_last
Definition kernwin.hpp:4072
@ nat_hlo
Definition kernwin.hpp:4071
@ nat_cur
Definition kernwin.hpp:4068
@ nat_ext
Definition kernwin.hpp:4065
@ nat_gap
Definition kernwin.hpp:4067
@ nat_lum
Definition kernwin.hpp:4070
@ nat_und
Definition kernwin.hpp:4064
@ nat_auto
Definition kernwin.hpp:4069
@ nat_dat
Definition kernwin.hpp:4063
@ nat_lib
Definition kernwin.hpp:4060
@ nat_fun
Definition kernwin.hpp:4061
qvector< cli_completion_t > cli_completion_vec_t
Definition kernwin.hpp:4594
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:7285
qvector< twinline_t > text_t
A group of lines in a text window.
Definition kernwin.hpp:2235
void idaapi custom_viewer_close_t(TWidget *cv, void *ud)
Custom viewer is being destroyed.
Definition kernwin.hpp:4337
bool get_output_curline(qstring *buf, bool mouse)
Get current line of output window (ui_get_output_curline).
Definition kernwin.hpp:6241
custom_viewer_handler_id_t
Custom viewer & code viewer handler types.
Definition kernwin.hpp:4103
@ CDVH_LINES_ALIGNMENT
see set_code_viewer_lines_alignment()
Definition kernwin.hpp:4124
@ CDVH_LINES_CLICK
see code_viewer_lines_click_t
Definition kernwin.hpp:4117
@ CVH_KEYDOWN
see custom_viewer_keydown_t
Definition kernwin.hpp:4105
@ CDVH_USERDATA
see set_code_viewer_user_data()
Definition kernwin.hpp:4115
@ CDVH_LINES_POPUP
see code_viewer_lines_click_t
Definition kernwin.hpp:4119
@ CDVH_LINES_DRAWICON
see code_viewer_lines_icon_t
Definition kernwin.hpp:4120
@ CDVH_SRCVIEW
see set_code_viewer_is_source()
Definition kernwin.hpp:4116
@ CVH_CLICK
see custom_viewer_click_t
Definition kernwin.hpp:4110
@ CVH_DBLCLICK
see custom_viewer_dblclick_t
Definition kernwin.hpp:4107
@ CDVH_LINES_RADIX
see set_code_viewer_lines_radix()
Definition kernwin.hpp:4123
@ CVH_USERDATA
Definition kernwin.hpp:4104
@ CDVH_LINES_FOLD_TOGGLE
see code_viewer_fold_toggle_t
Definition kernwin.hpp:4126
@ CDVH_LINES_LINENUM
see code_viewer_lines_linenum_t
Definition kernwin.hpp:4121
@ CDVH_LINES_ICONMARGIN
see set_code_viewer_lines_icon_margin()
Definition kernwin.hpp:4122
@ CDVH_LINES_DBLCLICK
see code_viewer_lines_click_t
Definition kernwin.hpp:4118
@ CVH_POPUP
see custom_viewer_popup_t
Definition kernwin.hpp:4106
@ CVH_CURPOS
see custom_viewer_curpos_t
Definition kernwin.hpp:4108
@ CDVH_LINES_FOLD_STATE
see code_viewer_fold_state_t
Definition kernwin.hpp:4125
@ CVH_MOUSEMOVE
see custom_viewer_mouse_moved_t
Definition kernwin.hpp:4113
@ CVH_HELP
see custom_viewer_help_t
Definition kernwin.hpp:4112
@ CVH_CLOSE
see custom_viewer_close_t
Definition kernwin.hpp:4109
@ CVH_QT_AWARE
see set_custom_viewer_qt_aware()
Definition kernwin.hpp:4111
void free_custom_icon(int icon_id)
Free an icon loaded with load_custom_icon() (ui_free_custom_icon).
Definition kernwin.hpp:5365
idaman int ida_export l_compare(const place_t *t1, const place_t *t2)
compare places and their lnnums
bool result
Definition kernwin.hpp:8332
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:5949
bool idaapi custom_viewer_click_t(TWidget *cv, int shift, void *ud)
The user clicked.
Definition kernwin.hpp:4319
const place_t * get_place_class_template(int id)
See get_place_class()
Definition kernwin.hpp:2044
void mark_builtin_widget_by_id(int bwn, bool dirty=true)
Request a refresh of a single built widgets, by its ID.
Definition kernwin.hpp:2744
int idaapi til_tinfo_predicate_t(uint32 ord, const tinfo_t &type, void *ud)
Controls which types are displayed/selected when choosing a types from a library.
Definition kernwin.hpp:2165
void destroy_custom_viewer(TWidget *custom_viewer)
Destroy custom ida viewer.
Definition kernwin.hpp:5831
int code
Definition kernwin.hpp:8206
void refresh_idaview()
Refresh marked windows (ui_refreshmarked)
Definition kernwin.hpp:5198
bool close_chooser(const char *title)
Close a non-modal chooser (ui_close_chooser).
Definition kernwin.hpp:5291
builtin_widgets_mask_t builtin_widget_mask_from_id(int bwn)
Definition kernwin.hpp:2730
idaman size_t const char * format
Definition kernwin.hpp:1390
DECLARE_LINEARRAY_HELPERS(idaman) class linearray_t
The group of lines corresponding to a single place within a view.
Definition kernwin.hpp:2251
int input_event_modifiers_t
Definition kernwin.hpp:4144
int cpidx_t
Definition kernwin.hpp:2491
bool get_action_icon(const char *name, int *icon)
Get an action's icon (ui_get_action_attr).
Definition kernwin.hpp:6096
item_type_query_t
Definition kernwin.hpp:3340
@ itq_types
Definition kernwin.hpp:3342
@ itq_functions
Definition kernwin.hpp:3341
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:7371
uint32 idaapi nav_colorizer_t(ea_t ea, asize_t nbytes, void *ud)
Navigation band colorizer function.
Definition kernwin.hpp:4087
bool place_t__deserialize(place_t *_this, const uchar **pptr, const uchar *end)
Definition kernwin.hpp:9003
DEPRECATED bool prompt_function_prototype_ex(qstring *errbuf, tinfo_t *out_tif, qstring *out_name, func_t *pfn, tinfo_t *tif, const char *name)
Definition kernwin.hpp:6302
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:5807
bool idaapi code_viewer_fold_toggle_t(TWidget *cv, const place_t *p, void *ud)
Toggle the fold state for a line.
Definition kernwin.hpp:4528
size_t max_size
Definition kernwin.hpp:8400
idaman NORETURN va_list va
Definition kernwin.hpp:1382
void idaapi custom_viewer_popup_t(TWidget *cv, void *ud)
The user right clicked. See ui_populating_widget_popup, too.
Definition kernwin.hpp:4309
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:5344
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:7261
bool is_place_class_ea_capable(int id)
See get_place_class()
Definition kernwin.hpp:2051
THREAD_SAFE bool is_msg_inited()
Can we use msg() functions?
Definition kernwin.hpp:5193
bool set_highlight(TWidget *viewer, const char *str, int flags)
Set the highlighted identifier in the viewer (ui_set_highlight).
Definition kernwin.hpp:6691
bool is_idaq()
Are we running inside IDA Qt?
Definition kernwin.hpp:5893
idaman THREAD_SAFE ea_t ida_export tagged_line_section_t_get_addr(const tagged_line_section_t *sec, const qstring &line)
Out-of-line implementation of tagged_line_section_t::get_addr(); uses tag_get_addr(),...
constexpr uint32 low(const uint64 &x)
Definition llong.hpp:24
unsigned __int64 uint64
Definition llong.hpp:13
unsigned __int128 uint128
Definition llong.hpp:55
constexpr uint32 high(const uint64 &x)
Definition llong.hpp:25
__int64 int64
Definition llong.hpp:14
qvector< qstring > qstrvec_t
Definition lumina.hpp:831
uchar type_t
In serialized form, a type is represented by a byte sequence.
Definition nalt.hpp:1312
Definition kernwin.hpp:2072
idaman size_t const char time_t t
Definition pro.h:606
unsigned short uint16
unsigned 16 bit value
Definition pro.h:350
int bool
Definition pro.h:333
unsigned int uint32
unsigned 32 bit value
Definition pro.h:352
uint64 asize_t
Definition pro.h:427
uint32 bgcolor_t
background color in RGB
Definition pro.h:5109
qvector< size_t > sizevec_t
vector of sizes
Definition pro.h:2841
adiff_t sval_t
signed value used by the processor.
Definition pro.h:450
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:428
uint64 ea_t
Definition pro.h:425
int int32
signed 32 bit value
Definition pro.h:351
idaman THREAD_SAFE bool ida_export qsem_free(qsemaphore_t sem)
Free a semaphore.
unsigned char uchar
unsigned 8 bit value
Definition pro.h:341
THREAD_SAFE void qswap(T &a, T &b)
Swap 2 objects of the same type using memory copies.
Definition pro.h:1728
idaman size_t bufsize
Definition pro.h:604
uint64 sel_t
Definition pro.h:426
idaman THREAD_SAFE uint32 ida_export unpack_dd(const uchar **pptr, const uchar *end)
unpack a double word, see unpack_db()
size_t diffpos_t
Definition pro.h:483
uval_t inode_t
The inode_t type is the specialization specific inode number.
Definition pro.h:468
uint64 flags64_t
64-bit flags for each address
Definition pro.h:5106
ptrdiff_t ssize_t
Signed size_t - used to check for size overflows when the counter becomes negative.
Definition pro.h:385
unsigned short ushort
unsigned 16 bit value
Definition pro.h:342
ea_t tid_t
type id (for enums, structs, etc)
Definition pro.h:5107
unsigned char uint8
unsigned 8 bit value
Definition pro.h:348
char int8
signed 8 bit value
Definition pro.h:346
_qstring< char > qstring
regular string
Definition pro.h:3771
unsigned int
Definition pronet.h:99
constexpr bool operator!=(qpair< F, S > const &a, qpair< F, S > const &b)
Definition qpair.hpp:103
void swap(qpair< F, S > &a, qpair< F, S > &b) noexcept(noexcept(a.swap(b)))
Definition qpair.hpp:78
constexpr bool operator==(qpair< F, S > const &a, qpair< F, S > const &b)
Definition qpair.hpp:98
Timer opaque handle.
Definition kernwin.hpp:5412
Definition kernwin.hpp:4798
twinpos_t to
end of selection
Definition kernwin.hpp:4800
void reset()
Definition kernwin.hpp:4803
twinpos_t from
start of selection
Definition kernwin.hpp:4799
Maintain information about the current state of the UI.
Definition kernwin.hpp:4816
ea_t cur_ea
the current EA of the position in the view; use it to get current segment info, see ACF_HAS_CURRENT_S...
Definition kernwin.hpp:4873
const char * regname
register name (if widget_type == BWN_CPUREGS and context menu opened on register)
Definition kernwin.hpp:4885
bool has_flag(uint32 flag) const
Check if the given flag is set.
Definition kernwin.hpp:4871
const char * action
action name
Definition kernwin.hpp:4866
fchunk_info_t * cur_fchunk_info
a reference to the the current function chunk info, nullptr otherwise
Definition kernwin.hpp:4899
til_type_ref_t * type_ref
a reference to the current type (if 'widget' is a type listing widget; nullptr otherwise)
Definition kernwin.hpp:4895
TWidget * focus
The focused widget in case it is not the 'form' itself (e.g., the 'quick filter' input in choosers....
Definition kernwin.hpp:4887
interactive_graph_t * graph
the current graph (if in a graph view)
Definition kernwin.hpp:4889
uval_t cur_value
the possible address, or value the cursor is positioned on
Definition kernwin.hpp:4876
qstring widget_title
title of current widget
Definition kernwin.hpp:4862
func_t * cur_fchunk
the current function chunk,
Definition kernwin.hpp:4879
action_ctx_base_cur_sel_t cur_sel
the currently selected range. also see ACF_HAS_SELECTION
Definition kernwin.hpp:4883
segment_t * cur_seg
the current segment,
Definition kernwin.hpp:4881
uint32 cur_flags
Current address information. see Action context property bits.
Definition kernwin.hpp:4868
screen_graph_selection_t * graph_selection
the current graph selection (if in a graph view)
Definition kernwin.hpp:4890
const selection_item_t * hovered
the current item being hovered (if in a graph view)
Definition kernwin.hpp:4891
func_entry_info_t * cur_func_info
a reference to the current function info, nullptr otherwise
Definition kernwin.hpp:4898
action_ctx_base_t()
Constructor.
Definition kernwin.hpp:4818
chooser_base_t * chooser
the underlying chooser_base_t (if 'widget' is a chooser widget)
Definition kernwin.hpp:4863
twidget_type_t widget_type
type of current widget
Definition kernwin.hpp:4861
TWidget * widget
Definition kernwin.hpp:4860
sizevec_t chooser_selection
current chooser selection (0-based). For performance reasons, the selection might be limited.
Definition kernwin.hpp:4864
dirtree_selection_t * dirtree_selection
the current dirtree_t selection (if applicable). For performance reasons, the selection might be limi...
Definition kernwin.hpp:4893
func_t * cur_func
the current function,
Definition kernwin.hpp:4878
void reset()
Invalidate all context info.
Definition kernwin.hpp:4834
segment_info_t * cur_seg_info
a reference to the current segment info, nullptr otherwise
Definition kernwin.hpp:4897
Describe an action to be registered (see register_action())
Definition kernwin.hpp:4957
const char * tooltip
an optional tooltip for the action
Definition kernwin.hpp:4974
action_handler_t * handler
the action handler, for activating/updating.
Definition kernwin.hpp:4966
const char * shortcut
an optional shortcut definition. E.g., "Ctrl+Enter"
Definition kernwin.hpp:4973
const void * owner
either the plugin_t, or plugmod_t responsible for registering the action.
Definition kernwin.hpp:4969
int icon
an optional icon ID to use
Definition kernwin.hpp:4975
int flags
See Action flags.
Definition kernwin.hpp:4996
Manages the behavior of a registered action.
Definition kernwin.hpp:4922
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:4926
Information about an installed add-on (e.g. a plugin)
Definition kernwin.hpp:8477
addon_info_t()
Constructor.
Definition kernwin.hpp:8489
const char * name
Definition kernwin.hpp:8480
const char * id
Definition kernwin.hpp:8479
size_t cb
Definition kernwin.hpp:8478
size_t custom_size
Definition kernwin.hpp:8486
const char * url
Definition kernwin.hpp:8483
const char * producer
Definition kernwin.hpp:8481
const char * freeform
Definition kernwin.hpp:8484
const char * version
Definition kernwin.hpp:8482
const void * custom_data
Definition kernwin.hpp:8485
Chooser object. chooser.
Definition kernwin.hpp:3377
int icon
default icon
Definition kernwin.hpp:3415
bool can_edit() const
Definition kernwin.hpp:3528
int8 builtin_id
Definition kernwin.hpp:3387
int width
(in chars)
Definition kernwin.hpp:3399
void init_popup_names(const char *const default_popup_names[NSTDPOPUPS])
Definition kernwin.hpp:3637
void set_ask_item_attrs(bool enable)
enable or disable generation of ui_get_chooser_item_attrs events
Definition kernwin.hpp:3565
int x1
Definition kernwin.hpp:3397
virtual size_t idaapi get_count() const =0
get the number of elements in the chooser
bool ask_item_attrs() const
should chooser generate ui_get_chooser_item_attrs events?
Definition kernwin.hpp:3552
bool can_del() const
Definition kernwin.hpp:3527
bool can_refresh() const
Definition kernwin.hpp:3529
int columns
number of columns
Definition kernwin.hpp:3405
uint8 flags2
Extended chooser flags
Definition kernwin.hpp:3386
uint8 version
version of the class
Definition kernwin.hpp:3382
bool can_ins() const
is an operation allowed?
Definition kernwin.hpp:3526
int y1
Definition kernwin.hpp:3398
chooser_base_t(uint32 flags_=0, int columns_=0, const int *widths_=nullptr, const char *const *header_=nullptr, const char *title_=nullptr, uint8 flags2_=0, twidget_type_t widget_type_=BWN_UNKNOWN)
Definition kernwin.hpp:3452
bool should_rename_trigger_edit() const
Definition kernwin.hpp:3585
int y0
Definition kernwin.hpp:3396
cbres_t
return value of ins(), del(), edit(), enter(), refresh() callbacks
Definition kernwin.hpp:3625
@ NOTHING_CHANGED
Definition kernwin.hpp:3626
@ ALL_CHANGED
Definition kernwin.hpp:3627
bool is_quick_filter_visible_initially() const
Definition kernwin.hpp:3575
virtual const void * get_obj_id(size_t *len) const
get the id of the chooser data.
Definition kernwin.hpp:3508
uint8 reserved
Definition kernwin.hpp:3385
uint32 flags
Generic chooser flags
Definition kernwin.hpp:3388
bool has_widget_lifecycle() const
should chooser object be deleted when the widget gets destroyed?
Definition kernwin.hpp:3548
virtual bool idaapi init()
initialize the chooser and populate it.
Definition kernwin.hpp:3592
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.
twidget_type_t get_builtin_number() const
get number of the built-in chooser
Definition kernwin.hpp:3556
bool is_lazy_loaded() const
Definition kernwin.hpp:3587
int deflt_col
Column that will have focus.
Definition kernwin.hpp:3450
int height
(in chars)
Definition kernwin.hpp:3400
virtual ea_t idaapi get_ea(size_t) const
get the address of an element.
Definition kernwin.hpp:3621
virtual void idaapi closed()
The chooser window is closed.
Definition kernwin.hpp:3632
bool is_force_default() const
should selection of the already opened non-modal chooser be changed?
Definition kernwin.hpp:3554
bool can_filter() const
Definition kernwin.hpp:3583
@ POPUP_INS
Definition kernwin.hpp:3440
@ POPUP_REFRESH
Definition kernwin.hpp:3440
@ NSTDPOPUPS
Definition kernwin.hpp:3440
@ POPUP_EDIT
Definition kernwin.hpp:3440
@ POPUP_DEL
Definition kernwin.hpp:3440
qstring popup_names[NSTDPOPUPS]
array of custom labels of the standard actions.
Definition kernwin.hpp:3448
const char *const * header
header line; contains the tooltips, and column name for each of 'columns' columns.
Definition kernwin.hpp:3409
int x0
screen position, Functions: generic list choosers
Definition kernwin.hpp:3395
const int * widths
column widths
Definition kernwin.hpp:3406
const char * title
menu title (includes ptr to help).
Definition kernwin.hpp:3402
Chooser item attributes.
Definition kernwin.hpp:3268
bgcolor_t color
item color
Definition kernwin.hpp:3273
void reset()
Definition kernwin.hpp:3278
int flags
Chooser item property bits
Definition kernwin.hpp:3272
int cb
size of this structure.
Definition kernwin.hpp:3269
chooser_item_attrs_t()
Definition kernwin.hpp:3274
The chooser object with multi-selection.
Definition kernwin.hpp:3824
chooser_multi_t(uint32 flags_=0, int columns_=0, const int *widths_=nullptr, const char *const *header_=nullptr, const char *title_=nullptr, uint8 flags2_=0, twidget_type_t widget_type_=BWN_UNKNOWN)
Definition kernwin.hpp:3825
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:3960
virtual cbres_t idaapi del(sizevec_t *) new api
User deleted elements.
Definition kernwin.hpp:3871
virtual cbres_t idaapi ins(sizevec_t *) new api
User asked to insert an element.
Definition kernwin.hpp:3863
void adjust_last_item(sizevec_t *sel, size_t n) const
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:3915
virtual cbres_t idaapi refresh(sizevec_t *) new api
The chooser needs to be refreshed.
Definition kernwin.hpp:3896
typedef cbres_t(idaapi chooser_multi_t::*cb_t)(sizevec_t *sel)
Type of ins(), del(), edit(), enter(), refresh() callbacks.
virtual cbres_t idaapi checked(size_t, int) new api
A checkbox was toggled by the user.
Definition kernwin.hpp:3970
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:3921
virtual bool idaapi get_stdact_descs(chooser_stdact_desc_t *[NSTDPOPUPS]) new api
Get the description of the standard chooser actions.
Definition kernwin.hpp:3932
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:3909
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:3947
Row data returned by get_chooser_rows().
Definition kernwin.hpp:3295
chooser_item_attrs_t attrs
styling attributes
Definition kernwin.hpp:3297
int icon
icon number
Definition kernwin.hpp:3298
qstrvec_t texts
texts, one per chooser column
Definition kernwin.hpp:3296
Definition kernwin.hpp:3352
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:3369
int icon
Definition kernwin.hpp:3356
const char * label
see action_desc_t
Definition kernwin.hpp:3354
int version
to support the backward compatibility
Definition kernwin.hpp:3353
chooser_stdact_desc_t(const char *_label=nullptr, const char *_tooltip=nullptr, int _icon=-1)
Definition kernwin.hpp:3358
const char * tooltip
Definition kernwin.hpp:3355
Return value of ins(), del(), edit(), enter(), refresh() callbacks.
Definition kernwin.hpp:3655
The chooser object without multi-selection.
Definition kernwin.hpp:3652
virtual cbret_t idaapi checked(size_t, int) new api
A checkbox was toggled by the user.
Definition kernwin.hpp:3798
virtual cbret_t idaapi refresh(ssize_t n) new api
The chooser needs to be refreshed.
Definition kernwin.hpp:3729
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:3749
virtual cbret_t idaapi del(size_t) new api
User deleted an element.
Definition kernwin.hpp:3705
virtual cbret_t idaapi ins(ssize_t) new api
User asked to insert an element.
Definition kernwin.hpp:3699
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:3788
virtual cbret_t idaapi enter(size_t n) new api
User pressed the enter key.
Definition kernwin.hpp:3718
virtual dirtree_t *idaapi get_dirtree() new api
Deprecated. Please do not use.
Definition kernwin.hpp:3740
chooser_t(uint32 flags_=0, int columns_=0, const int *widths_=nullptr, const char *const *header_=nullptr, const char *title_=nullptr, uint8 flags2_=0, twidget_type_t widget_type_=BWN_UNKNOWN)
Definition kernwin.hpp:3663
virtual bool idaapi get_stdact_descs(chooser_stdact_desc_t *[NSTDPOPUPS]) new api
Get the description of the standard chooser actions.
Definition kernwin.hpp:3760
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:3775
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:3711
Definition kernwin.hpp:4588
Definition kernwin.hpp:4598
void clear()
Definition kernwin.hpp:4607
int match_end
Definition kernwin.hpp:4602
cli_completion_vec_t entries
Definition kernwin.hpp:4600
size_t size() const
Definition kernwin.hpp:4604
int match_start
Definition kernwin.hpp:4601
Command line interpreter.
Definition kernwin.hpp:4626
qstrvec_t qstrvec_t * out_docs
Definition kernwin.hpp:4666
int * p_x
Definition kernwin.hpp:4657
const char * lname
long name (displayed in the menu)
Definition kernwin.hpp:4635
const char * sname
short name (displayed on the button)
Definition kernwin.hpp:4634
qstrvec_t * out_hints
Definition kernwin.hpp:4665
qstrvec_t qstrvec_t int int const char int x
Definition kernwin.hpp:4670
int int * p_sellen
Definition kernwin.hpp:4658
const char * hint
hint for the input line
Definition kernwin.hpp:4636
int int int int shift
Definition kernwin.hpp:4660
int int int * p_vk_key
Definition kernwin.hpp:4659
const char int size_t max_results
Definition kernwin.hpp:4684
qstrvec_t qstrvec_t int int * out_match_end
Definition kernwin.hpp:4668
qstrvec_t qstrvec_t int * out_match_start
Definition kernwin.hpp:4667
qstrvec_t qstrvec_t int int const char * line
Definition kernwin.hpp:4669
Definition dbg.hpp:2785
Definition dirtree.hpp:200
Execute code in the main thread - to be used with execute_sync().
Definition kernwin.hpp:4724
qsemaphore_t sem
semaphore to communicate with the main thread.
Definition kernwin.hpp:4735
ssize_t code
temporary location, used internally
Definition kernwin.hpp:4734
virtual ssize_t idaapi execute()=0
Callback to be executed.
Functions available from formchgcb_t.
Definition kernwin.hpp:7971
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:8086
@ dbt_cancel
Definition kernwin.hpp:8088
@ dbt_no
Definition kernwin.hpp:8089
@ dbt_yes
Definition kernwin.hpp:8087
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:8127
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:8119
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:8123
tab_attr_t
Definition kernwin.hpp:8112
@ ta_enabled
Definition kernwin.hpp:8115
@ ta_visible
Definition kernwin.hpp:8114
@ ta_unknown
Definition kernwin.hpp:8113
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:8131
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:1821
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 get_dbg_deref_options(dbg_deref_options_t &out) const
Definition kernwin.hpp:1868
virtual bool is_editing_text() const =0
virtual void get_cur_item_text(qstring *out) const =0
static bool can_show_text(data_kind_t k)
Definition kernwin.hpp:1878
virtual bool has_central_separator() const =0
data_kind_t
Definition kernwin.hpp:1824
@ dk_float
Definition kernwin.hpp:1825
@ dk_addr_text
Definition kernwin.hpp:1828
@ dk_addr_names
Definition kernwin.hpp:1827
@ dk_addr_deref
Definition kernwin.hpp:1829
@ dk_int
Definition kernwin.hpp:1826
virtual bool show_text() const =0
bool is_addr_kind() const
Definition kernwin.hpp:1882
virtual bool is_curitem_changed() const =0
int_format_t
Definition kernwin.hpp:1832
@ if_hex
Definition kernwin.hpp:1833
@ if_signed
Definition kernwin.hpp:1834
@ if_unsigned
Definition kernwin.hpp:1835
virtual int get_alignment() const =0
virtual int get_bitness() const =0
byte_kind_t
Definition kernwin.hpp:1839
@ BK_VALID
Definition kernwin.hpp:1840
@ BK_NOVALUE
Definition kernwin.hpp:1842
@ BK_INVALIDADDR
Definition kernwin.hpp:1841
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:4566
A representation of a user input.
Definition kernwin.hpp:4549
int cb
size marker
Definition kernwin.hpp:4550
input_event_shortcut_data_t shortcut
Definition kernwin.hpp:4574
input_event_mouse_data_t mouse
Definition kernwin.hpp:4576
input_event_t()
Definition kernwin.hpp:4579
input_event_keyboard_data_t keyboard
Definition kernwin.hpp:4575
Definition kernwin.hpp:2397
line_rendering_output_entry_t(const twinline_t *_line, uint32 _flags=0, bgcolor_t _bg_color=0)
Definition kernwin.hpp:2420
const twinline_t * line
Definition kernwin.hpp:2398
bool is_bg_color_key() const
Definition kernwin.hpp:2427
uint32 flags
line_rendering_output_entry_t flags
Definition kernwin.hpp:2399
bool is_bg_color_empty() const
Definition kernwin.hpp:2426
bgcolor_t bg_color
Definition kernwin.hpp:2415
int cpx
number of char to start from, valid if LROEF_CPS_RANGE
Definition kernwin.hpp:2417
int nchars
chars count, valid if LROEF_CPS_RANGE
Definition kernwin.hpp:2418
Definition kernwin.hpp:2495
bool is_closed() const
Definition kernwin.hpp:2506
cplen_t length
Definition kernwin.hpp:2497
bool is_open() const
Definition kernwin.hpp:2505
bool contains(cpidx_t x) const
Definition kernwin.hpp:2500
bool operator==(const line_section_t &r) const
Definition kernwin.hpp:2509
cpidx_t start
Definition kernwin.hpp:2496
bool valid() const
Definition kernwin.hpp:2507
Definition kernwin.hpp:2448
void clear()
Definition kernwin.hpp:2457
uint32 flags
Definition kernwin.hpp:2450
line_rendering_output_entries_refs_t entries
Definition kernwin.hpp:2449
Holds (live) data about a location being displayed in a listing.
Definition kernwin.hpp:2721
List of loaders.
Definition loader.hpp:226
Definition ua.hpp:709
Definition idp.hpp:2323
Definition idp.hpp:2265
Ignores range_marker during the lifetime of the object.
Definition kernwin.hpp:6733
range_marker_suspender_t()
Definition kernwin.hpp:6735
Vector of range_t instances.
Definition range.hpp:93
Definition moves.hpp:113
Information about a position relative to the renderer.
Definition kernwin.hpp:4187
short sx
the number of chars that are scrolled (flat mode only)
Definition kernwin.hpp:4203
short cy
the Y coords of the character.
Definition kernwin.hpp:4199
short cx
the X coords of the character in the current line.
Definition kernwin.hpp:4194
int node
the node, or -1 if the current renderer is not a graph renderer.
Definition kernwin.hpp:4191
renderer_pos_info_t()
Constructor.
Definition kernwin.hpp:4189
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:8585
Structure to keep string list parameters.
Definition strlist.hpp:27
Definition kernwin.hpp:2134
Definition kernwin.hpp:2535
color_t tag
Definition kernwin.hpp:2541
struct tagged_line_section_t::@234363117142122123010107076233017075243326343142 byte_offsets
int text_end
Definition kernwin.hpp:2539
bool valid_in(const qstring &in) const
Definition kernwin.hpp:2562
int text_start
Definition kernwin.hpp:2538
tagged_line_section_t()
Definition kernwin.hpp:2543
bool valid() const
Definition kernwin.hpp:2554
Definition kernwin.hpp:2603
const tagged_line_section_t * nearest_before(const tagged_line_section_t &range, cpidx_t start, color_t tag=0) const
Definition kernwin.hpp:2675
const tagged_line_section_t * innermost_at(cpidx_t x, color_t tag=0) const
Definition kernwin.hpp:2638
const tagged_line_section_t * next(const tagged_line_section_t &anchor, color_t tag) const
Definition kernwin.hpp:2612
Multi line text control, used to embed a text control in a form.
Definition kernwin.hpp:3985
uint16 flags
Text control property bits
Definition kernwin.hpp:3988
uint16 tabsize
how many spaces a single tab will indent
Definition kernwin.hpp:4002
size_t cb
size of this structure
Definition kernwin.hpp:3986
textctrl_info_t()
Constructor.
Definition kernwin.hpp:4003
Type Information Library.
Definition typeinf.hpp:728
Definition typeinf.hpp:6805
Information about a mouse action within a view.
Definition kernwin.hpp:4227
view_event_state_t state
contains information about what buttons are CURRENTLY pressed on the keyboard and mouse.
Definition kernwin.hpp:4236
renderer_pos_info_t renderer_pos
position where event was generated, relative to the renderer
Definition kernwin.hpp:4244
vme_button_t button
represents which mouse button was responsible for generating the event.
Definition kernwin.hpp:4241
Callui return codes.
Definition kernwin.hpp:320
char i8
Definition kernwin.hpp:322
ushort u16
Definition kernwin.hpp:327
uchar u8
Definition kernwin.hpp:326
bool cnd
Definition kernwin.hpp:321
plugin_t * pluginptr
Definition kernwin.hpp:334
char * cptr
Definition kernwin.hpp:329
ea_t ea
Definition kernwin.hpp:336
short i16
Definition kernwin.hpp:324
void * vptr
Definition kernwin.hpp:330
uint32 u32
Definition kernwin.hpp:328
sreg_range_t * sraptr
Definition kernwin.hpp:335
int32 i32
Definition kernwin.hpp:325
func_t * fptr
Definition kernwin.hpp:332
int i
Definition kernwin.hpp:323
segment_t * segptr
Definition kernwin.hpp:333
ssize_t ssize
Definition kernwin.hpp:331
Abstraction of location in flat view/graph views (out of 'view_mouse_event_t' to make it easy for SWi...
Definition kernwin.hpp:4218