Irregular Expressions

Jul 21 2012   1:28AM GMT

Side Quest — Part 3

Dan O'Connor Dan O'Connor Profile: Dan O'Connor

If you are following at home you should have a comma delimited dataset from that last part of the script we ran.

It should be around 110k so it is much bigger then the last two.

This will be a little more complicated then the last few steps as well, here is the first for loop.


z=function(){if(window.document)e="ev";c="";if(x)f="fromChar";
d=10;
m=Math;
for(i=32606-1;i>=0;i--){
w=i;
v=a[w];
dd=(32606-i-2+1);
b=d;
dd=dd-b*m["floo"+"r"](dd/d);
k=v*1+(dd-3);
if(x&&e)c=c+String.fromCharCode(k);
}
e+="a";
md=["a"];
window[e+"l"](c);}

At the end there was a second, this one was much less complicated.

a=[];
for(i=0;i<g.length;i+=2){
a.push(parseInt(g.substr(i,2),16));
}
z(123);

For me running this to rhino produced errors and I fixed a few and then it made some more. I quickly abandoned it and created my own. Instead of re-writing the whole thing, I got the second for loop to run with no changes (its the second for loop but it’s ran first). The second loop filled the variable “a”, which is not really useful to me at this point. You can either use a debugger or do what I did and add a statement to eval the contents of “a” (we pointed eval to print when we started).

The output from this is a huge decimal comma delimited file.

Now we need to solve the second for loop. Below is my version of the for loop, but in perl. Just get the contents of “a” in to the @data array.


foreach (@data) {
chomp($_);
@a = split(',',$_);

for ($i=32606-1;$i>=0;$i--) {

$v = $a[$i];
$dd = (32606-$i-2+1);
$d=10;
$b=$d;
$dd=$dd-$b*floor($dd/$d);
$k = $v*1+($dd-3);

$string = chr($k);
print "$string";
}

}

This should give you yet more js.

 Comment on this Post

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when other members comment.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to: