Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- error_reporting(E_ALL);
- /*
- These functions are to decrypt and encrypt FL saves using PHP.
- Written by Juni.
- Some fixes by OutCast.
- Based on flcodec.
- */
- function load_flchar($filename)
- {
- $content = file_get_contents($filename);
- $res = "";
- if($content)
- {
- $gene = "Gene";
- $l = filesize($filename) - 4;
- $i = 0;
- $p = 4;
- while($i < $l)
- {
- $c = ord($content{$p});
- $k = (ord($gene{$i % 4}) + $i) % 256;
- $r = $c ^ ( $k | 0x80 );
- $res .= chr($r);
- $i++; $p++;
- }
- }
- else echo ("Can't open file: ".$filename);
- return $res;
- }
- //Removed the encryption one because we don't need it for this :P
- $disabled_dirs_and_files = array(".","..","accounts.cfg","dsam.db","dsam.log","FLServer.cfg","motd.dat","flhookadmin.ini","flhookadmin.ini","banned","admin","name","CheatersDeathBackup_cheaters.log","bounties.txt","cheaters.log","flhook_cheaters.log","flhook_kicks.log");
- $path_to_files = "C:\Documents and Settings\\root.FMSRV1\My Documents\My Games\Freelancer\Accts\MultiPlayer\\";
- class databaseAccess extends SQLite3
- {
- function __construct()
- {
- $this->open("C:\Documents and Settings\\root.FMSRV1\My Documents\My Games\Freelancer\Accts\MultiPlayer\dsam.db");
- }
- }
- $db = new databaseAccess();
- $dirs = scandir($path_to_files);
- foreach($dirs as $dir){
- if(in_array($dir,$disabled_dirs_and_files)){}
- else{
- $char_files = scandir($path_to_files.$dir."\\");
- foreach($char_files as $file){
- if(in_array($file,$disabled_dirs_and_files)){}
- else{
- if(stristr($file, "login_") === FALSE){
- //echo str_replace("\n","<br>\n",load_flchar($path_to_files.$dir."\\".$file));
- $query = "SELECT `CharName` FROM `CharacterList` WHERE `CharPath`='".$dir."\\".$file."'";
- $result = $db->query($query);
- while($row = $result->fetchArray()) {
- $char_name = $row['CharName'];
- }
- if(preg_match("/\[Player\]/",file_get_contents($path_to_files.$dir."\\".$file)) == 0){
- $to_check = load_flchar($path_to_files.$dir."\\".$file);
- //echo str_replace("\n","<br>\n",load_flchar($path_to_files.$dir."\\".$file));
- }
- else{
- $to_check = file_get_contents($path_to_files.$dir."\\".$file);
- //echo str_replace("\n","<br>\n",file_get_contents($path_to_files.$dir."\\".$file));
- }
- if(preg_match("/house = (-|)(.+?), fc_admin/",$to_check) > 0){
- preg_match("/house = (-|)(.+?), fc_admin/",$to_check,$matches);
- if($matches[2] > -0.6){
- echo "WARNING: fc_admin reputation on character '".$char_name."' (".$dir."\\".$file.") is ".$matches[2].".<br>\n";
- }
- }
- if(preg_match("/rep_group = fc_admin/",$to_check) > 0){
- echo "WARNING: fc_admin affiliation found on character '".$char_name."' (".$dir."\\".$file.").<br>\n";
- }
- }
- }
- }
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement