Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

C++ Sql Question

All is well...
Member
Joined
Feb 22, 2006
Messages
1,520
Reaction score
0
Okay I'm not so good with C++ lol
Right now I'm trying to add an sql entry to a pass then rehash it

The problem I'm having is how to add the sql entry to the password.
It goes a little like this lol

Code:
MD5_String(account->passwd, user_password);

That's the line is uses now to convert the entered password to md5. What I want to do now is add a "salt" to it for instance '1T&l' just a random group of 4 characters looking something like this

*******md5hash*******1T&l

The step to add that salt on there is what I'm having difficulty with... lol, it should be pretty simple but uhh... yah hehe

And after that I just want to rehash it putting it in another MD5_String();
Which I'm pretty sure I can do =p

Here's what I posted at eAthena lol, since what I'm trying to mod is eAthena's source. I thought posting it here too might help lol
In what file is the password called at and where is the encoding to md5 at (the server gets the user's inputed password, md5's it, then compares it to the db entry).
I need to find this place so that I can change the password to be hash'ed from a single hashing to a salted hash then rehashed. This helps improve security substantially happy.gif

If you don't understand what I'm asking here's a break down:

// Pre-condition you have a registered password already salted and rehashed
You type in the login password
It converts it to md5 <== This is the location I'm looking for
Adds the salt
Rehashes
Compares database entry
Accepts or denies login

If someone could tell me where to find that, that would be awesome

**Edit**
Hmm wow I suck at C++ lol...
Anyone think they can walk me through it? It's at least worth a try for me to ask hehe
I think I found where but I'm not 100%
I'm messing with line:632'ish with that. I tried a couple of things but they all got errors compiling.

The first thing I tried was making a variable for the 'firsthash' which is the original coding of the line
Code:
MD5_String(account._passwd,user_password);


I tried turning that into a variable and using it something like thist
Code:
char firsthash = MD5_String(account->passwd,user_password);
MD5_String(firsthash + account->salt,salt);

I have no idea if I'm remotely close to getting it lol
But now you can kind of see what I'm trying to accomplish, if it isn't that confusing lol
salt was declared in the login.h as a char and was added to the login info sql query (@ line 592) in login.c
I'm not even 100% if I have the correct query either, but I am relatively sure lol

My error is
error C2120: 'void' illegal with all types

And I've no idea what it means lol
 
Custom Title Activated
Member
Joined
Aug 8, 2004
Messages
3,892
Reaction score
20
http://www.cs.wisc.edu/~hasti/cs368/CppTutorial/NOTES/STRING.html said:
string & append ( other_string )
- appends other_string to this string, and returns a reference to the result string.

That took me a whole 10 seconds to google.. :wink:
 
All is well...
Member
Joined
Feb 22, 2006
Messages
1,520
Reaction score
0
Google doesn't help when you don't know what to google...
Much like how a dictionary doesn't help when you can't spell the word...

A harder than just a google lol

**Edit**
And that doesn't answer my question lol
I'm not adding just a string. It's an sql entry I'm adding to it where the user's info is at.

**Edit2**
Well I did it lol
I figured out the way it worked

Firstly I just had to go through vBulletin's scripts and removed the salt from everything... *tedious* then I had to remod the eAthena source to read the password hashed twice.
 
Last edited:
Junior Spellweaver
Joined
Jul 8, 2005
Messages
135
Reaction score
0
couldent you have easily have used the DoSQl(); command from MySql.h?
 
Banned
Banned
Joined
Mar 30, 2007
Messages
4
Reaction score
0
sage

Google doesn't help when you don't know what to google...
Much like how a dictionary doesn't help when you can't spell the word...
. Read. Learn. Do.

Also, strcat -.-"
 
Back
Top