+
    i                    r   R t ^ RIHt ^ RIHt ]'       g   R]9   d   ^RIH	t	 M^ RI	t	 ^ RI
tR tR tR tR	 t ! R
 R]4      t^ RIt]	P(                  t^ RIHtHtHt ^ RIt^ RIt ! R R]4      t]	P:                  ! ]4       R R lt]	P>                  t  ! R R]P@                  4      t!]	PD                  ! ]!4       ]	PF                  t# ]	PH                  t$ ]	PJ                  t% ]	PL                  t& ]	PN                  t' ]	PP                  t( ]	PR                  t) ]	PT                  t* ]	PV                  t+ ]	PX                  t, ]	PZ                  t- ]	P\                  t. ]	P^                  t/ ]	P`                  t0 ]	Pb                  t1 ]	Pd                  t2]	Pf                  t3 ]	Ph                  t4 ]	Pj                  t5 ]	Pl                  t6 ]	Pn                  t7 ]	Pp                  t8 ]	Pr                  t9 ]	Pt                  t:]	Pv                  t; ]	Px                  t< ]	Pz                  t= ]	P|                  t> ]	P~                  t? ]	P                  t@ ]	P                  tA ]	P                  tB ]	P                  tC ]	P                  tD ]	P                  tE ]	P                  tF ]	P                  tG ]	P                  tH ]	P                  tI ]	P                  tJ ]	P                  tK ]	P                  tL ]	P                  tM ]	P                  tN ]	P                  tO ]	P                  tP ]	P                  tQ ]	P                  tR ]	P                  tS R R ltTR R ltUR R ltVR R ltWR R ltXR R ltY ! R R ]4      tZ]	P                  ! ]Z4       R! R" lt\R# R$ lt]R% R& lt^R' R( lt_R) R* lt`R+ R, ltaR- R. ltbR/ R0 ltcR1 R2 ltdR3 R4 lteR5 R6 ltfR7 R8 ltgR9 R: lth]	P                  ti ]	P                  tj ]	P                  tk ]	P                  tl ]	P                  tm ]	P                  tn ]	P                  to ]	P                  tp RR; R< lltqR= R> ltr]	P                  ts ]	P                  tt ]	P                  tu ]	P                  tv ]	P                  tw ]	P                  tx ]	P                  ty R? R@ ltzRA RB lt{RC RD lt|RE RF lt}RG RH lt~RI RJ ltRK RL ltRM RN ltRO RP ltRQ RR ltRS RT ltRU RV lt]	EP                  t ]	EP                  t ]	EP                  t ]	EP                  t ]	EP                  t ]	EP                  t ]	EP                  t ]	EP                  t ]	EP                  t ]	EP                  t ]	EP                   t ]	EP"                  t RW RX ltRRY RZ llt]	EP(                  t ]	EP*                  t ]	EP,                  t ]	EP.                  t ]	EP0                  t ]	EP2                  t R[ R\ lt]	EP6                  t ]	EP8                  t ]	EP:                  t ]	EP<                  t ]	EP>                  t ]	EP@                  t ]	EPB                  t ]	EPD                  t R] R^ ltR_ R` ltRa Rb ltRc Rd lt]	EPN                  t Re Rf ltRg Rh lt]	EPT                  t Ri Rj ltRk Rl ltRm Rn ltRo Rp ltRq Rr ltRRs Rt lltRRu Rv lltRw Rx ltRy Rz ltRR{ R| lltR} R~ ltR R ltR R ltR R ltR R ltR R ltR R ltR R ltR R ltR tR tR R ltR#   ] d	    ^ RIt ELi ; i)aJ  Functions that deal with segments.

IDA requires that all program addresses belong to segments (each address must
belong to exactly one segment). The situation when an address doesn't belong to
any segment is allowed as a temporary situation only when the user changes
program segmentation. Bytes outside a segment can't be converted to instructions,
have names, comments, etc. Each segment has its start address, ending address
and represents a contiguous range of addresses. There might be unused holes
between segments.

Each segment has its unique segment selector. This selector is used to
distinguish the segment from other segments. For 16-bit programs the selector
is equal to the segment base paragraph. For 32-bit programs there is special
array to translate the selectors to the segment base paragraphs. A selector is
a 32/64 bit value.

The segment base paragraph determines the offsets in the segment. If the start
address of the segment == (base << 4) then the first offset in the segment will
be 0. The start address should be higher or equal to (base << 4). We will call
the offsets in the segment 'virtual addresses'. So, the virtual address of the
first byte of the segment is (start address of segment - segment base linear
address).

For IBM PC, the virtual address corresponds to the offset part of the address.
For other processors (Z80, for example), virtual addresses correspond to Z80
addresses and linear addresses are used only internally. For MS Windows programs
the segment base paragraph is 0 and therefore the segment virtual addresses are
equal to linear addresses.

.. tip::
   The `IDA Domain API <https://ida-domain.docs.hex-rays.com/>`_ simplifies
   common tasks and provides better type hints, while remaining fully compatible
   with IDAPython for advanced use cases.

   For segment operations, see :mod:`ida_domain.segments`.)annotations)version_info.)_ida_segmentNc                     R V P                   P                  4       ,           pRV P                  P
                  : RV P                  P                  : RV: R2#   \        P                   d    Rp LPi ; i)z	proxy of  <r   z; z >)this__repr____builtin__	Exception	__class__
__module____name__)selfstrthiss   & CC:\Users\user\Downloads\ida93sp2\portable_win\python\ida_segment.py
_swig_reprr   0   sg    		 2 2 44 "^^669     s   !A A43A4c                   a  V 3R  lpV# )c                  < VR 8X  d   S! WV4       R# VR8X  d   V P                   P                  V4       R# \        W4      '       d5   \        \	        \        V 4      V4      \        4      '       d   S! WV4       R# \        RV ,          4      h)r	   thisownz(You cannot add instance attributes to %sN)r	   ownhasattr
isinstancegetattrtypepropertyAttributeError)r   namevaluesets   &&&r   set_instance_attrE_swig_setattr_nondynamic_instance_variable.<locals>.set_instance_attr;   su    6>E"YIIMM% T  ZT
D0I& &E" !K"       )r    r!   s   f r   *_swig_setattr_nondynamic_instance_variabler%   9   s    
 r#   c                   a  V 3R  lpV# )c                   < \        W4      '       d+   \        \        W4      \        4      '       g   S! WV4       R# \	        R V ,          4      h)z%You cannot add class attributes to %sN)r   r   r   r   r   )clsr   r   r    s   &&&r   set_class_attr?_swig_setattr_nondynamic_class_variable.<locals>.set_class_attrK   s:    3j1CX&N&N5! !H3!NOOr#   r$   )r    r)   s   f r   '_swig_setattr_nondynamic_class_variabler+   I   s    P
 r#   c                   a  V 3R lpV# )zlClass decorator for adding a metaclass to a SWIG wrapped class - a slimmed down version of six.add_metaclassc                p   < S! V P                   V P                  V P                  P                  4       4      # N)r   	__bases____dict__copy)r(   	metaclasss   &r   wrapper$_swig_add_metaclass.<locals>.wrapperV   s'    s}}cll6G6G6IJJr#   r$   )r2   r3   s   f r   _swig_add_metaclassr5   S   s    KNr#   c                  >    ] tR t^[tRt]! ]P                  4      tRtR# )_SwigNonDynamicMetazKMeta class to enforce nondynamic attributes (no new attributes) for a classr$   N)	r   r   __qualname____firstlineno____doc__r+   r   __setattr____static_attributes__r$   r#   r   r7   r7   [   s    U9$:J:JKKr#   r7   )TupleListUnionc                      ] tR t^gt$ ]! R R RR7      t]t]! ]P                  4      t
R]R&   R R ltR	 R
 ltR R ltR R ltR R ltR R lt]P&                  t]! ]]4      t]P,                  tRtR# )segment_defsr_arrayc                	6    V P                   P                  4       # r.   r	   r   xs   &r   <lambda>segment_defsr_array.<lambda>h       r#   c                	8    V P                   P                  V4      # r.   rC   rE   vs   &&r   rF   rG   h       AFFJJqMr#   The membership flagdoc"'unsigned long long (&)[SREG_NUM]'datac                   V ^8  d   QhRR/# )   rQ   rP   r$   )formats   "r   __annotate__ segment_defsr_array.__annotate__n   s     + +? +r#   c                	\    \         P                  ! V \         P                  ! V4      4       R # r.   )r   segment_defsr_array_swiginitnew_segment_defsr_array)r   rQ   s   &&r   __init__segment_defsr_array.__init__n   s'    11$##9$$(9* 	+r#   c                   V ^8  d   QhRR/# rS   returnintr$   )rT   s   "r   rU   rV   r   s     > > >r#   c                	.    \         P                  ! V 4      # r.   )r   segment_defsr_array___len__r   s   &r   __len__segment_defsr_array.__len__r       77==r#   c                    V ^8  d   QhRRRR/# )rS   ir_   r^   'unsigned long long const &'r$   )rT   s   "r   rU   rV   u   s     E ES E$@ Er#   c                	.    \         P                  ! W4      # r.   )r   segment_defsr_array___getitem__)r   rg   s   &&r   __getitem__segment_defsr_array.__getitem__u   s    ;;DDDr#   c               $    V ^8  d   QhRRRRRR/# )rS   rg   r_   rK   rh   r^   Noner$   )rT   s   "r   rU   rV   x   s'     H HS H%A HT Hr#   c                	0    \         P                  ! WV4      # r.   )r   segment_defsr_array___setitem__)r   rg   rK   s   &&&r   __setitem__segment_defsr_array.__setitem__x   s    ;;DQGGr#   c                   V ^8  d   QhRR/# )rS   r^   z'bytevec_t'r$   )rT   s   "r   rU   rV   {   s     A A; Ar#   c                	.    \         P                  ! V 4      # r.   )r   segment_defsr_array__get_bytesrb   s   &r   
_get_bytessegment_defsr_array._get_bytes{   s    ::4@@r#   c                    V ^8  d   QhRRRR/# )rS   btsz'bytevec_t const &'r^   rn   r$   )rT   s   "r   rU   rV   ~   s     F F1 FT Fr#   c                	.    \         P                  ! W4      # r.   )r   segment_defsr_array__set_bytes)r   ry   s   &&r   
_set_bytessegment_defsr_array._set_bytes~   s    ::4EEr#   r$   N)r   r   r8   r9   r   r   r   r
   r   segment_defsr_array_data_getrQ   __annotations__rZ   rc   rk   rq   rv   r|   
ida_idaapi_bounded_getitem_iterator__iter__bytesdelete_segment_defsr_array__swig_destroy__r<   r$   r#   r   rA   rA   g   sy    -/I!#GH/7$$0&D
, &+>EHAF33HZ,E#>>r#   rA   c               $    V ^8  d   QhRRRRRR/# )rS   segstartida_idaapi.ea_ttransmapz'eavec_t const &'r^   boolr$   )rT   s   "r   rU   rU      s(     E E EEEr#   c                .    \         P                  ! W4      # )a.  Set new translation list. 
        
:param segstart: start address of the segment to add translation to
:param transmap: vector of segment start addresses for the translation list. If transmap is empty, the translation list is deleted.
:returns: 1: ok
:returns: 0: too many translations or bad segstart)r   set_segment_translations)r   r   s   &&r   r   r      s     00DDr#   c                  B   ] tR t^t$ ]! R R RR7      t]t]! ]P                  ]P                  4      tR]R&    ]! ]P                  ]P                  4      tR]R&    ]! ]P                   ]P"                  4      tR]R&    ]! ]P&                  ]P(                  4      tR	]R
&    ]! ]P,                  ]P.                  4      tR	]R&    ]! ]P2                  ]P4                  4      tR	]R&    ]! ]P8                  ]P:                  4      tR	]R&    R R ltR R lt R R lt!R R lt"R R lt#]! ]PH                  ]PJ                  4      t&R]R&    R R lt'R R lt(R R lt)R  R! lt*R" R# lt+R$ R% lt,R& R' lt-R( R) lt.R* R+ lt/R, R- lt0R. R/ lt1R0 R1 lt2R2 R3 lt3R4 R5 lt4R6 R7 lt5]! ]Pl                  ]Pn                  4      t8R8]R9&    ]! ]Pr                  ]Pt                  4      t;R:]R;&    ]! ]Px                  ]Pz                  4      t>R	]R<&    ]! ]P~                  ]P                  4      tAR=]R>&    R? R@ ltBRA tC]! ]P                  ]P                  4      tFRB]RC&   ]! ]P                  ]P                  4      tIRB]RD&   RE RF ltJ]!tK]! ]J4      t; ]P                  tMRGtNRH# )I	segment_tc                	6    V P                   P                  4       # r.   rC   rD   s   &r   rF   segment_t.<lambda>   rH   r#   c                	8    V P                   P                  V4      # r.   rC   rJ   s   &&r   rF   r      rL   r#   rM   rN   r_   r   sclassorgbase'uchar'aligncombpermbitnessc                   V ^8  d   QhRR/# rS   r^   r   r$   )rT   s   "r   rU   segment_t.__annotate__        5 5 5r#   c                .    \         P                  ! V 4      # )zIs a 16-bit segment?
)r   segment_t_is_16bitrb   s   &r   is_16bitsegment_t.is_16bit        ..t44r#   c                   V ^8  d   QhRR/# r   r$   )rT   s   "r   rU   r      r   r#   c                .    \         P                  ! V 4      # )zIs a 32-bit segment?
)r   segment_t_is_32bitrb   s   &r   is_32bitsegment_t.is_32bit   r   r#   c                   V ^8  d   QhRR/# r   r$   )rT   s   "r   rU   r      r   r#   c                .    \         P                  ! V 4      # )zIs a 64-bit segment?
)r   segment_t_is_64bitrb   s   &r   is_64bitsegment_t.is_64bit   r   r#   c                   V ^8  d   QhRR/# r]   r$   )rT   s   "r   rU   r      s     2 2c 2r#   c                .    \         P                  ! V 4      # )zGet number of address bits.
)r   segment_t_abitsrb   s   &r   abitssegment_t.abits   s     ++D11r#   c                   V ^8  d   QhRR/# r]   r$   )rT   s   "r   rU   r      s     3 3s 3r#   c                .    \         P                  ! V 4      # )zGet number of address bytes.
)r   segment_t_abytesrb   s   &r   abytessegment_t.abytes   s     ,,T22r#   z'ushort'flagsc                   V ^8  d   QhRR/# r   r$   )rT   s   "r   rU   r      s     3 3t 3r#   c                	.    \         P                  ! V 4      # r.   )r   segment_t_comorgrb   s   &r   comorgsegment_t.comorg   s    ,,T22r#   c                   V ^8  d   QhRR/# rS   r^   rn   r$   )rT   s   "r   rU   r           7 74 7r#   c                	.    \         P                  ! V 4      # r.   )r   segment_t_set_comorgrb   s   &r   
set_comorgsegment_t.set_comorg       0066r#   c                   V ^8  d   QhRR/# r   r$   )rT   s   "r   rU   r      r   r#   c                	.    \         P                  ! V 4      # r.   )r   segment_t_clr_comorgrb   s   &r   
clr_comorgsegment_t.clr_comorg   r   r#   c                   V ^8  d   QhRR/# r   r$   )rT   s   "r   rU   r      s     2 2d 2r#   c                	.    \         P                  ! V 4      # r.   )r   segment_t_ob_okrb   s   &r   ob_oksegment_t.ob_ok   s    ++D11r#   c                   V ^8  d   QhRR/# r   r$   )rT   s   "r   rU   r           6 6$ 6r#   c                	.    \         P                  ! V 4      # r.   )r   segment_t_set_ob_okrb   s   &r   	set_ob_oksegment_t.set_ob_ok       //55r#   c                   V ^8  d   QhRR/# r   r$   )rT   s   "r   rU   r      r   r#   c                	.    \         P                  ! V 4      # r.   )r   segment_t_clr_ob_okrb   s   &r   	clr_ob_oksegment_t.clr_ob_ok   r   r#   c                   V ^8  d   QhRR/# r   r$   )rT   s   "r   rU   r      s     < < <r#   c                	.    \         P                  ! V 4      # r.   )r   segment_t_is_visible_segmrb   s   &r   is_visible_segmsegment_t.is_visible_segm   s    55d;;r#   c                    V ^8  d   QhRRRR/# )rS   visibler   r^   rn   r$   )rT   s   "r   rU   r           F F F Fr#   c                	.    \         P                  ! W4      # r.   )r   segment_t_set_visible_segm)r   r   s   &&r   set_visible_segmsegment_t.set_visible_segm   s    66tEEr#   c                    V ^8  d   QhRRRR/# )rS   debsegr   r^   rn   r$   )rT   s   "r   rU   r      r   r#   c                	.    \         P                  ! W4      # r.   )r   segment_t_set_debugger_segm)r   r   s   &&r   set_debugger_segmsegment_t.set_debugger_segm   s    77EEr#   c                   V ^8  d   QhRR/# r   r$   )rT   s   "r   rU   r           ; ;t ;r#   c                	.    \         P                  ! V 4      # r.   )r   segment_t_is_loader_segmrb   s   &r   is_loader_segmsegment_t.is_loader_segm       44T::r#   c                    V ^8  d   QhRRRR/# )rS   ldrsegr   r^   rn   r$   )rT   s   "r   rU   r      s     D Dd Dd Dr#   c                	.    \         P                  ! W4      # r.   )r   segment_t_set_loader_segm)r   r   s   &&r   set_loader_segmsegment_t.set_loader_segm   s    55dCCr#   c                   V ^8  d   QhRR/# r   r$   )rT   s   "r   rU   r      s     > >$ >r#   c                	.    \         P                  ! V 4      # r.   )r   segment_t_is_hidden_segtyperb   s   &r   is_hidden_segtypesegment_t.is_hidden_segtype   re   r#   c                    V ^8  d   QhRRRR/# )rS   hider   r^   rn   r$   )rT   s   "r   rU   r      s     E Et Et Er#   c                	.    \         P                  ! W4      # r.   )r   segment_t_set_hidden_segtype)r   r   s   &&r   set_hidden_segtypesegment_t.set_hidden_segtype   s    88DDr#   c                   V ^8  d   QhRR/# r   r$   )rT   s   "r   rU   r     r   r#   c                	.    \         P                  ! V 4      # r.   )r   segment_t_is_header_segmrb   s   &r   is_header_segmsegment_t.is_header_segm  r   r#   c                    V ^8  d   QhRRRR/# )rS   onr   r^   rn   r$   )rT   s   "r   rU   r     s     @ @$ @$ @r#   c                	.    \         P                  ! W4      # r.   )r   segment_t_set_header_segm)r   r
  s   &&r   set_header_segmsegment_t.set_header_segm  s    55d??r#   'sel_t'selz'sel_t [16]'defsrr   z'bgcolor_t'colorc                   V ^8  d   QhRR/# r   r$   )rT   s   "r   rU   r     s     3 3t 3r#   c                .    \         P                  ! V 4      # )zUpdate segment information. You must call this function after modification of segment characteristics. Note that not all fields of segment structure may be modified directly, there are special functions to modify some fields. 
        
:returns: success)r   segment_t_updaterb   s   &r   updatesegment_t.update  s     ,,T22r#   c                	Z    \         P                  ! V \         P                  ! 4       4       R # r.   )r   segment_t_swiginitnew_segment_trb   s   &r   rZ   segment_t.__init__  s    ''l.H.H.JKr#   r   start_eaend_eac                   V ^8  d   QhRR/# )rS   r^   z#'wrapped_array_t< sel_t,SREG_NUM >'r$   )rT   s   "r   rU   r   %  s     7 7> 7r#   c                	.    \         P                  ! V 4      # r.   )r   segment_t___getDefsrrb   s   &r   
__getDefsrsegment_t.__getDefsr%  r   r#   r$   N)Or   r   r8   r9   r   r   r   r
   r   segment_t_name_getsegment_t_name_setr   r   segment_t_sclass_getsegment_t_sclass_setr   segment_t_orgbase_getsegment_t_orgbase_setr   segment_t_align_getsegment_t_align_setr   segment_t_comb_getsegment_t_comb_setr   segment_t_perm_getsegment_t_perm_setr   segment_t_bitness_getsegment_t_bitness_setr   r   r   r   r   r   segment_t_flags_getsegment_t_flags_setr   r   r   r   r   r   r   r   r   r   r   r   r   r  r  r  segment_t_sel_getsegment_t_sel_setr  segment_t_defsr_getsegment_t_defsr_setr  segment_t_type_getsegment_t_type_setr   segment_t_color_getsegment_t_color_setr  r  rZ   segment_t_start_ea_getsegment_t_start_ea_setr  segment_t_end_ea_getsegment_t_end_ea_setr  _segment_t__getDefsruse64delete_segment_tr   r<   r$   r#   r   r   r      s   -/I!#GH88,D# <<<lFC L>>**,GS ,l>>((*E7 *\<<lD' \<<lD'  B B**,GW ,5
5
5
2
3 |??((*E8 *377266<FF;D>E;@L::LC "<#C#C((*E< *\<<lD' !,"B"B((*E; *3L ( C C!EHo E&|'H'H))+FO +7EZ E#44r#   r   c                    V ^8  d   QhRRRR/# rS   s'segment_t'r^   r   r$   )rT   s   "r   rU   rU     s     + +{ +d +r#   c                .    \         P                  ! V 4      # zSee SFL_HIDDEN.
)r   r   rD  s   &r   r   r     s     ''**r#   c                    V ^8  d   QhRRRR/# rC  r$   )rT   s   "r   rU   rU     s     3 3{ 3d 3r#   c                .    \         P                  ! V 4      # )z See SFL_HIDDEN, SCF_SHHID_SEGM.
)r   is_finally_visible_segmrH  s   &r   rK  rK    s     //22r#   c               $    V ^8  d   QhRRRRRR/# )rS   rD  rE  r   r   r^   rn   r$   )rT   s   "r   rU   rU     s!     5 5 5d 5d 5r#   c                .    \         P                  ! W4      # rG  )r   r   )rD  r   s   &&r   r   r     s     ((44r#   c                    V ^8  d   QhRRRR/# )rS   seg_typer   r^   r   r$   )rT   s   "r   rU   rU     s     / /7 /d /r#   c                .    \         P                  ! V 4      # )zOHas segment a special type? (SEG_XTRN, SEG_GRP, SEG_ABSSYM, SEG_COMM) 
        )r   is_spec_segm)rO  s   &r   rQ  rQ    s     $$X..r#   c                    V ^8  d   QhRRRR/# )rS   ear   r^   r   r$   )rT   s   "r   rU   rU     s     ' '? 'd 'r#   c                .    \         P                  ! V 4      # )zDoes the address belong to a segment with a special type? (SEG_XTRN, SEG_GRP, SEG_ABSSYM, SEG_COMM) 
        
:param ea: linear address)r   
is_spec_earS  s   &r   rU  rU    s     ""2&&r#   c               $    V ^8  d   QhRRRRRR/# )rS   segmrE  lockr   r^   rn   r$   )rT   s   "r   rU   rU     s!     . .K .t .t .r#   c                .    \         P                  ! W4      # )zLock segment pointer Locked pointers are guaranteed to remain valid until they are unlocked. Ranges with locked pointers cannot be deleted or moved. 
        )r   	lock_segm)rX  rY  s   &&r   r[  r[    s     !!$--r#   c                  X    ] tR tRt]! R R RR7      t]tR R lt]	P                  tRtR	# )
lock_segmenti  c                	6    V P                   P                  4       # r.   rC   rD   s   &r   rF   lock_segment.<lambda>  rH   r#   c                	8    V P                   P                  V4      # r.   rC   rJ   s   &&r   rF   r_    rL   r#   rM   rN   c                   V ^8  d   QhRR/# )rS   _segmrE  r$   )rT   s   "r   rU   lock_segment.__annotate__  s     % %k %r#   c                	\    \         P                  ! V \         P                  ! V4      4       R # r.   )r   lock_segment_swiginitnew_lock_segment)r   rb  s   &&r   rZ   lock_segment.__init__  s'    **42"2$ 	%r#   r$   N)r   r   r8   r9   r   r   r   r
   rZ   r   delete_lock_segmentr   r<   r$   r#   r   r]  r]    s-    -/I!#GH% $77r#   r]  c                    V ^8  d   QhRRRR/# )rS   rX  rE  r^   r   r$   )rT   s   "r   rU   rU     s     - - - -r#   c                .    \         P                  ! V 4      # )zIs a segment pointer locked?
)r   is_segm_locked)rX  s   &r   rk  rk    s     &&t,,r#   c                    V ^8  d   QhRRRR/# )rS   nr_   r^   z'sel_t *, ea_t *'r$   )rT   s   "r   rU   rU     s     ) )S )- )r#   c                .    \         P                  ! V 4      # )z6Get description of selector (0..get_selector_qty()-1)
)r   getn_selectorrm  s   &r   ro  ro    s     %%a((r#   c                   V ^8  d   QhRR/# r]   r$   )rT   s   "r   rU   rU     s     + + +r#   c                 ,    \         P                  ! 4       # )z!Get number of defined selectors.
)r   get_selector_qtyr$   r#   r   rs  rs    s     ((**r#   c                    V ^8  d   QhRRRR/# rS   segbaser   r^   r  r$   )rT   s   "r   rU   rU     s     0 0O 0w 0r#   c                .    \         P                  ! V 4      # )a  Allocate a selector for a segment if necessary. You must call this function before calling add_segm_ex(). add_segm() calls this function itself, so you don't need to allocate a selector. This function will allocate a selector if 'segbase' requires more than 16 bits and the current processor is IBM PC. Otherwise it will return the segbase value. 
        
:param segbase: a new segment base paragraph
:returns: the allocated selector number)r   setup_selectorrv  s   &r   rx  rx    s    
 &&w//r#   c                    V ^8  d   QhRRRR/# ru  r$   )rT   s   "r   rU   rU     s     3 3 3' 3r#   c                .    \         P                  ! V 4      # )a  Allocate a selector for a segment unconditionally. You must call this function before calling add_segm_ex(). add_segm() calls this function itself, so you don't need to allocate a selector. This function will allocate a new free selector and setup its mapping using find_free_selector() and set_selector() functions. 
        
:param segbase: a new segment base paragraph
:returns: the allocated selector number)r   allocate_selectorry  s   &r   r|  r|    s    
 ))'22r#   c                   V ^8  d   QhRR/# )rS   r^   r  r$   )rT   s   "r   rU   rU     s     - -7 -r#   c                 ,    \         P                  ! 4       # )z=Find first unused selector. 
        
:returns: a number >= 1)r   find_free_selectorr$   r#   r   r  r    s     **,,r#   c               $    V ^8  d   QhRRRRRR/# )rS   selectorr  	paragraphr   r^   r_   r$   )rT   s   "r   rU   rU     s!     
: 
:7 
: 
:# 
:r#   c                .    \         P                  ! W4      # )aE  Set mapping of selector to a paragraph. You should call this function _before_ creating a segment which uses the selector, otherwise the creation of the segment will fail. 
        
:param selector: number of selector to map
* if selector == BADSEL, then return 0 (fail)
* if the selector has had a mapping, old mapping is destroyed
* if the selector number is equal to paragraph value, then the mapping is destroyed because we don't need to keep trivial mappings.
:param paragraph: paragraph to map selector
:returns: 1: ok
:returns: 0: failure (bad selector or too many mappings))r   set_selector)r  r  s   &&r   r  r    s     $$X99r#   c                    V ^8  d   QhRRRR/# )rS   r  r  r^   rn   r$   )rT   s   "r   rU   rU   )  s     / /7 /d /r#   c                .    \         P                  ! V 4      # )zDelete mapping of a selector. Be wary of deleting selectors that are being used in the program, this can make a mess in the segments. 
        
:param selector: number of selector to remove from the translation table)r   del_selectorr  s   &r   r  r  )  s     $$X..r#   c                    V ^8  d   QhRRRR/# rS   r  r  r^   r   r$   )rT   s   "r   rU   rU   0  s     + +w +/ +r#   c                .    \         P                  ! V 4      # )zGet mapping of a selector. 
        
:param selector: number of selector to translate
:returns: paragraph the specified selector is mapped to. if there is no mapping, returns 'selector'.)r   sel2parar  s   &r   r  r  0  s    
   **r#   c                    V ^8  d   QhRRRR/# r  r$   )rT   s   "r   rU   rU   8  s     ) )W ) )r#   c                .    \         P                  ! V 4      # )zGet mapping of a selector as a linear address. 
        
:param selector: number of selector to translate to linear address
:returns: linear address the specified selector is mapped to. if there is no mapping, returns to_ea(selector,0);)r   sel2ear  s   &r   r  r  8  s    
 x((r#   c                    V ^8  d   QhRRRR/# )rS   baser   r^   r  r$   )rT   s   "r   rU   rU   @  s     , , ,7 ,r#   c                .    \         P                  ! V 4      # )zFind a selector that has mapping to the specified paragraph. 
        
:param base: paragraph to search in the translation table
:returns: selector value or base)r   find_selector)r  s   &r   r  r  @  s    
 %%d++r#   c                    V ^8  d   QhRRRR/# )rS   r  r  r^   'segment_t *'r$   )rT   s   "r   rU   rU   H  s     2 2g 2 2r#   c                .    \         P                  ! V 4      # )a   Get pointer to segment structure. This function finds a segment by its selector. If there are several segments with the same selectors, the last one will be returned. 
        
:param selector: a segment with the specified selector will be returned
:returns: pointer to segment or nullptr)r   get_segm_by_selr  s   &r   r  r  H  s    
 ''11r#   c          
     ,    V ^8  d   QhRRRRRRRRRR	/# )
rS   rD  rE  r   strr   r   r_   r^   r   r$   )rT   s   "r   rU   rU   P  s/     < <; <c <3 <s <d <r#   c                0    \         P                  ! WW#4      # )a`  Add a new segment. 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. 
        
:param s: pointer to filled segment structure. segment selector should have proper mapping (see set_selector()).
* if s.start_ea==BADADDR then s.start_ea <- get_segm_base(&s)
* if s.end_ea==BADADDR, then a segment up to the next segment will be created (if the next segment doesn't exist, then 1 byte segment will be created).
* if the s.end_ea < s.start_ea, then fail.
* if s.end_ea is too high and the new segment would overlap the next segment, s.end_ea is adjusted properly.
:param name: name of new segment. may be nullptr. if specified, the segment is immediately renamed
:param sclass: class of the segment. may be nullptr. if specified, the segment class is immediately changed
:param flags: Add segment flags
:returns: 1: ok
:returns: 0: failed, a warning message is displayed The specified default segment register values may be modified by processor modules (see ev_creating_segm). Also, if the default data segment value is BADSEL, it will be changed to the selector of the newly created segment. This ensures that the data segment is always correctly set, which is a good default for most processors.)r   add_segm_ex)rD  r   r   r   s   &&&&r   r  r  P  s     ##AV;;r#   c               4    V ^8  d   QhRRRRRRRRRRRR	R
R/# )rS   parar   startendr   r  r   r   r_   r^   r   r$   )rT   s   "r   rU   rU   z  sK     H H? H? HHH(+H47H=AHr#   c                2    \         P                  ! WW#WE4      # )aP  Add a new segment, second form. Segment alignment is set to saRelByte. Segment combination is "public" or "stack" (if segment class is "STACK"). Addressing mode of segment is taken as default (16-bit or 32-bit). Default segment registers are set to BADSEL. 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. 
        
:param para: segment base paragraph. if paragraph can't fit in 16-bit, then a new selector is allocated and mapped to the paragraph.
:param start: start address of the segment. if start==BADADDR then start <- to_ea(para,0).
:param end: end address of the segment. end address should be higher than start address. For emulate empty segments, use SEG_NULL segment type. If the end address is lower than start address, then fail. If end==BADADDR, then a segment up to the next segment will be created (if the next segment doesn't exist, then 1 byte segment will be created). If 'end' is too high and the new segment would overlap the next segment, 'end' is adjusted properly.
:param name: name of new segment. may be nullptr
:param sclass: class of the segment. may be nullptr. type of the new segment is modified if class is one of predefined names:
* "CODE" -> SEG_CODE
* "DATA" -> SEG_DATA
* "CONST" -> SEG_DATA
* "STACK" -> SEG_BSS
* "BSS" -> SEG_BSS
* "XTRN" -> SEG_XTRN
* "COMM" -> SEG_COMM
* "ABS" -> SEG_ABSSYM
:param flags: Add segment flags
:returns: 1: ok
:returns: 0: failed, a warning message is displayed)r   add_segm)r  r  r  r   r   r   s   &&&&&&r   r  r  z  s    (   cGGr#   c               $    V ^8  d   QhRRRRRR/# )rS   rS  r   r   r_   r^   r   r$   )rT   s   "r   rU   rU     s!     , , , , ,r#   c                .    \         P                  ! W4      # )zDelete a segment. 
        
:param ea: any address belonging to the segment
:param flags: Segment modification flags
:returns: 1: ok
:returns: 0: failed, no segment at 'ea'.)r   del_segm)rS  r   s   &&r   r  r    s       ++r#   c                   V ^8  d   QhRR/# r]   r$   )rT   s   "r   rU   rU     s     ' 'S 'r#   c                 ,    \         P                  ! 4       # )zGet number of segments.
)r   get_segm_qtyr$   r#   r   r  r         $$&&r#   c                    V ^8  d   QhRRRR/# rS   rS  r   r^   r  r$   )rT   s   "r   rU   rU     s     # # #- #r#   c                .    \         P                  ! V 4      # )zGet pointer to segment by linear address. 
        
:param ea: linear address belonging to the segment
:returns: nullptr or pointer to segment structure)r   getsegrV  s   &r   r  r    s    
 r""r#   c                    V ^8  d   QhRRRR/# )rS   rm  r_   r^   r  r$   )rT   s   "r   rU   rU     s     # #s #m #r#   c                .    \         P                  ! V 4      # )zGet pointer to segment by its number. 
        
:param n: segment number in the range (0..get_segm_qty()-1)
:returns: nullptr or pointer to segment structure)r   getnsegrp  s   &r   r  r    s    
 ""r#   c                    V ^8  d   QhRRRR/# )rS   rS  r   r^   r_   r$   )rT   s   "r   rU   rU     s     ) )_ ) )r#   c                .    \         P                  ! V 4      # )zGet number of segment by address. 
        
:param ea: linear address belonging to the segment
:returns: -1 if no segment occupies the specified address. otherwise returns number of the specified segment (0..get_segm_qty()-1))r   get_segm_numrV  s   &r   r  r    s    
 $$R((r#   c                    V ^8  d   QhRRRR/# r  r$   )rT   s   "r   rU   rU          ) )_ ) )r#   c                .    \         P                  ! V 4      # )z!Get pointer to the next segment.
)r   get_next_segrV  s   &r   r  r         $$R((r#   c                    V ^8  d   QhRRRR/# r  r$   )rT   s   "r   rU   rU     r  r#   c                .    \         P                  ! V 4      # )z%Get pointer to the previous segment.
)r   get_prev_segrV  s   &r   r  r    r  r#   c                   V ^8  d   QhRR/# rS   r^   r  r$   )rT   s   "r   rU   rU     s     ( (m (r#   c                 ,    \         P                  ! 4       # )z"Get pointer to the first segment.
)r   get_first_segr$   r#   r   r  r    s     %%''r#   c                   V ^8  d   QhRR/# r  r$   )rT   s   "r   rU   rU     s     ' '] 'r#   c                 ,    \         P                  ! 4       # )z!Get pointer to the last segment.
)r   get_last_segr$   r#   r   r  r    r  r#   c                    V ^8  d   QhRRRR/# )rS   r   r  r^   r  r$   )rT   s   "r   rU   rU     s     / /3 /- /r#   c                .    \         P                  ! V 4      # )zGet pointer to segment by its name. If there are several segments with the same name, returns the first of them. 
        
:param name: segment name. may be nullptr.
:returns: nullptr or pointer to segment structure)r   get_segm_by_name)r   s   &r   r  r    s    
 ((..r#   c               (    V ^8  d   QhRRRRRRRR/# )rS   rS  r   newendr   r_   r^   r   r$   )rT   s   "r   rU   rU     s)     	8 	8_ 	8o 	8c 	8	8r#   c                0    \         P                  ! WV4      # )a  Set segment end address. The next segment is shrinked to allow expansion of the specified segment. The kernel might even delete the next segment if necessary. The kernel will ask the user for a permission to destroy instructions or data going out of segment scope if such instructions exist. 
        
:param ea: any address belonging to the segment
:param newend: new end address of the segment
:param flags: Segment modification flags
:returns: 1: ok
:returns: 0: failed, a warning message is displayed)r   set_segm_end)rS  r  r   s   &&&r   r  r    s     $$R77r#   c               (    V ^8  d   QhRRRRRRRR/# )rS   rS  r   newstartr   r_   r^   r   r$   )rT   s   "r   rU   rU     s)     	< 	< 	</ 	<# 	<	<r#   c                0    \         P                  ! WV4      # )aX  Set segment start address. The previous segment is trimmed to allow expansion of the specified segment. The kernel might even delete the previous segment if necessary. The kernel will ask the user for a permission to destroy instructions or data going out of segment scope if such instructions exist. 
        
:param ea: any address belonging to the segment
:param newstart: new start address of the segment note that segment start address should be higher than segment base linear address.
:param flags: Segment modification flags
:returns: 1: ok
:returns: 0: failed, a warning message is displayed)r   set_segm_start)rS  r  r   s   &&&r   r  r    s     &&rU;;r#   c               (    V ^8  d   QhRRRRRRRR/# )rS   rS  r   r  moder_   r^   r   r$   )rT   s   "r   rU   rU     s)     < < <? <# <<r#   c                0    \         P                  ! WV4      # )a  Move segment start. The main difference between this function and set_segm_start() is that this function may expand the previous segment while set_segm_start() never does it. So, this function allows to change bounds of two segments simultaneously. If the previous segment and the specified segment have the same addressing mode and segment base, then instructions and data are not destroyed - they simply move from one segment to another. Otherwise all instructions/data which migrate from one segment to another are destroyed. 
        
:param ea: any address belonging to the segment
:param newstart: new start address of the segment note that segment start address should be higher than segment base linear address.
:param mode: policy for destroying defined items
* 0: if it is necessary to destroy defined items, display a dialog box and ask confirmation
* 1: if it is necessary to destroy defined items, just destroy them without asking the user
* -1: if it is necessary to destroy defined items, don't destroy them (i.e. function will fail)
* -2: don't destroy defined items (function will succeed)
:returns: 1: ok
:returns: 0: failed, a warning message is displayed)r   move_segm_start)rS  r  r  s   &&&r   r  r    s     ''d;;r#   c                    V ^8  d   QhRRRR/# )rS   code'move_segm_code_t'r^   r  r$   )rT   s   "r   rU   rU   >  s     1 1/ 13 1r#   c                .    \         P                  ! V 4      # )z3Return string describing error MOVE_SEGM_... code.
)r   move_segm_strerror)r  s   &r   r  r  >  s     **400r#   c               (    V ^8  d   QhRRRRRRRR/# )	rS   rD  rE  tor   r   r_   r^   r  r$   )rT   s   "r   rU   rU   D  s)     0 0 0/ 0# 00r#   c                0    \         P                  ! WV4      # )a  This function moves all information to the new address. 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. 
        
:param s: segment to move
:param to: new segment start address
:param flags: Move segment flags
:returns: Move segment result codes)r   	move_segm)rD  r  r   s   &&&r   r  r  D  s     !!!//r#   c               $    V ^8  d   QhRRRRRR/# )rS   rD  rE  is_deb_segmr   r^   r_   r$   )rT   s   "r   rU   rU   c  s!     > >[ >t >s >r#   c                .    \         P                  ! W4      # )a  Convert a debugger segment to a regular segment and vice versa. When converting debug->regular, the memory contents will be copied to the database. 
        
:param s: segment to modify
:param is_deb_segm: new status of the segment
:returns: Change segment status result codes)r   change_segment_status)rD  r  s   &&r   r  r  c  s     --a==r#   c                    V ^8  d   QhRRRR/# )rS   r   r_   r^   r   r$   )rT   s   "r   rU   rU     s     3 3s 3d 3r#   c                .    \         P                  ! V 4      # )zTake a memory snapshot of the running process. 
        
:param type: specifies which snapshot we want (see SNAP_ Snapshot types)
:returns: success)r   take_memory_snapshot)r   s   &r   r  r    s    
 ,,T22r#   c                   V ^8  d   QhRR/# r   r$   )rT   s   "r   rU   rU     s     % %4 %r#   c                 ,    \         P                  ! 4       # )zIs the database a miniidb created by the debugger? 
        
:returns: true if the database contains no segments or only debugger segments)r   
is_miniidbr$   r#   r   r  r    s     ""$$r#   c               $    V ^8  d   QhRRRRRR/# )rS   rD  rE  newbaser   r^   r   r$   )rT   s   "r   rU   rU     s!     2 2[ 2? 2d 2r#   c                .    \         P                  ! W4      # )zInternal function.
)r   set_segm_base)rD  r  s   &&r   r  r    s     %%a11r#   c               $    V ^8  d   QhRRRRRR/# )rS   grpr  r  r^   r_   r$   )rT   s   "r   rU   rU     s!     5 5G 5' 5S 5r#   c                .    \         P                  ! W4      # )a  Create a new group of segments (used OMF files). 
        
:param grp: selector of group segment (segment type is SEG_GRP) You should create an 'empty' (1 byte) group segment It won't contain anything and will be used to redirect references to the group of segments to the common selector.
:param sel: common selector of all segments belonging to the segment You should create all segments within the group with the same selector value.
:returns: 1: ok
:returns: 0: too many groups (see MAX_GROUPS))r   set_group_selector)r  r  s   &&r   r  r    s     **344r#   c                    V ^8  d   QhRRRR/# )rS   grpselr  r^   r$   )rT   s   "r   rU   rU     s     3 3w 3' 3r#   c                .    \         P                  ! V 4      # )zGet common selector for a group of segments. 
        
:param grpsel: selector of group segment
:returns: common selector of the group or 'grpsel' if no such group is found)r   get_group_selector)r  s   &r   r  r    s    
 **622r#   c               $    V ^8  d   QhRRRRRR/# )rS   r   r   	mappedsegr^   r   r$   )rT   s   "r   rU   rU     s(     E Eo EEEr#   c                .    \         P                  ! W4      # )zAdd segment translation. 
        
:param segstart: start address of the segment to add translation to
:param mappedseg: start address of the overlayed segment
:returns: 1: ok
:returns: 0: too many translations or bad segstart)r   add_segment_translation)r   r  s   &&r   r  r    s     //DDr#   c                    V ^8  d   QhRRRR/# )rS   r   r   r^   rn   r$   )rT   s   "r   rU   rU     s     ; ; ;$ ;r#   c                .    \         P                  ! V 4      # )znDelete the translation list 
        
:param segstart: start address of the segment to delete translation list)r   del_segment_translations)r   s   &r   r  r    s     00::r#   c               $    V ^8  d   QhRRRRRR/# )rS   r   z'eavec_t *'r   r   r^   z	'ssize_t'r$   )rT   s   "r   rU   rU     s'     E E{ Eo EEr#   c                .    \         P                  ! W4      # )a  Get segment translation list. 
        
:param transmap: vector of segment start addresses for the translation list
:param segstart: start address of the segment to get information about
:returns: -1 if no translation list or bad segstart. otherwise returns size of translation list.)r   get_segment_translations)r   r   s   &&r   r  r    s     00DDr#   c               $    V ^8  d   QhRRRRRR/# )rS   rD  rE  
repeatabler   r^   r  r$   )rT   s   "r   rU   rU     s!     7 7{ 7 7 7r#   c                .    \         P                  ! W4      # )zGet segment comment. 
        
:param s: pointer to segment structure
:param repeatable: 0: get regular comment. 1: get repeatable comment.
:returns: size of comment or -1)r   get_segment_cmt)rD  r  s   &&r   r  r    s     ''66r#   c               (    V ^8  d   QhRRRRRRRR/# )	rS   rD  rE  cmtr  r  r   r^   rn   r$   )rT   s   "r   rU   rU     s(     < <{ < <$ <$ <r#   c                0    \         P                  ! WV4      # )a  Set segment comment. 
        
:param s: pointer to segment structure
:param cmt: comment string, may be multiline (with '
'). maximal size is 4096 bytes. Use empty str ("") to delete comment
:param repeatable: 0: set regular comment. 1: set repeatable comment.)r   set_segment_cmt)rD  r  r  s   &&&r   r  r    s     ''
;;r#   c               $    V ^8  d   QhRRRRRR/# )rS   ctxz'outctx_t &'segrE  r^   rn   r$   )rT   s   "r   rU   rU     s!     6 6\ 6 6t 6r#   c                .    \         P                  ! W4      # )zGenerate segment footer line as a comment line. This function may be used in IDP modules to generate segment footer if the target assembler doesn't have 'ends' directive. 
        )r   std_out_segm_footer)r  r  s   &&r   r  r    s     ++C55r#   c               (    V ^8  d   QhRRRRRRRR/# )rS   rD  rE  r   r  r   r_   r^   r$   )rT   s   "r   rU   rU     s(     6 6[ 6 6C 6S 6r#   c                0    \         P                  ! WV4      # )a  Rename segment. The new name is validated (see validate_name). A segment always has a name. If you hadn't specified a name, the kernel will assign it "seg###" name where ### is segment number. 
        
:param s: pointer to segment (may be nullptr)
:param name: new segment name
:param flags: ADDSEG_IDBENC or 0
:returns: 1: ok, name is good and segment is renamed
:returns: 0: failure, name is bad or segment is nullptr)r   set_segm_name)rD  r   r   s   &&&r   r	  r	    s     %%au55r#   c               $    V ^8  d   QhRRRRRR/# )rS   rD  rE  r   r_   r^   r  r$   )rT   s   "r   rU   rU     s!     0 0[ 0 0# 0r#   c                .    \         P                  ! W4      # )zGet true segment name by pointer to segment. 
        
:param s: pointer to segment
:param flags: 0-return name as is; 1-substitute bad symbols with _ 1 corresponds to GN_VISIBLE
:returns: size of segment name (-1 if s==nullptr))r   get_segm_name)rD  r   s   &&r   r  r    s     %%a//r#   c                    V ^8  d   QhRRRR/# rS   rD  rE  r^   r  r$   )rT   s   "r   rU   rU      s     1 1[ 1C 1r#   c                .    \         P                  ! V 4      # )zGet segment name by pointer to segment. 
        
:param s: pointer to segment
:returns: size of segment name (-1 if s==nullptr))r   get_visible_segm_namerH  s   &r   r  r     s    
 --a00r#   c                    V ^8  d   QhRRRR/# r  r$   )rT   s   "r   rU   rU     s     * *k *S *r#   c                .    \         P                  ! V 4      # )zGet segment class. Segment class is arbitrary text (max 8 characters). 
        
:param s: pointer to segment
:returns: size of segment class (-1 if s==nullptr or bufsize<=0))r   get_segm_classrH  s   &r   r  r    s    
 &&q))r#   c               (    V ^8  d   QhRRRRRRRR/# )rS   rD  rE  r   r  r   r_   r^   r$   )rT   s   "r   rU   rU     s(     9 9k 93 9s 9 9r#   c                0    \         P                  ! WV4      # )a  Set segment class. 
        
:param s: pointer to segment (may be nullptr)
:param sclass: segment class (may be nullptr). If segment type is SEG_NORM and segment class is one of predefined names, then segment type is changed to:
* "CODE" -> SEG_CODE
* "DATA" -> SEG_DATA
* "STACK" -> SEG_BSS
* "BSS" -> SEG_BSS
* if "UNK" then segment type is reset to SEG_NORM.
:param flags: Add segment flags
:returns: 1: ok, name is good and segment is renamed
:returns: 0: failure, name is nullptr or bad or segment is nullptr)r   set_segm_class)rD  r   r   s   &&&r   r  r    s     &&q%88r#   c                    V ^8  d   QhRRRR/# )rS   rS  r   r^   r   r$   )rT   s   "r   rU   rU      s     $ $ $7 $r#   c                .    \         P                  ! V 4      # )zGet segment type. 
        
:param ea: any linear address within the segment
:returns: Segment types, SEG_UNDF if no segment found at 'ea')r   segtyperV  s   &r   r  r     s    
 ##r#   c                    V ^8  d   QhRRRR/# )rS   r   r   r^   r  r$   )rT   s   "r   rU   rU   (  s     5 5 5C 5r#   c                .    \         P                  ! V 4      # )zkGet text representation of segment alignment code. 
        
:returns: text digestable by IBM PC assembler.)r   get_segment_alignment)r   s   &r   r  r  (  s     --e44r#   c                    V ^8  d   QhRRRR/# )rS   r   r   r^   r  r$   )rT   s   "r   rU   rU   /  s     6 6' 6S 6r#   c                .    \         P                  ! V 4      # )zmGet text representation of segment combination code. 
        
:returns: text digestable by IBM PC assembler.)r   get_segment_combination)r   s   &r   r  r  /  s     //55r#   c                    V ^8  d   QhRRRR/# rS   rD  rE  r^   r   r$   )rT   s   "r   rU   rU   6       ) )[ )O )r#   c                .    \         P                  ! V 4      # )a  Get segment base paragraph. 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). 
        
:param s: pointer to segment
:returns: 0 if s == nullptr, the segment base paragraph)r   get_segm_pararH  s   &r   r$  r$  6      
 %%a((r#   c                    V ^8  d   QhRRRR/# r!  r$   )rT   s   "r   rU   rU   >  r"  r#   c                .    \         P                  ! V 4      # )aD  Get segment base linear address. 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) 
        
:param s: pointer to segment
:returns: 0 if s == nullptr, otherwise segment base linear address)r   get_segm_baserH  s   &r   r(  r(  >  r%  r#   c               $    V ^8  d   QhRRRRRR/# )rS   rD  rE  r   r_   r^   r   r$   )rT   s   "r   rU   rU   F  s!     	8 	8; 	8 	8 	8r#   c                .    \         P                  ! W4      # )a  Change segment addressing mode (16, 32, 64 bits). You must use this function to change segment addressing, never change the 'bitness' field directly. This function will delete all instructions, comments and names in the segment 
        
:param s: pointer to segment
:param bitness: new addressing mode of segment
* 2: 64-bit segment
* 1: 32-bit segment
* 0: 16-bit segment
:returns: success)r   set_segm_addressing)rD  r   s   &&r   r+  r+  F  s     ++A77r#   c                    V ^8  d   QhRRRR/# rC  r$   )rT   s   "r   rU   rU   R  s     ' '; '$ 'r#   c                .    \         P                  ! V 4      # r.   )r   update_segmrH  s   &r   r.  r.  R  s    ##A&&r#   c               $    V ^8  d   QhRRRRRR/# )rS   rD  rE  deltaz	'adiff_t'r^   r$   )rT   s   "r   rU   rU   V  s!     3 3 3I 3 3r#   c                .    \         P                  ! W4      # )z;Truncate and sign extend a delta depending on the segment.
)r   segm_adjust_diff)rD  r0  s   &&r   r2  r2  V  s     ((22r#   c               $    V ^8  d   QhRRRRRR/# )rS   rD  rE  rS  r   r^   r$   )rT   s   "r   rU   rU   \  s!     . .k . ./ .r#   c                .    \         P                  ! W4      # )z.Truncate an address depending on the segment.
)r   segm_adjust_ea)rD  rS  s   &&r   r5  r5  \  s     &&q--r#   c                .    \         P                  ! W4      # )z-Deprecated, use instead:
value = s.defsr[reg])r   	get_defsr)rD  regs   &&r   r7  r7  b  s     !!!))r#   c                0    \         P                  ! WV4      # )z-Deprecated, use instead:
s.defsr[reg] = value)r   	set_defsr)rD  r8  r   s   &&&r   r:  r:  h  s     !!!%00r#   c               $    V ^8  d   QhRRRRRR/# )rS   r0  z'PyObject *'r   r_   r^   r$   )rT   s   "r   rU   rU   n  s!     5 5, 5s 5c 5r#   c                .    \         P                  ! W4      # )a  Rebase the whole program by 'delta' bytes. 
        
:param delta: number of bytes to move the program
:param flags: Move segment flags it is recommended to use MSF_FIXONCE so that the loader takes care of global variables it stored in the database
:returns: Move segment result codes)r   rebase_program)r0  r   s   &&r   r=  r=  n  s     &&u44r#   )    )r:   
__future__r   sysr   _swig_python_version_info__package__r   r   r   builtinsr   ImportErrorr   r%   r+   r5   r   r7   weakrefSWIG_PYTHON_LEGACY_BOOLtypingr=   r>   r?   r   	ida_rangeobjectrA    segment_defsr_array_swigregisterr   SREG_NUMrange_tr   segment_t_swigregistersaAbs	saRelByte	saRelWord	saRelPara	saRelPage	saRelDblesaRel4KsaGroupsaRel32BytessaRel64Bytes
saRelQwordsaRel128BytessaRel512BytessaRel1024BytessaRel2048BytessaRel_MAX_ALIGN_CODEscPrivscGroupscPubscPub2scStackscCommonscPub3sc_MAX_COMB_CODESEGPERM_EXECSEGPERM_WRITESEGPERM_READSEGPERM_MAXVALSEG_MAX_BITNESS_CODE
SFL_COMORGSFL_OBOK
SFL_HIDDEN	SFL_DEBUG
SFL_LOADERSFL_HIDETYPE
SFL_HEADERSEG_NORMSEG_XTRNSEG_CODESEG_DATASEG_IMPSEG_GRPSEG_NULLSEG_UNDFSEG_BSS
SEG_ABSSYMSEG_COMMSEG_IMEMSEG_MAX_SEGTYPE_CODEr   rK  r   rQ  rU  r[  r]  lock_segment_swigregisterrk  ro  rs  rx  r|  r  r  r  r  r  r  r  r  ADDSEG_NOSREGADDSEG_OR_DIEADDSEG_NOTRUNCADDSEG_QUIETADDSEG_FILLGAPADDSEG_SPARSEADDSEG_NOAAADDSEG_IDBENCr  r  SEGMOD_KILLSEGMOD_KEEPSEGMOD_SILENTSEGMOD_KEEP0SEGMOD_KEEPSELSEGMOD_NOMOVESEGMOD_SPARSEr  r  r  r  r  r  r  r  r  r  r  r  MOVE_SEGM_OKMOVE_SEGM_PARAMMOVE_SEGM_ROOMMOVE_SEGM_IDPMOVE_SEGM_CHUNKMOVE_SEGM_LOADERMOVE_SEGM_ODDMOVE_SEGM_ORPHANMOVE_SEGM_DEBUGMOVE_SEGM_SOURCEFILESMOVE_SEGM_MAPPINGMOVE_SEGM_INVALr  r  
MSF_SILENT	MSF_NOFIX
MSF_LDKEEPMSF_FIXONCEMSF_PRIORITYMSF_NETNODESr  CSS_OK	CSS_NODBGCSS_NORANGE	CSS_NOMEM	CSS_BREAKSNAP_ALL_SEGSNAP_LOAD_SEGSNAP_CUR_SEGr  r  r  r  
MAX_GROUPSr  r  MAX_SEGM_TRANSLATIONSr  r  r  r  r  r	  r  r  r  r  r  r  r  r$  r(  r+  r.  r2  r5  r7  r:  r=  r$   r#   r   <module>r     s  ">F # 9#/"
 L$ L
 &>>  % %  ?& ?<  - -.A BE   S5	!! S5l  # #I .""	""	""	""	""	





(((($$
****,,,,#88 			


			


  			00 ((**((,,#88 $$
  $$
""	$$
(($$
        





    


$$
    #88 +35/'.86 8  & &| 4-)+03-
:/+),2<  ****,,((,,**&&**H., &&&&**((,,****'##)))('/	8	<<  ((..,,**..00 **00 ..$::  22 ..10 $$
""	$$
&&((((> 
		""	&&""	""	((**((3%25 $$
3E %:: ;E7<6601*9 $56))	8'3.*15E"  s   \' '\65\6