Register for your free account! | Forgot your password?

Go Back   elitepvpers > General Gaming > General Gaming Discussion
You last visited: Today at 07:47

  • Please register to post and access all features, it's quick, easy and FREE!

 

packet encryption LunaPlus

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Mar 2011
Posts: 12
Received Thanks: 0
packet encryption LunaPlus

anyone interested in reversing the packet encryption?
or has any one tried?
success/failure.. anything?

i've managed to:
-bypass gamegaurd
-bypass update launcher
-unpacked the exe
-bypass multi client checking
-swear filter bypass
-found encryption function --currently working on.



tachikomajocks is offline  
Old   #2
 
elite*gold: 0
Join Date: Mar 2011
Posts: 12
Received Thanks: 0
found unencrypted login packet stored at 0012FA96

does something wierd with user/pass.
sample tested with user all 'a' pass all 'z'

length 2 bytes ED 02 which later becomes 5b 01
session 2 bytes 00 00 modded later
packet type 2 bytes 07 01 does not get encrypted

0012FA90 ED 02 00 00 07 01 61 61 61 61 ..aaaa
0012FAA0 00 00 00 00 61 61 61 61 00 00 00 00 61 61 61 61 ....aaaa....aaaa
0012FAB0 61 61 61 61 00 7A 7A 7A 7A 7A 7A 7A 7A 7A 7A 7A aaaa.zzzzzzzzzzz
0012FAC0 AE 74 00 00 7A 00 55 53 30 31 00 00 31 30 30 34 t..z.US01..1004
0012FAD0 7A 7A 7A 7A 00 00 00 00 54 43 31 30 00 00 00 00 zzzz....TC10....
0012FAE0 00 00 00 00 00 00 00 E0 13 81 44 F3 2A 1B 86 00 .......D*†.


tachikomajocks is offline  
Old   #3
 
elite*gold: 0
Join Date: Mar 2011
Posts: 12
Received Thanks: 0
found the packet writing function.
unencrypted packet before it fills with junk:
0012F9E0 .........................DC 02 00 00 07 01 00 00 00 00 ............
0012F9F0 00 00 00 00 51 57 45 52 00 00 00 00 00 00 00 00 ....QWER........
0012FA00 00 00 00 00 00 5A 58 43 56 00 00 00 00 00 00 00 .....ZXCV.......
0012FB40 00 00 00 02 04 00 00 00 0D 00 00 00 ..........

unencrypted with some constant junk: in every packet i think.
0012F9E0 DC 02 00 00 07 01 00 00 00 00 ......
0012F9F0 9B 92 00 00 51 57 45 52 00 00 00 00 00 00 00 00 ›’..QWER........
0012FA00 00 00 00 00 00 5A 58 43 56 00 00 00 00 00 00 00 .....ZXCV.......
0012FA10 00 00 00 00 00 00 55 53 54 43 31 30 31 30 30 34 ......USTC101004
0012FA20 30 31 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01..............
0012FA30 00 00 00 00 00 00 00 E0 13 81 44 F3 2A 1B 86 00 .......D*†.
0012FB40 00 00 00 02 04 00 00 00 0D 00 00 00 ..........
tachikomajocks is offline  
Old   #4
 
elite*gold: 0
Join Date: Mar 2011
Posts: 12
Received Thanks: 0
found the multiclient check function:
to bypass change at hex address 3f838 fill with NOP's 4 bytes.


tachikomajocks is offline  
Old   #5
 
elite*gold: 0
Join Date: Mar 2011
Posts: 12
Received Thanks: 0
looks like the packet gets passed over 3 times, encrypting each time.
guessing it's using 3des encryption algorithm.
tachikomajocks is offline  
Old   #6
 
elite*gold: 0
Join Date: Mar 2011
Posts: 12
Received Thanks: 0
figured out 1st pass of tripple des encrypt.

all it does is subtract the last 4 bytes from the next 4 bytes eg: last encrypted 8 bytes (originally 0's)
and 4 non encypted bytes 262150e1/d9deaf1f/00000000.
subtracting d9 de af 1f from 00 00 00 00 = 26 21 50 e1 or (FFFFFFFF262150E1) in calc, it then
overwrites the 00 00 00 00 with e1 50 21 26 (reverse hex).
encrypt starts with the 6th byte (counting zero).
tachikomajocks is offline  
Old   #7
 
elite*gold: 0
Join Date: Feb 2010
Posts: 32
Received Thanks: 6
what hex program u use to edit on the bypass multi client? and can u figure out to edit the "Booth" buy item list?
meawww is offline  
Old   #8
 
elite*gold: 0
Join Date: Mar 2011
Posts: 12
Received Thanks: 0
i use XVI32 hex editor.
aha thats an awesome idea. might look into that as a side proj.
tachikomajocks is offline  
Old   #9
 
elite*gold: 0
Join Date: Mar 2008
Posts: 939
Received Thanks: 515
Quote:
Originally Posted by meawww View Post
what hex program u use to edit on the bypass multi client? and can u figure out to edit the "Booth" buy item list?
the only issue with that is it wont work visually maybe but working no
with gpotato games this is all of there games not just flyff
the client and server files have to be sync or login is impossable hince why so many people have issues when they make there first p server if they dont know this. and ask around with *i cant login or so and so item or skill crashes me.
now putting an item is shop is one thing actly being able to buy it is a nother the client would recognize it but server side wouldnt making the item inactive and none responsive
wisp66 is offline  
Old   #10
 
elite*gold: 0
Join Date: Mar 2011
Posts: 12
Received Thanks: 0
stuck at a line that writes some kind of time function...looks like it increases every second.
thought it might be timegettime function but couldnt match the output.

this part holds the key to the encryption. once this is sorted it all flows from here.

65105E93 F3:A5 REP MOVS DWORD PTR ES:[EDI],DWORD PTR DS:[ESI]

ECX=00000024 (decimal 36.)
DS:[ESI]=[0DE7006E]=00007F0D
ES:[EDI]=[0BCE0054]=00007F0B

0BCE0054 0B 7F 00 00 ..
tachikomajocks is offline  
Old   #11
 
elite*gold: 0
Join Date: Mar 2011
Posts: 12
Received Thanks: 0
giving up.. NEXT GAME!!

lune plus exe with all above mentioned bypasses:

tachikomajocks is offline  
Old   #12
 
elite*gold: 0
Join Date: Mar 2011
Posts: 12
Received Thanks: 0
found encryption source if anyone interested:

Code:
#include "stdafx.h"
#include "windef.h"
#include <mmsystem.h>
#include "HSEL.h"
#pragma comment(lib,"winmm.lib")
#pragma auto_inline(on)

const int LIMIT_SWAP_BLOCK_COUNT	= 5;
const int HSEL_VERSION				= 3;

#define GetKey()			(		(rand()%34000+10256)	*	(rand()%30000+10256)		+5	)

#define GetMultiGab()		(	(	(rand()%15000+512)		*	(rand()%10000+256)		)	*2	+1	)
#define GetPlusGab()		(	(	(rand()%5000+512)		*	(rand()%1000+256)		)	*2	+1	)

#define GetNextKey(A,B,C)	(	( (A)*(B) )	+	(C)	)
#define HSELSWAP(A,B)		(	(A)^=(B)^=(A)^=(B)	)

#define SharpRandom()		srand( (unsigned __int32)timeGetTime() )

/*--------------------------------------------------------------------------------*/
////////////////		HSEL_STREAM Class Fuction Body				////////////////
/*--------------------------------------------------------------------------------*/
CHSEL_STREAM::CHSEL_STREAM(void)
{
	iVersion = HSEL_VERSION; 
	iHSELType  = 0; 
	SharpRandom();
}

CHSEL_STREAM::~CHSEL_STREAM(void)
{							

}

__int32 CHSEL_STREAM::Initial(HSEL_INITIAL hselinit)
{
	iHSELType =0;
	switch(hselinit.iDesCount	&0x000F)
	{
		case HSEL_DES_SINGLE:
			{
				lpDesEncryptType=(&CHSEL_STREAM::DESSingleEncode);
				lpDesDecryptType=(&CHSEL_STREAM::DESSingleDecode);
			}
			break;
		case HSEL_DES_TRIPLE:
			{
				lpDesEncryptType=(&CHSEL_STREAM::DESTripleEncode);
				lpDesDecryptType=(&CHSEL_STREAM::DESTripleDecode);
			}
			break;
		default:{	return 0;		}break;
	}
	
	if(hselinit.iEncryptType == HSEL_ENCRYPTTYPE_RAND )
	{
		switch(rand()%4)
		{
		case 0:
			hselinit.iEncryptType = HSEL_ENCRYPTTYPE_1;
			break;
		case 1:
			hselinit.iEncryptType = HSEL_ENCRYPTTYPE_2;
			break;
		case 2:
			hselinit.iEncryptType = HSEL_ENCRYPTTYPE_3;
			break;
		default:
			hselinit.iEncryptType = HSEL_ENCRYPTTYPE_4;
			break;
		}
	}

	switch(hselinit.iEncryptType	&0x00F0)
	{
		case HSEL_ENCRYPTTYPE_1:
			{	
				lpDesLeftEncrypt	= (&CHSEL_STREAM::DESLeftEncode_Type_1);
				lpDesRightEncrypt	= (&CHSEL_STREAM::DESRightEncode_Type_1);
				lpDesMiddleEncrypt	= (&CHSEL_STREAM::DESMiddleEncode_Type_1);
				
				lpDesLeftDecrypt	= (&CHSEL_STREAM::DESLeftDecode_Type_1);
				lpDesRightDecrypt	= (&CHSEL_STREAM::DESRightDecode_Type_1);
				lpDesMiddleDecrypt	= (&CHSEL_STREAM::DESMiddleDecode_Type_1);
			}break;
		case HSEL_ENCRYPTTYPE_2:
			{		
				lpDesLeftEncrypt	= (&CHSEL_STREAM::DESLeftEncode_Type_2);
				lpDesRightEncrypt	= (&CHSEL_STREAM::DESRightEncode_Type_2);
				lpDesMiddleEncrypt	= (&CHSEL_STREAM::DESMiddleEncode_Type_2);
				
				lpDesLeftDecrypt	= (&CHSEL_STREAM::DESLeftDecode_Type_2);
				lpDesRightDecrypt	= (&CHSEL_STREAM::DESRightDecode_Type_2);
				lpDesMiddleDecrypt	= (&CHSEL_STREAM::DESMiddleDecode_Type_2);
			}break;
		case HSEL_ENCRYPTTYPE_3:
			{		
				lpDesLeftEncrypt	= (&CHSEL_STREAM::DESLeftEncode_Type_3);
				lpDesRightEncrypt	= (&CHSEL_STREAM::DESRightEncode_Type_3);
				lpDesMiddleEncrypt	= (&CHSEL_STREAM::DESMiddleEncode_Type_3);
				
				lpDesLeftDecrypt	= (&CHSEL_STREAM::DESLeftDecode_Type_3);
				lpDesRightDecrypt	= (&CHSEL_STREAM::DESRightDecode_Type_3);
				lpDesMiddleDecrypt	= (&CHSEL_STREAM::DESMiddleDecode_Type_3);
			}break;
		case HSEL_ENCRYPTTYPE_4:
			{		
				lpDesLeftEncrypt	= (&CHSEL_STREAM::DESLeftEncode_Type_4);
				lpDesRightEncrypt	= (&CHSEL_STREAM::DESRightEncode_Type_4);
				lpDesMiddleEncrypt	= (&CHSEL_STREAM::DESMiddleEncode_Type_4);
				
				lpDesLeftDecrypt	= (&CHSEL_STREAM::DESLeftDecode_Type_4);
				lpDesRightDecrypt	= (&CHSEL_STREAM::DESRightDecode_Type_4);
				lpDesMiddleDecrypt	= (&CHSEL_STREAM::DESMiddleDecode_Type_4);
			}break;
		default:{	return 0;			}break;
	}

	switch(hselinit.iSwapFlag	&0x0F00)
	{
		case HSEL_SWAP_FLAG_ON:		
			{
				lpSwapEncrypt=(&CHSEL_STREAM::SwapEncrypt);
				lpSwapDecrypt=(&CHSEL_STREAM::SwapDecrypt);
			}
			break;
		case HSEL_SWAP_FLAG_OFF:	
			{
				lpSwapEncrypt=(&CHSEL_STREAM::NoSwapEncrypt);
				lpSwapDecrypt=(&CHSEL_STREAM::NoSwapDecrypt);
			}
			break;
		default:{	return 0;	}break;
	}

	Init = hselinit;

	switch(hselinit.iCustomize		&0xF000)
	{
		case HSEL_KEY_TYPE_CUSTOMIZE:	
			{
				SetKeyCustom(hselinit.Keys);
			}
			break;
		case HSEL_KEY_TYPE_DEFAULT:	
			{
				GenerateKeys(Init.Keys);
			}
			break;
		default:{	return 0;	}	break;
	}

	Init.iCustomize= HSEL_KEY_TYPE_CUSTOMIZE;

	iHSELType = (hselinit.iDesCount|hselinit.iEncryptType|hselinit.iSwapFlag|hselinit.iCustomize);
	return iHSELType;
}

void CHSEL_STREAM::SetKeyCustom(HselKey IntoKey)
{
	Init.Keys = IntoKey;
	iCRCValue = 0;
	return;
}

void CHSEL_STREAM::GenerateKeys(HselKey &IntoKey)
{
	IntoKey.iLeftKey		= GetKey();		
	IntoKey.iRightKey		= GetKey();	
	IntoKey.iMiddleKey		= GetKey();	
	IntoKey.iTotalKey		= GetKey();

	IntoKey.iLeftMultiGab	= GetMultiGab();
	IntoKey.iRightMultiGab	= GetMultiGab();
	IntoKey.iMiddleMultiGab	= GetMultiGab();
	IntoKey.iTotalMultiGab	= GetMultiGab();

	IntoKey.iLeftPlusGab	= GetPlusGab();
	IntoKey.iRightPlusGab	= GetPlusGab();
	IntoKey.iMiddlePlusGab	= GetPlusGab();
	IntoKey.iTotalPlusGab	= GetPlusGab();

	return;
}

void CHSEL_STREAM::SetNextKey(void)
{
	Init.Keys.iLeftKey	= GetNextKey
		(
		Init.Keys.iLeftKey,
		Init.Keys.iLeftMultiGab,
		Init.Keys.iLeftPlusGab
		);

	Init.Keys.iRightKey	= GetNextKey
		(
		Init.Keys.iRightKey,
		Init.Keys.iRightMultiGab,	
		Init.Keys.iRightPlusGab
		);

	Init.Keys.iMiddleKey	= GetNextKey
		(
		Init.Keys.iMiddleKey,
		Init.Keys.iMiddleMultiGab,
		Init.Keys.iMiddlePlusGab
		);

	Init.Keys.iTotalKey	= GetNextKey
		(
		Init.Keys.iTotalKey,
		Init.Keys.iTotalMultiGab,
		Init.Keys.iTotalPlusGab
		);
	return;
}

bool CHSEL_STREAM::ChackFaultStreamSize(const __int32 iStreamSize)
{
	if( 0 >= iStreamSize )	{return false;}
	_ASSERTE(iStreamSize > 0);//
	return true;
}

bool CHSEL_STREAM::Encrypt(char *lpStream,const __int32 iStreamSize)
{	
	if(!ChackFaultStreamSize(iStreamSize)){return false;}// üũ

	(this->*lpSwapEncrypt)(lpStream,iStreamSize);//

	(this->*lpDesEncryptType)(lpStream,iStreamSize);//ȣ*

	SetNextKey();//Ű

	GetCRC(lpStream,iStreamSize);//CRC  ޱ

	return true;
}

bool CHSEL_STREAM::Decrypt(char *lpStream,const __int32 iStreamSize)
{
	if(!ChackFaultStreamSize(iStreamSize)){return false;}

	GetCRC(lpStream,iStreamSize);//CRC  ޱ

	(this->*lpDesDecryptType)(lpStream,iStreamSize);//ȣ*

	(this->*lpSwapDecrypt)(lpStream,iStreamSize);//

	SetNextKey();//Ű

	return true;
}

////////////////////////////////////////////////////////////////////////////
//				Single DES
void CHSEL_STREAM::DESSingleEncode(char *lpStream,const __int32 iStreamSize)
{
	(this->*lpDesLeftEncrypt)(lpStream,iStreamSize);
	return;
}

void CHSEL_STREAM::DESSingleDecode(char *lpStream,const __int32 iStreamSize)
{
	(this->*lpDesLeftDecrypt)(lpStream,iStreamSize);
	return;
}
////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////
//				Triple DES
void CHSEL_STREAM::DESTripleEncode(char *lpStream,const __int32 iStreamSize)
{
	(this->*lpDesLeftEncrypt)(lpStream,iStreamSize);
	(this->*lpDesRightEncrypt)(lpStream,iStreamSize);
	(this->*lpDesMiddleEncrypt)(lpStream,iStreamSize);
	return;
}

void CHSEL_STREAM::DESTripleDecode(char *lpStream,const __int32 iStreamSize)
{
	(this->*lpDesMiddleDecrypt)(lpStream,iStreamSize);
	(this->*lpDesRightDecrypt)(lpStream,iStreamSize);
	(this->*lpDesLeftDecrypt)(lpStream,iStreamSize);
	return;
}
////////////////////////////////////////////////////////////////////////////

void CHSEL_STREAM::GetCRC(char *lpStream,const __int32 iStreamSize)
{
	iCRCValue	=	0;

	iBlockCount		= iStreamSize>>2;	//   == __int32 iBlockCount = iStreamSize/4;
	iRemainCount	= iStreamSize&3;	//¥  ޱ==__int32 iRemainCount = iStreamSize%4; 
	iPos			= (iBlockCount<<2);			//Ʈ  ġ iBlockCount*4

	__int32 *lpBlock	= (__int32*)(lpStream);

	while(iBlockCount)
	{
		iCRCValue	^= (*(lpBlock++));
		iBlockCount--;
	}
	while(iRemainCount)
	{
		iCRCValue	^=	lpStream[iPos++];
		iRemainCount--;
	}
	return;
}

__int32		CHSEL_STREAM::GetCRCConvertInt(void)const
{
	return iCRCValue;
}

char	CHSEL_STREAM::GetCRCConvertChar(void)const
{
	char *cCRCKeyTemp = (char *)&iCRCValue;
	return (char)((*cCRCKeyTemp)^(*(cCRCKeyTemp+1))^(*(cCRCKeyTemp+2))^(*(cCRCKeyTemp+3)));
}

short	CHSEL_STREAM::GetCRCConvertShort(void)const
{
	short *sCRCKeyTemp = (short *)&iCRCValue;
	return (short)((*sCRCKeyTemp)	^ (*(sCRCKeyTemp+1)));
}

void CHSEL_STREAM::NoSwapEncrypt(char *lpStream, const __int32 iStreamSize)
{
	return;
}

void CHSEL_STREAM::NoSwapDecrypt(char *lpStream, const __int32 iStreamSize)
{
	return;
}

void CHSEL_STREAM::SwapEncrypt(char *lpStream,const __int32 iStreamSize)
{
	iBlockCount	= (iStreamSize>>2);	//   == __int32 iBlockCount = iStreamSize/4;

	if(LIMIT_SWAP_BLOCK_COUNT > iBlockCount)	{return;}// 2 ϶  Ұ.
	iBlockCount--;

	HselKey	*Keys = &Init.Keys;

	iLPos0 =	(Keys->iLeftKey&0x000F)%iBlockCount;
	iLPos1 =	((Keys->iLeftKey>>8)&0x000F)%iBlockCount;
	iLPos2 =	((Keys->iLeftKey>>16)&0x000F)%iBlockCount;
	iLPos3 =	((Keys->iLeftKey>>24)&0x000F)%iBlockCount;	

	iRPos0 =	(Keys->iRightKey&0x000F)%iBlockCount;
	iRPos1 =	((Keys->iRightKey>>8)&0x000F)%iBlockCount;
	iRPos2 =	((Keys->iRightKey>>16)&0x000F)%iBlockCount;
	iRPos3 =	((Keys->iRightKey>>24)&0x000F)%iBlockCount;	

	iMPos0 =	(Keys->iMiddleKey&0x000F)%iBlockCount;
	iMPos1 =	((Keys->iMiddleKey>>8)&0x000F)%iBlockCount;
	iMPos2 =	((Keys->iMiddleKey>>16)&0x000F)%iBlockCount;
	iMPos3 =	((Keys->iMiddleKey>>24)&0x000F)%iBlockCount;	

	__int32 *lpBlock = (__int32*)(lpStream);//ҿ 4Ʈ 

	if(iLPos0 != iRPos0){HSELSWAP(	(*(lpBlock+(iLPos0))),	(*(lpBlock+(iRPos0)))	);}
	if(iRPos0 != iMPos0){HSELSWAP(	(*(lpBlock+(iRPos0))),	(*(lpBlock+(iMPos0)))	);}

	if(iLPos1 != iRPos1){HSELSWAP(	(*(lpBlock+(iLPos1))),	(*(lpBlock+(iRPos1)))	);}
	if(iRPos1 != iMPos1){HSELSWAP(	(*(lpBlock+(iRPos1))),	(*(lpBlock+(iMPos1)))	);}

	if(iLPos2 != iRPos2){HSELSWAP(	(*(lpBlock+(iLPos2))),	(*(lpBlock+(iRPos2)))	);}
	if(iRPos2 != iMPos2){HSELSWAP(	(*(lpBlock+(iRPos2))),	(*(lpBlock+(iMPos2)))	);}

	if(iLPos3 != iRPos3){HSELSWAP(	(*(lpBlock+(iLPos3))),	(*(lpBlock+(iRPos3)))	);}
	if(iRPos3 != iMPos3){HSELSWAP(	(*(lpBlock+(iRPos3))),	(*(lpBlock+(iMPos3)))	);}
	return;
}

void CHSEL_STREAM::SwapDecrypt(char *lpStream,const __int32 iStreamSize)
{
	iBlockCount	= (iStreamSize>>2);	//   == __int32 iBlockCount = iStreamSize/4;

	if(LIMIT_SWAP_BLOCK_COUNT > iBlockCount)	{return;}// 2 ϶  Ұ.
	iBlockCount--;

	HselKey	*Keys = &Init.Keys;

	iLPos0 =	(Keys->iLeftKey&0x000F)%iBlockCount;
	iLPos1 =	((Keys->iLeftKey>>8)&0x000F)%iBlockCount;
	iLPos2 =	((Keys->iLeftKey>>16)&0x000F)%iBlockCount;
	iLPos3 =	((Keys->iLeftKey>>24)&0x000F)%iBlockCount;	

	iRPos0 =	(Keys->iRightKey&0x000F)%iBlockCount;
	iRPos1 =	((Keys->iRightKey>>8)&0x000F)%iBlockCount;
	iRPos2 =	((Keys->iRightKey>>16)&0x000F)%iBlockCount;
	iRPos3 =	((Keys->iRightKey>>24)&0x000F)%iBlockCount;	

	iMPos0 =	(Keys->iMiddleKey&0x000F)%iBlockCount;
	iMPos1 =	((Keys->iMiddleKey>>8)&0x000F)%iBlockCount;
	iMPos2 =	((Keys->iMiddleKey>>16)&0x000F)%iBlockCount;
	iMPos3 =	((Keys->iMiddleKey>>24)&0x000F)%iBlockCount;	

	__int32 *lpBlock = (__int32*)(lpStream);//ҿ 4Ʈ 

	if(iRPos3 != iMPos3){HSELSWAP(	(*(lpBlock+(iRPos3))),	(*(lpBlock+(iMPos3)))	);}
	if(iLPos3 != iRPos3){HSELSWAP(	(*(lpBlock+(iLPos3))),	(*(lpBlock+(iRPos3)))	);}

	if(iRPos2 != iMPos2){HSELSWAP(	(*(lpBlock+(iRPos2))),	(*(lpBlock+(iMPos2)))	);}
	if(iLPos2 != iRPos2){HSELSWAP(	(*(lpBlock+(iLPos2))),	(*(lpBlock+(iRPos2)))	);}

	if(iRPos1 != iMPos1){HSELSWAP(	(*(lpBlock+(iRPos1))),	(*(lpBlock+(iMPos1)))	);}
	if(iLPos1 != iRPos1){HSELSWAP(	(*(lpBlock+(iLPos1))),	(*(lpBlock+(iRPos1)))	);}

	if(iRPos0 != iMPos0){HSELSWAP(	(*(lpBlock+(iRPos0))),	(*(lpBlock+(iMPos0)))	);}
	if(iLPos0 != iRPos0){HSELSWAP(	(*(lpBlock+(iLPos0))),	(*(lpBlock+(iRPos0)))	);}
	return;
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////////////////////////////////
void CHSEL_STREAM::DESLeftEncode_Type_1(char *lpStream,const __int32 iStreamSize)
{
	iTempLeftKey	= Init.Keys.iLeftKey;//Ŭ  LeftKey 
	iBlockCount		= (iStreamSize>>2);	//   == __int32 iBlockCount = iStreamSize/4;
	iRemainCount	= (iStreamSize&3);	//¥  ޱ==__int32 iRemainCount = iStreamSize%4; 
	iPos			= (iBlockCount<<2);	//Ʈ  ġ iBlockCount*4
	__int32 *lpBlock	= (__int32*)lpStream;//ȣ*    
	char *lpChar			= ((char *)&(Init.Keys.iLeftKey));
	
	while(iBlockCount)
	{
		(*lpBlock)		^=	(iTempLeftKey);
		(iTempLeftKey)	=	(*(lpBlock++));
		(iBlockCount--);
	}
	while(iRemainCount)
	{
		lpStream[iPos++]	^=	(*(lpChar+iRemainCount));
		(iRemainCount--);
	}
	return;
}

void CHSEL_STREAM::DESLeftDecode_Type_1(char *lpStream,const __int32 iStreamSize)//̿ ̳ʽ  .
{
	iTempLeftKey	= Init.Keys.iLeftKey;//Ŭ  LeftKey 
	iBlockCount		= (iStreamSize>>2); //   == __int32 iBlockCount = iStreamSize/4;
	iRemainCount	= (iStreamSize&3);//¥  ޱ==__int32 iRemainCount = iStreamSize%4; 
	iPos			= (iBlockCount<<2);
	__int32 *lpBlock	= (__int32*)lpStream;//ȣ*    
	char *lpChar		= ((char *)&Init.Keys.iLeftKey);

	lpBlock			+=	(iBlockCount-1);
	(iTempLeftKey)	=	(*(lpBlock-1));

	while(	1	<	iBlockCount)
	{
		(*(lpBlock--))	^=	(iTempLeftKey);
		(iTempLeftKey)	=	(*(lpBlock-1))	;
		(iBlockCount--);
	}

	if(iBlockCount)
	{
		(*lpBlock)	^=	(Init.Keys.iLeftKey);
	}

	while(iRemainCount)
	{
		lpStream[iPos++]	^=	(*(lpChar+iRemainCount));
		(iRemainCount--);
	}
	return;
}

void CHSEL_STREAM::DESRightEncode_Type_1(char *lpStream,const __int32 iStreamSize)//̿ ̳ʽ  .
{
	iTempRightKey	= Init.Keys.iRightKey;//Ŭ  RightKey 
	iBlockCount		= iStreamSize>>2;	//   == __int32 iBlockCount = iStreamSize/4;
	iRemainCount	= iStreamSize&3;	//¥  ޱ==__int32 iRemainCount = iStreamSize%4; 
	iPos			= (iBlockCount<<2);			//Ʈ  ġ iBlockCount*4
	__int32 *lpBlock	= (__int32*)(lpStream+iPos+iRemainCount);
	char *lpChar	= ((char *)&Init.Keys.iRightKey);

	lpBlock = (__int32*)(lpStream+iStreamSize-4);

	while(iBlockCount)
	{
		(*lpBlock)		^=	(iTempRightKey);
		(iTempRightKey)	=	(*(lpBlock--));
		iBlockCount--;
	}

	while(iRemainCount)
	{
		lpStream[--iRemainCount]	^=	(*(lpChar+iRemainCount));
	}
	return;
}

void CHSEL_STREAM::DESRightDecode_Type_1(char *lpStream,const __int32 iStreamSize)//̿ ̳ʽ  .
{
	iTempRightKey	= Init.Keys.iRightKey;//Ŭ  RightKey 
	iBlockCount		= iStreamSize>>2;	//   == __int32 iBlockCount = iStreamSize/4;
	iRemainCount	= iStreamSize&3;	//¥  ޱ==__int32 iRemainCount = iStreamSize%4; 
	iPos			= (iBlockCount<<2);			//Ʈ  ġ iBlockCount*4

	__int32 *lpBlock	= (__int32*)(lpStream+iRemainCount);
	char *lpChar	= ((char *)&Init.Keys.iRightKey);

	iTempRightKey	= *(lpBlock+1);

	while(1 < iBlockCount)
	{
		(*(lpBlock++)) ^=	(iTempRightKey);
		iTempRightKey	=	(*(lpBlock+1));
		iBlockCount--;
	}

	if(iBlockCount)
	{
		*(lpBlock)		^=	(Init.Keys.iRightKey);
	}

	while(iRemainCount)
	{
		lpStream[--iRemainCount]	^=	(*(lpChar+iRemainCount));
	}

	return;
}

void CHSEL_STREAM::DESMiddleEncode_Type_1(char *lpStream,const __int32 iStreamSize)//̿ ̳ʽ  .
{
	iTempMiddleKey	= Init.Keys.iMiddleKey;//Ŭ  MiddleKey 
	iBlockCount		= iStreamSize>>2;	//   == __int32 iBlockCount = iStreamSize/4;
	iRemainCount	= iStreamSize&3;	//¥  ޱ==__int32 iRemainCount = iStreamSize%4; 
	iPos			= (iBlockCount<<2);			//Ʈ  ġ iBlockCount*4

	__int32 *lpBlock	= (__int32*)(lpStream);
	char *lpChar	= ((char *)&Init.Keys.iMiddleKey);

	while(iBlockCount)
	{
		(*(lpBlock++)) ^= iTempMiddleKey;
		iBlockCount--;
	}
	while(iRemainCount)
	{
		lpStream[iPos++]	^=	(*(lpChar+iRemainCount));
		iRemainCount--;
	}

	return;
}

void CHSEL_STREAM::DESMiddleDecode_Type_1(char *lpStream,const __int32 iStreamSize)//̿ ̳ʽ  .
{
	iTempMiddleKey	= Init.Keys.iMiddleKey;//Ŭ  MiddleKey 
	iBlockCount		= iStreamSize>>2;	//   == __int32 iBlockCount = iStreamSize/4;
	iRemainCount	= iStreamSize&3;	//¥  ޱ==__int32 iRemainCount = iStreamSize%4; 
	iPos			= (iBlockCount<<2);			//Ʈ  ġ iBlockCount*4
	__int32 *lpBlock	= (__int32*)(lpStream);
	char *lpChar			= ((char*)&Init.Keys.iMiddleKey);

	while(iBlockCount)
	{
		(*(lpBlock++)) ^= iTempMiddleKey;
		iBlockCount--;
	}
	while(iRemainCount)
	{
		lpStream[iPos++]	^=	(*(lpChar+iRemainCount));
		iRemainCount--;
	}
	return;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////
void CHSEL_STREAM::DESLeftEncode_Type_2(char *lpStream,const __int32 iStreamSize)
{
	iTempLeftKey	= Init.Keys.iLeftKey;//Ŭ  LeftKey 
	iBlockCount		= (iStreamSize>>2);	//   == __int32 iBlockCount = iStreamSize/4;
	iRemainCount	= (iStreamSize&3);	//¥  ޱ==__int32 iRemainCount = iStreamSize%4; 
	iPos			= (iBlockCount<<2);	//Ʈ  ġ iBlockCount*4
	__int32 *lpBlock	= (__int32*)lpStream;//ȣ*    
	char *lpChar			= ((char *)&(Init.Keys.iLeftKey));
	
	while(iBlockCount)
	{
		(*lpBlock)		+=	(iTempLeftKey);
		(iTempLeftKey)	=	(*(lpBlock++));
		(iBlockCount--);
	}
	while(iRemainCount)
	{
		lpStream[iPos++]	+=	(*(lpChar+iRemainCount));
		(iRemainCount--);
	}
	return;
}

void CHSEL_STREAM::DESLeftDecode_Type_2(char *lpStream,const __int32 iStreamSize)//̿ ̳ʽ  .
{
	iTempLeftKey	= Init.Keys.iLeftKey;//Ŭ  LeftKey 
	iBlockCount		= (iStreamSize>>2); //   == __int32 iBlockCount = iStreamSize/4;
	iRemainCount	= (iStreamSize&3);//¥  ޱ==__int32 iRemainCount = iStreamSize%4; 
	iPos			= (iBlockCount<<2);
	__int32 *lpBlock	= (__int32*)lpStream;//ȣ*    
	char *lpChar		= ((char *)&Init.Keys.iLeftKey);

	lpBlock			+=	(iBlockCount-1);
	(iTempLeftKey)	=	(*(lpBlock-1));

	while(	1	<	iBlockCount)
	{
		(*(lpBlock--))	-=	(iTempLeftKey);
		(iTempLeftKey)	=	(*(lpBlock-1))	;
		(iBlockCount--);
	}

	if(iBlockCount)
	{
		(*lpBlock)	-=	(Init.Keys.iLeftKey);
	}

	while(iRemainCount)
	{
		lpStream[iPos++]	-=	(*(lpChar+iRemainCount));
		(iRemainCount--);
	}
	return;
}

void CHSEL_STREAM::DESRightEncode_Type_2(char *lpStream,const __int32 iStreamSize)//̿ ̳ʽ  .
{
	iTempRightKey	= Init.Keys.iRightKey;//Ŭ  RightKey 
	iBlockCount		= iStreamSize>>2;	//   == __int32 iBlockCount = iStreamSize/4;
	iRemainCount	= iStreamSize&3;	//¥  ޱ==__int32 iRemainCount = iStreamSize%4; 
	iPos			= (iBlockCount<<2);			//Ʈ  ġ iBlockCount*4
	__int32 *lpBlock	= (__int32*)(lpStream+iPos+iRemainCount);
	char *lpChar	= ((char *)&Init.Keys.iRightKey);

	lpBlock = (__int32*)(lpStream+iStreamSize-4);
	
	while(iBlockCount)
	{
		(*lpBlock)		+=	(iTempRightKey);
		(iTempRightKey)	=	(*(lpBlock--));
		iBlockCount--;
	}

	while(iRemainCount)
	{
		lpStream[--iRemainCount]	+=	(*(lpChar+iRemainCount));
	}
	return;
}

void CHSEL_STREAM::DESRightDecode_Type_2(char *lpStream,const __int32 iStreamSize)//̿ ̳ʽ  .
{
	iTempRightKey	= Init.Keys.iRightKey;//Ŭ  RightKey 
	iBlockCount		= iStreamSize>>2;	//   == __int32 iBlockCount = iStreamSize/4;
	iRemainCount	= iStreamSize&3;	//¥  ޱ==__int32 iRemainCount = iStreamSize%4; 
	iPos			= (iBlockCount<<2);			//Ʈ  ġ iBlockCount*4
	__int32 *lpBlock	= (__int32*)(lpStream+iRemainCount);
	char *lpChar	= ((char *)&Init.Keys.iRightKey);

	iTempRightKey	= *(lpBlock+1);
	
	while(1 < iBlockCount)
	{
		(*(lpBlock++))	-=	(iTempRightKey);
		iTempRightKey	=	(*(lpBlock+1));
		iBlockCount--;
	}
	
	if(iBlockCount)
	{
		*(lpBlock)		-=	(Init.Keys.iRightKey);
	}

	while(iRemainCount)
	{
		lpStream[--iRemainCount]	-=	(*(lpChar+iRemainCount));
	}
	
	return;
}

void CHSEL_STREAM::DESMiddleEncode_Type_2(char *lpStream,const __int32 iStreamSize)//̿ ̳ʽ  .
{
	iTempMiddleKey	= Init.Keys.iMiddleKey;//Ŭ  MiddleKey 
	iBlockCount		= iStreamSize>>2;	//   == __int32 iBlockCount = iStreamSize/4;
	iRemainCount	= iStreamSize&3;	//¥  ޱ==__int32 iRemainCount = iStreamSize%4; 
	iPos			= (iBlockCount<<2);			//Ʈ  ġ iBlockCount*4
	__int32 *lpBlock	= (__int32*)(lpStream);
	char *lpChar	= ((char *)&Init.Keys.iMiddleKey);

	while(iBlockCount)
	{
		(*(lpBlock++)) += iTempMiddleKey;
		iBlockCount--;
	}
	while(iRemainCount)
	{
		lpStream[iPos++]	+=	(*(lpChar+iRemainCount));
		iRemainCount--;
	}

	return;
}

void CHSEL_STREAM::DESMiddleDecode_Type_2(char *lpStream,const __int32 iStreamSize)//̿ ̳ʽ  .
{
	iTempMiddleKey	= Init.Keys.iMiddleKey;//Ŭ  MiddleKey 
	iBlockCount		= iStreamSize>>2;	//   == __int32 iBlockCount = iStreamSize/4;
	iRemainCount	= iStreamSize&3;	//¥  ޱ==__int32 iRemainCount = iStreamSize%4; 
	iPos			= (iBlockCount<<2);			//Ʈ  ġ iBlockCount*4
	__int32 *lpBlock	= (__int32*)(lpStream);
	char *lpChar			= ((char*)&Init.Keys.iMiddleKey);
	
	while(iBlockCount)
	{
		(*(lpBlock++)) -= iTempMiddleKey;
		iBlockCount--;
	}
	while(iRemainCount)
	{
		lpStream[iPos++]	-=	(*(lpChar+iRemainCount));
		iRemainCount--;
	}
	return;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////
void CHSEL_STREAM::DESLeftEncode_Type_3(char *lpStream,const __int32 iStreamSize)
{
	iTempLeftKey	= Init.Keys.iLeftKey;//Ŭ  LeftKey 
	iBlockCount		= (iStreamSize>>2);	//   == __int32 iBlockCount = iStreamSize/4;
	iRemainCount	= (iStreamSize&3);	//¥  ޱ==__int32 iRemainCount = iStreamSize%4; 
	iPos			= (iBlockCount<<2);	//Ʈ  ġ iBlockCount*4
	__int32 *lpBlock	= (__int32*)lpStream;//ȣ*    
	char *lpChar			= ((char *)&(Init.Keys.iLeftKey));
	
	while(iBlockCount)
	{
		(*lpBlock)		-=	(iTempLeftKey);
		(iTempLeftKey)	=	(*(lpBlock++));
		(iBlockCount--);
	}
	while(iRemainCount)
	{
		lpStream[iPos++]	-=	(*(lpChar+iRemainCount));
		(iRemainCount--);
	}
	return;
}

void CHSEL_STREAM::DESLeftDecode_Type_3(char *lpStream,const __int32 iStreamSize)//̿ ̳ʽ  .
{
	
	iTempLeftKey	= Init.Keys.iLeftKey;//Ŭ  LeftKey 
	iBlockCount		= (iStreamSize>>2); //   == __int32 iBlockCount = iStreamSize/4;
	iRemainCount	= (iStreamSize&3);//¥  ޱ==__int32 iRemainCount = iStreamSize%4; 
	iPos			= (iBlockCount<<2);
	
	__int32 *lpBlock	= (__int32*)lpStream;//ȣ*    
	char *lpChar		= ((char *)&Init.Keys.iLeftKey);

	lpBlock			+=	(iBlockCount-1);
	(iTempLeftKey)	=	(*(lpBlock-1));

	while(	1	<	iBlockCount)
	{
		(*(lpBlock--))	+=	(iTempLeftKey);
		(iTempLeftKey)	=	(*(lpBlock-1));
		(iBlockCount--);
	}

	if(iBlockCount)
	{
		(*lpBlock)	+=	(Init.Keys.iLeftKey);
	}

	while(iRemainCount)
	{
		lpStream[iPos++]	+=	(*(lpChar+iRemainCount));
		(iRemainCount--);
	}
	return;
}

void CHSEL_STREAM::DESRightEncode_Type_3(char *lpStream,const __int32 iStreamSize)//̿ ̳ʽ  .
{
	iTempRightKey	= Init.Keys.iRightKey;//Ŭ  RightKey 
	iBlockCount		= iStreamSize>>2;	//   == __int32 iBlockCount = iStreamSize/4;
	iRemainCount	= iStreamSize&3;	//¥  ޱ==__int32 iRemainCount = iStreamSize%4; 
	iPos			= (iBlockCount<<2);			//Ʈ  ġ iBlockCount*4
	__int32 *lpBlock	= (__int32*)(lpStream+iPos+iRemainCount);
	char *lpChar	= ((char *)&Init.Keys.iRightKey);
	
	lpBlock = (__int32*)(lpStream+iStreamSize-4);
	
	while(iBlockCount)
	{
		(*lpBlock)		-=	(iTempRightKey);
		(iTempRightKey)	=	(*(lpBlock--));
		iBlockCount--;
	}

	while(iRemainCount)
	{
		lpStream[--iRemainCount]	-=	(*(lpChar+iRemainCount));
	}
	return;
}

void CHSEL_STREAM::DESRightDecode_Type_3(char *lpStream,const __int32 iStreamSize)//̿ ̳ʽ  .
{
	iTempRightKey	= Init.Keys.iRightKey;//Ŭ  RightKey 
	iBlockCount		= iStreamSize>>2;	//   == __int32 iBlockCount = iStreamSize/4;
	iRemainCount	= iStreamSize&3;	//¥  ޱ==__int32 iRemainCount = iStreamSize%4; 
	iPos			= (iBlockCount<<2);			//Ʈ  ġ iBlockCount*4
	__int32 *lpBlock	= (__int32*)(lpStream+iRemainCount);
	char *lpChar	= ((char *)&Init.Keys.iRightKey);

	iTempRightKey	= *(lpBlock+1);
	
	while(1 < iBlockCount)
	{
		(*(lpBlock++))	+=	(iTempRightKey);
		iTempRightKey	=	(*(lpBlock+1));
		iBlockCount--;
	}
	
	if(iBlockCount)
	{
		*(lpBlock)		+=	(Init.Keys.iRightKey);
	}

	while(iRemainCount)
	{
		lpStream[--iRemainCount]	+=	(*(lpChar+iRemainCount));
	}
	
	return;
}

void CHSEL_STREAM::DESMiddleEncode_Type_3(char *lpStream,const __int32 iStreamSize)//̿ ̳ʽ  .
{
	iTempMiddleKey	= Init.Keys.iMiddleKey;//Ŭ  MiddleKey 
	iBlockCount		= iStreamSize>>2;	//   == __int32 iBlockCount = iStreamSize/4;
	iRemainCount	= iStreamSize&3;	//¥  ޱ==__int32 iRemainCount = iStreamSize%4; 
	iPos			= (iBlockCount<<2);			//Ʈ  ġ iBlockCount*4
	__int32 *lpBlock	= (__int32*)(lpStream);
	char *lpChar	= ((char *)&Init.Keys.iMiddleKey);

	while(iBlockCount)
	{
		(*(lpBlock++)) -= iTempMiddleKey;
		iBlockCount--;
	}
	while(iRemainCount)
	{
		lpStream[iPos++]	-=	(*(lpChar+iRemainCount));
		iRemainCount--;
	}

	return;
}

void CHSEL_STREAM::DESMiddleDecode_Type_3(char *lpStream,const __int32 iStreamSize)//̿ ̳ʽ  .
{
	iTempMiddleKey	= Init.Keys.iMiddleKey;//Ŭ  MiddleKey 
	iBlockCount		= iStreamSize>>2;	//   == __int32 iBlockCount = iStreamSize/4;
	iRemainCount	= iStreamSize&3;	//¥  ޱ==__int32 iRemainCount = iStreamSize%4; 
	iPos			= (iBlockCount<<2);	//Ʈ  ġ iBlockCount*4
	
	__int32 *lpBlock	= (__int32*)(lpStream);
	char *lpChar			= ((char*)&Init.Keys.iMiddleKey);
	
	while(iBlockCount)
	{
		(*(lpBlock++)) += iTempMiddleKey;
		iBlockCount--;
	}
	while(iRemainCount)
	{
		lpStream[iPos++]	+=	(*(lpChar+iRemainCount));
		iRemainCount--;
	}
	return;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////
void CHSEL_STREAM::DESLeftEncode_Type_4(char *lpStream,const __int32 iStreamSize)
{
	iTempLeftKey	= Init.Keys.iLeftKey;//Ŭ  LeftKey 
	iBlockCount		= (iStreamSize>>2);	//   == __int32 iBlockCount = iStreamSize/4;
	iRemainCount	= (iStreamSize&3);	//¥  ޱ==__int32 iRemainCount = iStreamSize%4; 
	iPos			= (iBlockCount<<2);	//Ʈ  ġ iBlockCount*4
	
	__int32 *lpBlock	= (__int32*)lpStream;//ȣ*    
	char *lpChar			= ((char *)&(Init.Keys.iLeftKey));
	
	while(iBlockCount)
	{
		(*lpBlock)		-=	(iTempLeftKey);
		(iTempLeftKey)	=	(*(lpBlock++));
		(iBlockCount--);
	}
	while(iRemainCount)
	{
		lpStream[iPos++]	^=	(*(lpChar+iRemainCount));
		(iRemainCount--);
	}
	return;
}

void CHSEL_STREAM::DESLeftDecode_Type_4(char *lpStream,const __int32 iStreamSize)//̿ ̳ʽ  .
{
	iTempLeftKey	= Init.Keys.iLeftKey;//Ŭ  LeftKey 
	iBlockCount		= (iStreamSize>>2); //   == __int32 iBlockCount = iStreamSize/4;
	iRemainCount	= (iStreamSize&3);//¥  ޱ==__int32 iRemainCount = iStreamSize%4; 
	iPos			= (iBlockCount<<2);
	
	__int32 *lpBlock	= (__int32*)lpStream;//ȣ*    
	char *lpChar		= ((char *)&Init.Keys.iLeftKey);

	lpBlock			+=	(iBlockCount-1);
	(iTempLeftKey)	=	(*(lpBlock-1));

	while(	1	<	iBlockCount)
	{
		(*(lpBlock--))	+=	(iTempLeftKey);
		(iTempLeftKey)	=	(*(lpBlock-1));
		(iBlockCount--);
	}

	if(iBlockCount)
	{
		(*lpBlock)	+=	(Init.Keys.iLeftKey);
	}

	while(iRemainCount)
	{
		lpStream[iPos++]	^=	(*(lpChar+iRemainCount));
		(iRemainCount--);
	}
	return;
}

void CHSEL_STREAM::DESRightEncode_Type_4(char *lpStream,const __int32 iStreamSize)//̿ ̳ʽ  .
{
	iTempRightKey	= Init.Keys.iRightKey;//Ŭ  RightKey 
	iBlockCount		= iStreamSize>>2;	//   == __int32 iBlockCount = iStreamSize/4;
	iRemainCount	= iStreamSize&3;	//¥  ޱ==__int32 iRemainCount = iStreamSize%4; 
	iPos			= (iBlockCount<<2);			//Ʈ  ġ iBlockCount*4
	
	__int32 *lpBlock	= (__int32*)(lpStream+iStreamSize-4);
	char *lpChar	= ((char *)&Init.Keys.iRightKey);
	
	while(iBlockCount)
	{
		(*lpBlock)		+=	(iTempRightKey);
		(iTempRightKey)	=	(*(lpBlock--));
		iBlockCount--;
	}

	while(iRemainCount)
	{
		lpStream[--iRemainCount]	^=	(*(lpChar+iRemainCount));
	}
	return;
}

void CHSEL_STREAM::DESRightDecode_Type_4(char *lpStream,const __int32 iStreamSize)//̿ ̳ʽ  .
{
	iTempRightKey	= Init.Keys.iRightKey;//Ŭ  RightKey 
	iBlockCount		= iStreamSize>>2;	//   == __int32 iBlockCount = iStreamSize/4;
	iRemainCount	= iStreamSize&3;	//¥  ޱ==__int32 iRemainCount = iStreamSize%4; 
	iPos			= (iBlockCount<<2);			//Ʈ  ġ iBlockCount*4
	
	__int32 *lpBlock	= (__int32*)(lpStream+iRemainCount);
	char *lpChar	= ((char *)&Init.Keys.iRightKey);

	iTempRightKey	= *(lpBlock+1);
	
	while(1 < iBlockCount)
	{
		(*(lpBlock++))	-=	(iTempRightKey);
		iTempRightKey	=	(*(lpBlock+1));
		iBlockCount--;
	}
	
	if(iBlockCount)
	{
		*(lpBlock)		-=	(Init.Keys.iRightKey);
	}
	while(iRemainCount)
	{
		lpStream[--iRemainCount]	^=	(*(lpChar+iRemainCount));
	}
	
	return;
}

void CHSEL_STREAM::DESMiddleEncode_Type_4(char *lpStream,const __int32 iStreamSize)//̿ ̳ʽ  .
{
	iTempMiddleKey	= Init.Keys.iMiddleKey;//Ŭ  MiddleKey 
	iBlockCount		= iStreamSize>>2;	//   == __int32 iBlockCount = iStreamSize/4;
	iRemainCount	= iStreamSize&3;	//¥  ޱ==__int32 iRemainCount = iStreamSize%4; 
	iPos			= (iBlockCount<<2);			//Ʈ  ġ iBlockCount*4

	__int32 *lpBlock = (__int32*)(lpStream);
	char *lpChar = ((char *)&Init.Keys.iMiddleKey);

	while(iBlockCount)
	{
		(*(lpBlock++)) ^= iTempMiddleKey;
		iBlockCount--;
	}
	while(iRemainCount)
	{
		lpStream[iPos++]	+=	(*(lpChar+iRemainCount));
		iRemainCount--;
	}

	return;
}

void CHSEL_STREAM::DESMiddleDecode_Type_4(char *lpStream,const __int32 iStreamSize)//̿ ̳ʽ  .
{
	iTempMiddleKey	= Init.Keys.iMiddleKey;//Ŭ  MiddleKey 
	iBlockCount		= iStreamSize>>2;	//   == __int32 iBlockCount = iStreamSize/4;
	iRemainCount	= iStreamSize&3;	//¥  ޱ==__int32 iRemainCount = iStreamSize%4; 
	iPos			= (iBlockCount<<2);	//Ʈ  ġ iBlockCount*4

	__int32 *lpBlock = (__int32*)(lpStream);
	char *lpChar = ((char*)&Init.Keys.iMiddleKey);

	while(iBlockCount)
	{
		(*(lpBlock++)) ^= iTempMiddleKey;
		iBlockCount--;
	}
	while(iRemainCount)
	{
		lpStream[iPos++]	-=	(*(lpChar+iRemainCount));
		iRemainCount--;
	}
	return;
}
tachikomajocks is offline  
Old   #13
 
elite*gold: 0
Join Date: Dec 2010
Posts: 8
Received Thanks: 0
anyone still working on the decrypter?


raider101 is offline  
Reply



« Previous Thread | Next Thread »

Similar Threads
BOI Packet Encryption
I've made some research about the packet encryption used in this game and I thought I'd share them. BOI uses a simple XOR-Algorithm. Each byte of...
13 Replies - Battle of the Immortals
Packet encryption.
Not sure if anyone has tried making a proxy yet, other than the one that is stickied (which is injected and I imagine directly hooks the games send...
2 Replies - Shaiya
Help with Packet Encryption?
can someone help with these packets? im completely lost lol.i typed in A,B,ABC aand recorded the 3 packets A 2C 35 52 66 BF 66 15 E1 2C 3A D6...
9 Replies - General Coding
Packet Encryption
so heute mal nichts zu tun also hab ich mal nach einem opfer ausschau gehalten und stie dabei auf steam steam ist wie vermutlich jeder wei eine...
4 Replies - General Coding
Packet encryption
Hi,I&#39;m trying to make a simple L2 bot, but i got stuck in begginning - in the packet encryption. I rewrote the l2j login thread sources (those about...
1 Replies - Lineage 2



All times are GMT +1. The time now is 07:47.


Powered by vBulletin®
Copyright ©2000 - 2016, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.

Support | Contact Us | FAQ | Advertising | Privacy Policy
Copyright ©2016 elitepvpers All Rights Reserved.