웹마스터 팁

인터넷 돌아댕기다 퍼왔어요.

/***
* Soya/1.0.0-b3 (crlvl: 0; Thu, 25 Oct 2001 15:13:22 UTC)
* Copyright (c) 2001, Saltstorm.
**/
/*#KEEP**
* Soya.Encode.ScriptDecoder
* Decodes JScript/VBscript data encoded with the
* MS ScriptEncoder in true crossbrowser manner.
*
* This script was influenced by the C version (scrdec.c) by Mr.Brownstone.
* --------------------------------------------------------------------------------
* ! DISCLAIMER !
* This script is for demonstrative and educational purposes only.
* Use of this script is at your own risk. The author cannot be
* held responsible if any laws are broken by use of this script.
* --------------------------------------------------------------------------------
* scrdec1x.c is copyright (c) Mr.Brownstone <mrbrownstone@virtualconspiracy.com>
*  http://www.virtualconspiracy.com/scrdec.html
*
* Soya.Encode.ScriptDecoder [ScriptDecoder.js] (this script)
* is copyright (c) 2001, Thomas Loo - Saltstorm. <soya@saltstorm.net>
*
* MS ScriptEncoder counterpart can be found here: (2001-05-13)
*  http://msdn.microsoft.com/scripting/vbscript/download/vbsdown.htm
* --------------------------------------------------------------------------------
**/

function Soya_Encode_ScriptDecoder()
{
this.name = 'Soya.Encode.ScriptDecoder';
this.type = 'constructor';
this.version = '1.04';
this.dependencies = [];

this.decode = $Soya_Encode_ScriptDecoder_decode;

this.$matrix = null;
this.$createMatrix = $Soya_Encode_ScriptDecoder_$createMatrix;
this.$rotor = [
1,2,0, 1,2,0, 2,0,0, 2,0,2, 1,0,2, 0,1,0, 2,0,1,
1,2,0, 0,2,1, 0,2,0, 0,2,1, 1,0,2, 0,2,0, 1,0,1,
1,2,0, 1,0,2, 1,0,2, 0,1,1, 2,0,0, 1,1,2, 0,1,0, 2];
this.$ccmap = [
0x7b,0x57,0x6e, 0x32,0x2e,0x2d, 0x30,0x47,0x75, 0x21,0x7a,0x52,
0x29,0x56,0x60, 0x5b,0x42,0x71, 0x38,0x6a,0x5e, 0x33,0x2f,0x49,
0x3d,0x26,0x5c, 0x58,0x49,0x62, 0x3a,0x41,0x7d, 0x35,0x34,0x29,
0x65,0x32,0x36, 0x39,0x5b,0x20, 0x5c,0x76,0x7c, 0x56,0x72,0x7a,
0x73,0x43,0x00, 0x66,0x38,0x6b, 0x4e,0x39,0x63, 0x45,0x70,0x33,
0x6b,0x45,0x2b, 0x62,0x68,0x68, 0x59,0x71,0x51, 0x78,0x4f,0x66,
0x5e,0x09,0x76, 0x7d,0x62,0x31, 0x4a,0x44,0x64, 0x6d,0x23,0x54,
0x71,0x75,0x43, 0x00,0x00,0x00, 0x60,0x7e,0x3a, 0x00,0x00,0x00,
0x53,0x5e,0x7e, 0x00,0x00,0x00, 0x42,0x77,0x45, 0x27,0x4a,0x2c,
0x48,0x61,0x2a, 0x72,0x5d,0x74, 0x75,0x22,0x27, 0x31,0x4b,0x37,
0x37,0x6f,0x44, 0x4d,0x4e,0x79, 0x52,0x3b,0x59, 0x22,0x4c,0x2f,
0x54,0x50,0x6f, 0x6a,0x67,0x26, 0x47,0x2a,0x72, 0x64,0x7d,0x6a,
0x2d,0x74,0x39, 0x20,0x54,0x7b, 0x00,0x2b,0x3f, 0x2e,0x2d,0x38,
0x4c,0x2c,0x77, 0x5d,0x30,0x67, 0x7e,0x6e,0x53, 0x6c,0x6b,0x47,
0x6f,0x66,0x34, 0x79,0x35,0x78, 0x74,0x25,0x5d, 0x43,0x21,0x30,
0x26,0x64,0x23, 0x76,0x4d,0x5a, 0x25,0x52,0x5b, 0x24,0x63,0x6c,
0x2b,0x3f,0x48, 0x28,0x7b,0x55, 0x23,0x78,0x70, 0x41,0x29,0x69,
0x34,0x28,0x2e, 0x09,0x73,0x4c, 0x2a,0x59,0x21, 0x44,0x33,0x24,
0x3f,0x00,0x4e, 0x77,0x6d,0x50, 0x3b,0x55,0x09, 0x55,0x53,0x56,
0x69,0x7c,0x73, 0x61,0x3a,0x35, 0x63,0x5f,0x61, 0x50,0x65,0x4b,
0x67,0x46,0x58, 0x51,0x58,0x3b, 0x49,0x31,0x57, 0x4f,0x69,0x22,
0x46,0x6c,0x6d, 0x68,0x5a,0x4d, 0x7c,0x48,0x25, 0x36,0x27,0x28,
0x70,0x5c,0x46, 0x6e,0x3d,0x4a, 0x7a,0x24,0x32, 0x2f,0x79,0x41,
0x5f,0x37,0x3d, 0x4b,0x60,0x5f, 0x5a,0x51,0x4f, 0x2c,0x20,0x42,
0x57,0x36,0x65  ];
}

function $Soya_Encode_ScriptDecoder_$createMatrix(){
// prebuilding the char-matrix will give us a
// *slight* performance boost for repeated decode calls.

var i, j,
afccs = function (cca) {
   return String.fromCharCode
    (cca[0], 0, cca[1], 0, cca[2]).split('x00');
  };
this.$matrix = [];

this.$matrix[9] = afccs(this.$ccmap.slice(0, j = 3));
for(i = 0x20; i < 0x80; j += 3, i++)
  this.$matrix[i] = afccs(this.$ccmap.slice(j, j + 3));
}


function $Soya_Encode_ScriptDecoder_decode(sData){
var i, j, cc, at, sEncoded, sDecoded = '';

// do we have anything to decode. if not, return an empty string.
if(!sData)
  return sDecoded;

// else try isolating the sEncoded script from its surroundings.
else if(/#@~^.{6}==(.+).{6}==^#~@/.test(sData))
  sEncoded = RegExp.$1;

// no surrounding checksum found, then subject everything for decoding.
else sEncoded = sData;

// is this the first time this method is called ??
// then build the magic matrix...
if(!this.$matrix)
  this.$createMatrix();

// iterate the sEncoded string and decode it char by char...
for(at = i = j = 0; i < sEncoded.length; i++){
  cc = sEncoded.charCodeAt(i);

// 'at' switched off and the charcode is less 128 means we have
// to perform decoding unless charcode equals 64 (@, at).
  if(!at && cc < 0x80)
    (cc != 0x40) ?
      (sDecoded += this.$matrix[cc][this.$rotor[j++ % 0x40]]) : at = 1;

// 'at' switch is apparantly on...
// switch it off and replace char left of '@' if one of the key-chars
// Other values are not relevant.
  else {
    at = 0, j++;
    switch(cc.toString()){
case '33' : sDecoded += 'x3c'; //<;
  break;
case '35' : sDecoded += 'x0d';
  break;
case '36' : sDecoded += 'x40'; //@
  break;
case '38' : sDecoded += 'x0a';
  break;
case '42' : sDecoded += 'x3e'; //>
  break;
default   :
     break;
}
    }
  }

return sDecoded;
}

if(typeof(Soya) == 'object') Soya.registerBean('Soya.Encode.ScriptDecoder', false, 1);

...............................................................................................................
  Written date/time: 2002-02-02 09:33:57
...............................................................................................................
  COMPUTER - hardware, software, programming, flash, graphic, java, php
          GAME - diablo2, fortress2, starcraft
...............................................................................................................
  http://myhome.hananet.net/~changminyang
...............................................................................................................
제목 글쓴이 날짜
[Tip] 페이지 이동중이라고 표시해보자~ ^_^ [10] BiHon 2001.03.28
DHTM 을 이용한 마우스 오른쪽의 메뉴 만들기.. [11] 허진규 2001.03.30
주소치면 이동하는 스크립트 gain.ne.kg 2001.07.27
오늘 날짜 보여주기 스크립트 [3] 정후니 2001.08.31
페이지마다 타이틀 변경하기 [3] WOWpc 2001.10.10
팝업창 다시 안뜨게 하기 [9] Bassfeel 2001.12.03
연합뉴스 속보 홈에 다는 코드입니다. [1] 이환 2001.12.28
textarea 입력받는 글자수 제한하는 스크립트 [5] 오기 2002.01.17
[JavaScript] 익스플로러,네츠케이프 모두에서 iframe 과 비슷하게 해보자! [3] 티르 2002.01.24
자바 스크립트 인코딩 된것 디코딩 하는 스크립트 [6] 양창민 2002.02.02
복사 및 오른쪽 버튼 사용금지 스크립트 Jacylee 2002.02.21
▩마우스 오버시 그림이 진해지는 스크립 ▩윤미 2002.02.21
폼 항목중 입력하지 않을때 경고창 띄우기 Topy 2002.02.22
자바스크립트로 변수처리하기! 두기두바 2002.02.22
[JavaScript] 폼 버튼을 클릭하면 경고 메세지 보내기 SM 2002.02.24
[JavaScript] 창을 열면 인사하는 간단한 스크립트 SM 2002.02.24
[JavaScript] 웹문서에 주소창 넣기 스크립트 [4] SM 2002.02.24
[JavaScript] 마우스 커스 이동만으로 배경색상을 바꾸어보자 SM 2002.02.24
[JavaScript] 자바스크립트 버튼에 링크 걸기 SM 2002.02.24
[JavaScript] 이미지나 버튼 클릭시 생기는 점선 없애기 [1] SM 2002.02.24