Script to analyze DAT Bug

Results 1 to 2 of 2
  1. #1
    Member Makloud is offline
    MemberRank
    Apr 2008 Join Date
    BRLocation
    53Posts

    thumbs up Script to analyze DAT Bug

    System for analysis of specific folders in the folder Dataserver Userdata if there are any. Dat buggy on the server and can jeopardize the stability, as one. Dat buggy can certainly give crash.
    The analysis is done folder by folder to avoid overloading the system, simply enter the folder number, for example the image below.

    PHP Code:
    <?
    //Script Elaborado por Mak
    //ArcadePT - www.arcadept.com
    ?>
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
    </head>

    <body>
    <form id="form1" name="form1" method="post" action="">

      <table width="400" border="0" align="center" cellpadding="6" cellspacing="0">
        <tr>
          <td align="center" bgcolor="#CC9900"><strong>Analisador de userdata com Dat Bugado</strong></td>
        </tr>
        
        <tr>
          <td align="center" bgcolor="#CCCCCC">Selecione a pasta a ser analisada:
            <label>
            <select name="pasta" id="pasta">
              <?
    for($npasta=0;$npasta<=255;$npasta++){
    ?>
              <option value="<?=$npasta?><? if ($_POST['pasta'] == $npasta) echo "selected='selected'"?>>
                <?=$npasta?>
              </option>
              <?
    }
    ?>
            </select>
            </label>
            <label>
            <input type="submit" name="acao" id="acao" value="Analisar" />
            </label></td>
        </tr>
        <tr>
          <td align="right" bgcolor="#CCCCCC"><strong>By Mak</strong></td>
        </tr>
      </table>
    </form>



    <table width="400" border="0" align="center" cellpadding="0" cellspacing="0">
      <tr>
        <td height="50" align="center" bgcolor="#CCCCCC"><?php


    if ($_POST['acao']) {
    $pasta $_POST['pasta'];

    if (!
    $pasta) {

    echo 
    "ERRO: Favor Escolher uma Pasta!";

    } else {

    //Pasta do Servidor
    $diretorio "C:/SeuServer/DataServer/userdata/".$pasta;

    // abre o diretório
    $ponteiro  opendir($diretorio);
    // monta os vetores com os itens encontrados na pasta
    while ($nome_itens readdir($ponteiro)) {
        
    $itens[] = $nome_itens;
    }

    // ordena o vetor de itens
    sort($itens);
    // percorre o vetor para fazer a separacao entre arquivos e pastas
    foreach ($itens as $listar) {
    // retira "./" e "../" para que retorne apenas pastas e arquivos
       
    if ($listar!="." && $listar!=".."){

    // checa se o tipo de arquivo encontrado é uma pasta
               
    if (is_dir($listar)) {
    // caso VERDADEIRO adiciona o item à variável de pastas
                
    $pastas[]=$listar;
            } else{
    // caso FALSO adiciona o item à variável de arquivos
                
    $arquivos[]=$listar;
            }
       }
    }

    // lista os arquivos se houverem
    $c=0;
    if (
    $arquivos != "") {
            
    $conta =0;
    foreach(
    $arquivos as $listar){

    $charDat $diretorio."/".$listar;


            
    $fOpen fopen($charDat"r");
            
    $fRead =fread($fOpen,filesize($charDat));
            @
    fclose($fOpen);
            
            
    //Pegando Level
            
    $charLevel substr($fRead,0xc8,1);
            
    $charLevel ord($charLevel);
            if(!
    is_numeric($charLevel) OR $charLevel == 0) {
            
    $conta=$conta+1;
            echo 
    "$listar <b>Bugado</b><br>";
            }


    }
            if (
    $conta == 0) { echo "Nenhum Data Bugado encontrado!"; }
    }




        }
        }
    ?></td>
      </tr>
    </table>
    </body>
    </html>
    The analysis is based on collecting information from the. Dat would be the case that the level of char, if it is corrupted the level will not be found and so we know that. Dat is buggy.
    In this case we do not have to restore one. Dat buggy, simply identify it.
    Last edited by DarkKnightH20; 27-01-10 at 09:37 AM.


  2. #2
    Omega bobsobol is offline
    MemberRank
    May 2007 Join Date
    UKLocation
    5,702Posts

    Re: Script to analyze DAT Bug

    Sounds intriguing... I wouldn't want this tool to run on my Web Server though.

    I could see it running quite nicely via Windows Task Scheduler / cron, or from Telnet/SSH.



Advertisement