neige d'aoust

knowledge, art, and other stuff

User Tools

Site Tools


symbolicjs

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
symbolicjs [2025/05/12 17:21] Yukisymbolicjs [2025/05/12 21:22] (current) Yuki
Line 61: Line 61:
  
 <code javascript> <code javascript>
-[,$___,$_$$$,$$___,$$,$_$_,$_,____$,____]={}+[], +[,$___,$_$$$,$$___,$$,$_$_,$_,____$,____]={}+[], // o,b,j,e,c,t,space,O 
-[$$$_$,$$_,$$_$$,$$$$]=![]+[], +[$$$_$,$$_,$$_$$,$$$$]=![]+[], // f,a,l,s 
-[,$$_$,$$$_]=!``+[], +[,$$_$]=!``+[], // r 
-[__$]=-`!`+[], +[__$]=-`!`+[], // N 
-[,_$$,$_$,$$$_$,$$$,$_$,,,$_$__]=~[]/[]+[], +[,_$$,$_$,,$$$,,,,$_$__]=~[]/[]+[], // I,n,i,y 
-[$$$_,,$_$$]=[][[]]+[]+[$$$_,,$_$$]=[][[]]+[] // u,d
 </code> </code>
 +
 +Of course, a few of those are not needed, can be removed if you don't need them, and those identifiers can always be shorter. We need at least enough to spell ''constructor'' and ''return btoa''. Here's the minimum:
 +
 +<code javascript>
 +[,$___,$_$$$,,$$,$_$_$,$_,____$]={}+[], // o,b,e,c,t,space
 +[,$$_,,$$$$]=![]+[], // a,s
 +[,$$_$]=!``+[], // r
 +[$$$_,$_$]=[][[]]+[], // u,n
 +</code>
 +
 +<note>Note that we need the ''l'' for ''console.log'', and I'll put it back here, but it's shorter to move the ''i'' to the ''btoa'' call later in this document.</note>
  
 ===== Execute arbitrary code ===== ===== Execute arbitrary code =====
Line 83: Line 94:
 ===== Build more letters ===== ===== Build more letters =====
  
-We can then use `btoa` to get a lot of the letters we're missing:+We can then use `btoa` to get a lot of the letters we're missing, most notably ''h'' and ''i'' to spell ''return this'', and the ''g'' from ''log''.
  
 <code javascript> <code javascript>
-[K,C,g,h]=Function("return btoa`((!`")() // returns 'KCgh'+[K,i,g,h]=Function("return btoa")()`*(!` // returns 'Kigh'
 </code> </code>
  
 <code javascript> <code javascript>
-[,,$__$,$$$$$]=$($$_$+$$+$_+$$$_+$$_$+$_$+____$+$_$$$+$_+$___+$$_+`\`((!\``)()+[,$$$,$__$,$$$$$]=$((_=$$_$+$$+$_+$$$_+$$_$+$_$+____$)+$_$$$+$_+$___+$$_)()`*(!`
 </code> </code>
 +
 +<note>
 +It's useful to save ''"return "'' for later here. You might want to use another variable name, though.
 +</note>
  
 ===== Build the global object ===== ===== Build the global object =====
Line 100: Line 115:
  
 <code javascript> <code javascript>
-_=$($$_$+$$+$_+$$$_+$$_$+$_$+____$+$_+$$$$$+$$$+$$$$)()+_=$(_+$_+$$$$$+$$$+$$$$)()
 </code> </code>
  
Line 113: Line 128:
 </code> </code>
  
-===== Final result =====+===== console.log example ===== 
 + 
 +<code javascript> 
 +[,$___,$_$$$,,$$,$_$_$,$_,____$]={}+[], // o b e c t space 
 +[,$$_,$$_$$,$$$$]=![]+[], // a l s 
 +[,$$_$]=!``+[], // r 
 +[$$$_,$_$]=[][[]]+[], // u n 
 +$=(_=>_)[$_$_$+$___+$_$+$$$$+$_+$$_$+$$$_+$_$_$+$_+$___+$$_$], // $=Function 
 +[,$$$,$__$,$$$$$]=$($$_$+$$+$_+$$$_+$$_$+$_$+____$+$_$$$+$_+$___+$$_)()`*(!` // i g h 
 +$($$_$+$$+$_+$$$_+$$_$+$_$+____$+$_+$$$$$+$$$+$$$$)() // $("return this")() 
 +[$_$_$+$___+$_$+$$$$+$___+$$_$$+$$][$$_$$+$___+$__$]($$$$$+$$+$$_$$+$$_$$+$___) // console.log("hello"
 +</code>
  
 <code javascript> <code javascript>
-[,$___,$_$$$,$$___,$$,$_$_$,$_,____$,____]={}+[],[$$$_$,$$_,$$_$$,$$$$]=![]+[],[,$$_$,$$$_]=!``+[],[__$]=-`!`+[],[,_$$,$_$,$$$_$,$$$,$_$,,,$_$__]=~[]/[]+[],[$$$_,,$_$$]=[][[]]+[],$=(_=>_)[$_$_$+$___+$_$+$$$$+$_+$$_$+$$$_+$_$_$+$_+$___+$$_$],[,,$__$,$$$$$]=$($$_$+$$+$_+$$$_+$$_$+$_$+____$+$_$$$+$_+$___+$$_+`\`((!\``)(),$($$_$+$$+$_+$$$_+$$_$+$_$+____$+$_+$$$$$+$$$+$$$$)()[$_$_$+$___+$_$+$$$$+$___+$$_$$+$$][$$_$$+$___+$__$]($$$$$+$$+$$_$$+$$_$$+$___)+[,$___,$_$$$,,$$,$_$_$,$_,____$]={}+[],[,$$_,$$_$$,$$$$]=![]+[],[,$$_$]=!``+[],[$$$_,$_$]=[][[]]+[],$=(_=>_)[$_$_$+$___+$_$+$$$$+$_+$$_$+$$$_+$_$_$+$_+$___+$$_$],[,$$$,$__$,$$$$$]=$($$_$+$$+$_+$$$_+$$_$+$_$+____$+$_$$$+$_+$___+$$_)()`*(!`,$($$_$+$$+$_+$$$_+$$_$+$_$+____$+$_+$$$$$+$$$+$$$$)()[$_$_$+$___+$_$+$$$$+$___+$$_$$+$$][$$_$$+$___+$__$]($$$$$+$$+$$_$$+$$_$$+$___)
 </code> </code>
symbolicjs.1747084907.txt.gz · Last modified: by Yuki