I wrote this at noon today when I decrypted a webpage Trojan ......
It mainly uses the javascript string split method, array reverse and join method.
<HTML>
<Head>
<Title> character and string flip using JavaScript programming </title>
<Meta name = "author" content = "purpleendurer">
</Head>
<Body>
<Form name = "FRT">
Source string: <input type = "checkbox" name = "ckbrow"> line flip </input> <input type = "checkbox" name = "ckbchar"> Line Character flip </input> <button onclick = "reverseall () "> processing </button> <br>
<Textarea name = "tas" rows = "12" Cols = "90">
D321
C321
B321
A543
</Textarea> <br>
Conversion Result: <br>
<Br> <textarea name = "tar" rows = "12" Cols = "90"> </textarea>
</Form>
<Script language = JavaScript>
Function reverseall ()
{
VaR S1 = Document. FRT. TAS. value;
VaR AS1 = s1.split ("/N"); // divides data into arrays by row
If (true = Document. FRT. ckbrow. Checked)
{
AS1 = as1.reverse (); // flip between lines
}
VaR S2 = "";
If (true = Document. FRT. ckbchar. Checked)
{
// Line Character flip
VaR I, T, T1;
For (I = 0; I <as1.length; I ++)
{
T = AS1 [I]. Split (''); // divides characters into arrays.
T1 = T. Reverse (); // In-row character flip
S2 + = t1.join ('');
}
/* Another Implementation Method
For (I = 0; I <as1.length; I ++)
{
T = AS1 [I]. Split ('');
T1 = T. Reverse ();
S2 + = t1.join ('');
}
*/
S2 = s2.substr (1 );
}
Else
{
S2 = as1.join ("");
}
Document. FRT. Tar. value = S2;
}
// Line flip
Function reverserows ()
{
VaR S1 = Document. FRT. TAS. value;
VaR as0 = s1.split ("/N"); // divide the array by row
VaR AS1 = as0.reverse (); // array flip
Document. FRT. Tar. value = as1.join ("");
}
// Line Character flip
Function reversechar ()
{
VaR S1 = Document. FRT. TAS. value;
VaR as0 = s1.split ("/N ");
VaR S2 = "", I, T, T1;
For (I = 0; I <as0.length; I ++)
{
T = as0 [I]. Split (''); // divides characters into arrays.
T1 = T. Reverse ();
S2 + = t1.join ('');
}
/* Another Implementation Method
VaR S2 = "", I, T, T1;
For (I = 0; I <as0.length; I ++)
{
T = as0 [I]. Split ('');
T1 = T. Reverse ();
S2 + = t1.join ('');
}
*/
document.frT.taR.value = s2.substr(1);
}
</script>
</body>