Register for your free account! | Forgot your password?

You last visited: Today at 13:53

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

Advertisement



C++ Password Seed

Discussion on C++ Password Seed within the CO2 Private Server forum part of the Conquer Online 2 category.

Reply
 
Old   #1
 
Mr_PoP's Avatar
 
elite*gold: 0
Join Date: Apr 2008
Posts: 759
Received Thanks: 285
C++ Password Seed

Quote:
Nullable
Code:
typedef struct packetSeed
{
    unsigned short Length; // 0x8
    unsigned short Type; // 0x423
    unsigned int Seed; // random
} * PPACKETSEED;
so it should go like this

8 bytes (length, type and then a random int pass seed)

the random pass << means i should make a rand of some letter and numbers then encrypt it ?
Mr_PoP is offline  
Old 02/12/2011, 00:29   #2
 
elite*gold: 21
Join Date: Jul 2005
Posts: 9,193
Received Thanks: 5,376
seeing as I said a random int seed that would mean the value of it should be an int.

Simply generate a random number and write it to the password seed and send to the client. Client should now respond with the auth request packet which you will need to then read the relevant sections, setup your password encryption using the seed you sent in the first packet and the username you read from the auth request packet and run it through password decryption to get the users password. You can then continue with login procedure like normal (IE: Confirm all information from the client and then send the corresponding auth response packet and continue to game server)
pro4never is offline  
Thanks
1 User
Old 02/12/2011, 01:38   #3
 
Mr_PoP's Avatar
 
elite*gold: 0
Join Date: Apr 2008
Posts: 759
Received Thanks: 285
Quote:
Originally Posted by pro4never View Post
seeing as I said a random int seed that would mean the value of it should be an int.

Simply generate a random number and write it to the password seed and send to the client. Client should now respond with the auth request packet which you will need to then read the relevant sections, setup your password encryption using the seed you sent in the first packet and the username you read from the auth request packet and run it through password decryption to get the users password. You can then continue with login procedure like normal (IE: Confirm all information from the client and then send the corresponding auth response packet and continue to game server)
does it matter if the rand was like (22222222) or (11111111) etc?
Mr_PoP is offline  
Old 02/12/2011, 03:35   #4
 
Ian*'s Avatar
 
elite*gold: 0
Join Date: Nov 2006
Posts: 805
Received Thanks: 464
Quote:
Originally Posted by Mr_PoP View Post
does it matter if the rand was like (22222222) or (11111111) etc?
as long as it does not exceed sizeof(int)
Ian* is offline  
Old 02/12/2011, 03:38   #5
 
Mr_PoP's Avatar
 
elite*gold: 0
Join Date: Apr 2008
Posts: 759
Received Thanks: 285
Quote:
Originally Posted by Ian* View Post
as long as it does not exceed sizeof(int)
i made a function to control it
Mr_PoP is offline  
Old 02/12/2011, 03:49   #6
 
Ian*'s Avatar
 
elite*gold: 0
Join Date: Nov 2006
Posts: 805
Received Thanks: 464
Quote:
Originally Posted by Mr_PoP View Post
i made a function to control it
Ian* is offline  
Thanks
1 User
Old 02/12/2011, 13:36   #7
 
Mr_PoP's Avatar
 
elite*gold: 0
Join Date: Apr 2008
Posts: 759
Received Thanks: 285
onther question if i may , can i make it conset or something ??? why should i make it random?!!?
Mr_PoP is offline  
Old 02/12/2011, 19:28   #8
 
elite*gold: 80
Join Date: Sep 2007
Posts: 642
Received Thanks: 168
Quote:
Originally Posted by Mr_PoP View Post
onther question if i may , can i make it conset or something ??? why should i make it random?!!?
It doesn't matter how u come up with the number. Just as long as it doesn't exceed the max size of an int as stated before.
Santa is offline  
Old 02/12/2011, 21:29   #9
 
Mr_PoP's Avatar
 
elite*gold: 0
Join Date: Apr 2008
Posts: 759
Received Thanks: 285
considering my program is just for test so am not using packets

here is the code i made

Code:
                        Auth_Setup();
			CAuthCryptography Dec;
			AuthProtocolCryptographer dec;
			Print("Socket Connected -> %s",inet_ntoa(addr.sin_addr));
			char rSeed[9];
			RandSeed(rSeed);
			send(sListen,rSeed,8,0);
			char buf[1096];
			int buflen=strlen(buf);
			recv(sListen,buf,buflen,0);
			Dec.Decrypt(buf,buf,buflen);
			unsigned char psw[16];
			memcpy(psw,buf+132,16);
			dec.Decrypt(psw,16);
			cout<<psw;
the randseed for make 8 random numbers like =78549621 and its working becuase the client sending back some encrypted letters and at the end the same number i sent to it , when i receved it i tried to decrypt it but it didnt work , i used (Hybridz & Nullable) codes but it didnt work , i know it's sounds mean because I keep asking and it's look like am an stupid but as u know Guys always the 1st time is hardest one lol, so please dont get upset becuase am asking etc , thank u all
Mr_PoP is offline  
Old 02/12/2011, 23:14   #10
 
bone-you's Avatar
 
elite*gold: 20
Join Date: Mar 2006
Posts: 1,491
Received Thanks: 536
Before you continue, you need to manage your sockets properly. Having a single "recv" pull data will cause you a lot of problems later on that you will be unable to identify. What if that single recv returns no data read? Are they blocking sockets? Could I fake being a client to lock your server up indefinitely? What if recv doesn't read the entire packet at once?
bone-you is offline  
Old 02/13/2011, 00:49   #11
 
Mr_PoP's Avatar
 
elite*gold: 0
Join Date: Apr 2008
Posts: 759
Received Thanks: 285
Quote:
Originally Posted by bone-you View Post
Before you continue, you need to manage your sockets properly. Having a single "recv" pull data will cause you a lot of problems later on that you will be unable to identify. What if that single recv returns no data read? Are they blocking sockets? Could I fake being a client to lock your server up indefinitely? What if recv doesn't read the entire packet at once?
yeah yeah , i will do that but once i find the right codes which will allow me to decrypt/encrypt what am geting from the client once i get the (servername,accid,password) i will make a new prog with a manged socket i saw ur source yeah , but it's only i cant decrypt the pass,accid and server name!
Mr_PoP is offline  
Old 02/13/2011, 01:09   #12


 
CptSky's Avatar
 
elite*gold: 0
Join Date: Jan 2008
Posts: 1,434
Received Thanks: 1,147
Quote:
Originally Posted by Mr_PoP View Post
yeah yeah , i will do that but once i find the right codes which will allow me to decrypt/encrypt what am geting from the client once i get the (servername,accid,password) i will make a new prog with a manged socket i saw ur source yeah , but it's only i cant decrypt the pass,accid and server name!
The seed is for the password encryption (RC5). If you can't decrypt the first packet sent by the client, you need to check the auth crypto...
CptSky is offline  
Old 02/13/2011, 19:13   #13
 
unknownone's Avatar
 
elite*gold: 20
Join Date: Jun 2005
Posts: 1,013
Received Thanks: 381
You can't use "any" random numbers. You must use 16 random numbers produced by calling the rand() method. (Which are int16s, but you only need the least sig byte). You must first call srand(packet->Seed)

This works because rand() and srand() are not really random (In Microsoft's implementation). They produce a fixed sequence of integers if seeded by the same number, because it's implementation looks like this.

Code:
int _seed;

int srand(int seed) {
    _seed = seed;
}

short rand() {
    _seed *= 0x343fd;
    _seed += 0x269ec3;
    return (short)((_seed >> 0x10) & 0x7fff);
}
unknownone is offline  
Old 02/13/2011, 19:35   #14
 
elite*gold: 0
Join Date: Sep 2008
Posts: 1,683
Received Thanks: 505
Good luck programming a function that returns a random number.
Basser is offline  
Thanks
1 User
Old 02/13/2011, 19:41   #15
 
Mr_PoP's Avatar
 
elite*gold: 0
Join Date: Apr 2008
Posts: 759
Received Thanks: 285
Quote:
Originally Posted by unknownone View Post
You can't use "any" random numbers. You must use 16 random numbers produced by calling the rand() method. (Which are int16s, but you only need the least sig byte). You must first call srand(packet->Seed)

This works because rand() and srand() are not really random (In Microsoft's implementation). They produce a fixed sequence of integers if seeded by the same number, because it's implementation looks like this.

Code:
int _seed;

int srand(int seed) {
    _seed = seed;
}

short rand() {
    _seed *= 0x343fd;
    _seed += 0x269ec3;
    return (short)((_seed >> 0x10) & 0x7fff);
}
Quote:
Originally Posted by Basser View Post
Good luck programming a function that returns a random number.
well this one works :

Code:
//random seed
void rPassSeed(char *seed)
{
	srand ( time(NULL) );
	char k[8];
	for (int i=0;i<8;i++)
	{
		k[i]=rand()%10;
	}
	sprintf(seed,"%d%d%d%d%d%d%d%d",k[0],k[1],k[2],k[3],k[4],k[5],k[6],k[7]);
}
i made it char so i can use send() function!?
Mr_PoP is offline  
Reply


Similar Threads Similar Threads
Farmerama seed bot
03/06/2012 - Browsergames - 14 Replies
anyone know that game ? farmerama.com its cool game but I need some help ... where I can get seed bot :P ? help me
Seed's ID's
11/12/2011 - Lineage 2 - 1 Replies
Mans need a Seed's ID for Manor System Regards Ty :bandit: :bandit: :bandit: :bandit: :bandit: :bandit:
Seed on mobs
10/05/2009 - Lineage 2 - 10 Replies
I`m using ig walker 2.05 Basic->combact heal->I did activate the Auto Use Seed but i dont`t use them, lf help.
SEED
01/26/2006 - General Gaming Discussion - 1 Replies
Von Dänen entwickeltes MMORPG in Cellshading Style (XVIII oder so...oder wie Xmen Legends 2) http://www.seedthegame.com/news.php



All times are GMT +2. The time now is 13:53.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2024 elitepvpers All Rights Reserved.