...

View Full Version : Reverse Engineering - Can't do this one...



zero
08-21-2005, 05:38 PM
<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

JPM
08-21-2005, 06:33 PM
Check out substr() and unescape()/ascii

Mr J
08-21-2005, 06:45 PM
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.

zero
08-22-2005, 01:15 PM
Thanks guys. that one wasn't hard at all :D



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum