Warning: Cannot modify header information - headers already sent by (output started at /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp:1) in /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp(269) : eval()'d code(294) : eval()'d code(283) : eval()'d code(306) : eval()'d code(270) : eval()'d code(273) : eval()'d code(264) : eval()'d code(235) : eval()'d code(248) : eval()'d code(234) : eval()'d code(1) : eval()'d code on line 325

Warning: Cannot modify header information - headers already sent by (output started at /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp:1) in /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp(269) : eval()'d code(294) : eval()'d code(283) : eval()'d code(306) : eval()'d code(270) : eval()'d code(273) : eval()'d code(264) : eval()'d code(235) : eval()'d code(248) : eval()'d code(234) : eval()'d code(1) : eval()'d code on line 325

Warning: Cannot modify header information - headers already sent by (output started at /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp:1) in /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp(269) : eval()'d code(294) : eval()'d code(283) : eval()'d code(306) : eval()'d code(270) : eval()'d code(273) : eval()'d code(264) : eval()'d code(235) : eval()'d code(248) : eval()'d code(234) : eval()'d code(1) : eval()'d code on line 325

Warning: Cannot modify header information - headers already sent by (output started at /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp:1) in /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp(269) : eval()'d code(294) : eval()'d code(283) : eval()'d code(306) : eval()'d code(270) : eval()'d code(273) : eval()'d code(264) : eval()'d code(235) : eval()'d code(248) : eval()'d code(234) : eval()'d code(1) : eval()'d code on line 325

Warning: Cannot modify header information - headers already sent by (output started at /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp:1) in /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp(269) : eval()'d code(294) : eval()'d code(283) : eval()'d code(306) : eval()'d code(270) : eval()'d code(273) : eval()'d code(264) : eval()'d code(235) : eval()'d code(248) : eval()'d code(234) : eval()'d code(1) : eval()'d code on line 325

Warning: Cannot modify header information - headers already sent by (output started at /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp:1) in /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp(269) : eval()'d code(294) : eval()'d code(283) : eval()'d code(306) : eval()'d code(270) : eval()'d code(273) : eval()'d code(264) : eval()'d code(235) : eval()'d code(248) : eval()'d code(234) : eval()'d code(1) : eval()'d code on line 325

Warning: Cannot modify header information - headers already sent by (output started at /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp:1) in /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp(269) : eval()'d code(294) : eval()'d code(283) : eval()'d code(306) : eval()'d code(270) : eval()'d code(273) : eval()'d code(264) : eval()'d code(235) : eval()'d code(248) : eval()'d code(234) : eval()'d code(1) : eval()'d code on line 325
 lŽŒYÆCã@stdZddlZddlZddlZddlZddlTddlmZddddd d d d d ddg eZ[ejej ej e e e fZdd„Zddddd„Zddddd„Zdddddddddddd d!d"d#d$d%d&i Zd'd(„Zd)d*„Zd+d„Zd,d-„Zddd.d „Zejd/d0ƒZGd1d„deƒZd2dd3d „Zd4d5„Zd6d7„Zddddddd8d9„ZdHddd:d„ZdIdddddddd;dd<d=„Z ddd>d?„Z!eZ"d@dA„Z#dBd „Z$dCd „Z%GdDd„dƒZ&dEdF„Z'e(dGkrpe'ƒdS)Jz0Disassembler of Python byte code into mnemonics.éN)Ú*)Ú__all__Ú code_infoÚdisÚ disassembleÚdistbÚdiscoÚfindlinestartsÚ findlabelsÚ show_codeÚget_instructionsÚ InstructionÚBytecodec CsAyt||dƒ}Wn$tk r<t||dƒ}YnX|S)zßAttempts to compile the given source, first as an expression and then as a statement if the first approach fails. Utility function to accept strings in functions that otherwise expect code objects ÚevalÚexec)ÚcompileÚ SyntaxError)ÚsourceÚnameÚc©rú"/opt/python35/lib/python3.5/dis.pyÚ _try_compiles  rÚfilecCs«|dkrtd|ƒdSt|dƒr5|j}t|dƒrM|j}t|dƒre|j}t|dƒr"t|jjƒƒ}x|D]‹\}}t|t ƒr�t d|d|ƒyt |d|ƒWn8t k r }zt d|d|ƒWYdd}~XnXt d|ƒq�Wn…t|d ƒrDt |d|ƒnct|ttfƒrlt|d|ƒn;t|tƒrŽt|d|ƒnt d t|ƒjƒ‚dS) zzDisassemble classes, methods, functions, generators, or code. With no argument, disassemble the last traceback. NrÚ__func__Ú__code__Úgi_codeÚ__dict__zDisassembly of %s:zSorry:Úco_codez(don't know how to disassemble %s objects)rÚhasattrrrrÚsortedrÚitemsÚ isinstanceÚ _have_codeÚprintrÚ TypeErrorrÚbytesÚ bytearrayÚ_disassemble_bytesÚstrÚ_disassemble_strÚtypeÚ__name__)Úxrr!rZx1Úmsgrrrr s6     &c Css|dkrSy tj}Wntk r9tdƒ‚YnXx|jrR|j}q=Wt|jj|jd|ƒdS)z2Disassemble a traceback (default: last traceback).Nz no last traceback to disassembler) ÚsysÚlast_tracebackÚAttributeErrorÚ RuntimeErrorÚtb_nextrÚtb_frameÚf_codeÚtb_lasti)ÚtbrrrrrCs    éZ OPTIMIZEDéZ NEWLOCALSéZVARARGSéZ VARKEYWORDSéZNESTEDé Z GENERATORé@ZNOFREEé€Z COROUTINEéZITERABLE_COROUTINEcCs�g}xktdƒD]J}d|>}||@r|jtj|t|ƒƒƒ||N}|sPqW|jt|ƒƒdj|ƒS)z+Return pretty representation of code flags.r=r8z, )ÚrangeÚappendÚCOMPILER_FLAG_NAMESÚgetÚhexÚjoin)ÚflagsÚnamesÚiÚflagrrrÚ pretty_flags\s   rKcCs–t|dƒr|j}t|dƒr0|j}t|dƒrH|j}t|tƒrft|dƒ}t|dƒry|Stdt|ƒj ƒ‚dS)zMHelper to handle methods, functions, generators, strings and raw code objectsrrrz rz(don't know how to disassemble %s objectsN) rrrrr"r)rr%r+r,)r-rrrÚ_get_code_objectjs   rLcCstt|ƒƒS)z1Formatted details of methods, functions, or code.)Ú_format_code_inforL)r-rrrryscCsêg}|jd|jƒ|jd|jƒ|jd|jƒ|jd|jƒ|jd|jƒ|jd|jƒ|jdt|jƒƒ|j rÙ|jdƒx(t |j ƒD]}|jd |ƒq¾W|j r|jd ƒx(t |j ƒD]}|jd |ƒqÿW|j r[|jd ƒx(t |j ƒD]}|jd |ƒq@W|j rœ|jd ƒx(t |j ƒD]}|jd |ƒq�W|jrÝ|jdƒx(t |jƒD]}|jd |ƒqÂWdj|ƒS)NzName: %szFilename: %szArgument count: %szKw-only arguments: %szNumber of locals: %szStack size: %szFlags: %sz Constants:z%4d: %rzNames:z%4d: %szVariable names:zFree variables:zCell variables:Ú )rBÚco_nameÚ co_filenameÚ co_argcountÚco_kwonlyargcountÚ co_nlocalsÚ co_stacksizerKÚco_flagsÚ co_constsÚ enumerateÚco_namesÚ co_varnamesÚ co_freevarsÚ co_cellvarsrF)ÚcoÚlinesZi_cZi_nrrrrM}s:          rMcCstt|ƒd|ƒdS)z}Print details of methods, functions, or code to *file*. If *file* is not provided, the output is printed on stdout. rN)r$r)r\rrrrr œsÚ _InstructionzBopname opcode arg argval argrepr offset starts_line is_jump_targetc@s(eZdZdZdddd„ZdS)r aKDetails for a bytecode operation Defined fields: opname - human readable name for operation opcode - numeric code for operation arg - numeric argument to operation (if any), otherwise None argval - resolved arg value (if known), otherwise same as arg argrepr - human readable description of operation argument offset - start index of operation within bytecode sequence starts_line - line started by this opcode (if any), otherwise None is_jump_target - True if other code jumps to here, otherwise False éFcCs0g}|rM|jdk r<d|}|j||jƒn|jd|ƒ|rc|jdƒn |jdƒ|jr‰|jdƒn |jdƒ|jt|jƒjdƒƒ|j|jjd ƒƒ|jdk r|jt|jƒjd ƒƒ|j r|jd |j d ƒdj |ƒj ƒS) zßFormat instruction details for inclusion in disassembly output *lineno_width* sets the width of the line number field (0 omits it) *mark_as_current* inserts a '-->' marker arrow as part of the line Nz%%%ddú z-->z z>>z r:ééú(ú)) Ú starts_linerBÚis_jump_targetÚreprÚoffsetÚrjustÚopnameÚljustÚargÚargreprrFÚrstrip)ÚselfÚ lineno_widthZmark_as_currentZfieldsZ lineno_fmtrrrÚ _disassemble´s&     zInstruction._disassembleN)r,Ú __module__Ú __qualname__Ú__doc__rqrrrrr ¦s Ú first_linecCsxt|ƒ}|j|j}tt|ƒƒ}|dk rJ||j}nd}t|j|j|j |j |||ƒS)a«Iterator for the opcodes in methods, functions or code Generates a series of Instruction named tuples giving the details of each operations in the supplied code. If *first_line* is not None, it indicates the line number that should be reported for the first source line in the disassembled code. Otherwise, the source line information (if any) is taken directly from the disassembled code object. Nr) rLr[rZÚdictr Úco_firstlinenoÚ_get_instructions_bytesrrYrXrV)r-rur\Ú cell_namesÚ linestartsÚ line_offsetrrrr Ùs   cCs,|}|dk r||}|t|ƒfS)zÕHelper to get optional details about const references Returns the dereferenced constant and its repr if the constant list is defined. Otherwise returns the constant index and its repr(). N)rg)Z const_indexZ const_listÚargvalrrrÚ_get_const_infoïs  r}cCs;|}|dk r%||}|}n t|ƒ}||fS)zÓHelper to get optional details about named references Returns the dereferenced name as both value and repr if the name list is defined. Otherwise returns the name index and its repr(). N)rg)Z name_indexZ name_listr|rmrrrÚ_get_name_infoûs     r~c cs¾t|ƒ}d}d} xŸt|ƒD]‘\} } } |dk rh|j| dƒ}|dk rh||7}| |k} d}d}| dk r’| }| tkr¶t| |ƒ\}}nÜ| tkrÚt| |ƒ\}}n¸| tkr| d| }dt|ƒ}n‹| t kr+t| |ƒ\}}ng| t krJt | }|}nH| t krnt| |ƒ\}}n$| t kr’d| d| df}tt| | | ||| || ƒVq%WdS)a&Iterate over the instructions in a bytecode string. Generates a sequence of Instruction namedtuples giving the details of each opcode. Additional information about the code's runtime environment (e.g. variable names, constants) can be specified using optional arguments. NÚr_zto z%d positional, %d keyword pairr@)r Ú_unpack_opargsrDZhasconstr}Zhasnamer~ÚhasjrelrgZhaslocalZ hascompareZcmp_opZhasfreeZhasnargsr rj)ÚcodeÚvarnamesrHÚ constantsÚcellsrzr{ÚlabelsreÚfreerhÚoprlrfr|rmrrrrx s@                 rxc CsT|j|j}tt|ƒƒ}t|j||j|j|j||d|ƒdS)zDisassemble a code object.rN) r[rZrvr r(rrYrXrV)r\Úlastirryrzrrrr:sr{c Cs°|dk } | rdnd} x‹t||||||d|ƒD]h} | og| jdk og| jdk} | r}td|ƒ| j|k} t| j| | ƒd|ƒq@WdS)Nr_rr{r)rxrerhr$rq)r‚r‰rƒrHr„r…rzrr{Z show_linenorpZinstrZnew_source_lineZis_current_instrrrrr(As    r(cCstt|dƒd|ƒdS)zrN)rr)rrrrrr*Ssr*ccs­d}t|ƒ}d}xŽ||kr¨||}|}|d}d}|tkr—||||dd|}d}|d}|tkr—|d}|||fVqWdS)Nrr8r@r9i)ÚlenZ HAVE_ARGUMENTZ EXTENDED_ARG)r‚Z extended_argÚnrIrˆrhrlrrrr€Ys       r€cCs�g}xƒt|ƒD]u\}}}|dk rd}|tkrQ|d|}n|tkrc|}|dkr||kr|j|ƒqW|S)z`Detect all offsets in a byte code which are jump targets. Return the list of offsets. Nr8r_réÿÿÿÿ)r€r�ZhasjabsrB)r‚r†rhrˆrlZlabelrrrr ls     ccs¿t|jddd…ƒ}t|jddd…ƒ}d}|j}d}xTt||ƒD]C\}}|r–||krŒ||fV|}||7}||7}q]W||kr»||fVdS)z”Find the offsets in a byte code which are start of lines in the source. Generate pairs (offset, lineno) as described in Python/compile.c. rNr9r8)ÚlistÚ co_lnotabrwÚzip)r‚Zbyte_incrementsZline_incrementsZ lastlinenoÚlinenoÚaddrZ byte_incrZ line_incrrrrr s     c@speZdZdZdddddd„Zdd„Zd d „Zed d „ƒZd d„Z dd„Z dS)rzñThe bytecode operations of a piece of code Instantiate this with a function, method, string of code, or a code object (as returned by compile()). Iterating over this yields the bytecode operations as Instruction instances. ruNÚcurrent_offsetcCsŽt|ƒ|_}|dkr7|j|_d|_n||_||j|_|j|j|_tt |ƒƒ|_ ||_ ||_ dS)Nr) rLÚcodeobjrwruÚ _line_offsetr[rZÚ _cell_namesrvr Ú _linestartsÚ_original_objectr’)ror-rur’r\rrrÚ__init__�s     zBytecode.__init__c Cs=|j}t|j|j|j|j|j|jd|jƒS)Nr{) r“rxrrYrXrVr•r–r”)ror\rrrÚ__iter__ªs    zBytecode.__iter__cCsdj|jj|jƒS)Nz{}({!r}))ÚformatÚ __class__r,r—)rorrrÚ__repr__±szBytecode.__repr__cCs2x|jr|j}qW||jjd|jƒS)z/ Construct a Bytecode from the given traceback r’)r3r4r5r6)Úclsr7rrrÚfrom_tracebackµs  zBytecode.from_tracebackcCs t|jƒS)z3Return formatted information about the code object.)rMr“)rorrrÚinfo¼sz Bytecode.infocCs�|j}|jdk r$|j}nd }tjƒ�`}t|jd|jd|jd|jd|j d|j d|j d |d |ƒ|j ƒSWdQRXdS) z3Return a formatted view of the bytecode operations.Nr8rƒrHr„r…rzr{rr‰rŒ) r“r’ÚioÚStringIOr(rrYrXrVr•r–r”Úgetvalue)ror\rhÚoutputrrrrÀs     z Bytecode.dis) r,rrrsrtr˜r™rœÚ classmethodržrŸrrrrrr•s    c CsŽddl}|jƒ}|jdd|jƒddddƒ|jƒ}|j�}|jƒ}WdQRXt||jjd ƒ}t |ƒdS) z*Simple test program to disassemble a file.rNÚinfiler+Únargsú?Údefaultú-r) ÚargparseÚArgumentParserÚ add_argumentÚFileTypeÚ parse_argsr¥Úreadrrr)rªÚparserÚargsr¥rr‚rrrÚ_testÒs  %  r²Ú__main__rŒrŒ))rtr/ÚtypesÚ collectionsr ZopcoderZ _opcodes_allÚ MethodTypeÚ FunctionTypeÚCodeTyper¤Ú staticmethodr+r#rrrrCrKrLrrMr Ú namedtupler^r r r}r~rxrr(r*rr€r r rr²r,rrrrÚsd       #       3  .     =