Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

HackthisSite Javascripted password

 
Rob Hope
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to pass a level on a hack game but struggling on this level.

It seems to be using Macromedia javascript functions to randomise some strings using a loop but my math/logic isnt up to it.
Can anyoe figure out what the password should be or if my understanding of the problem is completely off?

 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Clean up the code

 
Rob Hope
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry - are you saying the solution is just to cleanup the code and then it will work?

 
Rob Crowther
author
Ranch Hand
Posts: 297
5
Android Fedora Firefox Browser
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What do you mean, you didn't mention before that the code wasn't working?

He's not trying to fix the code, he's trying to help you understand the code, which is what you asked for, no?
 
Rob Hope
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rob Crowther wrote:

He's not trying to fix the code, he's trying to help you understand the code, which is what you asked for, no?


Nope - I wasn't that greedy!
I just asked for someone to spoonfeed me the answer
*if they want to teach me how the code actually works too that would be very cool.

I understand that the function MM_buildUp holds the string variables of nice + blue + input

But don't understand how the other functions work to create the password...
 
Rob Crowther
author
Ranch Hand
Posts: 297
5
Android Fedora Firefox Browser
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hit F12 (or in Firefox Ctrl+Shift+K) and look for the JavaScript debugger. you can then set a break point and step through the code examining the values of the variables at every step. Here's a nice tutorial with screenshots. You'll understand things a lot more quickly if you can see for yourself how it works rather than us trying to tell you.
 
Rob Hope
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In Java script are these symbols you cleaned up used for comments? <!-- & //-->

I am now sure how to use firebug to set breakpoints and edit in the javascript on the fly to examine the generated values using console.log
 
Rob Crowther
author
Ranch Hand
Posts: 297
5
Android Fedora Firefox Browser
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rob Hope wrote:In Java script are these symbols you cleaned up used for comments? <!-- & //-->


They are used to stop browsers with no support for JavaScript getting confused by characters that are invalid in HTML that appear in the script. Unless you need to support Netscape Navigator 1.0 or Internet Explorer 2.0 there's no need for them these days.

Rob Hope wrote:I am now sure how to use firebug to set breakpoints and edit in the javascript on the fly to examine the generated values using console.log


Good. Unless that is a typo?
 
Rob Hope
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry yes it was a typo

Ive managed to set a watch in firebug on the variables but am only returning null values currently

console.log (MM_changeProp)

any ideas?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64827
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You might want to try using Chrome or Safari. I find the WebKit Dev Tools more feature-rich and easier to use than Firebug.
 
Rob Crowther
author
Ranch Hand
Posts: 297
5
Android Fedora Firefox Browser
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you read the article I linked to? Where have you set your break points?
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic