Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Aug 2005
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Reverse Engineering - Can't do this one...

    Code:
    <SCRIPT LANGUAGE="Javascript">
    var Text ="
    
    <script language=\"JavaScript1.1\">
    <!--
    function right(e) {
    if (navigator.appName == 'Netscape' &&
    (e.which == 3 || e.which == 2))
    return false;
    else if (navigator.appName == 'Microsoft Internet Explorer' &&
    (event.button == 2 || event.button == 3)) {
    alert(\"No way!\");
    return false;
    }
    return true;
    }
    document.onmousedown=right;
    if (document.layers) window.captureEvents(Event.MOUSEDOWN);
    window.onmousedown=right;
    //-->
    </script>
    
    
    <center>
    <script language="JavaScript">
    function Login(){
    var done=0;
    var a1="%69";
    var a=document.login.a.value;
    a=a.toLowerCase();
    var b=document.login.b.value;
    b=b.toLowerCase();
    var b1= b.substr(2,3)+ b.substr(0,1)+ b.substr(1,2); 
    var c1="%61";
    var c=document.login.c.value;
    c=c.toLowerCase();
    var d1= new Array("q", "t", "1", "@", "r", "d", "67", ".", "k", "#", "u", "l", "12", "k", "o", "t", 
    
    "ß", "5", "&", "§", "f", "z", "c", "d", "6", "k") ;
    var d=document.login.d.value;
    d=d.toLowerCase();
    var e=document.login.e.value;
    e=e.toLowerCase();
    var f = e.substring(1,2) + e.substring (4,5)+ e.substring (6,7) + e.substring (0,1) + 
    
    e.substring(5,6)+ e.substring(2,3) + e.substring(3,4);
    if (a== unescape(a1) && b1=="ntwan" && c== unescape(c1) && d== d1[22] + d1[14] + d1[11] + d1[5] && 
    
    f=="eber" ) {
    var g= b.substr(2,3)+ d.substr(0,1)+ e.substr(1,2); 
    window.location.href="index.php?pw="+g;
     done=1;
    }
    if (done==0) { alert("Wrong"); 
    window.location.reload();}
    }
        
    </script>
      <form name=login>
        <table width=255 border=1 cellpadding=1>
          <tr>
            <td>Field 1:</td>
            <td>
              <input type=text name=a>
            </td>
          </tr>
          <tr>
            <td>Field 2:</td>
            <td>
              <input type=text name=b>
            </td>
          </tr>
          <tr>
            <td>Field 3:</td>
            <td>
              <input type=text name=c>
            </td>
          </tr>
          <tr>
            <td>Field 4:</td>
            <td>
              <input type=text name=d>
            </td>
          </tr>
          <tr>
            <td>Field 5:</td>
            <td>
              <input type=text name=e>
            </td>
          </tr>
        </table>
        <br>
        <input type=button value="Submit" onClick="Login()" name="button">
      </form>
    </center>";
    
    function DeCode() { var NewText; NewText = unescape(Text); document.write(NewText);} DeCode();
    </SCRIPT>
    As you can see, there isn't much to this code. **BUT** I've been trying to reverse engineer this to get the proper inputs for each text area with no luck. Would someone be so kind as to point me to a tutorial concerning this? I do not want an answer, only to learn. Answers are no fun.

    Thanks

    Zero
    Last edited by zero; 08-21-2005 at 04:42 PM.

  • #2
    JPM
    JPM is offline
    Regular Coder
    Join Date
    Mar 2004
    Location
    Norway
    Posts
    204
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Check out substr() and unescape()/ascii
    <JPM />

  • #3
    Senior Coder
    Join Date
    Aug 2002
    Location
    UK
    Posts
    2,789
    Thanks
    2
    Thanked 14 Times in 14 Posts
    In brief

    substring(indexA, indexB)

    indexA
    An integer between 0 and 1 less than the length of the string.

    indexB
    An integer between 0 and 1 less than the length of the string.

    substring extracts characters from indexA up to but not including indexB.
    The silent one.

    The most dangerous thing in the world is an idea.
    The most dangerous person in the world is the one with an idea.

  • #4
    New to the CF scene
    Join Date
    Aug 2005
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks guys. that one wasn't hard at all


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •