idalib/
meta.rs

1use std::marker::PhantomData;
2use std::mem;
3
4use bitflags::bitflags;
5
6use crate::ffi::inf::*;
7use crate::idb::IDB;
8use crate::Address;
9
10bitflags! {
11    #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
12    pub struct AnalysisFlags: u32 {
13        const CODE = AF_CODE as _;
14        const MARKCODE = AF_MARKCODE as _;
15        const JUMPTBL = AF_JUMPTBL as _;
16        const PURDAT = AF_PURDAT as _;
17        const USED = AF_USED as _;
18        const UNK = AF_UNK as _;
19
20        const PROCPTR = AF_PROCPTR as _;
21        const PROC = AF_PROC as _;
22        const FTAIL = AF_FTAIL as _;
23        const LVAR = AF_LVAR as _;
24        const STKARG = AF_STKARG as _;
25        const REGARG = AF_REGARG as _;
26        const TRACE = AF_TRACE as _;
27        const VERSP = AF_VERSP as _;
28        const ANORET = AF_ANORET as _;
29        const MEMFUNC = AF_MEMFUNC as _;
30        const TRFUNC = AF_TRFUNC as _;
31
32        const STRLIT = AF_STRLIT as _;
33        const CHKUNI = AF_CHKUNI as _;
34        const FIXUP = AF_FIXUP as _;
35        const DREFOFF = AF_DREFOFF as _;
36        const IMMOFF = AF_IMMOFF as _;
37        const DATOFF = AF_DATOFF as _;
38
39        const FLIRT = AF_FLIRT as _;
40        const SIGCMT = AF_SIGCMT as _;
41        const SIGMLT = AF_SIGMLT as _;
42        const HFLIRT = AF_HFLIRT as _;
43
44        const JFUNC = AF_JFUNC as _;
45        const NULLSUB = AF_NULLSUB as _;
46
47        const DODATA = AF_DODATA as _;
48        const DOCODE = AF_DOCODE as _;
49        const FINAL = AF_FINAL as _;
50    }
51}
52
53bitflags! {
54    #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
55    pub struct AnalysisFlags2: u32 {
56        const DOEH = AF2_DOEH as _;
57        const DORTTI = AF2_DORTTI as _;
58        const MACRO = AF2_MACRO as _;
59        const MERGESTR = AF2_MERGESTR as _;
60    }
61}
62
63bitflags! {
64    #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
65    pub struct ShowXRefFlags: u8 {
66        const SEGXRF = SW_SEGXRF as _;
67        const XRFMRK = SW_XRFMRK as _;
68        const XRFFNC = SW_XRFFNC as _;
69        const XRFVAL = SW_XRFVAL as _;
70    }
71}
72
73#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
74#[repr(u32)]
75pub enum FileType {
76    #[doc(hidden)]
77    OldEXE = filetype_t::f_EXE_old as _,
78    #[doc(hidden)]
79    OldCOM = filetype_t::f_COM_old as _,
80    BIN = filetype_t::f_BIN as _,
81    DRV = filetype_t::f_DRV as _,
82    WIN = filetype_t::f_WIN as _,
83    HEX = filetype_t::f_HEX as _,
84    MEX = filetype_t::f_MEX as _,
85    LX = filetype_t::f_LX as _,
86    LE = filetype_t::f_LE as _,
87    NLM = filetype_t::f_NLM as _,
88    COFF = filetype_t::f_COFF as _,
89    PE = filetype_t::f_PE as _,
90    OMF = filetype_t::f_OMF as _,
91    SREC = filetype_t::f_SREC as _,
92    ZIP = filetype_t::f_ZIP as _,
93    OMFLIB = filetype_t::f_OMFLIB as _,
94    AR = filetype_t::f_AR as _,
95    LOADER = filetype_t::f_LOADER as _,
96    ELF = filetype_t::f_ELF as _,
97    W32RUN = filetype_t::f_W32RUN as _,
98    AOUT = filetype_t::f_AOUT as _,
99    PRC = filetype_t::f_PRC as _,
100    EXE = filetype_t::f_EXE as _,
101    COM = filetype_t::f_COM as _,
102    AIXAR = filetype_t::f_AIXAR as _,
103    MACHO = filetype_t::f_MACHO as _,
104    PSXOBJ = filetype_t::f_PSXOBJ as _,
105    MD1IMG = filetype_t::f_MD1IMG as _,
106}
107
108#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
109#[repr(u8)]
110pub enum Compiler {
111    UNK = COMP_UNK as _,
112    MS = COMP_MS as _,
113    BC = COMP_BC as _,
114    WATCOM = COMP_WATCOM as _,
115    GNU = COMP_GNU as _,
116    VISAGE = COMP_VISAGE as _,
117    BP = COMP_BP as _,
118    UNSURE = COMP_UNSURE as _,
119}
120
121pub struct Metadata<'a> {
122    _marker: PhantomData<&'a IDB>,
123}
124
125impl<'a> Metadata<'a> {
126    pub(crate) fn new() -> Self {
127        Self {
128            _marker: PhantomData,
129        }
130    }
131
132    pub fn version(&self) -> u16 {
133        unsafe { idalib_inf_get_version() }
134    }
135
136    pub fn genflags(&self) -> u16 {
137        unsafe { idalib_inf_get_genflags() }
138    }
139
140    pub fn is_auto_enabled(&self) -> bool {
141        unsafe { idalib_inf_is_auto_enabled() }
142    }
143
144    pub fn use_allasm(&self) -> bool {
145        unsafe { idalib_inf_use_allasm() }
146    }
147
148    pub fn loading_idc(&self) -> bool {
149        unsafe { idalib_inf_loading_idc() }
150    }
151
152    pub fn no_store_user_info(&self) -> bool {
153        unsafe { idalib_inf_no_store_user_info() }
154    }
155
156    pub fn readonly_idb(&self) -> bool {
157        unsafe { idalib_inf_readonly_idb() }
158    }
159
160    pub fn check_manual_ops(&self) -> bool {
161        unsafe { idalib_inf_check_manual_ops() }
162    }
163
164    pub fn allow_non_matched_ops(&self) -> bool {
165        unsafe { idalib_inf_allow_non_matched_ops() }
166    }
167
168    pub fn is_graph_view(&self) -> bool {
169        unsafe { idalib_inf_is_graph_view() }
170    }
171
172    pub fn lflags(&self) -> u32 {
173        unsafe { idalib_inf_get_lflags() }
174    }
175
176    pub fn decode_fpp(&self) -> bool {
177        unsafe { idalib_inf_decode_fpp() }
178    }
179
180    pub fn is_32bit_or_higher(&self) -> bool {
181        unsafe { idalib_inf_is_32bit_or_higher() }
182    }
183
184    pub fn is_32bit_exactly(&self) -> bool {
185        unsafe { idalib_inf_is_32bit_exactly() }
186    }
187
188    pub fn is_16bit(&self) -> bool {
189        unsafe { idalib_inf_is_16bit() }
190    }
191
192    pub fn is_64bit(&self) -> bool {
193        unsafe { idalib_inf_is_64bit() }
194    }
195
196    pub fn is_dll(&self) -> bool {
197        unsafe { idalib_inf_is_dll() }
198    }
199
200    pub fn is_flat_off32(&self) -> bool {
201        unsafe { idalib_inf_is_flat_off32() }
202    }
203
204    pub fn is_be(&self) -> bool {
205        unsafe { idalib_inf_is_be() }
206    }
207
208    pub fn is_wide_high_byte_first(&self) -> bool {
209        unsafe { idalib_inf_is_wide_high_byte_first() }
210    }
211
212    pub fn dbg_no_store_path(&self) -> bool {
213        unsafe { idalib_inf_dbg_no_store_path() }
214    }
215
216    pub fn is_snapshot(&self) -> bool {
217        unsafe { idalib_inf_is_snapshot() }
218    }
219
220    pub fn pack_idb(&self) -> bool {
221        unsafe { idalib_inf_pack_idb() }
222    }
223
224    pub fn compress_idb(&self) -> bool {
225        unsafe { idalib_inf_compress_idb() }
226    }
227
228    pub fn is_kernel_mode(&self) -> bool {
229        unsafe { idalib_inf_is_kernel_mode() }
230    }
231
232    pub fn app_bitness(&self) -> u32 {
233        unsafe { idalib_inf_get_app_bitness().into() }
234    }
235
236    pub fn database_change_count(&self) -> u32 {
237        unsafe { idalib_inf_get_database_change_count() }
238    }
239
240    pub fn filetype(&self) -> FileType {
241        unsafe { mem::transmute(idalib_inf_get_filetype()) }
242    }
243
244    pub fn ostype(&self) -> u16 {
245        unsafe { idalib_inf_get_ostype() }
246    }
247
248    pub fn apptype(&self) -> u16 {
249        unsafe { idalib_inf_get_apptype() }
250    }
251
252    pub fn asmtype(&self) -> u8 {
253        unsafe { idalib_inf_get_asmtype() }
254    }
255
256    pub fn specsegs(&self) -> u8 {
257        unsafe { idalib_inf_get_specsegs() }
258    }
259
260    pub fn af(&self) -> AnalysisFlags {
261        AnalysisFlags::from_bits_retain(unsafe { idalib_inf_get_af() })
262    }
263
264    pub fn trace_flow(&self) -> bool {
265        unsafe { idalib_inf_trace_flow() }
266    }
267
268    pub fn mark_code(&self) -> bool {
269        unsafe { idalib_inf_mark_code() }
270    }
271
272    pub fn create_jump_tables(&self) -> bool {
273        unsafe { idalib_inf_create_jump_tables() }
274    }
275
276    pub fn noflow_to_data(&self) -> bool {
277        unsafe { idalib_inf_noflow_to_data() }
278    }
279
280    pub fn create_all_xrefs(&self) -> bool {
281        unsafe { idalib_inf_create_all_xrefs() }
282    }
283
284    pub fn create_func_from_ptr(&self) -> bool {
285        unsafe { idalib_inf_create_func_from_ptr() }
286    }
287
288    pub fn create_func_from_call(&self) -> bool {
289        unsafe { idalib_inf_create_func_from_call() }
290    }
291
292    pub fn create_func_tails(&self) -> bool {
293        unsafe { idalib_inf_create_func_tails() }
294    }
295
296    pub fn should_create_stkvars(&self) -> bool {
297        unsafe { idalib_inf_should_create_stkvars() }
298    }
299
300    pub fn propagate_stkargs(&self) -> bool {
301        unsafe { idalib_inf_propagate_stkargs() }
302    }
303
304    pub fn propagate_regargs(&self) -> bool {
305        unsafe { idalib_inf_propagate_regargs() }
306    }
307
308    pub fn should_trace_sp(&self) -> bool {
309        unsafe { idalib_inf_should_trace_sp() }
310    }
311
312    pub fn full_sp_ana(&self) -> bool {
313        unsafe { idalib_inf_full_sp_ana() }
314    }
315
316    pub fn noret_ana(&self) -> bool {
317        unsafe { idalib_inf_noret_ana() }
318    }
319
320    pub fn guess_func_type(&self) -> bool {
321        unsafe { idalib_inf_guess_func_type() }
322    }
323
324    pub fn truncate_on_del(&self) -> bool {
325        unsafe { idalib_inf_truncate_on_del() }
326    }
327
328    pub fn create_strlit_on_xref(&self) -> bool {
329        unsafe { idalib_inf_create_strlit_on_xref() }
330    }
331
332    pub fn check_unicode_strlits(&self) -> bool {
333        unsafe { idalib_inf_check_unicode_strlits() }
334    }
335
336    pub fn create_off_using_fixup(&self) -> bool {
337        unsafe { idalib_inf_create_off_using_fixup() }
338    }
339
340    pub fn create_off_on_dref(&self) -> bool {
341        unsafe { idalib_inf_create_off_on_dref() }
342    }
343
344    pub fn op_offset(&self) -> bool {
345        unsafe { idalib_inf_op_offset() }
346    }
347
348    pub fn data_offset(&self) -> bool {
349        unsafe { idalib_inf_data_offset() }
350    }
351
352    pub fn use_flirt(&self) -> bool {
353        unsafe { idalib_inf_use_flirt() }
354    }
355
356    pub fn append_sigcmt(&self) -> bool {
357        unsafe { idalib_inf_append_sigcmt() }
358    }
359
360    pub fn allow_sigmulti(&self) -> bool {
361        unsafe { idalib_inf_allow_sigmulti() }
362    }
363
364    pub fn hide_libfuncs(&self) -> bool {
365        unsafe { idalib_inf_hide_libfuncs() }
366    }
367
368    pub fn rename_jumpfunc(&self) -> bool {
369        unsafe { idalib_inf_rename_jumpfunc() }
370    }
371
372    pub fn rename_nullsub(&self) -> bool {
373        unsafe { idalib_inf_rename_nullsub() }
374    }
375
376    pub fn coagulate_data(&self) -> bool {
377        unsafe { idalib_inf_coagulate_data() }
378    }
379
380    pub fn coagulate_code(&self) -> bool {
381        unsafe { idalib_inf_coagulate_code() }
382    }
383
384    pub fn final_pass(&self) -> bool {
385        unsafe { idalib_inf_final_pass() }
386    }
387
388    pub fn af2(&self) -> u32 {
389        unsafe { idalib_inf_get_af2() }
390    }
391
392    pub fn handle_eh(&self) -> bool {
393        unsafe { idalib_inf_handle_eh() }
394    }
395
396    pub fn handle_rtti(&self) -> bool {
397        unsafe { idalib_inf_handle_rtti() }
398    }
399
400    pub fn macros_enabled(&self) -> bool {
401        unsafe { idalib_inf_macros_enabled() }
402    }
403
404    pub fn merge_strlits(&self) -> bool {
405        unsafe { idalib_inf_merge_strlits() }
406    }
407
408    pub fn base_address(&self) -> Address {
409        unsafe { idalib_inf_get_baseaddr().into() }
410    }
411
412    pub fn start_stack_segment(&self) -> Address {
413        unsafe { idalib_inf_get_start_ss().into() }
414    }
415
416    pub fn start_code_segment(&self) -> Address {
417        unsafe { idalib_inf_get_start_cs().into() }
418    }
419
420    pub fn start_instruction_pointer(&self) -> Address {
421        unsafe { idalib_inf_get_start_ip().into() }
422    }
423
424    pub fn start_address(&self) -> Address {
425        unsafe { idalib_inf_get_start_ea().into() }
426    }
427
428    pub fn start_stack_pointer(&self) -> Address {
429        unsafe { idalib_inf_get_start_sp().into() }
430    }
431
432    pub fn main_address(&self) -> Address {
433        unsafe { idalib_inf_get_main().into() }
434    }
435
436    pub fn min_address(&self) -> Address {
437        unsafe { idalib_inf_get_min_ea().into() }
438    }
439
440    pub fn max_address(&self) -> Address {
441        unsafe { idalib_inf_get_max_ea().into() }
442    }
443
444    pub fn omin_address(&self) -> Address {
445        unsafe { idalib_inf_get_omin_ea().into() }
446    }
447
448    pub fn omax_ea(&self) -> Address {
449        unsafe { idalib_inf_get_omax_ea().into() }
450    }
451
452    pub fn lowoff(&self) -> u64 {
453        unsafe { idalib_inf_get_lowoff().into() }
454    }
455
456    pub fn highoff(&self) -> u64 {
457        unsafe { idalib_inf_get_highoff().into() }
458    }
459
460    pub fn maxref(&self) -> u64 {
461        unsafe { idalib_inf_get_maxref().into() }
462    }
463
464    pub fn netdelta(&self) -> i64 {
465        unsafe { idalib_inf_get_netdelta().into() }
466    }
467
468    pub fn xrefnum(&self) -> u8 {
469        unsafe { idalib_inf_get_xrefnum() }
470    }
471
472    pub fn type_xrefnum(&self) -> u8 {
473        unsafe { idalib_inf_get_type_xrefnum() }
474    }
475
476    pub fn refcmtnum(&self) -> u8 {
477        unsafe { idalib_inf_get_refcmtnum() }
478    }
479
480    pub fn xrefflag(&self) -> u8 {
481        unsafe { idalib_inf_get_xrefflag() }
482    }
483
484    pub fn show_xref_seg(&self) -> bool {
485        unsafe { idalib_inf_show_xref_seg() }
486    }
487
488    pub fn show_xref_tmarks(&self) -> bool {
489        unsafe { idalib_inf_show_xref_tmarks() }
490    }
491
492    pub fn show_xref_fncoff(&self) -> bool {
493        unsafe { idalib_inf_show_xref_fncoff() }
494    }
495
496    pub fn show_xref_val(&self) -> bool {
497        unsafe { idalib_inf_show_xref_val() }
498    }
499
500    pub fn max_autoname_len(&self) -> u16 {
501        unsafe { idalib_inf_get_max_autoname_len() }
502    }
503
504    pub fn nametype(&self) -> i8 {
505        unsafe { idalib_inf_get_nametype() }
506    }
507
508    pub fn short_demnames(&self) -> u32 {
509        unsafe { idalib_inf_get_short_demnames() }
510    }
511
512    pub fn long_demnames(&self) -> u32 {
513        unsafe { idalib_inf_get_long_demnames() }
514    }
515
516    pub fn demnames(&self) -> u8 {
517        unsafe { idalib_inf_get_demnames() }
518    }
519
520    pub fn listnames(&self) -> u8 {
521        unsafe { idalib_inf_get_listnames() }
522    }
523
524    pub fn indent(&self) -> u8 {
525        unsafe { idalib_inf_get_indent() }
526    }
527
528    pub fn cmt_indent(&self) -> u8 {
529        unsafe { idalib_inf_get_cmt_indent() }
530    }
531
532    pub fn margin(&self) -> u16 {
533        unsafe { idalib_inf_get_margin() }
534    }
535
536    pub fn lenxref(&self) -> u16 {
537        unsafe { idalib_inf_get_lenxref() }
538    }
539
540    pub fn outflags(&self) -> u32 {
541        unsafe { idalib_inf_get_outflags() }
542    }
543
544    pub fn show_void(&self) -> bool {
545        unsafe { idalib_inf_show_void() }
546    }
547
548    pub fn show_auto(&self) -> bool {
549        unsafe { idalib_inf_show_auto() }
550    }
551
552    pub fn gen_null(&self) -> bool {
553        unsafe { idalib_inf_gen_null() }
554    }
555
556    pub fn show_line_pref(&self) -> bool {
557        unsafe { idalib_inf_show_line_pref() }
558    }
559
560    pub fn line_pref_with_seg(&self) -> bool {
561        unsafe { idalib_inf_line_pref_with_seg() }
562    }
563
564    pub fn gen_lzero(&self) -> bool {
565        unsafe { idalib_inf_gen_lzero() }
566    }
567
568    pub fn gen_org(&self) -> bool {
569        unsafe { idalib_inf_gen_org() }
570    }
571
572    pub fn gen_assume(&self) -> bool {
573        unsafe { idalib_inf_gen_assume() }
574    }
575
576    pub fn gen_tryblks(&self) -> bool {
577        unsafe { idalib_inf_gen_tryblks() }
578    }
579
580    pub fn cmtflg(&self) -> u8 {
581        unsafe { idalib_inf_get_cmtflg() }
582    }
583
584    pub fn show_repeatables(&self) -> bool {
585        unsafe { idalib_inf_show_repeatables() }
586    }
587
588    pub fn show_all_comments(&self) -> bool {
589        unsafe { idalib_inf_show_all_comments() }
590    }
591
592    pub fn hide_comments(&self) -> bool {
593        unsafe { idalib_inf_hide_comments() }
594    }
595
596    pub fn show_src_linnum(&self) -> bool {
597        unsafe { idalib_inf_show_src_linnum() }
598    }
599
600    pub fn test_mode(&self) -> bool {
601        unsafe { idalib_inf_test_mode() }
602    }
603
604    pub fn show_hidden_insns(&self) -> bool {
605        unsafe { idalib_inf_show_hidden_insns() }
606    }
607
608    pub fn show_hidden_funcs(&self) -> bool {
609        unsafe { idalib_inf_show_hidden_funcs() }
610    }
611
612    pub fn show_hidden_segms(&self) -> bool {
613        unsafe { idalib_inf_show_hidden_segms() }
614    }
615
616    pub fn limiter(&self) -> u8 {
617        unsafe { idalib_inf_get_limiter() }
618    }
619
620    pub fn is_limiter_thin(&self) -> bool {
621        unsafe { idalib_inf_is_limiter_thin() }
622    }
623
624    pub fn is_limiter_thick(&self) -> bool {
625        unsafe { idalib_inf_is_limiter_thick() }
626    }
627
628    pub fn is_limiter_empty(&self) -> bool {
629        unsafe { idalib_inf_is_limiter_empty() }
630    }
631
632    pub fn bin_prefix_size(&self) -> i16 {
633        unsafe { idalib_inf_get_bin_prefix_size().into() }
634    }
635
636    pub fn prefflag(&self) -> u8 {
637        unsafe { idalib_inf_get_prefflag() }
638    }
639
640    pub fn prefix_show_segaddr(&self) -> bool {
641        unsafe { idalib_inf_prefix_show_segaddr() }
642    }
643
644    pub fn prefix_show_funcoff(&self) -> bool {
645        unsafe { idalib_inf_prefix_show_funcoff() }
646    }
647
648    pub fn prefix_show_stack(&self) -> bool {
649        unsafe { idalib_inf_prefix_show_stack() }
650    }
651
652    pub fn prefix_truncate_opcode_bytes(&self) -> bool {
653        unsafe { idalib_inf_prefix_truncate_opcode_bytes() }
654    }
655
656    pub fn strlit_flags(&self) -> u8 {
657        unsafe { idalib_inf_get_strlit_flags() }
658    }
659
660    pub fn strlit_names(&self) -> bool {
661        unsafe { idalib_inf_strlit_names() }
662    }
663
664    pub fn strlit_name_bit(&self) -> bool {
665        unsafe { idalib_inf_strlit_name_bit() }
666    }
667
668    pub fn strlit_serial_names(&self) -> bool {
669        unsafe { idalib_inf_strlit_serial_names() }
670    }
671
672    pub fn unicode_strlits(&self) -> bool {
673        unsafe { idalib_inf_unicode_strlits() }
674    }
675
676    pub fn strlit_autocmt(&self) -> bool {
677        unsafe { idalib_inf_strlit_autocmt() }
678    }
679
680    pub fn strlit_savecase(&self) -> bool {
681        unsafe { idalib_inf_strlit_savecase() }
682    }
683
684    pub fn strlit_break(&self) -> u8 {
685        unsafe { idalib_inf_get_strlit_break() }
686    }
687
688    pub fn strlit_zeroes(&self) -> i8 {
689        unsafe { idalib_inf_get_strlit_zeroes() }
690    }
691
692    pub fn strtype(&self) -> i32 {
693        unsafe { idalib_inf_get_strtype() }
694    }
695
696    pub fn strlit_sernum(&self) -> u64 {
697        unsafe { idalib_inf_get_strlit_sernum().into() }
698    }
699
700    pub fn datatypes(&self) -> u64 {
701        unsafe { idalib_inf_get_datatypes().into() }
702    }
703
704    pub fn abibits(&self) -> u32 {
705        unsafe { idalib_inf_get_abibits() }
706    }
707
708    pub fn is_mem_aligned4(&self) -> bool {
709        unsafe { idalib_inf_is_mem_aligned4() }
710    }
711
712    pub fn pack_stkargs(&self) -> bool {
713        unsafe { idalib_inf_pack_stkargs() }
714    }
715
716    pub fn big_arg_align(&self) -> bool {
717        unsafe { idalib_inf_big_arg_align() }
718    }
719
720    pub fn stack_ldbl(&self) -> bool {
721        unsafe { idalib_inf_stack_ldbl() }
722    }
723
724    pub fn stack_varargs(&self) -> bool {
725        unsafe { idalib_inf_stack_varargs() }
726    }
727
728    pub fn is_hard_float(&self) -> bool {
729        unsafe { idalib_inf_is_hard_float() }
730    }
731
732    pub fn abi_set_by_user(&self) -> bool {
733        unsafe { idalib_inf_abi_set_by_user() }
734    }
735
736    pub fn use_gcc_layout(&self) -> bool {
737        unsafe { idalib_inf_use_gcc_layout() }
738    }
739
740    pub fn map_stkargs(&self) -> bool {
741        unsafe { idalib_inf_map_stkargs() }
742    }
743
744    pub fn huge_arg_align(&self) -> bool {
745        unsafe { idalib_inf_huge_arg_align() }
746    }
747
748    pub fn appcall_options(&self) -> u32 {
749        unsafe { idalib_inf_get_appcall_options() }
750    }
751
752    pub fn privrange_start_address(&self) -> Address {
753        unsafe { idalib_inf_get_privrange_start_ea().into() }
754    }
755
756    pub fn privrange_end_address(&self) -> Address {
757        unsafe { idalib_inf_get_privrange_end_ea().into() }
758    }
759
760    pub fn cc_id(&self) -> Compiler {
761        unsafe { mem::transmute(idalib_inf_get_cc_id() & COMP_MASK) }
762    }
763
764    pub fn cc_cm(&self) -> u8 {
765        unsafe { idalib_inf_get_cc_cm() }
766    }
767
768    pub fn cc_size_i(&self) -> u8 {
769        unsafe { idalib_inf_get_cc_size_i() }
770    }
771
772    pub fn cc_size_b(&self) -> u8 {
773        unsafe { idalib_inf_get_cc_size_b() }
774    }
775
776    pub fn cc_size_e(&self) -> u8 {
777        unsafe { idalib_inf_get_cc_size_e() }
778    }
779
780    pub fn cc_defalign(&self) -> u8 {
781        unsafe { idalib_inf_get_cc_defalign() }
782    }
783
784    pub fn cc_size_s(&self) -> u8 {
785        unsafe { idalib_inf_get_cc_size_s() }
786    }
787
788    pub fn cc_size_l(&self) -> u8 {
789        unsafe { idalib_inf_get_cc_size_l() }
790    }
791
792    pub fn cc_size_ll(&self) -> u8 {
793        unsafe { idalib_inf_get_cc_size_ll() }
794    }
795
796    pub fn cc_size_ldbl(&self) -> u8 {
797        unsafe { idalib_inf_get_cc_size_ldbl() }
798    }
799
800    pub fn procname(&self) -> String {
801        unsafe { idalib_inf_get_procname() }
802    }
803
804    pub fn strlit_pref(&self) -> String {
805        unsafe { idalib_inf_get_strlit_pref() }
806    }
807}
808
809pub struct MetadataMut<'a> {
810    _marker: PhantomData<&'a mut IDB>,
811}
812
813impl<'a> MetadataMut<'a> {
814    pub(crate) fn new() -> Self {
815        Self {
816            _marker: PhantomData,
817        }
818    }
819
820    pub fn set_show_all_comments(&mut self) -> bool {
821        unsafe { idalib_inf_set_show_all_comments() }
822    }
823
824    pub fn set_show_hidden_insns(&mut self) -> bool {
825        unsafe { idalib_inf_set_show_hidden_insns() }
826    }
827
828    pub fn set_show_hidden_funcs(&mut self) -> bool {
829        unsafe { idalib_inf_set_show_hidden_funcs() }
830    }
831
832    pub fn set_show_hidden_segms(&mut self) -> bool {
833        unsafe { idalib_inf_set_show_hidden_segms() }
834    }
835}