Reset MBrahmanPoints in both .TAD and MSSQL

Page 2 of 2 FirstFirst 12
Results 16 to 24 of 24
  1. #16
    Tantra Freelancer A v a r a is offline
    MemberRank
    Apr 2014 Join Date
    In Your HeadLocation
    554Posts

    Re: Reset MBrahmanPoints in both .TAD and MSSQL

    Unfortunately this is what happen to the test account.


  2. #17
    Enthusiast alxndr is offline
    MemberRank
    Nov 2012 Join Date
    Lima, PerúLocation
    45Posts

    Re: Reset MBrahmanPoints in both .TAD and MSSQL

    @A v a r a, that is some nice corrupted TAD you got there XD .. post the original TAD and the modified one to see what could have happen, and tell what version of php are you using.

  3. #18
    Tantra Freelancer A v a r a is offline
    MemberRank
    Apr 2014 Join Date
    In Your HeadLocation
    554Posts

    Re: Reset MBrahmanPoints in both .TAD and MSSQL

    Quote Originally Posted by alxndr View Post
    @A v a r a, that is some nice corrupted TAD you got there XD .. post the original TAD and the modified one to see what could have happen, and tell what version of php are you using.
    Php Version 5.3

    This is the TAD files (Original and modified) -P.rar

  4. #19
    Enthusiast alxndr is offline
    MemberRank
    Nov 2012 Join Date
    Lima, PerúLocation
    45Posts

    Re: Reset MBrahmanPoints in both .TAD and MSSQL

    @A v a r a, did you modify the php script? if so, please post your final code.

  5. #20
    Tantra Freelancer A v a r a is offline
    MemberRank
    Apr 2014 Join Date
    In Your HeadLocation
    554Posts

    Re: Reset MBrahmanPoints in both .TAD and MSSQL

    This is the final script I used.

    PHP Code:
    <?php
    $accountsPath 
    'D:\\account';
    $accountsPathZeroMP 'D:\\account_zero_mp';

    function 
    endsWith($haystack$needle)
    {
      return 
    $needle === "" || substr($haystack, -strlen($needle)) === $needle;
    }

    function 
    find($path){
      global 
    $accountsPath$accountsPathZeroMP;
      foreach( 
    glob$path "\\*" ) as $filename ) {
        if(
    filetype($filename) == 'dir')
          
    find($filename);
        
        if(
    endsWith($filename,'.TAD') or endsWith($filename,'.tad')){
          
    $open fopen($filename,'rb');
          
    $read fread($open,filesize($filename));
          
    $newTAD substr_replace(substr_replace(substr_replace($newTAD,'00000000',2816,8),'00000000',6192,8),'00000000',9568,8); // reset to zero monthly master point
          
    fclose($open);
          
                
    $newFileName str_replace($accountsPath,$accountsPathZeroMP,$filename);
                
                if(!
    file_exists(dirname($newFileName))){
            
    mkdir(dirname($newFileName), 0777true);
          }
                
          
    $target fopen($newFileName,'wb');
          
    fwrite($target,hex2bin($newTAD));
          
    fclose($target);
          
        }
      }
    }

    find($accountsPath);
    echo 
    'Finished';
    ?>
    The one you posted with the Master Point reset works well but if loaded only with the Monthly Master Points that was the result.

    - - - Updated - - -

    Ok I think I got and it works well now.

    This is the code I used (modified from what you given)

    PHP Code:
    <?php
    $accountsPath 
    'D:\\Server\\Hero\\DBSRV\\account';
    $accountsPathZeroMP 'D:\\account_zero_mp';

    function 
    endsWith($haystack$needle)
    {
      return 
    $needle === "" || substr($haystack, -strlen($needle)) === $needle;
    }

    function 
    find($path){
      global 
    $accountsPath$accountsPathZeroMP;
      foreach( 
    glob$path "\\*" ) as $filename ) {
        if(
    filetype($filename) == 'dir')
          
    find($filename);
        
        if(
    endsWith($filename,'.TAD') or endsWith($filename,'.tad')){
          
    $open fopen($filename,'rb');
          
    $read fread($open,filesize($filename));
          
    $newTAD substr_replace(substr_replace(substr_replace(bin2hex($read),'00000000',2861,8),'00000000',6192,8),'00000000',9568,8); //reset to zero monthly master point
          
    fclose($open);
          
                
    $newFileName str_replace($accountsPath,$accountsPathZeroMP,$filename);
                
                if(!
    file_exists(dirname($newFileName))){
            
    mkdir(dirname($newFileName), 0777true);
          }
                
          
    $target fopen($newFileName,'wb');
          
    fwrite($target,hex2bin($newTAD));
          
    fclose($target);
          
        }
      }
    }

    find($accountsPath);
    echo 
    'Finished';
    ?>
    This one resets the Monthly Master Point smoothly without corrupting the file.
    Last edited by A v a r a; 30-08-14 at 11:13 AM.

  6. #21
    Enthusiast alxndr is offline
    MemberRank
    Nov 2012 Join Date
    Lima, PerúLocation
    45Posts

    Re: Reset MBrahmanPoints in both .TAD and MSSQL

    @A v a r a, haha yeah that looks fine, cheers!

  7. #22
    Tantra/Web Development jbeitz107 is offline
    MemberRank
    Mar 2012 Join Date
    USALocation
    1,471Posts

    Re: Reset MBrahmanPoints in both .TAD and MSSQL

    Courtesy of alxndr along with a few mods of my own. Enjoy!
    PHP Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
    <title>TAD File Reader</title>

    <style type="text/css">
    .content {
        float: left;
        font-size: 11px;
        margin: 5px;
        padding: 5px;
    }

    .utility {
        -moz-border-radius: 5px;
        -webkit-border-radius: 5px;
        background: red;
        border-radius: 5px;
        clear: left;
        cursor:pointer;
        float: left;
        font-size: 11px;
        height: auto;
        margin: 5px;
        padding: 5px;
        width: 180px;
    }

    .box {
        -moz-border-radius: 5px;
        -webkit-border-radius: 5px;
        background: #6699FF;
        border-radius: 5px;
        cursor:pointer;
        float: left;
        font-size: 17px;
        height: auto;
        margin: 10px;
        padding: 10px;
        width: auto;
    }
    </style>
    </head>
    <body>
    <div class="content">
    <div class="box">
                <form id="finduser"  method="POST" action="tad.php">
                <input type="text" id="search" name="search">
                <input type="Submit" Value="Search for User">
                <input type="hidden" name="action" value="submitted">
                </form>
                
    <?php
    if ($_POST['action'] == 'submitted')

    error_reporting(0);
    function 
    raza($raza){ 
    $razastr1 ''
    switch(
    $raza){ 
     case 
    1
     
    $razastr1 'Naga'
     break; 
     case 
    2
     
    $razastr1 'Kinnara'
     break; 
     case 
    4
     
    $razastr1 'Asura'
     break; 
     case 
    8
     
    $razastr1 'Rakshasa'
     break; 
     case 
    16
     
    $razastr1 'Yaksa'
     break; 
     case 
    32
     
    $razastr1 'Gandarva'
     break; 
     case 
    64
     
    $razastr1 'Deva'
     break; 
     case 
    128
     
    $razastr1 'Garuda'
     break; 
     default: 
     
    $razastr1 'GM'

    return 
    $razastr1


    function 
    dios($dios){ 
    $diosstr''
    switch(
    $dios){ 
     case 
    1
     
    $diosstr='Brahma';  
     break; 
     case 
    2
     
    $diosstr='Vishnu';  
     break; 
     case 
    4
     
    $diosstr='Shiva';  
     break; 
     case 
    10
     
    $diosstr='GM'
     break; 
     default: 
     
    $diosstr='None';  

    return 
    $diosstr

    $accdir 'ACCOUNT DIRECTORY';
    $post $_POST['search'];
    $Initial=substr($post,0,1);
    $nombre_fichero $_POST['search'].".tad"
    $gestor fopen("$accdir\\$Initial\\$nombre_fichero""rb")or die("Unable to find account to $post");
     
    $contenido fread($gestorfilesize($nombre_fichero)); 
    $contrasenia substr($contenido,52,32); 
    $charsep 1688
    $char1 substr($contenido,88+$charsep*0,20); 
    $char2 substr($contenido,88+$charsep*1,20); 
    $char3 substr($contenido,88+$charsep*2,20); 
    $raza1 base_convert(bin2hex(substr($contenido,116+$charsep*0,1)),16,10); 
    $raza2 base_convert(bin2hex(substr($contenido,116+$charsep*1,1)),16,10); 
    $raza3 base_convert(bin2hex(substr($contenido,116+$charsep*2,1)),16,10); 

    $pd1 base_convert(bin2hex(strrev(substr($contenido,136+$charsep*0,4))),16,10); 
    $pd2 base_convert(bin2hex(strrev(substr($contenido,136+$charsep*1,4))),16,10); 
    $pd3 base_convert(bin2hex(strrev(substr($contenido,136+$charsep*2,4))),16,10); 

    $mp1 base_convert(bin2hex(strrev(substr($contenido,2816+$charsep*0,4))),16,10);
    $mp2 base_convert(bin2hex(strrev(substr($contenido,6192+$charsep*0,4))),16,10);
    $mp3 base_convert(bin2hex(strrev(substr($contenido,9568+$charsep*0,4))),16,10);

    $dios1 base_convert(bin2hex(substr($contenido,144+$charsep*0,1)),16,10); 
    $dios2 base_convert(bin2hex(substr($contenido,144+$charsep*1,1)),16,10); 
    $dios3 base_convert(bin2hex(substr($contenido,144+$charsep*2,1)),16,10); 
    $lvl1 base_convert(bin2hex(substr($contenido,145+$charsep*0,1)),16,10); 
    $lvl2 base_convert(bin2hex(substr($contenido,145+$charsep*1,1)),16,10); 
    $lvl3 base_convert(bin2hex(substr($contenido,145+$charsep*2,1)),16,10); 
    $muscle1 base_convert(bin2hex(strrev(substr($contenido,108+$charsep*0,2))),16,10); 
    $muscle2 base_convert(bin2hex(strrev(substr($contenido,108+$charsep*1,2))),16,10); 
    $muscle3 base_convert(bin2hex(strrev(substr($contenido,108+$charsep*2,2))),16,10); 
    $nerve1 base_convert(bin2hex(strrev(substr($contenido,110+$charsep*0,2))),16,10); 
    $nerve2 base_convert(bin2hex(strrev(substr($contenido,110+$charsep*1,2))),16,10); 
    $nerve3 base_convert(bin2hex(strrev(substr($contenido,110+$charsep*2,2))),16,10); 
    $heart1 base_convert(bin2hex(strrev(substr($contenido,112+$charsep*0,2))),16,10); 
    $heart2 base_convert(bin2hex(strrev(substr($contenido,112+$charsep*1,2))),16,10); 
    $heart3 base_convert(bin2hex(strrev(substr($contenido,112+$charsep*2,2))),16,10); 
    $soul1 base_convert(bin2hex(strrev(substr($contenido,114+$charsep*0,2))),16,10); 
    $soul2 base_convert(bin2hex(strrev(substr($contenido,114+$charsep*1,2))),16,10); 
    $soul3 base_convert(bin2hex(strrev(substr($contenido,114+$charsep*2,2))),16,10); 

    echo 
    '<br>M5 Password: ' $contrasenia '<br><br>'
    //Character 1
    echo 'Char 1: ' $char1 '<br>';
    echo 
    'God: ' dios($dios1) . '<br>';
    echo 
    'Level: ' $lvl1 '<br>'
    echo 
    'Muscle: ' $muscle1 '<br>'
    echo 
    'Nerve: ' $nerve1 '<br>'
    echo 
    'Heart: ' $heart1 '<br>'
    echo 
    'Soul: ' $soul1 '<br>';
    echo 
    'Tribe: ' raza($raza1) . '<br>';
    echo 
    'Monthly MP: ' $mp1 '<br>';
    echo 
    'Master Points: ' $pd1 '<br><br>'

    //Character 2
    echo 'Char 2: ' $char2 '<br>';
    echo 
    ' God: ' dios($dios2) . '<br>';
    echo 
    'Level: ' $lvl2 '<br>';
    echo 
    'Muscle: ' $muscle2 '<br>'
    echo 
    'Nerve: ' $nerve2 '<br>'
    echo 
    'Heart: ' $heart2 '<br>'
    echo 
    'Soul: ' $soul2 '<br>';
    echo 
    'Tribe: ' raza($raza2) . '<br>';
    echo 
    'Monthly MP: ' $mp2 '<br>';
    echo 
    'Master Points: ' $pd2 '<br><br>'

    //Character 3 
    echo 'Char 3: ' $char3 '<br>'
    echo 
    'God: ' dios($dios3) . '<br>'
    echo 
    'Level: ' $lvl3 '<br>'
    echo 
    'Muscle: ' $muscle3 '<br>'
    echo 
    'Nerve: ' $nerve3 '<br>'
    echo 
    'Heart: ' $heart3 '<br>'
    echo 
    'Soul: ' $soul3 '<br>';
    echo 
    'Tribe: ' raza($raza3) . '<br>';
    echo 
    'Monthly MP: ' $mp3 '<br>'
    echo 
    'Master Points: ' $pd3 '<br><br>';
    echo 
    '</div></div>';
     
    fclose($gestor); 
    }
    ?>
    </body>
    </html>

  8. #23
    تانترا اون لاين Lunatic is offline
    MemberRank
    Jan 2014 Join Date
    KoreaLocation
    420Posts

    Re: Reset MBrahmanPoints in both .TAD and MSSQL

    can anyone help me ?
    - > Fatal error: Call to undefined function hex2bin() in C:\xampp\htdocs\test.php on line 29
    Please Help ")

  9. #24
    Tantra/Web Development jbeitz107 is offline
    MemberRank
    Mar 2012 Join Date
    USALocation
    1,471Posts

    Re: Reset MBrahmanPoints in both .TAD and MSSQL

    You are using an older version of php so use my script.



Page 2 of 2 FirstFirst 12

Advertisement