Use add_function_ex() for safer access. If the fn->end_ea is #BADADDR, then IDA will try to determine the function bounds by calling find_func_bounds(..., #FIND_FUNC_DEFINE).
Member add_segm_ex (segment_t *NONNULL s, const char *name, const char *sclass, int flags)
Use add_segment_ex() for safer access without pointer lifetime issues. If a segment already exists at the specified range of addresses, this segment will be truncated. Instructions and data in the old segment will be deleted if the new segment has another addressing mode or another segment base address.
Use enumerate_segments_with_selector_ea() for safer access without pointer lifetime issues. This function will call the callback function 'func' for each segment that has the specified selector. Enumeration starts from the last segment and stops at the first segment (reverse order). If the callback function 'func' returns a value != #BADADDR, the enumeration is stopped and this value is returned to the caller.
Use find_function_bounds() for safer access. This function tries to find the start and end addresses of a new function. It calls the module with processor_t::func_bounds in order to fine tune the function boundaries.
Use find_func_regvar() for safer access. One of 'canon' and 'user' should be nullptr. If both 'canon' and 'user' are nullptr it returns the first regvar definition in the range.
Use get_func_effective_spd() for safer access. This function returns the sp-diff used by the instruction. The difference between get_spd() and get_effective_spd() is present only for instructions like "pop [esp+N]": they modify sp and use the modified value.
Use get_frame_size_ea() for safer access. This function takes into account size of local variables + size of saved registers + size of return address + number of purged bytes. The purged bytes correspond to the arguments of the functions with __stdcall and __fastcall calling conventions.
Use segment_info_t::base() or get_segment_base() for safer access. Segment base linear address is used to calculate virtual addresses. The virtual address of the first byte of the segment will be (start address of segment - segment base linear address)
Use get_segment_ea_by_sel() for safer access. This function finds a segment by its selector. If there are several segments with the same selectors, the last one will be returned.
Use segment_info_t::para() or get_segment_para() for safer access. Segment base paragraph may be converted to segment base linear address using to_ea() function. In fact, to_ea(get_segm_para(s), 0) == get_segm_base(s).
Use lock_segment_by_ea() for safer access. Locked pointers are guaranteed to remain valid until they are unlocked. Ranges with locked pointers cannot be deleted or moved.
Use move_segment() for safer access. It fixes up address sensitive information in the kernel. The total effect is equal to reloading the segment to the target address. For the file format dependent address sensitive information, loader_t::move_segm is called. Also IDB notification event idb_event::segm_moved is called.
Use set_frame_size_ea() for safer access. Note: The returned size may not include all stack arguments. It does so only for __stdcall and __fastcall calling conventions. To get the entire frame size for all cases use frame.get_func_frame(pfn).get_size()
Member set_func_cmt (const func_t *pfn, const char *cmt, bool repeatable)
Use soff_to_fpoff_ea() for safer access. This function converts the offsets inside the udt_type_data_t object into the frame pointer offsets (for example, EBP-relative).
Use std_out_segment_footer() for safer access. This function may be used in IDP modules to generate segment footer if the target assembler doesn't have 'ends' directive.