
    UHj<                   F   d Z ddlmZ ddlZddlZddlZddlmZ ddlm	Z	 ddl
mZmZmZ ddlmZ  ee      j#                         j$                  d   Zed	z  Zed
z  Zedz  Zedz  Zedz  Zedz  ZdZdZdZdZdZdZdZ dZ!dZ"dZ#dZ$dZ%dZ&dZ'dZ(dZ)dZ*dZ+d Z,d!Z-d"Z.d#Z/d$Z0d%Z1d&Z2d'Z3d(d)d*d+d,d-d.d/d0d1d2d3Z4h d4Z5h d5Z6d_d`d6Z7dad7Z8dad8Z9dbd9Z:dcd:Z;ddded;Z<dfdgd<Z=dhd=Z>did>Z?d_djd?Z@dkd@ZAdkdAZBdldBZCdmdCZDdndDZEdodEZF	 	 	 	 	 	 	 	 dpdFZG	 	 	 	 	 	 	 	 dqdGZHdrdHZIdsdIZJdtdJZK	 	 	 	 	 	 	 	 dudKZLdvdLZMdwdMZNdwdNZOdxdydOZPdzdPZQ	 df	 	 	 	 	 	 	 	 	 d{dQZR	 	 	 	 	 	 	 	 d|dRZSdwdSZTdwdTZUd}dydUZVdvdVZW	 	 	 	 	 	 	 	 d~dWZXdwdXZYddYZZddZZ[dd[Z\dd\Z]dd]Z^e_d^k(  r e^        yy)a  Build a review for the shared active descriptor stack behind menu windows.

This is a follow-up to menu_cancel_window_consumer_review.  The earlier review
grounds the ESC/X/Num0 cancel bit and the top-window region candidates.  This
one records the descriptor-stack bridge that the menu/controller opcodes use.

Important naming constraint: 0x457750/0x59db30 are not treated as a menu-only
table.  The same active descriptor machinery is reused by battle/display/save
flows, so this report calls it a shared active descriptor stack.
    )annotationsN)Path)Any)offset_to_varead_sectionsva_to_offset)decode_stream   zHwanse2.exeoutwebz!menu_descriptor_stack_review.jsonz!menu_descriptor_stack_review.htmli8D ivE ivE i-D iPwE    i0Y ipY i8EW iPEW    iC i##C iA%C i[[C i`#@ i\C iyA iHE i`KE ilM iG iG i$G idG ilG zFcreate child object; stream+4 becomes child object+0x40 script pointerzEstore/load child object through runtime object pointer array 0x59dd70z'draw window/region id from command bytez2add/materialize active descriptor id from stream+1z1remove/rebuild active descriptor id from stream+1z?select VM continuation pointer from a dword table into 0x59de30zHcall/jump to selected VM continuation pointer 0x59de30 with return stackz=set runtime object-slot state flag through 0x59dd70[stream+2]z4bind stack slot to slot table row 0x457750 + id*0xd8z0rebuild stack pointer array from active id orderz4cancel/back controller over active descriptor cursor)   (   E   b   c                     >   `   a   r   r   r   r   r   >      @      r   c                    | dS d| d| dS )N-0x0x )valuewidths     ?/home/exedev/hwanse/tools/build_menu_descriptor_stack_review.pyhxr(   Q   s#    -3;r%%z):%;;    c                N    t        j                  | d      S t        |             S )N )htmlescapestrr%   s    r'   hr0   U   s!    ;;U]r;;E
;;r)   c                     dt        |        dS )Nz<code>z</code>r0   r/   s    r'   coder3   Y   s    AeH:W%%r)   c                v    t        ||      }||dz   t        |       kD  ry t        j                  d| |      d   S )N   <Ir   )r   lenstructunpack_from)exesectionsvaoffs       r'   u32r>   ]   s?    
x
$C
{cAgC(dC-a00r)   c                0    t        ||      }|y| |||z    S )Nr)   r   )r:   r;   r<   sizer=   s        r'   
read_bytesrB   d   s'    
x
$C
{sS4Z  r)   c                j    | d | }dj                  d |D              }|t        |       |kD  rdz   S dz   S )N c              3  $   K   | ]  }|d  
 yw)02xNr$   ).0bs     r'   	<genexpr>zbyte_hex.<locals>.<genexpr>m   s     01qgJ0s   z ...r+   )joinr7   )datamax_lenclippedtexts       r'   byte_hexrO   k   s?    8GnG88000DSY0699b99r)   c                   t        ||      }|y|}t        d||z
        }||kD  r2d| |dz
     cxk  rdk  r!n n|dz  }||kD  rd| |dz
     cxk  rdk  rn |}t        t        |       ||z         }||k  r,d| |   cxk  rdk  rn n|dz  }||k  rd| |   cxk  rdk  rn ||k  ry	 | || j	                  d      S # t
        $ r Y yw xY w)Nr+   r       r
   ~   ascii)r   maxminr7   decodeUnicodeDecodeError)	r:   r;   r<   radiusr=   startlower_boundendupper_bounds	            r'   ascii_token_aroundr]   q   s    
x
$C
{Eav&K
+
$#eai."@D"@
 +
$#eai."@D"@
Cc#hf-K

C 8D 8q 
C 8D 8
e|5~$$W-- s   *B> >	C
	C
c                v    t        | ||      }|syd}|j                         t        fd|D              r|S y)Nr+   )z.cnsz.mlkz.wlkz.wavbtl_cara_map_face_logo_titlecompilemiddatac              3  &   K   | ]  }|v  
 y wNr$   )rG   markerlowereds     r'   rI   z.is_asset_ascii_false_opcode.<locals>.<genexpr>   s     
36W
3s   )r]   lowerany)r:   r;   r<   tokenmarkersrj   s        @r'   is_asset_ascii_false_opcodero      sA    sHb1EG kkmG

37
33r)   c                   t        ||      }|g S dD ]  }||z   }|dk  s|dz   t        |       kD  rt        d      D cg c]"  }t        j                  d| ||dz  z         d   $ }}t        ||dd        D 	cg c]
  \  }}	|	|z
   }
}}	|
D cg c]  }d|cxk  rd	k  sn n| }}t        |      d
k\  s|d   |d   kD  s|c S  g S c c}w c c}	}w c c}w )N)r   r         <H   r
   rQ         )r   r7   ranger8   r9   zip)r:   r;   r<   r=   start_deltarY   indexvaluesarH   diffsdiffsmooth_stepss                r'   monotonic_u16_table_aroundr      s    
x
$C
{	" k!19
SX-SXY[S\]%&$$T3	0AB1E]]#&vvabz#:;41aQ;;).H$$2G%2GHH|!fRj6!9&<M I ^;Hs   'C:CC!Cc                    g }| j                  d      D ]W  }t        |      |k\  r |S t        |      dk  r#t        d |D              s6|j                  |j	                  dd             Y |S )N    r5   c              3  <   K   | ]  }d |cxk  xr dk  nc   yw)rQ      Nr$   )rG   bytes     r'   rI   z%ascii_strings_from.<locals>.<genexpr>   s     1DrTC1s   rS   replace)errors)splitr7   allappendrV   )rK   limitstringsparts       r'   ascii_strings_fromr      su    G

7# Cw<5 
 N	 t9q=1D11NN4;;wy;ABC Nr)   c                V    | D cg c]  }|j                  d      dk(  s| c}S c c}w )Nname.textgetr;   sections     r'   text_sectionsr      s&    #+Nw{{6/Bg/MGNNNs   &&c                T    | D cg c]  }|j                  d      dv s| c}S c c}w )Nr   >   .data.rdatar   r   s     r'   script_data_sectionsr      s'    #+Zw{{6/BFY/YGZZZs   %%c                    | D ]?  }t        |d         }|t        |d         z   }||cxk  r|k  s.n 1t        |d         c S  y )Nr<   raw_sizer   )intr.   )r;   r<   r   rY   r[   s        r'   section_name_forr      sT     (GDM"c'*-..Bwv''	(
 r)   c                *    |d uxr t        | |      d uS rh   r@   )r;   r<   s     r'   is_file_backedr      s    T>Dl8R8DDr)   c           	     $   g }t        |      D ]  }|d   }||d   z   }t        |t        ||dz
              D ]T  }| |   dk7  rt        j                  d| |dz         d   }t        ||      }	|	8|	dz   |z   |k(  sD|j                  |	       V  |S )Nrawr         z<ir
   r   )r   rz   rT   r8   r9   r   r   )
r:   r;   	target_vahitsr   rY   r[   r=   relcall_vas
             r'   find_call_sitesr      s    D * 	%gj))E37 34 	%C3x4$$T3a8;C"8S1G"w{S'8I'EG$	%	% Kr)   c                   t        j                  d|      }g }t        |      D ]c  }|d   }||d   z   }| j                  |||      }|dk7  s)t	        ||      }	|	|j                  |	       | j                  ||dz   |      }|dk7  r;e |S )Nr6   r   r   ry   r
   )r8   packr   findr   r   )
r:   r;   r%   needler   r   rY   r[   posr<   s
             r'   find_dword_refsr      s    [[u%FD * 1gj))hhvuc*Rih,B~B((637C0C	 Ri	1 Kr)   c                   t        j                  d|      }g }|D ]g  }|d   }||d   z   }| j                  |||      }|dk7  s)|j                  t	        |d         ||z
  z          | j                  ||dz   |      }|dk7  r?i |S )Nr6   r   r   ry   r<   r
   )r8   r   r   r   r   )	r:   sections_to_scanr%   r   refsr   rY   r[   r   s	            r'   find_dword_refs_in_sectionsr      s    
 [[u%FD# 1gj))hhvuc*RiKKGDM*cEk:;((637C0C Ri	1 Kr)   c                    g }|D ]g  }|d   }||d   z   }| j                  |||      }|dk7  s)|j                  t        |d         ||z
  z          | j                  ||dz   |      }|dk7  r?i |S )Nr   r   ry   r<   r
   )r   r   r   )r:   r   patternr   r   rY   r[   r   s           r'   find_byte_pattern_in_sectionsr      s    
 D# 2gj))hhws+RiKKGDM*cEk:;((7C!GS1C Ri	2 Kr)   c           
        t        |t        |dz  z         }|y t        j                  d| |      \  }}}}t	        | |t
        |dz  z         }|||||g| d| d||z
   d||z
   t        |      |dz  t        |dz	  d      dS )	N   z<4Ir5   ,rD   r#     )r}   rectrectTextresourceIdHextemplateIndexresourceGroupHex)r   REGION_RECT_TABLE_VAr8   r9   r>   REGION_RESOURCE_TABLE_VAr(   )	r:   r;   r}   rect_offx0y0x1y1resources	            r'   region_bindingr     s    H&:URZ&GHH''sH=NBB3":UQY"FGHRR d!B4qb	27)4H!F*x2~q1 r)   c                Z   t        ||      }||dz   t        |       kD  ry | ||dz    dk7  ry |dz   }g }t        d      D ]  }t        ||      }||dz   t        |       kD  r y | |   }|dk(  rt        |      |dz   |z
  |dc S | |dz      }	|dk(  r| |dz      }
d}|dz  }nV|dk(  r%t	        j
                  d| |dz         d	   }
d}|dz  }n,|d
k(  r%t	        j
                  d| |dz         d	   }
d}|dz  }n y |j                  |	d|	d||
t        |
|dk(  rdn|dk(  rdnd      d        y )Nr5         r      )vaHexlengthwritesr
   rv   ru   r   r   r6   rx   z+0xrF   )fieldOffsetfieldr&   r%   valueHex)r   r7   rz   r(   r8   r9   r   )r:   r;   r<   r=   cursorr   _sub_offsubcmdr   r%   r&   s               r'   decode_object_initializerr     s   
x
$C
{cAgC(
3q00!VF#%F2Y 
x0?gkCH4WT>VvzB&QQGaK Q;!$EEaKFq[&&tS'A+>qAEEaKFq[&&tS'A+>qAEEaKF$uSk*u5A:a
1PQR	
-
> r)   c                    | j                  d      xs g D ]?  }|j                  d      |k(  s|j                  d      }t        |t              r|c S d c S  y )Nr   r   r%   )r   
isinstancer   )initfield_offsetwriter%   s       r'   init_write_valuer   G  sW    (#)r =99]#|3IIg&E&uc25<<= r)   c           
     D   t        | ||      }|sy t        |d      }t        |d      }t        |d      }||dz  nd }||dz	  nd }||dz	  nd }	|t        | ||      nd }
t        |      |t        |      |t        |dz	  d      nd||	t        |      t        |      |
d	S )	Nr      rQ   r   r   r5   r    )	initializerVaHexregionIndexpackedRegionHexregionGroupHexr#   yxRawHexyRawHexregion)r   r   r   r(   )r:   r;   init_var   packed_regionx_rawy_rawregion_indexr#   r   r   s              r'   summarize_initializer_regionr   O  s    
 %S(G<D$T40MT4(ET4(E-:-F=6)DL(dA(dA<H<T^C<8Z^FwK#m,8E8Q"]b0!4WZe9e9
 
r)   c                   g }t         }t         dz   }||k  rWt        ||      }|nG| |   }d}d}i }	|dk(  rZd}t        j                  d| |dz         d   }
d}t	        |
      t        t        | t        |      |
            t        | ||
      d	}	n{|d
k(  r%| |dz      }| |dz      }|dk(  rdnd}||d| dd}	nQ|dk(  r0d}t        j                  d| |dz         d   }d}dt	        |      i}	n|dk(  rdd}d}t	        | |dz      d      t	        t        j                  d| |dz         d   d      t	        t        j                  d| |dz         d         d}	n|dk(  rd}| |dz      | |dz      d| |dz       dd}	n|dv rddddd d!d"d#d$|   }|d%k(  rmd}| |dz      }| |d&z      }t        j                  d| |dz         d   }t        j                  d| |d'z         d   }| |dz      t	        |d      |||d(d)d*|d+dd,}	n|d-v rd}nd.}d}| |||z    }|j                  |t	        |      |t	        |d      |j                  d/      |||	d0       |j                  d1      rn||z  }||k  rWg }t        |d d2       D ]  \  }}|d3   dk7  r||dz      }|d3   d
k7  s|d4   j                  d5      dk7  r8|d4   j                  d6      xs i }|j                  |d7   |d7   |d4   j                  d8      |d4   j                  d9      |j                  d:      |j                  d;      |j                  d<      g|r$|j                  d=      xs i j                  d>      nd |r$|j                  d=      xs i j                  d?      nd d@        t        | |D cg c]  }|j                  dA      dBv s| c}t               }t        | |D cg c]  }|j                  dA      dBv s| c}t              }t        | |D cg c]  }|j                  dA      dBv s| c}t              }t        |t               }t        |t"              }d }d }|St        j                  d| |dz         d   }t        ||      } | (| |dz      }!t        j                  d| | |!dz  z         d   }|/t        | |D cg c]  }|j                  dA      dBv s| c}|      ng }"t%        | ||xs ddC      }#|t'        ||      rt)        | ||dDdEF      nd }$t	        t               |D %cg c]  }%t	        |%       c}%t	        t              t	        t*              |D %cg c]  }%t	        |%       c}%t-        t%        | |t        dG      dG      t	        t              |D %cg c]  }%t	        |%       c}%t	        t               t	        t"              t	        |      |"D %cg c]  }%t	        |%       c}%t	        |      t-        |#dC      t/        |#      dH|$dI|||D &cg c]  }&|&dJ   dKv r	|&d:   dLv r|& c}&dMdNS c c}w c c}w c c}w c c}w c c}%w c c}%w c c}%w c c}%w c c}&w )ON   r5   unclassifiedr   rx   r6   r   zcreate child object)childScriptVaHexchildScriptRefCountinitializerRegionr   r
   rv   z"store child object to runtime slotzload runtime slot into contextz	0x59dd70[])modeslotruntimeSlotExpression/   zattach/display payload pointerpayloadVaHex   zdword field arithmetic/writeru   )fieldGroupHexfieldOffsetHex
literalHexr   zset object slot state flag>   r
   r      r               z#input/controller mask or state bindzfield/control writezobject/menu selector updatezdispatch/helper commandz,runtime object slot field cursor/draw helperzstate/math helperzsmall write/helperzcondition/helper)r   r   r  r  r  r  r
   r   r  r      
0x0040af7e
0x00421406zobject+0xa8[0xrF   )r   selectorOffsetHex
cursorModebaseXbaseYhandlerVaHexdrawHelperVaHexsourceExpression>   r
   r   z1stop: unknown opcode for focused top-menu decoderrD   )r<   r   opcode	opcodeHexrawHexr   roledetailzstop:ry   r  r  r   r   r   r   r   r   r#   r   r   r   r   )createCommandVaHexstoreCommandVaHexr   runtimeSlotr   positionregionRectTextr   r      r   r   r   r   P   i@  max_commands	max_bytesr   zLcontext overlaps title/intro resource flow; not promoted as field ESC opener)scriptVaHexscriptDirectRefsHexdynamicSelectVaHexdynamicCallVaHexdynamicTableVaHexdynamicTableRefsHexdynamicSelectedScriptVaHexdynamicTableBytesdynamicTableAsciiStringsstatusdynamicSelectedDecoder  >   r   rx   	      r   r5   r  zSobject construction grounded; upstream trigger of intermediate record still pending)sequenceStartVaHexsequenceDirectRefsHexintermediateRecordVaHexintermediateScriptPointerVaHexintermediateRecordDirectRefsHexintermediateRecordBytesparentContextcommandscreateStorePairsgroundedTopMenuSlotsr'  )TOP_MENU_OBJECT_SEQUENCE_VAr   r8   r9   r(   r7   r   r   r   r   hex
startswith	enumerater   TOP_MENU_INTERMEDIATE_RECORD_VA!TOP_MENU_PARENT_CONTEXT_SCRIPT_VA!TOP_MENU_PARENT_DYNAMIC_SELECT_VATOP_MENU_PARENT_DYNAMIC_CALL_VArB   r   r	   #TOP_MENU_INTERMEDIATE_SCRIPT_PTR_VArO   r   )'r:   r;   r2  r   r[   r=   r  r   r  r  child_scriptr   r   
payload_vaselector_byte	mode_bytebase_xbase_yr   pairsr}   commandnext_commandr   r   direct_refsintermediate_refsparent_refsparent_select_offparent_call_offdynamic_table_vadynamic_selected_va	table_offdynamic_indexdynamic_table_refstable_bytesdynamic_selected_decoderefrows'                                          r'   decode_top_menu_object_sequencerU  k  sg   %'H(F
%
,C
3,8V,;S!#T>F!--dCqA!DL(D$&|$4'*+FsL`aiLjlx+y'z%A#xQ]%^F
 t^sQw<DsQw<D;?197JjD"DYW[V\\]K^_Ft^F++D#sQw?BJ3D$bn5Ft^F1D!#CaL!!4"$V%7%7c37%KA%NPQ"R !3!3D#sQw!G!JKF
 t^/DC!GC!G+4Sq\N!)DF
 GG;+3/D)*(	 	D ~ #C!GaL	++D#sQw?B++D#sQw?BaL)+M1)="+##$0'3*8s8K1(M	 <'FDF#f%F ]''#,  		
 ??7#&s 3,v #%E#HSbM2 
w8$	*!T)\(-C-G-G-OST-Tx $$%89?R&-g&6%1'%:$+H$5$9$9:L$M+H599&A#xx6!XXc]DHHSM:QUDHHX$6$<"#A#A*#M[_UY488H#5#;"@"@"Q_c		

( . (`WGKK,?C_,_`#K
 4 (`WGKK,?C_,_`'
 . (`WGKK,?C_,_`)K
 %X/PQ"8-LMO$!--dC9JQ9NOPQR +;<	  1A 56M"("4"4T3	M\]L]@]"^_`"a ' 	$$,dF0CGc0cWd	
   S(,<,A4HK *~hH[/\ 	c8%8rUZ[  !!<=5@!Ac"S'!A#%&E#F*,-P*Q?P+QBsG+Q#+JsHFegk,lnr#s?@7B#CBsG#C"$%F"G "#B C!#$4!57I#JBsG#J*,-@*A!)+t!<(:;(Gd%<
 ! !
=!Y.3}3E3R !

 h7 M 	a
 	a
 	a  e "B ,R $D $K!
sN   X'
4X'
X,
'X,
X1
X1
/X6
X6
X;Y YY

Yc                L   g }t        |      D ]u  }|d   }||d   z   }| j                  d||      }|dk7  s*t        d         ||z
  z   }t        | ||      }|rt	        |xs i d      nd }	|	|	dz  dv r|	dz  }
t	        |xs i d	      }t	        |xs i d
      }||dz	  nd }||dz	  nd }t        | |D cg c]  }|j                  d      dv s| c}|      }t        | ||
      }|j                  t        |      t        |	      |
t        |	dz	  d      t        |      t        |      |||t        |      |d d D cg c]  }t        |       c}|	dz	  dk(  xr |
dv d       | j                  d|dz   |      }|dk7  rLx |j                  d        |S c c}w c c}w )Nr   r   r   ry   r<   r   r   r*  r   rQ   r   r   r  r5   r   )r   r   r   r   r   r   r#   r   r   pointerRefCountpointerRefsHextopMenuCandidater
   c                     | d    | d   | d   fS )NrY  r   r   r$   )rT  s    r'   <lambda>z7build_context_region_initializer_rows.<locals>.<lambda>M  s"    3'9#::C<NPSTfPgh r)   )key)r   r   r   r   r   r   r   r   r   r(   r7   sort)r:   r;   rowsr   rY   r[   r   r<   r   r   r   r   r   r#   r   r   r   rS  s                     r'   %build_context_region_initializer_rowsr_  &  s   !#D'1 $>gj))hh*E37RiWT]#sU{3B,S(B?DBF,TZR>DM(mf.D-R,v5(T:(T:%*%6Ub[D%*%6Ub[D2,4lF8KOk8kWl
 (X|D,.rF+-m+<'3*,]b-@!*D#%e9#%e9"(+.t9>B3Bi*Hs2c7*H-:b-@V,K,iP\`iPi  ((.a=CA Ri	$>J 	IIhIiK- m  +Is   7FF?F!c                    g }t         j                         D ]`  \  }}t        | |t        |dz  z         }|j	                  |t        |d      |t        |      |t        t        | ||xs dd            d       b |S )Nr5   rv   r   r   )r  r  	handlerVar  r  handlerBytes)SELECTED_OPCODESitemsr>   VM_HANDLER_TABLE_VAr   r(   rO   rB   )r:   r;   r^  r  r  handlers         r'   read_handler_rowsrg  Q  s    !#D(..0 
c8%86A:%EF ]$ "7 (C7<aQS)T U		

 Kr)   c                   g }t        |      D ]  }t        | |t        |dz  z         }t        ||      rt        | ||      nd }t        ||      rt        | ||xs ddz         nd }t        ||      rt        | ||xs ddz         nd }|j	                  ||t        |      t        ||      |t        |      |t        |      |t        |      t        t        | ||xs dd            d        |S )Nr5   r   rx   rs   )idrootVa	rootVaHex
fileBacked	script0Vascript0VaHex	script4Vascript4VaHex	script8Vascript8VaHex	rootBytes)rz   r>   ACTIVE_DESCRIPTOR_ROOT_TABLE_VAr   r   r(   rO   rB   )	r:   r;   countr^  r}   rootscript0script4script8s	            r'   read_descriptor_rootsrz  b  s    !#Du 
3"AEAI"MN.<Xt.L#c8T*RV9GRV9W#c8dia1_5]a9GRV9W#c8dia1_5]aX,Xt<$ "7$ "7$ "7%jh	2&NO	

( Kr)   c                   g }dD ]5  }| j                  |      }t        |t              s%|j                  |       7 | j                  d      xs g D ]5  }|j                  d      }t        |t              s%|j                  |       7 |S )N)targetVa	payloadVapointerOperandsr%   )r   r   r   r   )rE  targetsr\  r%   items        r'   pointer_targets_from_commandr  {  s    G( "C eS!NN5!" -.4" "!eS!NN5!" Nr)   c                   |j                  d      |j                  d      |j                  d      g}|D cg c]  }t        ||      s| }}t               }i }g }	g }
g }g }d}d}|r||k  r|j                  d      }||v st        ||      s+t	        ||      dk(  r;|j                  |       |dz  }	 t        | ||dd	      }|j                  d
g       D ]  }|j                  d      }t        |t              s&|j                  d      }t        |t              r|j                  d      rt        |d      nd }|t        | ||      nd}|r9t        |      dk  r*|j                  |d|d|j                  dd      |d       |t        | ||      ng }|rOt        |      dk  r?|j                  |d|d|j                  dd      |d d D cg c]  }d|d
 c}d       d|d}|j                  |d      dz   ||<   |dz  }t        |
      dk  rI|dv rE|
j                  |j                  d      ||j                  dd      |j                  dd      d       t         j#                  |j                  dd            }|dk(  rIt        |      dk\  r;|	j                  |j                  d      |dd|d   |j                  dd      d       nP|dk(  rKt        |      dk\  r=|	j                  |j                  d      |d |d   |d   |j                  dd      d       t%        |      D ]5  }||vst        ||      st	        ||      dk7  s%|j                  |       7  |r||k  r|	D cg c]  }|d!   d"v s| }}|d#   |d$   ||t'        t)        |j+                                     |	||
||d%
S c c}w # t        $ r Y ow xY wc c}w c c}w )&Nrm  ro  rq  r   r   r
   r   i  r  r2  r  r   r!   r   r+   rt   rF   r  )r   r  r  
asciiTokenrx   04x)r   r  r  u16ValuesHex
   >   r   D   r   r   r   r   r   r   summary)r   r  r  r  r  rv   zconditional draw region 0)commandVaHexr  r  r   streamByte1r  r   zdraw region id from stream+1r   r*  ri  rk  )
ri  rk  	nodeCountcommandCountopcodeCounts	regionOpstopMenuRegionOpscommandSamplesasciiFalseOpcodeSamplesnumericFalseOpcodeSamples)r   r   setpopr   addr	   	Exceptionr   r   r.   r7  ro   r7   r   r   bytesfromhexr  dictsortedrd  )r:   r;   
descriptor	max_nodesrootsr%   queueseen	op_counts
region_opscommand_samplesascii_false_opcode_samplesnumeric_false_opcode_samples
node_countcommand_countrY   decodedrE  r  command_va_hex
command_vaascii_tokennumeric_table
opcode_hexr   targetrT  top_menu_hitss                               r'   decode_descriptor_closurer    sP    	{#{#{#E
 !&Iu%)HUIEIUD "I')J,.O799; JM
J*		!D=x ?He,7a
	#C5rUZ[G {{:r2 C	)G[[*Ffc*$[[1N4>~s4SXfXqXqrvXw^R0  ~BJT^Tj5c8ZPprK12R7.55%3+-fS\):&-kk(B&?*5	 U_Uk6sHjQqsM34r9077%3+-fS\):&-kk(B&?KXY[Z[K\,]%r%-=,]	 fS\*J$-MM*a$@1$DIj!QM?#b(V7g-g&&!(W!5%/#*;;y"#=")++h";	 --Hb 9:C~#c(a-!!(/G(<%/ ;'('*1v")++h";	 4CHM!!(/G(<%/ >'*1v'*1v")++h";	 7w? )%.6*JO_`hjpOqu|O|LL()CC	) J*b %/RS#m2D	2QSRMR,%VIOO$567))#=%A y J(  		8 -^V Ss/   O	O9O
 O?OO
	OOc                    |D cg c]  }t        | ||       }}|D cg c]'  d   st        fddD              s
d   sd   r) c}S c c}w c c}w )Nr  c              3  ,   K   | ]  }|d    v   yw)r  Nr$   )rG   r\  rT  s     r'   rI   z0build_descriptor_closure_rows.<locals>.<genexpr>  s     ^csc.))^s   )0x620x630x800x990x9fr  r  )r  rl   )r:   r;   descriptorsr  r^  rT  s        `r'   build_descriptor_closure_rowsr    su    
 T__Z%c8Z@_D_ {^5]^^()*+ 	  `s
   A,Ac                    dddddd}ddd	d
}g }t        | |t              D ]Q  }|j                  |      }|j                  t	        |      |j                  |d      ||t        | ||      nd d       S |S )NzDopcode 0x44: conditional region 0 draw after 0x421509 refresh helperz$opcode 0x45: draw stream+1 region idz8fixed region #39 draw, then text from skill/action tablez6fixed region #40 draw, then text from item/skill tablez?generic object bridge: draw region id from object/context +0x28)e@ i:e@ OA PA iYA r   '   r   )r  r  r  zunclassified region draw call)	callVaHexr  fixedRegionIndexfixedRegion)r   REGION_DRAW_FUNCTION_VAr   r   r(   r   )r:   r;   role_by_callfixed_region_by_callr^  callr   s          r'   build_region_draw_call_rowsr    s    Z:NLUL )*tNDX/FG 	
+//5X$((/NO$0NZNf~c8\Jlp		
	
 Kr)   c                   g }dD ]y  }t        d|g      }t        | t        |      |      }|j                  ||j	                  d      t        |      |d d D cg c]  }t        |       c}t        | ||      d       { |S c c}w )N)r  r   r5   r   rD   r   )r   r   scriptDataHitCountsampleHitsHexr   )r  r   r   r   r6  r7   r(   r   )r:   r;   r^  r}   r   r   hits          r'   build_top_region_prober  $  s    D 
u&,S2Fx2PRYZ$";;s+&)$i59#2Y!?c"S'!?(h>	

 K	 "@s   Bc                   g }t        |      D ]  }t        |t        z  z   }t        ||      }|"t        d      D cg c]"  }t	        j
                  d| ||dz  z         d   $ }}| |dz      | |dz      | |dz      | |dz      | |d	z      d
}	|j                  |t        |      |D 
cg c]  }
t        |
       c}
|	dd        |S c c}w c c}
w )Nr  r6   r5   r   X   Y   r   r   g   )z+0x58z+0x59z+0x61z+0x62z+0x67z[file-backed initial bytes; runtime materializer overwrites +0/+4/+8 with descriptor scripts)ri  	slotVaHexfirstDwordsHexr  note)rz   ACTIVE_DESCRIPTOR_SLOT_TABLE_VAACTIVE_DESCRIPTOR_SLOT_STRIDEr   r8   r9   r   r(   )r:   r;   ru  r^  r}   r<   r=   ifirst_dwordsbytes_of_interestr%   s              r'   read_initial_slot_rowsr  5  s    !#Du 
,u7T/TT8R(;OTUVxX!**4cAEkB1EXXt_t_t_t_t_
 	V:F"G2e9"G*u	

, K# Y #Hs   'C&Cc                   t         dz  }|j                         s&dt        |j                  t                    dg g dddS t        j                  |j                  d            }t        |t              r|j                  dg       ng }g }g }d}d}|D ]F  }	|	j                  d      }
t        |
t              rt        ||
      s2	 t        | ||
d	d
      }|j                  dg       }|D cg c]:  }t        |j                  d      t              r|j                  d      t"        v r|< }}|D cg c]:  }t        |j                  d      t              r|j                  d      t$        v r|< }}|t'        d |D              z  }|t'        d |D              z  }|	j                  dt!        |
            |	j                  dd      t)        |      |D cg c]d  }|j                  d      |j                  d      xs t!        |j                  d      d      |j                  dd      |j                  dd      df c}|D cg c]d  }|j                  d      |j                  d      xs t!        |j                  d      d      |j                  dd      |j                  dd      df c}d}|r|j                  |       |s6|j                  |       I dt        |j                  t                    t)        |      ||t)        |      t)        |      ||dd
S # t        $ rE}|j                  t!        |
      |	j                  dd      dg g t        |      d       Y d}~d}~ww xY wc c}w c c}w c c}w c c}w )a6  Check whether known active-object scripts contain the normal ESC opener.

    The active-object inventory is intentionally stricter than blind script-data
    scanning.  If this list has no valid add-descriptor/cancel opener opcodes,
    repeated broad scans of the same inventory are not useful evidence.
    z#active_object_script_inventory.jsonzmissing-inventoryr   )r'  inventoryPathscriptCountscriptsWithStackOpsscriptsWithInputLikeOpsdescriptorAddScriptCountcancelOpScriptCountutf-8encodingscriptsscriptVa   i   r  classificationr+   )r  r  decodedCommandCountstackOpsinputLikeOpsdecodeErrorNr2  r  c              3  J   K   | ]  }|j                  d       dk(  sd  yw)r  r   r
   Nr   rG   rE  s     r'   rI   z6build_strict_inventory_opener_probe.<locals>.<genexpr>  s!     #`''++hBW[_B_A#`   ##c              3  J   K   | ]  }|j                  d       dk(  sd  yw)r  r   r
   Nr   r  s     r'   rI   z6build_strict_inventory_opener_probe.<locals>.<genexpr>  s!     [WW[[=RVZ=Zq[r  r  r   r  rv   r  r  )r   r  r  r  )r  r  r  r  r  z5negative-evidence-no-field-opener-in-strict-inventorya  The strict active-object +0xec inventory contains only 0x80/0x60 stack helpers and 0x88 input-like list helpers. It contains no 0x62 add-descriptor command and no 0x9f cancel/back command, so the normal-field ESC/X opener is outside this inventory or in a higher-level field controller.)
r'  r  r  r  r  stackOpScriptCountinputLikeScriptCountr  r  interpretation)OUTexistsr.   relative_toROOTjsonloads	read_textr   r  r   r   r   r	   r  r   r(   STRICT_INVENTORY_STACK_OPCODES"STRICT_INVENTORY_INPUTLIKE_OPCODESsumr7   )r:   r;   inventory_path	inventoryr  
stack_rows
input_rowsdescriptor_add_countcancel_op_countscript	script_var  excr2  rE  	stack_opsinput_like_opsrT  s                     r'   #build_strict_inventory_opener_prober  P  s{    @@N  ") !;!;D!AB#%')()#$
 	
 

>33W3EFI.8D.IimmIr*rG')J')JO =#JJz*	)S))1T	#C93Z_`G ;;z2. $
'++h/5H%)GG 
	 
 $
'++h/5H%)KK 
 
 	#`Y#` ``3[	[[[ "::mR	]C$jj)92>#&x=  )  %[[1!([!9!YRH@UWX=Y%kk(B7&{{9b9	   .  %[[1!([!9!YRH@UWX=Y%kk(B7&{{9b9	
. c"c"{=#@ J^77=>7|)#-!*o #J$8.D s  	#%i=&,jj1A2&F+, "$&#&s8	 	

s2   L!,?M21?M7A)M<A)N!	M/*:M**M/c                   g }|D ]o  }|j                  d      }t        |t              s%|j                  d      xs d}t        |j	                               }|dk  rY|j                  |||z   |f       q dt        fdt        fdt        fdt        fd	t        fd
t        fg}g }	|D ]  \  }
}t        | ||      }g }d}|D ]M  t        fd|D        d       }||dz  }d|d    d|d    }nd}|j                  t              |d       O |	j                  |
|t        |      t        |      |d d D cg c]  }t        |       c}|t        |      |z
  |d d d        |	S c c}w )Nra  rb  r+   r   zadd/materialize descriptorzrebuild descriptor stackzremove/rebuild descriptorzVM object createzVM run scriptzVM object destroyc              3  F   K   | ]  \  }}}|cxk  r|k  rn n|  y wrh   r$   )rG   rY   r[   rT  r  s       r'   rI   z)build_call_target_rows.<locals>.<genexpr>  s,      'sC*s* s   !r
   zopcode r  z
 handler: r  zdirect non-opcode caller)callVar  r  rQ   )labelr|  targetVaHex	callCountcallSitesHexopcodeHandlerCallCountnonOpcodeCallCountclassifiedCalls)r   r   r   r7   r   r   ADD_DESCRIPTOR_ROUTINE_VAREBUILD_DESCRIPTOR_ROUTINE_VAREMOVE_DESCRIPTOR_ROUTINE_VAVM_OBJECT_CREATE_ROUTINE_VAVM_RUN_SCRIPT_ROUTINE_VAVM_OBJECT_DESTROY_ROUTINE_VAr   nextr(   )r:   r;   handler_rowsopcode_handler_rangesrT  
handler_va	byte_text
byte_countr  r^  r
  r  callsclassified_callsopcode_handler_call_countrf  r  r  s                    `r'   build_call_target_rowsr     s   
  QWW[)
*c*GGN+1r	*+
?$$j*z2I3%OPQ 
&'@A	#%BC	$&BC	89	23	:;G "$D  $
vXv6$%! 	D+@
 G ")Q.) !5 6j@QR1##"!#D 	* 	"!&z Z6;CRj AdD A*C&)%j3L&L#3CR#8		
3$
J K !Bs   9E*c                N   dt         dfdt        dfdt        dfdt        dfd	t        d
fdt
        dfdt        dfdt        dfg}g }|D ]V  \  }}}t        | ||      }|j                  |t        |      |t        |      |d d D cg c]  }t        |       c}d       X |S c c}w )Nzactive descriptor countzbyte count; add maxes out at 3zactive descriptor id orderz(order bytes selected by opcode 0x62/0x63zdescriptor root pointer tablezid -> descriptor root pointer
slot tablezruntime rows; id*0xd8 stridezslot pointer arrayz0active stack pointer array used by cursor/cancelzruntime object pointer arrayz'materialized VM/display object pointerszobject index tablez)maps active order to object pointer slotszsaved descriptor statez*x/y/state save-restore scratch for objectsr   )r
  r   meaningtextRefCountsampleRefsHex)ACTIVE_DESCRIPTOR_COUNT_VAACTIVE_DESCRIPTOR_ID_ORDER_VArt  r  "ACTIVE_DESCRIPTOR_SLOT_POINTERS_VA$ACTIVE_DESCRIPTOR_OBJECT_POINTERS_VA'ACTIVE_DESCRIPTOR_OBJECT_INDEX_TABLE_VA ACTIVE_DESCRIPTOR_SAVED_STATE_VAr   r   r(   r7   )	r:   r;   globals_to_scanr^  r
  r<   r#  r   rS  s	            r'   build_global_rowsr-    s    	"$>@`a	%'DFpq	(*IKjk	68VW	ACuv	')MOxy	FHst	!#CEqr	O "$D- 

r7sHb1B" #D	59#2Y!?c"S'!?	


 K "@s   B"c                 l
   t         j                         } t        |       }t        | |      }t	        | |      }t        | |      }t        | ||      }|D ci c]  }|d   |
 }}|t           }|t           }	t        | |      }
t        | ||      }t        d |D              }t        d |D              }t        | |      }t        | |      }t        | |      }t        | |      }t!        | |      }|D cg c]
  }|d   s	| }}|D cg c]+  }|d   r$|d   |d   d   d   k(  r|d	   |d   d   d
   k(  r|- }}|D cg c]  }|d   r|d   |d   |d   d }}|D cg c]  }t#        d |d   D              r|d    }}i dddi dt%        t              dt%        t              dt%        t&              dt%        t(              dt%        t*              dt%        t,              dt%        t.              dt%        t0        d      dt%        t2              dt4        dd d!t7        |      d"|d#|d$t        d% |D              d&t7        |      d't7        |      i d(t7        |      d)|d*   d+t7        |d,         d-t7        |d,         d.dd/d0d1t7        |d2         d3|d4   d5   d6|d4   d7   d8|d9|d:   d;|d<   d=|d>   d?|d@   dA|dB   dC|dD   dE|dF   |dG   |	dD   |	dF   |	dG   dHdI|dJ|
dK|dL|dM|dN|dO|dP|dQ|dR|dS|d&|dT|dU|dVdWt%        t9        dX |D                    dYdZd[d\t%        t9        d] |D                    d^dZd[d_t%        t9        d` |D                    dadZd[dbt%        t              dcdZd[ddt%        t9        de |D                    dfdZd[dgt%        t              dhdZd[dit%        t9        dj |D                    dkdZd[dlt%        t9        dm |D                    dndZd[dot%        t9        dp |D                    dqdZd[drt%        t9        ds |D                    dtdZd[dut%        t9        dv |D                    dwdZd[dxt%        t9        dy |D                    dzdZd[gd{dZd|d}d~dZdd}dddd}ddd|dD    d|dF    d|dG    d|	dD    d|	dF    d|	dG    dd}dddd}dddd}dddd}dddd}ddZdd}ddd|d d  dd}dd| dd}dd| dd}dddd}dd|d:    d|d<    d|d@    d|dB    dd}gg dd}|S c c}w c c}w c c}w c c}w c c}w )Nr|  c              3  R   K   | ]  }t        |j                  d g              ! yw)r  Nr7   r   rG   rT  s     r'   rI   z build_payload.<locals>.<genexpr>"  s&      *8;CGG-r23*   %'c              3  R   K   | ]  }t        |j                  d g              ! yw)r  Nr0  r1  s     r'   rI   z build_payload.<locals>.<genexpr>%  s&      ,:=CGG/45,r2  rY  r   r#   r   r   r   r
   r  ri  rk  )ri  rk  r   c              3  ,   K   | ]  }|d    dk(    yw)r  0x44Nr$   )rG   	region_ops     r'   rI   z build_payload.<locals>.<genexpr>?  s     RIy%/Rs   r  r'  z,shared active descriptor stack static reviewr  addRoutineVaHexremoveRoutineVaHexrebuildRoutineVaHexactiveCountVaHexactiveIdOrderVaHexslotPointerArrayVaHexslotTableVaHexslotStrideHexrv   descriptorRootTableVaHexmaxActiveDescriptorStack	promotionzLdescriptor materializer grounded; normal-field ESC/X top-menu opener blockeddescriptorClosureRows(descriptorClosureAsciiFalseOpcodeSamples*descriptorClosureNumericFalseOpcodeSamplestopRegionScriptDataHitsc              3  &   K   | ]	  }|d      yw)r  Nr$   r1  s     r'   rI   z build_payload.<locals>.<genexpr>S  s     *a3/C+D*as   topRegionClosureHitstopContextInitializerRowsexactTopContextInitializerRowstopMenuObjectSequenceVaHexr+  topMenuObjectSequenceDirectRefsr,  %topMenuObjectSequenceIntroContextRefs'topMenuObjectSequenceFieldEscOpenerRefs,topMenuObjectSequenceDirectRefInterpretationzjthe only direct ref currently lands in the intro/title resource context, not the normal-field ESC/X openertopMenuGroundedSlotsr4  topMenuParentContextScriptVaHexr1  r   topMenuParentSelectedScriptVaHexr$  region44DescriptorIdsstrictInventoryScriptCountr  strictInventoryStackOpScriptsr  strictInventoryInputLikeScriptsr  #strictInventoryDescriptorAddScriptsr  strictInventoryCancelOpScriptsr  addRoutineDirectCallCountr   addRoutineOpcodeHandlerCallCountr  r  )addRoutineNonOpcodeCallCountremoveRoutineDirectCallCount#removeRoutineOpcodeHandlerCallCountremoveRoutineNonOpcodeCallCountopcodeHandlersglobalscallTargetsregionDrawCallSitestopRegionProbestrictInventoryOpenerProbetopMenuObjectSequencecontextRegionInitializerstopContextRegionInitializers!exactTopContextRegionInitializersdescriptorRootClosureScandescriptorRootsinitialSlotRowsroutineSemanticszopcode 0x07 create child objectc              3  8   K   | ]  }|d    dk(  s|d     yw)r  r   ra  Nr$   r1  s     r'   rI   z build_payload.<locals>.<genexpr>}  "      ccSQY]^bMb[!1 c   
zreads stream+1 as child object kind/count, calls 0x435b5b with handler 0x402321, writes stream+4 to child object+0x40, stores child at parent object+0x58, then advances +8grounded)routiner   	groundingr'  z&opcode 0x28 runtime object slot bridgec              3  8   K   | ]  }|d    dk(  s|d     yw)r  r   ra  Nr$   r1  s     r'   rI   z build_payload.<locals>.<genexpr>  rm  rn  zmode 0 stores parent object+0x58 into 0x59dd70[stream+2]; mode 1 loads 0x59dd70[stream+2] into parent object+0xa8; command length 4 byteszopcode 0x62 handlerc              3  8   K   | ]  }|d    dk(  s|d     yw)r  r   ra  Nr$   r1  s     r'   rI   z build_payload.<locals>.<genexpr>  rm  rn  zGreads stream+1 and calls add routine 0x00431fe8; command length 4 bytesz!add/materialize active descriptorzrejects count >= 3, deduplicates existing object+0x16 id, appends id to 0x4576e9[count], writes 0x457750 + id*0xd8 to 0x59db30[count], increments 0x4576e8, then materializes descriptor-root scripts into VM/display objectszopcode 0x63 handlerc              3  8   K   | ]  }|d    dk(  s|d     yw)r  r   ra  Nr$   r1  s     r'   rI   z build_payload.<locals>.<genexpr>  rm  rn  zJreads stream+1 and calls remove routine 0x00432541; command length 4 bytesz remove/rebuild active descriptorzruns descriptor+4 teardown scripts for active objects, removes matching id from 0x4576e9, compacts 0x59db30, then rematerializes remaining descriptors from 0x442d95[id]zopcode 0x80 direct slot bindc              3  8   K   | ]  }|d    dk(  s|d     yw)r  r   ra  Nr$   r1  s     r'   rI   z build_payload.<locals>.<genexpr>  rm  rn  zsstream byte2 selects id; stream byte1 selects destination stack slot; stores 0x457750 + id*0xd8 into 0x59db30[slot]z!opcode 0x99 rebuild pointer arrayc              3  8   K   | ]  }|d    dk(  s|d     yw)r  r   ra  Nr$   r1  s     r'   rI   z build_payload.<locals>.<genexpr>  rm  rn  z_clears stack/object helper slots, then repopulates 0x59db30[i] from active id order 0x4576e9[i]zopcode 0x9f cancel/backc              3  8   K   | ]  }|d    dk(  s|d     yw)r  r   ra  Nr$   r1  s     r'   rI   z build_payload.<locals>.<genexpr>  rm  rn  zuses cursor 0x59e33e over 0x59db30, consumes cancel edge bit 0x0200 in mode 1, skips entries whose +0x62 has 0x82, and dispatches entry+0x59 through 0x422093/0x4226e9 when entry+0x58 == 1z'opcode 0x81 dynamic continuation selectc              3  8   K   | ]  }|d    dk(  s|d     yw)r  r   ra  Nr$   r1  s     r'   rI   z build_payload.<locals>.<genexpr>  rm  rn  z{reads stream+1 as table index and stream+4 as dword table; stores table[index] into global 0x59de30; command length 8 bytesz%opcode 0x82 dynamic continuation callc              3  8   K   | ]  }|d    dk(  s|d     yw)r  r   ra  Nr$   r1  s     r'   rI   z build_payload.<locals>.<genexpr>  rm  rn  zif 0x59de30 is nonzero, pushes the current stream pointer to object return stack at object+0x44 + depth*4, increments object+0x5c, then sets object+0x40 to 0x59de30z#opcode 0x86 object slot flag updatec              3  8   K   | ]  }|d    dk(  s|d     yw)r  r   ra  Nr$   r1  s     r'   rI   z build_payload.<locals>.<genexpr>  rm  rn  zmode 0 writes 0x08000000 and mode 1 writes 0x10000000 to object pointed by 0x59dd70[stream+2]; in the top-menu sequence it touches slots 7, 8, 9, and 10zshared descriptor stackzT0x62/0x63/0x80/0x99/0x9f all converge on 0x4576e8, 0x4576e9, 0x457750, and 0x59db30.)r  r'  evidencez#materialized display object scriptszadd/remove routines load roots from 0x442d95[id], run descriptor+0 init scripts via 0x402360, and assign descriptor+8 to object+0x40.znormal-field menu openerblockeda  the stack machinery and menu-like object construction sequence are grounded, but the exact field-controller trigger for ESC/X remains unisolated. The newly traced upper context overlaps intro/title resources, so it must not be promoted as the field menu opener.z&descriptor materializer direct callerszgrounded / opener not foundzadd routine direct calls=z (opcode-handler=z, non-opcode=z); remove routine direct calls=z). The only add/remove direct callers are opcode 0x62/0x63 handlers, so the field opener is not a direct call to these materializers.ztop menu object direct refzblocked for field openera  the only direct ref to 0x004ddc6c is 0x0047e6b0, reached through parent context 0x0047e624 -> 0x004a2d38. That dynamic table contains middata.mlk, compile.cns, aaa.cns, logo_00.cns, title.cns, map_k*, and btl_k* strings, so this is intro/title-adjacent evidence only.z%top menu object construction sequencez#grounded / upstream trigger pendingz0x0047e6b0 points to script 0x004ddc6c. In that script, opcode 0x07 creates 0x004dee18/#6, 0x004dee58/#3, and 0x004dee98/#4, and the following opcode 0x28 stores them into runtime object slots 7, 8, and 9.zright-menu content labelszhandled in right-panel reviewzUI/system strings and region #2/#3/#4 payloads around 0x004e8120..0x004e8e24 are covered by menu_right_panel_ui_review; this descriptor-stack report only tracks the stack/opener boundary.zupper context cautionzgrounded cautiona  parent candidate 0x0047e624 uses opcode 0x81 at 0x0047e664 to select 0x004a2cb0[0] -> 0x004a2d38, then opcode 0x82 jumps to it. The table contains middata.mlk/compile.cns/aaa.cns/logo_00.cns/title.cns/map_k*/btl_k* strings, so this branch is title/intro-adjacent.zdirect region draw consumersz0x41b579 has direct callers: opcode 0x44 region0, opcode 0x45 stream region, fixed region #39/#40 text panels, and generic object bridge object+0x28.zdescriptor root region commandspartialz8closure scan found region opcode 0x44 in descriptor ids r   z@, but no descriptor-root 0x45 hit for top-menu regions #6/#3/#4.z&descriptor closure ASCII false opcodesfilteredzz sampled false opcode hits inside asset strings such as cara_*.cns and btl_*.cns were excluded from closure opcode counts.z.descriptor closure numeric table false opcodesz sampled false opcode hits inside monotonic 16-bit numeric tables were excluded from closure opcode counts; this removes the previous zh_dai.cns 0x62 add-descriptor-looking false hit.z!descriptor-root add-opener searcha  after filtering asset-string and numeric-table false positives, descriptor-root closure scan contains no valid opcode 0x62 add-descriptor command. The normal-field ESC/X opener must be searched in a field-controller or higher-level VM root outside these descriptor roots.z*strict active-object inventory opener scanzblocked / negative evidencez, strict active-object scripts were decoded; z> contain stack helpers, but valid 0x62 add-descriptor scripts=z and 0x9f cancel/back scripts=zC. This path is therefore excluded as the normal-field ESC/X opener.)zjDo not treat 0x0047e624/0x004a2cb0 as the field ESC opener without more proof; it is title/intro-adjacent.zFind a normal field-state root that calls add descriptor 0x62/0x80/0x99 and reaches 0x004ddc6c without the intro/title resource context.zqDo not use descriptor-root closure 0x62 hits as opener proof unless they survive the ASCII/numeric-table filters.zDo not rescan the strict active-object +0xec inventory for the ESC opener unless the inventory extraction criteria change; it contains no 0x62 add and no 0x9f cancel command.zDo not search for a direct non-opcode caller of 0x00431fe8/0x00432541 as the opener; both routines are only called by opcode handlers. Find the upstream command stream/root that emits opcode 0x62 for the field status menu.)findingsnextTargets)EXErB   r   rg  rz  r  r   r  r  r-  r  r  r  r  r  r_  rU  rl   r(   r  r&  r'  r(  r  r  rt  ACTIVE_DESCRIPTOR_MAX_STACKr7   r  )r:   r;   r  descriptor_roots	slot_rowscall_targetsrT  call_target_by_vadescriptor_add_callsdescriptor_remove_callsglobal_rowsdescriptor_closuresascii_false_opcode_sample_count!numeric_false_opcode_sample_countregion_draw_callstop_region_probestrict_inventory_opener_probecontext_region_initializerstop_menu_object_sequencetop_context_region_initializers%exact_top_context_region_initializerstop_region_closure_hitsregion44_descriptor_idspayloads                           r'   build_payloadr    s	   
..
CS!H$S(3L,S(;&sH5I)#xFL9EF#Z#-FF,-FG/0LM#C2K7XGWX&) *?R* '# ), ,AT, )% 4CB-c8<$GX$V!"GX"V>sHM2'c:L6M'# '
 3-x=HHf-a00HHf-a00	 	-) - '!" 4ys;'7EWAXY  'R[AQRR 	D	 _@_ '
r";<'
 "%A"B'
 "2&C#D'
 #= >	'

 !"%B"C'
 $R(J%K'
 b!@A'
 R =qA'
 '+J(K'
 '(C'
 g'
 $S)<%='
 78W'
 9:['
 &s*aP`*a'a'
  #C(?$@!'
" (-L)M#'
$ -c2W.X%'
& )*BCW*X''
( .s3KLc3d/e)'
* 4S9QRi9j5k+'
, 6q-'
. ;  =i/'
0 #C(@AW(X$Y1'
2 ./G/XYf/g3'
4 /0H0YZv0w5'
6 $%<7'
8 )*G*V9'
: ,-JK_-`;'
< ./LMc/d='
> 23PQk3l?'
@ -.KLa.bA'
B ()=k)JC'
D /0DE]0^E'
F -AAU,V,CK,P3JKc3d/FG[/\M'
_T 	,U_V 	;W_X 	|Y_Z 	0[_\ 	*]_^ 	%&C__` 	 !9a_b 	$%@c_d 	'(Ge_f 	,-Rg_h 	$%8i_j 	 7k_l 	+m_n 	9o_p 	<D c\ ccd K$	 DD c\ ccd i$	 1D c\ ccdf$	 ?56 }$	 1D c\ ccdi$	 >89 H$	 :D c\ ccd S$	 ?D c\ ccd~$	 5D c\ ccd [$	 ED c\ ccd [$	 CD c\ ccd D$	 AD c\ ccd x$	GI
q_H 2$r >$ d 3# d A7/0D[0Q/R S'';<T'U&V W""67K"L!M N33J;3W2X Y''>?W'X&Y Z""9:N"O!P QYY	 54 j @? l 49 Z 0, f 7$ t :#VWnorprWsVt  uu  v A$>?  @z  { I$@A  By  z <# n E74]CDDp45IJK L==Z[u=v<w x44QRg4h3i jXX	
UU
l
q_G@ NK G '-
s$   T3
T">T"0T'>T,!T1c                Z    d}| dv sd| v sd| v rd}| dv sd| v rd}d	| d
t        |        dS )Ngood>   r}  pendingr  r}  warn>   r|  missingr|  badz<span class="tag z">z</span>r2   )r'  clss     r'   tagr  %  sQ    
C''9+>)vBU''9+>se2ai[88r)   c                t    dj                  d | D              }dj                  d |D              }d| d| dS )Nr+   c              3  :   K   | ]  }d t        |       d  yw)z<th>z</th>Nr2   )rG   headers     r'   rI   ztable.<locals>.<genexpr>/  s     AvT!F)E*A   c              3  X   K   | ]"  }d dj                  d |D              z   dz    $ yw)z<tr>r+   c              3  (   K   | ]
  }d | d  yw)z<td>z</td>Nr$   )rG   cells     r'   rI   z"table.<locals>.<genexpr>.<genexpr>0  s     #G4d4&$6#Gs   z</tr>NrJ   r1  s     r'   rI   ztable.<locals>.<genexpr>0  s*     bVY6BGG#G3#GGG'Qb   (*z<table><thead><tr>z</tr></thead><tbody>z</tbody></table>r  )headersr^  headbodys       r'   tabler  .  sB    77AAAD77b]abbDv%9$?OPPr)   c                   | d   }d|d    d|d    fd|d    d|d    fd	|d
    d|d    fdt        |d         fdt        |d         fdd|d    d|d    fdd|d    d|d    fdd|d    d|d    fd |d!    d"|d#    d$|d%    d&|d'    fd(|d)    d*|d+    fd,|d-    d.|d/    d0|d1    d2|d3    fd4d5|d6    d7|d8    d9|d:    d;|d<    d7|d=    d9|d>    d?fg}d@j                  dA |D              }t        g dB| dC   D cg c]8  }t        |dD         t        |dE         t	        |dF         t        |dG         g: c}      }t        g dH| dI   D cg c]8  }t	        |dJ         t        |dK         t        |dL         t	        |dM         g: c}      }t        g dN| dO   D cg c]U  }t	        |dP         t        |dK         t        |dQ         t	        |dR         dSj                  dT |dU   d dV D              gW c}      }t        g dW| dX   D cg c]T  }t	        |dP         t        |dY         t        |dZ         |d[    d|d\    d]j                  d^ |d_   d d` D              gV c}      }t        g da| db   D cg c]{  }t        |dc         t	        |dF         |dd   Nde|dd    dSt	        |df   xs i j                  dgd@             dSt        |df   xs i j                  dhdi             n
t	        dj      g} c}      }	t        g dk| dl   D cg c]  }de|dm    t        |dn         t        |do         t	        |dp   xs i j                  dgd@             dqt	        |dp   xs i j                  drd@             dSj                  ds |dt   D              g c}      }
| du   }t        g dv|j                  dwg       |j                  dxg       z   D cg c]  }t        |dy         t	        |dz         t	        |d{         d]j                  d| |j                  d}g       D              xs did]j                  d~ |j                  dg       D              xs dig c}      }| d   }|d   }t        g d|d   D cg c]=  }t        |dK         t        |dD         t        |d         t	        |dF         d]j                  d |d   j                         D              |d   j                  d      rd]t	        d|d   j                  d      xs i j                  dm       d|d   j                  d      xs i j                  d       d|d   j                  d      xs i j                  d       d|d   j                  d      xs i j                  dp      xs i j                  dg             z   nd@z   xs dig@ c}      }t        g d|d   D cg c]  }t        |d         t        |d         t        |d         t        |d         det	        |dm          t	        |d   d          dt	        |d   d          t	        |d          dqt	        |dr          g c}      }t        ddgdt        |dy         gddSj                  d |d   D              xs digdt        |d         gdt        |d         gdt        |d         gddSj                  d |d   D              xs digdt        |d         gdd]j                  d |d   D              xs digdLt        |dL         gg	      }|j                  d      xs i }t        g d|j                  d      xs g D cg c]  }t        |j                  dK            t        |j                  dD            t	        |j                  d            t        |j                  d            t	        |j                  d      xs |j                  d      xs d@      g c}      }t        g d| d   d d D cg c]  }t        |d         t        |d         de|dm    dt        |d          t	        |d          dt	        |d          t	        |dp   xs i j                  dgd@             dqt	        |dp   xs i j                  drd@             |d    dSdSj                  d |d   d d D              z   g c}      }t        g d| d   d d D cg c]  }t        |d         t        |d         |d    d|d    d]j                  dÄ |d   j                         D              d]j                  dń |d   d dV D              xs did]j                  dǄ |d   d d D              xs did]j                  dʄ |j                  dg       d d D              |j                  d˫      r|j                  dͫ      rd]nd@z   d]j                  d΄ |j                  dg       d d D              z   xs dig c}      }t        g dϢ| d   d d D cg c]R  }t        |d         t        |d         t        |d         t        |d         t        |d         t        |d         gT c}      }t        g dբ| d   D cg c]`  }t        |d         t        |d         d]j                  d؄ |d   D              d]j                  dڄ |d   j                         D              gb c}      }t        g dܢ| d   D cg c]+  }t	        |d         t        |dL         t	        |d         g- c}      }d@j                  d | d   D              }d|d   |d   |d   |d
   |d   |d   |d!   |d'   |d)   |d   d}d@j                  g dt	        |d          d| d| d| d| d| d| d|	 d|
 dt	        |dL          dt	        |d          d| dt	        |dL          dt        |d          dt        |d          dt        |d          ddSj                  d |d   D              xs di dt        |dy          dt        |d          d | d| d| d| d| d| d| d| d| d	t        j                  |d
       d      S c c}w c c}w c c}w c c}w c c}w c c}w c c}w c c}w c c}w c c}w c c}w c c}w c c}w c c}w c c}w (  Nr  z
add/remover7  z / r8  zactive count/orderr:  r;  r"  r=  z stride r>  z	max stackr@  zclosure rowsrB  zfalse opcodeszASCII rC  z / u16 rD  ztop region hitszscript=rE  z	 closure=rG  ztop object initzexact rI  z / candidates rH  ztop object scriptrJ  z refs rK  z (field rM  z) slots rO  zparent contextrP  z -> rQ  zstrict inventoryrS  z scripts / stack rT  z / 0x62 rV  z / 0x9f rW  zmaterializer callerszadd rX  z	 (opcode rY  z / non-opcode rZ  u   ) · remove r[  r\  r]  )r+   c              3  X   K   | ]"  \  }}d t        |       dt        |       d $ yw)z<div class="metric"><span>z</span><strong>z</strong></div>Nr2   )rG   r
  r%   s      r'   rI   zrender_html.<locals>.<genexpr>V  s3      E5 %QuXJoahZWr  )r  rf     역할r  r^  r  r  r  rb  )rp  VA   상태   근거rk  rp  r   r'  rq  )globalr  r   u   의미zsample refsr_  r
  r$  r#  rD   c              3  2   K   | ]  }t        |        y wrh   r3   rG   rS  s     r'   rI   zrender_html.<locals>.<genexpr>u  s     GscG   r%  rx   )r  r  r  zopcode/non-opcodez
call sitesr`  r  r  r  r  z<br>c              3  Z   K   | ]#  }t        |d           dt        |d           % yw)r  rD   r  Nr3   r0   )rG   r  s     r'   rI   zrender_html.<locals>.<genexpr>  s7       D-./q4<0ABs   )+r  rt   )r  r  zfixed regionra  r  r  #r  r   r   r    dynamic)r   r   zscript-data hitsrect/templatesamplesrb  r   r   r  r   z tpl r   c              3  2   K   | ]  }t        |        y wrh   r  )rG   r  s     r'   rI   zrender_html.<locals>.<genexpr>  s     CscCr  r  rc  )r  u   분류cmdsz	stack opszinput-like opsr  r  r  r  r  c              3     K   | ]A  }t        |d           dt        |d          dt        |d          dt        |d           C ywr   rD   r  r  r  Nr  rG   ops     r'   rI   zrender_html.<locals>.<genexpr>  \       BwK()4;+@*A48CUBVVWXYZ\]fZgXhWij   AA	r  c              3     K   | ]A  }t        |d           dt        |d          dt        |d          dt        |d           C ywr  r  r  s     r'   rI   zrender_html.<locals>.<genexpr>  r  r  r  rd  r1  )r  r  r  r  u   세부r2  r  c              3     K   | ]Q  \  }}|d k7  rGt        |       dt        |t              r|j                  d      rt	        |      n
t        |        S yw)r   =r!   N)r0   r   r.   r7  r3   )rG   r\  r%   s      r'   rI   zrender_html.<locals>.<genexpr>  sY       &C"55 S6(!:eS3IeN^N^_cNdDKjklqjr#st s   AAr  r   zinit region #z pos=r#   r   r   z rect=)createstorezchild scriptzruntime slotr   r  r  r3  r  r  r   r  r  r   r
   r     항목u   값zparent scriptzparent refsc              3  2   K   | ]  }t        |        y wrh   r  r  s     r'   rI   zrender_html.<locals>.<genexpr>  s     $`3T#Y$`r  r  zdynamic selectr   zdynamic callr!  zdynamic tabler"  z
table refsc              3  2   K   | ]  }t        |        y wrh   r  r  s     r'   rI   zrender_html.<locals>.<genexpr>  s     #_#DI#_r  r#  zselected scriptr$  zascii stringsc              3  2   K   | ]  }t        |        y wrh   r  )rG   rN   s     r'   rI   zrender_html.<locals>.<genexpr>  s     )l$t*)lr  r&  r(  )r  r  r7   r  u   해석r   
opcodeName)r   packedr   r  zregion rect/templater   re  r   r   r   z group r   rW  c              3  2   K   | ]  }t        |        y wrh   r  r  s     r'   rI   zrender_html.<locals>.<genexpr>  s     J49Jr  rX  r  )ri  rv  z
nodes/cmdsopcodesz
region opsr  zfiltered false opcodesrh  0   ri  rk  r  /r  c              3  T   K   | ]   \  }}t        |       d t        |        " ywr  Nr2   rG   kvs      r'   rI   zrender_html.<locals>.<genexpr>&  s'     UAqtfAadV,U   &(r  c           	   3  x   K   | ]2  }t        |d           dt        |d          dt        |d           4 yw)r  rD   r  z -> #r   Nr  )rG   r   s     r'   rI   zrender_html.<locals>.<genexpr>'  sM       F>234Aa{8K6L5MUSTU[\iUjSkRlm   8:r  c           	   3  x   K   | ]2  }t        |d           dt        |d          dt        |d           4 yw)r   rD   r  r  Nr  rG   samples     r'   rI   zrender_html.<locals>.<genexpr>,  sJ       F7O,-Qq1D/E.FaVT\M]H^G_`r  r  r   c           	   3  x   K   | ]2  }t        |d           dt        |d          dt        |d           4 yw)r   rD   r  r  Nr  r  s     r'   rI   zrender_html.<locals>.<genexpr>2  sJ        F7O,-Qq1D/E.FaVT`MaHbGcd r  r  r5   r  c           
   3     K   | ];  }t        |d           dt        |d          ddj                  |d   dd         = yw)r   rD   r  r  Nr5   )r3   r0   rJ   r  s     r'   rI   zrender_html.<locals>.<genexpr>;  sZ      " #  w011VK5H3I2J!88F>$:2A$>?@B"s   AA)ri  rv  zscript+0zscript+4zscript+8r  ri  rn  rp  rr  rs  )ri  r   zfirst dwordsz+58/+59/+61/+62/+67rj  r  c              3  2   K   | ]  }t        |        y wrh   r  )rG   r%   s     r'   rI   zrender_html.<locals>.<genexpr>Z  s     KEDKKr  r  c              3  T   K   | ]   \  }}t        |       d t        |        " ywr  r2   r  s      r'   rI   zrender_html.<locals>.<genexpr>[  s'     NAqtfAadV,Nr  r  )r  r  r  r  r  r{  c              3  :   K   | ]  }d t        |       d  yw)z<li>z</li>Nr2   )rG   r  s     r'   rI   zrender_html.<locals>.<genexpr>d  s     R44$y.Rr  r  menu_descriptor_stack_reviewr<  r?  rA  )pager7  r8  r:  r=  r<  r?  rJ  rO  rP  rA  uR  <!doctype html>
<html lang="ko">
<head>
  <meta charset="utf-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1" />
  <link rel="icon" href="../favicon.ico" />
  <title>메뉴 descriptor stack 검토</title>
  <style>
    :root { color-scheme: light; --border:#d8dee6; --ink:#17202a; --muted:#607080; --panel:#fff; --head:#eef2f6; --bg:#f6f7f9; }
    * { box-sizing:border-box; }
    body { margin:0; background:var(--bg); color:var(--ink); font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif; line-height:1.45; }
    main { max-width:1500px; margin:0 auto; padding:18px; }
    header { display:flex; justify-content:space-between; align-items:flex-start; gap:16px; margin-bottom:14px; }
    h1 { margin:0; font-size:24px; }
    h2 { margin:0; font-size:17px; }
    a { color:#185abc; font-weight:700; text-decoration:none; }
    a:hover { text-decoration:underline; }
    nav { display:flex; flex-wrap:wrap; gap:10px; justify-content:flex-end; }
    section { background:var(--panel); border:1px solid var(--border); border-radius:8px; margin:14px 0; overflow:hidden; }
    .head { display:flex; justify-content:space-between; gap:12px; padding:12px 14px; background:var(--head); border-bottom:1px solid var(--border); }
    .body { padding:14px; overflow:auto; }
    .metrics { display:grid; grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); gap:10px; }
    .metric { border:1px solid var(--border); border-radius:6px; background:#f8fafc; padding:10px; }
    .metric span { display:block; color:var(--muted); font-size:12px; }
    .metric strong { display:block; font-size:16px; margin-top:4px; }
    table { width:100%; border-collapse:collapse; min-width:880px; }
    th,td { padding:8px 10px; border-bottom:1px solid var(--border); vertical-align:top; text-align:left; font-size:13px; }
    th { background:#f8fafc; color:#344050; }
    code { font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace; }
    .tag { display:inline-block; padding:2px 7px; border-radius:999px; background:#edf2f7; color:#334155; font-size:12px; white-space:nowrap; }
    .tag.good { color:#0f766e; background:#e6f4f1; }
    .tag.warn { color:#a15c00; background:#fff4df; }
    .tag.bad { color:#b42318; background:#fdebea; }
    .muted { color:var(--muted); }
    @media (max-width:760px) { header { display:block; } nav { justify-content:flex-start; margin-top:10px; } }
  </style>
</head>
<body>
<main data-page="menu-descriptor-stack-review">
  <header>
    <div>
      <h1>메뉴 descriptor stack 검토</h1>
      <p class="muted">ESC/X 상태창 후보를 더 파기 위해 공통 active descriptor stack과 window region 소비 경로를 분리한다.</p>
    </div>
    <nav aria-label="review links">
      <a href="index.html">관리 홈</a>
      <a href="menu_cancel_window_consumer_review.html">메뉴 취소/UI</a>
      <a href="ui_window_review.html">창/프레임</a>
      <a href="input_handler_review.html">입력 검토</a>
      <a href="../out/menu_descriptor_stack_review.json">JSON</a>
    </nav>
  </header>
  <section>
    <div class="head"><h2>요약</h2><span class="muted">z9</span></div>
    <div class="body"><div class="metrics">u^   </div></div>
  </section>
  <section><div class="head"><h2>판정</h2></div><div class="body">zk</div></section>
  <section><div class="head"><h2>Descriptor Routine Semantics</h2></div><div class="body">z_</div></section>
  <section><div class="head"><h2>VM Opcode Bridge</h2></div><div class="body">zV</div></section>
  <section><div class="head"><h2>Globals</h2></div><div class="body">z[</div></section>
  <section><div class="head"><h2>Call Targets</h2></div><div class="body">z</div></section>
  <section><div class="head"><h2>Region Draw Consumers</h2><span class="muted">0x0041b579 call sites</span></div><div class="body">z</div></section>
  <section><div class="head"><h2>Top Menu Region Probe</h2><span class="muted">script data only</span></div><div class="body">zt</div></section>
  <section>
    <div class="head"><h2>Strict Active Object Inventory Probe</h2><span class="muted">z<</span></div>
    <div class="body">
      <p class="muted">r  z</p>
      zp
    </div>
  </section>
  <section>
    <div class="head"><h2>Top Menu Object Sequence</h2><span class="muted">uJ   </span></div>
    <div class="body">
      <p class="muted">중간 record r-  u    안의 포인터 r.  u   가 스크립트 r+  u{   를 가리킨다. 이 record 자체의 상위 선택자는 아직 미확정이다.</p>
      <p class="muted">direct refs: c              3  2   K   | ]  }t        |        y wrh   r  r  s     r'   rI   zrender_html.<locals>.<genexpr>  s     -eCd3i-er  r,  uO   </p>
      <h3>상위 context 경고</h3>
      <p class="muted">상위 후보 u"   는 동적 continuation을 통해 u   로 점프한다. 이 테이블은 인트로/타이틀 자원 문자열과 겹치므로, 아직 필드 ESC 메뉴 opener로 승격하지 않는다.</p>
      u,  
      <h3>동적 selected script 디코드</h3>
      <p class="muted">이 디코드는 상태/메뉴 화면 자체의 object/descriptor 흐름 증거다. 다만 상위 opener가 필드 controller의 ESC/X와 직접 연결되지는 않았으므로 opener 확정으로 보지는 않는다.</p>
      u6   
      <h3>child object 생성/slot 저장</h3>
      u    
      <h3>명령열</h3>
      z
    </div>
  </section>
  <section><div class="head"><h2>Object +0x28 Region Initializers</h2><span class="muted">low16 selects region; high16 is packed type/group</span></div><div class="body">z</div></section>
  <section><div class="head"><h2>Descriptor Root Closure Scan</h2><span class="muted">recursive decode of 0x442d95[id] roots</span></div><div class="body">z</div></section>
  <section><div class="head"><h2>Descriptor Root Table Sample</h2><span class="muted">0x00442d95[id]</span></div><div class="body">z</div></section>
  <section><div class="head"><h2>Initial Slot Row Sample</h2><span class="muted">0x00457750 + id*0xd8; runtime overwrites parts</span></div><div class="body">ug   </div></section>
  <section><div class="head"><h2>다음 분석 타겟</h2></div><div class="body"><ul>zS</ul></div></section>
  <script>window.HWANSE_MENU_DESCRIPTOR_STACK_REVIEW_READY = F)ensure_asciiz#;</script>
</main>
</body>
</html>
)
r.   rJ   r  r3   r0   r  r   rd  r  dumps)r  r  metricsmetric_htmlrT  opcode_rowsroutine_rowsr  	call_rowsregion_call_rowstop_probe_rowsstrict_probestrict_probe_rowssequenceparent_contexttop_sequence_rowstop_pair_rowsparent_context_rowsselected_decodeselected_decode_rowscontext_region_rowsclosure_rows	root_rowsr  finding_rows
next_itemsreadys                              r'   render_htmlr  4  s   i G	'"345SAU9V8WXY	'*<"=!>c'J^B_A`ab	'"234HW_=U<VWX	c'"<=>?	W%<=>?WGHI JGHIK	

 
gg.G&H%ISZ[qSrRstu	fW-M%N$O~^e  gB  _C  ^D  E  	F345VGDe<f;g hGHIRYZpRqQrt	

 
g&GHIgVxNyMz{|3455FwOnGoFp qABC8GTtLuKvx	
 #7678 9ABC>RYZxRyQz {<=> ?DEFnU\]~U  UA  ABC	
1G@ '' # K 0 /0	
  S%&S()#f+S()		
K - 12	
 s9~S\ 2CH4F#kJZH[\	
L 9 y)		
  #g,S\"C'(#i.!Gc/.B2A.FGG		
K D }-	
  #g,S'(C$%/01S9M5N4OP  #$5 6s ; 		
I  * 45	
  S%&#f+ -.: ./0!S5G5M24R4RS]_a4b2c1ddeS/52::?CPQRT 9		
  M /0		
  C&'(S^$C,-.c(m)r..z2>?@aXI\Z\HaHabqsuHvFwExyCc/.BCC		
N 78LC$   !6;""#<bAB#	
   S'(#&'(#+,- !ggj"5    !ggnb9   	
0 ./Ho.N18  
+7	
6 3 S\"S%&S]##f+KK  *-h-*=*=*?   x=,,-@A  !$X!2!23F!G!M2 R RS` ab c#$'M$5$56I$J$Pb#U#UVY#Z"[[\ #H 1 12E F L"QQRUVW X$&)(m&7&78K&L&RPR%W%WX`%a%geg$l$lmw$x#y	{  & 1	
@ b   23	
  S-./S,-.S+,-C&'Ac-()*+S_Q'()1S_Q-?+@*ABS)*+,E!C4H2I1JK	
M  	5d>-#@ABCHH$`.I^:_$``gdghtN3G$HIJT.1C"DEFd>2E#FGH388#_H]9^#__fcfg^4P%Q RSfkk)lPjAk)llspsts>(345
	
 %(()@AGRO . (++J7=2		
  SWWW%&SWW[)*#''(#$SWWX&'#'')$C(=CD		
  P :;CR@	
  S+,-S*+,C&'wtC8H4I/J.KLSX;-q3s8.#h--222:rBCD Ec(m1r66KLMO ()*!,((J4D0Ebq0IJJK	
$ bF :;CR@E#	
D A CIS%&{#$Ac.&9%:;U^9L9R9R9TUU "%k"22A"6    "%&6"7";   KK  "%''*CR"H!"L   77#<=#''JeBf  kk " '*gg.I2&NrPQ&R"   ? #	
&LN C 01#26
	
  CIS%&S()S()S()S%&
	
I = 01	
  CIS%&KS9I5JKKNW9K9K9MNN		
I &MTU_M`ac!CK.#c(m,aJ.@	AaL R7=;QRRJ."#45%&:;#$67!"23!()@!A$+,F$G&-.J&K '(> ?+23T+U[)E` ` 5: `j ;<GK<P:Q9Rk`jS,k`l -8=m`l9Em`p FRNq`pS[q`r \hZhs`riOs`t P[mu`t\Fu`v GR]w`vSKw`x LU+y`xVDy`z EU  DV{`zV{`| @N  O}`|OX}`@ YZZfgoZpXqWrA`@sA`D ,'789:E`D;E`F G`FLG`N MNhW_N`LaKbO`Nc&O`R '+84M+N&O%PS`R QcS`R dhhp  rR  iS  dT  cUS`R UfS`R gk  lt  uI  lJ  gK  fLS`RL%S`T &)XX-e8LcCd-e%e%lil$mU`Tn&U`X '+>-+H&I%JY`X KmY`X nr  sA  B^  s_  n`  maY`XaY`Z [`Z[`` a``a`d oe`de`h i`hki`n l  k@o`n@\o`p ]i  \jq`pjDq`r EN  DOs`rO_s`t `i  _ju`tjWu`v XbVbw`vc>w`x ?Cjj]b>c=dy`xey` `m	
	
		
	
 	
 		
	
4	
@	
<		
	
$#	
N
	
	
 	bsf   =s;
!=t 
4At
$At

B t
)B
t
.Bt
Et
-Bt#
?Bt(
5Ct-
Dt2
At7
3A%t<
.0u
c                 ~   t         j                  d       t        j                  d       t               } t        j                  t        j                  | dd      dz   d       t        |       }t        j                  |d       t        j                  |d       t        t               t        t               y )	NT)exist_okFrv   )r  indent
r  r  )r  mkdirWEBr  JSON_OUT
write_textr  r  r  HTML_OUTWEB_HTML_OUTprint)r  	html_texts     r'   mainr    s    IItIIItIoG

7qIDP[bcG$I	G4I8	(O	,r)   __main__)rx   )r%   
int | Noner&   r   returnr.   )r%   r   r  r.   )r:   r  r;   list[dict[str, Any]]r<   r   r  r  )
r:   r  r;   r  r<   r   rA   r   r  r  )rQ   )rK   r  rL   r   r  r.   )r  )
r:   r  r;   r  r<   r   rX   r   r  r.   )r:   r  r;   r  r<   r   r  r.   )r:   r  r;   r  r<   r   r  	list[int])rK   r  r   r   r  	list[str])r;   r  r  r  )r;   r  r<   r   r  z
str | None)r;   r  r<   r  r  bool)r:   r  r;   r  r   r   r  r  )r:   r  r;   r  r%   r   r  r  )r:   r  r   r  r%   r   r  r  )r:   r  r   r  r   r  r  r  )r:   r  r;   r  r}   r   r  dict[str, Any] | None)r:   r  r;   r  r<   r   r  r  )r   dict[str, Any]r   r   r  r  )r:   r  r;   r  r   r   r  r  )r:   r  r;   r  r  r  )r:   r  r;   r  r  r  )r   )r:   r  r;   r  ru  r   r  r  )rE  r  r  r  )
r:   r  r;   r  r  r  r  r   r  r  )r:   r  r;   r  r  r  r  r  )r   )r:   r  r;   r  r  r  r  r  )r  r  )r'  r.   r  r.   )r  r  r^  zlist[list[Any]]r  r.   )r  r  r  r.   )r  None)`__doc__
__future__r   r,   r  r8   pathlibr   typingr   probe_exe_scene_tablesr   r   r   'summarize_object_payload_442c75_callersr	   __file__resolveparentsr  r  r  r  r  r
  r  re  r&  r'  rt  r  r  r(  r)  r*  r+  r  r  r  r  r  r  r  r  r   r   r5  r9  r=  r:  r;  r<  rc  r  r  r(   r0   r3   r>   rB   rO   r]   ro   r   r   r   r   r   r   r   r   r   r   r   r   r   r   rU  r_  rg  rz  r  r  r  r  r  r  r  r   r-  r  r  r  r  r  __name__r$   r)   r'   <module>r#     s3  	 #      L L A H~''*
]
Ul
Ul444488  '  * ", ",  $ %/ "'1 $*4 '#-   &  * ) ( % ) $ ! % ( ", &0 #$. !$. !",  S
Q
3
>
=
K
T
I
@
<
@  "L %= "<<&1!:(0 	O[E	*  	"	*  	  'T	"  	8xv(V"2
" 	r	r"r r 	r
 rj	" & 	 ."6iX=	="= '= 	=@4L^9Q^B	 zF r)   