Ive seen a lot of ppl asking for a password thing. so here you go... ^-^.
EDIT: sorry i was looking at the wrog file!
PHP:
<?php
/*Should work with most Kal servers, official ones at least. Put ?acc=desiredaccount
-- after the script's filename in the URL... e.g.: http://blabla.com/decrypt.php?acc=fire123
-- */
function strhex($string) {
$hex="";
for ($i=0;$i<strlen($string);$i++)
$hex.=(strlen(dechex(ord($string[$i])))<2)? "0".dechex(ord($string[$i])): dechex(ord($string[$i]));
return $hex;
}
$acc = $_GET['acc']; // -- account name
$char = $_GET['char']; // -- char name
// -- Decrypting arrays...
$array_text = array('!','"','#','$','%','&','\'','(',')','*','+',',','-','.','/','0','1','2','3','4','5','6','7',
'8','9',':',';','<','=','>','?','@','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S',
'T','U','V','W','X','Y','Z','[','\\',']','^','_','`','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o',
'p','q','r','s','t','u','v','w','x','y','z','{','|','}','~');
$array_hex = array('95','88','9D','4C','F2','3E','BB','C0','7F','18','70','A6','E2','EC','77','2C','3A','4A',
'91','5D','7A','29','BC','6E','D4','40','17','2E','CB','72','9C','A1','FF','F3','F8','9B','50','51','6D','E9',
'9A','B8','84','A8','14','38','CE','92','5C','F5','EE','B3','89','7B','A2','AD','71','E3','D5','BF','53','28',
'44','33','48','DB','FC','09','1F','94','12','73','37','82','81','39','C2','8D','7D','08','4F','B0','FE','79',
'0B','D6','23','7C','4B','8E','06','5A','CC','62');
// -- We mustn't forget to connect to SQL uh...
$conn = mssql_connect('********') or die('Couldn\'t connect');
if($char) {
mssql_select_db('***********');
$q_char = mssql_query('SELECT TOP 1 UID FROM Player WHERE Name = \''.$char.'\'');
$c_assoc = mssql_fetch_assoc($q_char);
$uid = $c_assoc['UID'];
mssql_select_db('***********');
$q_acc = mssql_query('SELECT [PWD], ID FROM Login WHERE UID = \''.$uid.'\'');
echo $acc;
} else {
$db = mssql_select_db('***********');
$q_acc = mssql_query('SELECT [PWD], ID FROM Login WHERE ID = \''.$acc.'\'');
}
if(mssql_num_rows($q_acc) != 1) {
echo 'No accounts returned! Please make sure you typed it in right. http://blabla.com/decrypt.php?acc=NAME';
} else {
$assoc = mssql_fetch_assoc($q_acc);
$pass = strtoupper(strhex($assoc['PWD']));
echo 'Account: '.$assoc['ID'];
echo '<br />Encrypted password: 0x'.$pass;
// -- Let's split...
$pass = str_split($pass, 2);
$newpass = '';
foreach($pass as $key => $value) {
$newpass .= str_replace($array_hex, $array_text, $value); // -- return a string after each iteration
}
echo '<br />Decrypted password: '.$newpass;
}
?>