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!

Does anyone have a working password changer php file for the tad file in DBSRV/Accoun

Status
Not open for further replies.
Custom Title Activated
Loyal Member
Joined
Mar 26, 2012
Messages
1,465
Reaction score
131
DBSRV/Account???????? working password changer php code? this is what i have so far with no luck what so ever in the account file but, works in the sql server with no problems. thank you
$fp = fopen("C:/kathana6/DBSRV/Share/Serv02/new/$UserID.txt","w");
fwrite($fp,$UserID."\r\n");
fwrite($fp,$password."\r\n");
fwrite($fp,"000000\r\n");
fwrite($fp,$userkey."\r\n");
$userid = $_SESSION['username'];
$password2 = strtoupper(md5($newpass));
$initial=substr($userid,0,1);
if (ereg("^[a-zA-Z]$",$initial))
{
$initial=strtoupper($initial);
}
else
{
$initial="etc";
}
$accdir=("C:\kathana6\DBSRV\Account");
$f=fopen("./inc/sample.tad", "r");
$f=@fopen($accdir."\\".$initial."\\".$userid.".TAD",r) or die("Error");
$acc = @fread($f,7124);
$demopass=substr($acc,52,32);
$acc = str_replace($demopass,$password2,$acc);
$f2=@fopen($accdir."\\".$initial."\\".$userid.".TAD",w);
@fwrite($f2,$acc) or die("Error");
@fclose($f);
fclose($fp);
 
Last edited:
Newbie Spellweaver
Joined
Nov 5, 2011
Messages
96
Reaction score
6
your script just need simple adjustment and it will run correctly
 
Newbie Spellweaver
Joined
Nov 5, 2011
Messages
96
Reaction score
6
$demopass=substr($acc,52,32);

with

$demopass=substr($acc,52,36);

i think this is the answer

if still not correct than we should re check it again ^^
 
Newbie Spellweaver
Joined
Nov 5, 2011
Messages
96
Reaction score
6
php is a hard things for me

i've made tad extraction tool but in delphi

here is the image, but i hide username and password for privacy
 
Custom Title Activated
Loyal Member
Joined
Mar 26, 2012
Messages
1,465
Reaction score
131
php is a hard things for me

i've made tad extraction tool but in delphi

here is the image, but i hide username and password for privacy

do you have a copy of this tool you can share? also php isn't much more difficult than dos but, the md5 configuration is quite a task to get correct. thanx
 
Newbie Spellweaver
Joined
Nov 5, 2011
Messages
96
Reaction score
6
sorry i cant share it due to my contract with neo-zoominc
 
Custom Title Activated
Loyal Member
Joined
Mar 26, 2012
Messages
1,465
Reaction score
131
i see how it is. well see if they would be willing to at least allow a sharing of the password change php code so that i can fix it. thank you.
 
Newbie Spellweaver
Joined
Nov 5, 2011
Messages
96
Reaction score
6
just 1 question .. why you need to open sample.dat if you just want to change password?

Code:
$userid = $_SESSION['username'];
$password2 = strtoupper(md5($newpass));
$initial=substr($userid,0,1);
// Looking for directory at account folder
if (ereg("^[a-zA-Z]$",$initial))
{
   $initial=strtoupper($initial);
}
else
{
   $initial="etc";
}


// Base directory for account
$accdir=("C:\kathana6\DBSRV\Account");

// Open and read file
$f=@fopen($accdir."\\".$initial."\\".$userid.".TAD",r) or die("Error");
$acc = @fread($f,7124);

// Close file
@fclose($f);

// Read password
$demopass=substr($acc,51,36); // start from 52th byte for 36 bytes

// Replace old password to new password
$acc = str_replace($demopass,$password2,$acc);

// Open WRITE
$f2=@fopen($accdir."\\".$initial."\\".$userid.".TAD",w);
@fwrite($f2,$acc) or die("Error")

// Clean Up--

fclose($f2);
 
Last edited:
Custom Title Activated
Loyal Member
Joined
Mar 26, 2012
Messages
1,465
Reaction score
131
didn't know if i needed it or not. thanx

also on another note i get an error in dreamweaver line 102 not sure why this is. but, this is the last line of code you have given me

nevermind i figured it out lol you are missing semicolon after @fwrite($f2,$acc) or die("Error") LOL

Awesome help bro!!!!! All works fine now. I can change the password in both the website and the .tad file now with no issues at all.

didn't know if i needed it or not. thanx

also on another note i get an error in dreamweaver line 102 not sure why this is. but, this is the last line of code you have given me

nevermind i figured it out lol you are missing semicolon after @fwrite($f2,$acc) or die("Error") LOL

Awesome help bro!!!!! All works fine now. I can change the password in both the website and the .tad file now with no issues at all.

Ok I know that it is changing the md5 code in the tad file correctly but, why is it when I try to log in that it says Connection to server has failed?
 
Newbie Spellweaver
Joined
Nov 5, 2011
Messages
96
Reaction score
6
I don't know if it is a correct code but just try it first ^^
Code:
$userid = $_SESSION['username'];
$password2 = strtoupper(md5($newpass));
$initial=substr($userid,0,1);
// Looking for directory at account folder
if (ereg("^[a-zA-Z]$",$initial))
{
   $initial=strtoupper($initial);
}
else
{
   $initial="etc";
}


// Base directory for account
$accdir=("C:\kathana6\DBSRV\Account");

// Open and read file
$f=@fopen($accdir."\\".$initial."\\".$userid.".TAD",r) or die("Error");
$acc = @fread($f,7124);

// Close file
@fclose($f);

// Read password
$demopass=substr($acc,51,36); // start from 52th byte for 36 bytes

// Formatting password
$temppass = array (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); // Make sure it is 36 bytes
for(i=0; i<strlen($password2); i++)
{
   $temppass[i] = ord($password2[i]); // not sure only ord or ordutf8
}

// Replace old password to new password
$acc = str_replace($demopass,$temppass,$acc);

// Open WRITE
$f2=@fopen($accdir."\\".$initial."\\".$userid.".TAD",w);
@fwrite($f2,$acc) or die("Error");

// Clean Up--

fclose($f2);
 
Custom Title Activated
Loyal Member
Joined
Mar 26, 2012
Messages
1,465
Reaction score
131
i think your first code is correct other than it deletes more than it should like character name was Drayko and the md5 code was followed by yko which was the last of the character name. anyhow if i haven't said it Thank you for all your help so far.
also in your new code there is an error on this line but, not sure what it is. perhaps you know what it is
for(i=0; i<strlen($password2); i++)
 
Custom Title Activated
Loyal Member
Joined
Mar 26, 2012
Messages
1,465
Reaction score
131
good idea it's so good to share lol

i have been modding the heck out of the zone gamers web template and have it mostly working except the gmadminpanel and the password change so far. it changes the pass for the site with no issues but, still a work in progress for the .tad file lol
 
Newbie Spellweaver
Joined
Nov 5, 2011
Messages
96
Reaction score
6
forgot the '$'

Code:
for($i=0; $i<strlen($password2); $i++)
{
   $temppass[$i] = ord($password2[$i]); // not sure only ord or ordutf8
}
 
Banned
Banned
Joined
Mar 9, 2008
Messages
93
Reaction score
20
Este es el codigo reparado, se puede mejorar más.
$fp = fopen("C:/kathana6/DBSRV/Share/Serv02/new/$UserID.txt","w");
fwrite($fp,$UserID."\r\n");
fwrite($fp,$password."\r\n");
fwrite($fp,"000000\r\n");
fwrite($fp,$userkey."\r\n");
@fclose($fp);


$userid = $_SESSION['username'];


$password2 = strtoupper(md5($newpass));


$initial=substr($userid,0,1);
if (ereg("^[a-zA-Z]$",$initial))
{
$initial=strtoupper($initial);
}
else
{
$initial="etc";
}
$accdir=("C:\kathana6\DBSRV\Account");
$f=@fopen($accdir."\\".$initial."\\".$userid.".TAD",r) or die("Error");
$acc = @fread($f,7124);
$demopass=substr($acc,52,32);
$acc = str_replace($demopass,$password2,$acc);
$f2=@fopen($accdir."\\".$initial."\\".$userid.".TAD",w);
@fwrite($f2,$acc) or die("Error");
@fclose($f2);
@fclose($f);
 
Status
Not open for further replies.
Back
Top