Advertisement
Guest User

Untitled

a guest
Jun 25th, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.79 KB | None | 0 0
  1. <?php
  2. error_reporting(E_ALL);
  3. /*
  4. These functions are to decrypt and encrypt FL saves using PHP.
  5. Written by Juni.
  6. Some fixes by OutCast.
  7. Based on flcodec.
  8. */
  9.  
  10. function load_flchar($filename)
  11. {
  12. $content = file_get_contents($filename);
  13. $res = "";
  14. if($content)
  15. {
  16. $gene = "Gene";
  17. $l = filesize($filename) - 4;
  18. $i = 0;
  19. $p = 4;
  20. while($i < $l)
  21. {
  22. $c = ord($content{$p});
  23. $k = (ord($gene{$i % 4}) + $i) % 256;
  24. $r = $c ^ ( $k | 0x80 );
  25. $res .= chr($r);
  26. $i++; $p++;
  27. }
  28. }
  29. else echo ("Can't open file: ".$filename);
  30. return $res;
  31. }
  32. //Removed the encryption one because we don't need it for this :P
  33.  
  34. $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");
  35.  
  36. $path_to_files = "C:\Documents and Settings\\root.FMSRV1\My Documents\My Games\Freelancer\Accts\MultiPlayer\\";
  37. class databaseAccess extends SQLite3
  38. {
  39. function __construct()
  40. {
  41. $this->open("C:\Documents and Settings\\root.FMSRV1\My Documents\My Games\Freelancer\Accts\MultiPlayer\dsam.db");
  42. }
  43. }
  44. $db = new databaseAccess();
  45. $dirs = scandir($path_to_files);
  46. foreach($dirs as $dir){
  47. if(in_array($dir,$disabled_dirs_and_files)){}
  48. else{
  49. $char_files = scandir($path_to_files.$dir."\\");
  50. foreach($char_files as $file){
  51. if(in_array($file,$disabled_dirs_and_files)){}
  52. else{
  53. if(stristr($file, "login_") === FALSE){
  54. //echo str_replace("\n","<br>\n",load_flchar($path_to_files.$dir."\\".$file));
  55. $query = "SELECT `CharName` FROM `CharacterList` WHERE `CharPath`='".$dir."\\".$file."'";
  56. $result = $db->query($query);
  57. while($row = $result->fetchArray()) {
  58. $char_name = $row['CharName'];
  59. }
  60. if(preg_match("/\[Player\]/",file_get_contents($path_to_files.$dir."\\".$file)) == 0){
  61. $to_check = load_flchar($path_to_files.$dir."\\".$file);
  62. //echo str_replace("\n","<br>\n",load_flchar($path_to_files.$dir."\\".$file));
  63. }
  64. else{
  65. $to_check = file_get_contents($path_to_files.$dir."\\".$file);
  66. //echo str_replace("\n","<br>\n",file_get_contents($path_to_files.$dir."\\".$file));
  67. }
  68. if(preg_match("/house = (-|)(.+?), fc_admin/",$to_check) > 0){
  69. preg_match("/house = (-|)(.+?), fc_admin/",$to_check,$matches);
  70. if($matches[2] > -0.6){
  71. echo "WARNING: fc_admin reputation on character '".$char_name."' (".$dir."\\".$file.") is ".$matches[2].".<br>\n";
  72. }
  73. }
  74.  
  75. if(preg_match("/rep_group = fc_admin/",$to_check) > 0){
  76. echo "WARNING: fc_admin affiliation found on character '".$char_name."' (".$dir."\\".$file.").<br>\n";
  77. }
  78. }
  79. }
  80. }
  81. }
  82. }
  83. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement