Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


{REQUEST}Program Made.

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
GaaraShippuuden16
Master Cheater
Reputation: 0

Joined: 15 Nov 2007
Posts: 317

PostPosted: Wed Feb 20, 2008 4:16 pm    Post subject: {REQUEST}Program Made. Reply with quote

Hello I would like to request to see if any one could make a program out of the following source code the link is there incase u need to look at the program or w/e i just want a downloadable version of it that doesnt connect to the internet so i can use it if the internet is out or something. Please and thanks.

http://www.seabreezecomputers.com/encrypter/


Code:
//Important note: Use -20 to work in Firefox and IE
textbox = new String;
fmtextbox = new String;
var timer = 50;

function wordWrap(textbox)
{
   if (document.fm.insert.value == 'On')  // if insert message is on
   {
      comp = textbox.search(document.fm.test.value);
      if (comp != -1) // if they didn't delete the help message
         textbox = textbox.replace(document.fm.test.value, "");
   }
   
   var space = 0;  // takes on the position of spaces
   var begin = 0;  // takes on position of beginning of lines
   var linelength = 0;  // takes on the length of each line
   var textwidth = 65;  // width of textbox
   var textlength = textbox.length;
   var letter;
   var newtextbox = "";

   
   for (i = 0; i < textlength; i++)
   {
      letter = textbox.charCodeAt(i);
     
      if (letter == 32)  // if space
         space = i;  // position of space
      if (letter == 10)  // if CR
      {
         newtextbox += textbox.substring(begin, i + 1);
         begin = i + 1;  // position of CR
      }
     
         
      linelength = i - begin;
         
      if (linelength > textwidth - 2)  // then we need to add a CR
      {
         if (space > begin) // if there is a space in current line
            i = space;  // back up to space and add wordwrap
         newtextbox += textbox.substring(begin, i + 1);
         newtextbox += String.fromCharCode(182) +
                  String.fromCharCode(10);
         begin = i + 1;
      }
   } // end for
   newtextbox += textbox.substring(begin, i);   
   //document.fm.textbox.value = newtextbox;
   //alert();
   if (document.fm.insert.value == 'On')  // if insert help is on
      if (comp != -1) // if they didn't delete the help message
         newtextbox = document.fm.test.value + newtextbox;
   
   return(newtextbox);

}  // end function wordWrap(textbox)


function removeWrap(textbox)
{
   var delwrap = textbox;
   
   // for IE
   var regExp = new RegExp(String.fromCharCode(182) +
      String.fromCharCode(13) + String.fromCharCode(10),"gi");
     
   textbox = delwrap.replace(regExp, "");
   
   // for netscape and firefox
   delwrap = textbox;
   var regExp = new RegExp(String.fromCharCode(182) +
      String.fromCharCode(10),"gi");
     
   textbox = delwrap.replace(regExp, "");
   return(textbox);
}  // end function removeWrap(textbox)


function ClipBoard()
{
   Copied = document.fm.textbox.createTextRange();
   Copied.execCommand("Copy");
   document.fm.textbox.select();
}   // end functuon ClipBoard()

function selectall()
{
   document.fm.textbox.select();
}  // end function selectall()

function closeit()
{
   document.getElementById('message').style.visibility = "hidden";
}  // end function closeit()

function hidekey()
{
   if (document.fm.hide.value == 'Off')  // turn on hide key
   {
      key = document.fm.key.value;
      document.getElementById('pw').innerHTML =
      'Key: <INPUT SIZE=20 TYPE="password" NAME="key" MAXLENGTH="20" ONKEYPRESS="key_pushed(event);">';
      document.fm.key.value = key;
      document.fm.hide.value = 'On';
   }
   else // turn off hide key
   {
      key = document.fm.key.value;
      document.getElementById('pw').innerHTML =
      'Key: <INPUT SIZE=20 TYPE="text" NAME="key" MAXLENGTH="20" ONKEYPRESS="key_pushed(event);">';
      document.fm.key.value = key;
      document.fm.hide.value = 'Off';
   }
}  // end function hidekey()

function insertmsg()
{
   if (document.fm.insert.value == 'Off')  // turn on insert
   {
      //textbox = document.fm.textbox.value;
      document.fm.textbox.value = document.fm.test.value + document.fm.textbox.value;
      document.fm.insert.value = 'On';   
      document.fm.insert2.value = 'On';
   }
   else // turn off insert
   {
      document.fm.textbox.value = document.fm.textbox.value.replace(document.fm.test.value, "");
      //document.fm.textbox.value = textbox;
      document.fm.insert.value = 'Off';
      document.fm.insert2.value = 'Off';
   }
} // end function insertmsg(n)   

function formula(letter, n, bit)
{
   // if I put all these characters together it is a total of 89
   var letters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" +  // 24
      "abcdefghijklmnopqrstuvwxyz" +  // 24 + 24 = 48
      "1234567890" +  //  10 + 48 = 58
      "`-=\[];',./" +  // 11 + 58 = 69
      "~!@#$%^&*()";   // 11 + 69 = 80
   var letters2 = "abcdefghijklmnopqrstuvwxyz";
   var numbers = "1234567890";
   var symbols = "`-=\[];',./";
   var symbols2 = "~!@#$%^&*()_+|{}:<>?";
   var inc = 10;
   var pos;
   
   
      // ** SP ** Should be > 32
      if (letter >= 32 && letter < 127)
         inc = 10;
      else return 0;
     
   if ((pos = letters.indexOf(String.fromCharCode(n))) == -1)
   if ((pos = letters2.indexOf(String.fromCharCode(n))) == -1)
   if ((pos = numbers.indexOf(String.fromCharCode(n))) == -1)
   if ((pos = symbols.indexOf(String.fromCharCode(n))) == -1)
   if ((pos = symbols2.indexOf(String.fromCharCode(n))) == -1)
      pos = 4;  // if not found in any of the above characters
   
   //if (pos >= 20)
   //   pos = pos - 20;
   //else if (pos > 10)
   //   pos = pos - 10;
   
   
     
   if (bit == 1)  // if encrypting
      if (letter + pos + inc >= 127)
         return pos + inc - 95; // ** SP ** should be 94
      else
         return pos + inc;     
   
   if (bit == 2)  // if decrypting
      if (letter - pos - inc <= 31) // ** SP ** should be 32
         return pos + inc + (-95); // ** SP ** should be 94
      else
         return pos + inc;
   
   
} // end formula(n)

function resetboxes()
{
   textbox = "";
   fmtextbox = "";
   document.fm.insert.value = 'Off';
   document.fm.insert2.value = 'Off';
     
} // end function resetboxes()


function change(bit)
{
   newtextbox = new String;
   //fmtextbox = document.fm.textbox.value;
   var letter;
   var key = document.fm.key.value;
   var textlength = fmtextbox.length;
   var keylength = key.length;
   var n = 0; // position in key
   var j = 0;
   var c = 0;
   
   if (fmtextbox == textbox)
   {
      alert("Done");
      if (bit == 2) // if decrypt
         document.fm.textbox.value = removeWrap(document.fm.textbox.value);
      return;
   }
   newtextbox = ""; // blank newtextbox string
   for(i = 0; i < textlength; i++)
   {
      //letter = String.fromCharCode(fmtextbox.charCodeAt(i));
         
      if (fmtextbox.charCodeAt(i) < textbox.charCodeAt(i))
      {   
         // encrypting
         c = fmtextbox.charCodeAt(i) + 1;
         newtextbox += String.fromCharCode(c);     
         j = 1;
         
      }
      else if (fmtextbox.charCodeAt(i) > textbox.charCodeAt(i))
      {
         // decrypting
         c = fmtextbox.charCodeAt(i) - 1;   
         newtextbox += String.fromCharCode(c);
         j = 1;   
               
      } // end else
      else if (fmtextbox.charCodeAt(i) == textbox.charCodeAt(i))
      {
         c = fmtextbox.charCodeAt(i);
         newtextbox += String.fromCharCode(c);
         //document.fm.test.value += c.toString();
         p = 1;
         
      } // end else
     
   } // end for
   
   if (j == 0 && p == 1)
   {
      alert("Done");
      if (bit == 2) // if decrypt
         document.fm.textbox.value = removeWrap(document.fm.textbox.value);
   }
   
   if (j == 1) // if we aren't done changing the box
   {   
      document.fm.textbox.value = newtextbox;
      fmtextbox = newtextbox;   
      if (document.fm.textbox.value != textbox)
         setTimeout("change("+bit+");", timer);
      else
      {   
         alert("Done");   
         if (bit == 2) // if decrypt
            document.fm.textbox.value = removeWrap(document.fm.textbox.value);
      }
   }
} // end function change(textbox)


function encrypter()
{
   document.fm.textbox.value = wordWrap(document.fm.textbox.value);
   //return;
   newtextbox = new String;
   textbox = document.fm.textbox.value;
   var key = document.fm.key.value;
   var textlength = textbox.length;
   var keylength = key.length;
   var n = 0; // position in key
   var letter;
   
   if (document.fm.insert.value == 'On')  // if insert message is on
   {
      comp = textbox.search(document.fm.test.value);
      if (comp != -1) // if they didn't delete the help message
         textbox = textbox.replace(document.fm.test.value, "");
   }
   
   
   newtextbox = ""; // blank newtextbox string
   for (i = 0; i < textlength; i++)
   {
      letter = textbox.charCodeAt(i);
     
      c = textbox.charCodeAt(i) + formula(letter, key.charCodeAt(n), 1);
   
      newtextbox += String.fromCharCode(c);
     
      // the following if statement is because of a difference
      // in firefox.  It does CRLF, 13 and 10,
      // whereas IE only does CR (13).
      // Otherwise I would just need n++;
      //if (letter != 10 && letter != 13 && letter != 32)
      // ** SP ** should be > 32
      if (letter >= 32 && letter < 127)
         n++;
      if (n >= keylength)
         n = 0;   
      //document.fm.test.value += c + ', ';
   } // end for
           
   //document.fm.textbox.value = newtextbox;
   
   textbox = newtextbox;
   fmtextbox = document.fm.textbox.value;
   if (document.fm.insert.value == 'On')  // if insert help is on
      if (comp != -1) // if they didn't delete the help message
         textbox = document.fm.test.value + newtextbox;
   //document.fm.test.value = textbox;
   
   change();
} // end function encrypter()

function decrypter()
{
   
   newtextbox = new String;
   textbox = document.fm.textbox.value;
   var key = document.fm.key.value;
   var textlength = textbox.length;
   var keylength = key.length;
   var n = 0; // position in key
   var letter;
   
   // the following is for gmail:
   // gmail puts a  (char 194) in front of each
   // extended ASCII character (161-180). So I need
   // to strip the textbox of char 194
   // It appears that sending from yahoo to aol also
   // put in char 194
   textbox = textbox.replace(/Â/g, "");
   textlength = textbox.length;
   document.fm.textbox.value = textbox;
   
   if (document.fm.insert.value == 'On')  // if insert message is on
   {
      comp = textbox.search(document.fm.test.value);
      if (comp != -1) // if they didn't delete the help message
         textbox = textbox.replace(document.fm.test.value, "");
   }   
   
   newtextbox = ""; // blank newtextbox string
   for (i = 0; i < textlength; i++)
   {
      letter = textbox.charCodeAt(i);
     
      c = textbox.charCodeAt(i) - formula(letter, key.charCodeAt(n), 2);
   
      newtextbox += String.fromCharCode(c);         

      // the following if statement is because of a difference
      // in firefox.  It does CRLF, 13 and 10,
      // whereas IE only does CR (13).
      // Otherwise I would just need n++;
      //if (letter != 10 && letter != 13 && letter != 32)
      // ** SP ** should be > 32
      if (letter >= 32 && letter < 127)
         n++;
      if (n >= keylength)
         n = 0;   
      //document.fm.test.value += c + ', ';
      if (n >= keylength)
         n = 0;
   } // end for
   //document.fm.textbox.value = newtextbox;
   
   textbox = newtextbox;
   fmtextbox = document.fm.textbox.value;
   if (document.fm.insert.value == 'On')  // if insert help is on
      if (comp != -1) // if they didn't delete the help message
         textbox = document.fm.test.value + newtextbox;
   //document.fm.test.value = textbox;
   change(2);
   
} // end function decrypter()

function key_pushed(event)
{
   var keyCode = event.keyCode ? event.keyCode :
                event.which ? event.which : event.charCode;
   
   if(keyCode==13)
   {
      //event.cancelBubble = true;
      //event.returnValue = false;
      //entertext();
      return false;
   }
}  // end key_pushed

_________________


^^Click it you know you wanna^^

I can't send/reply to PM's
Back to top
View user's profile Send private message Yahoo Messenger
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites