Axino.net

Javascript Missions 3 :: Math time

by Arxleol on Monday 17.05.2010, under hackthissite.org, javascript, tutorial

Let’s see how faith intends to check our math skills :D

As you can see we have source code in front of us now let’s just crack it:

var foo = 5 + 6 * 7
var bar = foo % 8
var moo = bar * 2
var rar = moo / 3
function check(x)
{
        if (x.length == moo)
        {
                        alert("win!");
                        window.location += "?lvl_password="+x;
        } else {
                        alert("fail D:");
	 }
}

As you can see length of input is compared to variable moo.

Variable foo has value of 47. This should be straightforward math. Variable bar has value of 7 because % percentage sign represents remainder of 47 divided by 8. Read more about modular arithmetics. And therefore variable moo has value of 14.

To win we have solution string of length 14 characters and this one is really simple: aaaaaaaaaaaaaa

Similar Posts:

:, , , , ,
1 comment for this entry:

Leave a Reply

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Archives