Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>What fun! Here's my go at it. Basically what is happening here is a bunch of numbers and strings are being assigned to variables. Those variables are being concatenated to form an encoded string. That encoded string is decoded to form a string of JavaScript code. That code is set as the body of a function, which is then executed.</p> <p>Let's take it line by line:</p> <p><strong>Line 1:</strong></p> <pre class="lang-js prettyprint-override"><code>゚ω゚ノ = /`m´)ノ ~┻━┻ //*´∇`*/['_']; </code></pre> <p><code>゚ω゚ノ</code> - a global variable<br> <code>/`m´)ノ ~┻━┻ /</code> - a regular expression<br> <code>/*´∇`*/</code> - a multi-line comment<br> <code>['_']</code> - get the property <code>_</code> of the regular expression.</p> <p>Since a RegExp does not have a <code>_</code> property, the variable <code>゚ω゚ノ</code> contains the value <code>undefined</code>.</p> <p><strong>Line 2:</strong></p> <pre class="lang-js prettyprint-override"><code>o = (゚ー゚) = _ = 3; </code></pre> <p>Define the variables <code>o</code>, <code>゚ー゚</code>, and <code>_</code>, and set each of their values to <code>3</code>.</p> <p><strong>Line 3:</strong></p> <pre class="lang-js prettyprint-override"><code>c = (゚Θ゚) = (゚ー゚) - (゚ー゚); </code></pre> <p>Define the variables <code>c</code> and <code>゚Θ゚</code> and set their values to <code>0</code>. (<code>゚ー゚</code> is <code>3</code>, so <code>(゚ー゚) - (゚ー゚)</code> is the same as <code>゚ー゚ - ゚ー゚</code> is the same as <code>3 - 3</code>. Now <code>c</code> and <code>゚Θ゚</code> both contain <code>1</code>;</p> <p><strong>Line 4:</strong></p> <pre class="lang-js prettyprint-override"><code>(゚Д゚) = (゚Θ゚) = (o ^ _ ^ o) / (o ^ _ ^ o); </code></pre> <p>Define the variable <code>゚Д゚</code> and redefine the variable <code>゚Θ゚</code>. <code>^</code> is the <a href="http://msdn.microsoft.com/en-us/library/ece515h6(VS.94).aspx" rel="noreferrer">bitwise XOR operator</a> and <code>o</code> and <code>_</code> are both <code>3</code>.<br> <code>o ^ _ ^ o</code> is the same as <code>3 ^ 3 ^ 3</code>.<br> <code>3 ^ 3</code> is <code>0</code>, <code>3 ^ 0</code> is <code>3</code>.<br> Then <code>3 / 3</code> is <code>1</code>.<br> <code>゚Д゚</code> and <code>゚Θ゚</code> both now contain <code>1</code>.</p> <p><strong>Line 5:</strong></p> <pre class="lang-js prettyprint-override"><code>(゚Д゚) = { ゚Θ゚: '_', ゚ω゚ノ: ((゚ω゚ノ == 3) + '_')[゚Θ゚], ゚ー゚ノ: (゚ω゚ノ + '_')[o ^ _ ^ o - (゚Θ゚)], ゚Д゚ノ: ((゚ー゚ == 3) + '_')[゚ー゚] }; </code></pre> <p>With line breaks and indentation:</p> <pre class="lang-js prettyprint-override"><code>(゚Д゚) = { ゚Θ゚: '_', ゚ω゚ノ: ((゚ω゚ノ == 3) + '_')[゚Θ゚], ゚ー゚ノ: (゚ω゚ノ + '_')[o ^ _ ^ o - (゚Θ゚)], ゚Д゚ノ: ((゚ー゚ == 3) + '_')[゚ー゚] }; </code></pre> <p>Redefine <code>゚Д゚</code> as an object literal, with properties <code>゚Θ゚</code>, <code>゚ω゚ノ</code>, <code>゚ー゚ノ</code>, and <code>゚Д゚ノ</code>.<br> <code>゚Д゚.゚Θ゚</code> is "_".<br> <code>゚Д゚.゚ω゚ノ</code> is <code>((undefined == 3) + "_")[1]</code> which is <code>"false_"[1]</code> which is <code>"a"</code>.<br> <code>゚Д゚.゚ー゚ノ</code> is <code>(undefined + "_")[3 ^ 3 ^ 3 - 1]</code> which is <code>"undefined_"[2]</code> which is <code>"d"</code>.<br> <code>゚Д゚.゚Д゚ノ</code> is <code>((3 == 3) + "_")[3]</code> which is <code>"true_"[3]</code> which is <code>"u"</code>.</p> <p><strong>Line 6:</strong></p> <pre class="lang-js prettyprint-override"><code>(゚Д゚)[゚Θ゚] = ((゚ω゚ノ == 3) + '_')[c ^ _ ^ o]; </code></pre> <p>Is the same as:</p> <pre class="lang-js prettyprint-override"><code>゚Д゚.゚Θ゚ = ((undefined == 3) + "_")[1 ^ 3 ^ 3]; </code></pre> <p>Which is the same as:</p> <pre class="lang-js prettyprint-override"><code>゚Д゚.゚Θ゚ = "false_"[1]; </code></pre> <p>So <code>゚Д゚.゚Θ゚</code> is <code>"a"</code>.</p> <p><strong>Lines 7 - 16:</strong></p> <p>And so it continues, assigning strings and numbers to variables and object properties. Until the last line:</p> <p><strong>Line 17:</strong></p> <pre class="lang-js prettyprint-override"><code>(゚Д゚)['_']((゚Д゚)['_'](゚ε゚ + (゚Д゚)[゚o゚] + (゚Д゚)[゚ε゚] + (゚Θ゚) + (゚ー゚) + (゚Θ゚) + (゚Д゚)[゚ε゚] + (゚Θ゚) + ((゚ー゚) + (゚Θ゚)) + (゚ー゚) + (゚Д゚)[゚ε゚] + (゚Θ゚) + (゚ー゚) + ((゚ー゚) + (゚Θ゚)) + (゚Д゚)[゚ε゚] + (゚Θ゚) + ((o ^ _ ^ o) + (o ^ _ ^ o)) + ((o ^ _ ^ o) - (゚Θ゚)) + (゚Д゚)[゚ε゚] + (゚Θ゚) + ((o ^ _ ^ o) + (o ^ _ ^ o)) + (゚ー゚) + (゚Д゚)[゚ε゚] + ((゚ー゚) + (゚Θ゚)) + (c ^ _ ^ o) + (゚Д゚)[゚ε゚] + (゚ー゚) + ((o ^ _ ^ o) - (゚Θ゚)) + (゚Д゚)[゚ε゚] + (゚Θ゚) + (゚Θ゚) + (c ^ _ ^ o) + (゚Д゚)[゚ε゚] + (゚Θ゚) + (゚ー゚) + ((゚ー゚) + (゚Θ゚)) + (゚Д゚)[゚ε゚] + (゚Θ゚) + ((゚ー゚) + (゚Θ゚)) + (゚ー゚) + (゚Д゚)[゚ε゚] + (゚Θ゚) + ((゚ー゚) + (゚Θ゚)) + (゚ー゚) + (゚Д゚)[゚ε゚] + (゚Θ゚) + ((゚ー゚) + (゚Θ゚)) + ((゚ー゚) + (o ^ _ ^ o)) + (゚Д゚)[゚ε゚] + ((゚ー゚) + (゚Θ゚)) + (゚ー゚) + (゚Д゚)[゚ε゚] + (゚ー゚) + (c ^ _ ^ o) + (゚Д゚)[゚ε゚] + (゚Θ゚) + (゚Θ゚) + ((o ^ _ ^ o) - (゚Θ゚)) + (゚Д゚)[゚ε゚] + (゚Θ゚) + (゚ー゚) + (゚Θ゚) + (゚Д゚)[゚ε゚] + (゚Θ゚) + ((o ^ _ ^ o) + (o ^ _ ^ o)) + ((o ^ _ ^ o) + (o ^ _ ^ o)) + (゚Д゚)[゚ε゚] + (゚Θ゚) + (゚ー゚) + (゚Θ゚) + (゚Д゚)[゚ε゚] + (゚Θ゚) + ((o ^ _ ^ o) - (゚Θ゚)) + (o ^ _ ^ o) + (゚Д゚)[゚ε゚] + (゚Θ゚) + (゚ー゚) + (o ^ _ ^ o) + (゚Д゚)[゚ε゚] + (゚Θ゚) + ((o ^ _ ^ o) + (o ^ _ ^ o)) + ((o ^ _ ^ o) - (゚Θ゚)) + (゚Д゚)[゚ε゚] + (゚Θ゚) + ((゚ー゚) + (゚Θ゚)) + (゚Θ゚) + (゚Д゚)[゚ε゚] + (゚Θ゚) + ((o ^ _ ^ o) + (o ^ _ ^ o)) + (c ^ _ ^ o) + (゚Д゚)[゚ε゚] + (゚Θ゚) + ((o ^ _ ^ o) + (o ^ _ ^ o)) + (゚ー゚) + (゚Д゚)[゚ε゚] + (゚ー゚) + ((o ^ _ ^ o) - (゚Θ゚)) + (゚Д゚)[゚ε゚] + ((゚ー゚) + (゚Θ゚)) + (゚Θ゚) + (゚Д゚)[゚o゚])(゚Θ゚))('_'); </code></pre> <p>By this time, we have the following variables:</p> <pre class="lang-js prettyprint-override"><code>゚ω゚ノ // undefined o // 3 ゚ー゚ // 4 _ // 3 c // 0 ゚Θ゚ // 1 ゚Д゚ /* { "1": "f", ゚Θ゚: "_", ゚ω゚ノ: "a", ゚ー゚ノ: "d", ゚Д゚ノ: "e", c: "c", o: "o", return: "\\", ゚Θ゚ノ: "b", constructor: "\"", _: Function } */ ゚o゚ // "constructor" ゚ε゚ // "return" o゚ー゚o // "u" </code></pre> <p>That line is mostly one big string concatenation. We can make it <em>slightly</em> more readable by removing the unnecessary parentheses and adding line breaks:</p> <pre class="lang-js prettyprint-override"><code>゚Д゚['_']( ゚Д゚['_']( ゚ε゚ + ゚Д゚[゚o゚] + ゚Д゚[゚ε゚] + ゚Θ゚ + ゚ー゚ + ゚Θ゚ + ゚Д゚[゚ε゚] + ゚Θ゚ + (゚ー゚ + ゚Θ゚) + ゚ー゚ + ゚Д゚[゚ε゚] + ゚Θ゚ + ゚ー゚ + (゚ー゚ + ゚Θ゚) + ゚Д゚[゚ε゚] + ゚Θ゚ + ((o ^ _ ^ o) + (o ^ _ ^ o)) + ((o ^ _ ^ o) - ゚Θ゚) + ゚Д゚[゚ε゚] + ゚Θ゚ + ((o ^ _ ^ o) + (o ^ _ ^ o)) + ゚ー゚ + ゚Д゚[゚ε゚] + (゚ー゚ + ゚Θ゚) + (c ^ _ ^ o) + ゚Д゚[゚ε゚] + ゚ー゚ + ((o ^ _ ^ o) - ゚Θ゚) + ゚Д゚[゚ε゚] + ゚Θ゚ + ゚Θ゚ + (c ^ _ ^ o) + ゚Д゚[゚ε゚] + ゚Θ゚ + ゚ー゚ + (゚ー゚ + ゚Θ゚) + ゚Д゚[゚ε゚] + ゚Θ゚ + (゚ー゚ + ゚Θ゚) + ゚ー゚ + ゚Д゚[゚ε゚] + ゚Θ゚ + (゚ー゚ + ゚Θ゚) + ゚ー゚ + ゚Д゚[゚ε゚] + ゚Θ゚ + (゚ー゚ + ゚Θ゚) + (゚ー゚ + (o ^ _ ^ o)) + ゚Д゚[゚ε゚] + (゚ー゚ + ゚Θ゚) + ゚ー゚ + ゚Д゚[゚ε゚] + ゚ー゚ + (c ^ _ ^ o) + ゚Д゚[゚ε゚] + ゚Θ゚ + ゚Θ゚ + ((o ^ _ ^ o) - ゚Θ゚) + ゚Д゚[゚ε゚] + ゚Θ゚ + ゚ー゚ + ゚Θ゚ + ゚Д゚[゚ε゚] + ゚Θ゚ + ((o ^ _ ^ o) + (o ^ _ ^ o)) + ((o ^ _ ^ o) + (o ^ _ ^ o)) + ゚Д゚[゚ε゚] + ゚Θ゚ + ゚ー゚ + ゚Θ゚ + ゚Д゚[゚ε゚] + ゚Θ゚ + ((o ^ _ ^ o) - ゚Θ゚) + (o ^ _ ^ o) + ゚Д゚[゚ε゚] + ゚Θ゚ + ゚ー゚ + (o ^ _ ^ o) + ゚Д゚[゚ε゚] + ゚Θ゚ + ((o ^ _ ^ o) + (o ^ _ ^ o)) + ((o ^ _ ^ o) - ゚Θ゚) + ゚Д゚[゚ε゚] + ゚Θ゚ + (゚ー゚ + ゚Θ゚) + ゚Θ゚ + ゚Д゚[゚ε゚] + ゚Θ゚ + ((o ^ _ ^ o) + (o ^ _ ^ o)) + (c ^ _ ^ o) + ゚Д゚[゚ε゚] + ゚Θ゚ + ((o ^ _ ^ o) + (o ^ _ ^ o)) + ゚ー゚ + ゚Д゚[゚ε゚] + ゚ー゚ + ((o ^ _ ^ o) - ゚Θ゚) + ゚Д゚[゚ε゚] + (゚ー゚ + ゚Θ゚) + ゚Θ゚ + ゚Д゚[゚o゚] )(゚Θ゚) )("_"); </code></pre> <p>The value of that concatenated string is:</p> <pre class="lang-js prettyprint-override"><code>return"\141\154\145\162\164\50\42\110\145\154\154\157\54\40\112\141\166\141\123\143\162\151\160\164\42\51" </code></pre> <p>So, replacing all the variables with literals, we end up with the following JavaScript which gets executed on that last line:</p> <pre class="lang-js prettyprint-override"><code>Function(Function("return\"\\141\\154\\145\\162\\164\\50\\42\\110\\145\\154\\154\\157\\54\\40\\112\\141\\166\\141\\123\\143\\162\\151\\160\\164\\42\\51\"")(1))("_") </code></pre> <p>Breaking that line down, in the middle we see the concatenated string is passed to a <code>Function</code> constructor, making the string the function body:</p> <pre class="lang-js prettyprint-override"><code>Function("return\"\\141\\154\\145\\162\\164\\50\\42\\110\\145\\154\\154\\157\\54\\40\\112\\141\\166\\141\\123\\143\\162\\151\\160\\164\\42\\51\"") </code></pre> <p>So, that string is evaluated as JavaScript, and the <code>Function</code> constructor returns this function:</p> <pre class="lang-js prettyprint-override"><code>function () { return"\141\154\145\162\164\50\42\110\145\154\154\157\54\40\112\141\166\141\123\143\162\151\160\164\42\51"; } </code></pre> <p>That function is immediately executed:</p> <pre class="lang-js prettyprint-override"><code>Function("return\"\\141\\154\\145\\...\\51\"")(1) </code></pre> <p>And returns the string:</p> <pre class="lang-js prettyprint-override"><code>alert("Hello, JavaScript") </code></pre> <p>Hey, that looks like JavaScript! But it's not yet. It's just a string. But that string is passed to another <code>Function</code> constructor, giving us a function that executes the string as JavaScript:</p> <pre class="lang-js prettyprint-override"><code>Function("alert(\"Hello, JavaScript\")") </code></pre> <p>That is the same as:</p> <pre class="lang-js prettyprint-override"><code>function () { alert("Hello, JavaScript"); } </code></pre> <p>That function is immediately executed:</p> <pre class="lang-js prettyprint-override"><code>Function("alert(\"Hello, JavaScript\")")("_") </code></pre> <p>And our unobfuscated code is finally called.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload