
    6 f                     v    d Z ddlZddlmZmZ  G d dej                  Zedk    r ej                     dS dS )z Tests for P.A.C.K.E.R. unpacker.    N)detectunpackc                       e Zd ZdZd Zd ZdS )
TestPackerzP.A.C.K.E.R. testcase.c                 t      fd} fd} |d            |d            |d            |d           dS )zTest detect() function.c                 H                         t          |                     S N)
assertTruer   sourceselfs    ]/var/www/equiseq/venv/lib/python3.11/site-packages/jsbeautifier/unpackers/tests/testpacker.pypositivez(TestPacker.test_detect.<locals>.positive   s    ??6&>>222    c                 H                         t          |                     S r	   )assertFalser   r   s    r   negativez(TestPacker.test_detect.<locals>.negative   s    ##F6NN333r    z	var a = bzeval(function(p,a,c,k,e,rz eval ( function(p, a, c, k, e, rN )r   r   r   s   `  r   test_detectzTestPacker.test_detect   s|    	3 	3 	3 	3 	3	4 	4 	4 	4 	4 	,---344444r   c                       fd} |dd            |dd            |dd            |dd	            |d
d           dS )zTest unpack() function.c                 h    t          |           o"                    t          |           |          S r	   )r   assertEqualr   )inpoutr   s     r   checkz%TestPacker.test_unpack.<locals>.check"   s*    #;;E4#3#3F3KK#E#EEr   a
  eval(function(p,a,c,k,e,r){e=String;if(!''.replace(/^/,String)){while(c--)r[c]=k[c]||c;k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('0 2=1',62,3,'var||a'.split('|'),0,{}))zvar a=1uO  function test (){alert ('This is a test!')}; eval(function(p,a,c,k,e,r){e=String;if(!''.replace(/^/,String)){while(c--)r[c]=k[c]||c;k=[function(e){return r[e]}];e=function(){return'\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\b'+e(c)+'\b','g'),k[c]);return p}('0 2=\'{Íâ–+›ï;ã†Ù¥#\'',3,3,'var||a'.split('|'),0,{}))uN   function test (){alert ('This is a test!')}; var a='{Íâ–+›ï;ã†Ù¥#'a  eval(function(p,a,c,k,e,d){e=function(c){return c.toString(36)};if(!''.replace(/^/,String)){while(c--){d[c.toString(a)]=k[c]||c.toString(a)}k=[function(e){return d[e]}];e=function(){return'\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\b'+e(c)+'\b','g'),k[c])}}return p}('2 0="4 3!";2 1=0.5(/b/6);a.9("8").7=1;',12,12,'str|n|var|W3Schools|Visit|search|i|innerHTML|demo|getElementById|document|w3Schools'.split('|'),0,{}))zfvar str="Visit W3Schools!";var n=str.search(/w3Schools/i);document.getElementById("demo").innerHTML=n;a  a=b;
while(1){
g=h;{return'\w+'};break;eval(function(p,a,c,k,e,d){e=function(c){return c.toString(36)};if(!''.replace(/^/,String)){while(c--){d[c.toString(a)]=k[c]||c.toString(a)}k=[function(e){return d[e]}];e=function(){return'\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\b'+e(c)+'\b','g'),k[c])}}return p}('$(5).4(3(){$('.1').0(2);$('.6').0(d);$('.7').0(b);$('.a').0(8);$('.9').0(c)});',14,14,'html|r5e57|8080|function|ready|document|r1655|rc15b|8888|r39b0|r6ae9|3128|65309|80'.split('|'),0,{}))c=abx;za=b;
while(1){
g=h;{return'\w+'};break;$(document).ready(function(){$('.r5e57').html(8080);$('.r1655').html(80);$('.rc15b').html(3128);$('.r6ae9').html(8888);$('.r39b0').html(65309)});c=abx;a  eval(function(p,a,c,k,e,r){e=function(c){return c.toString(36)};if('0'.replace(0,e)==0){while(c--)r[e(c)]=k[c];k=[function(e){return r[e]||e}];e=function(){return'[0-9ab]'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\b'+e(c)+'\b','g'),k[c]);return p}('$(5).a(6(){ $('.8').0(1); $('.b').0(4); $('.9').0(2); $('.7').0(3)})',[],12,'html|52136|555|65103|8088|document|function|r542c|r8ce6|rb0de|ready|rfab0'.split('|'),0,{}))z$(document).ready(function(){ $('.r8ce6').html(52136); $('.rfab0').html(8088); $('.rb0de').html(555); $('.r542c').html(65103)})Nr   )r   r   s   ` r   test_unpackzTestPacker.test_unpack   s    	F 	F 	F 	F 	F 	.
 	
 	
 	
 	) ]	
 	
 	
 	 Dt	
 	
 	

 	 Y R	
 	
 	

 	 z N	
 	
 	
 	
 	
r   N)__name__
__module____qualname____doc__r   r   r   r   r   r   r      s8          5 5 5&
 &
 &
 &
 &
r   r   __main__)	r!   unittestjsbeautifier.unpackers.packerr   r   TestCaser   r   mainr   r   r   <module>r'      s    ' &  8 8 8 8 8 8 8 8
7
 7
 7
 7
 7
" 7
 7
 7
t zHMOOOOO r   