3v4l.org

run code in 300+ PHP versions simultaneously
<?Php /* * by Henrique Kieckbusch * * just send this .php file into a PHP server and open it. * * */ class chromaSquad{ var $dados; function chromaSquad(){ $this->dados = array(); } function salvoParaArray( $conteudo ){ $t = explode('#',$conteudo); foreach($t as $_t){ $t2 = explode('!',$_t); if(count($t2)>1)$this->dados[ $this->_c( $t2[0] )] = $this->_c($t2[1] ); } } function _c($a, $d = -1){ for($a = str_split( utf8_decode($a) ), $r='',$i=0;$i<count($a);$i++) $r .= chr( ord($a[$i]) + ( $d*ord( substr(str_rot13('vOSnn95Lo8C1fDPMYKIUvrLcYZ8G699o'), $i%32, 1) ) ) ); return $d > 0 ? utf8_encode($r) : $r; } function postParaArquivo( $a ){ foreach($a as $i=>$j) echo $this->_c($i,1).'!'.$this->_c($j,1).'#'; } } $cabecalho = ' <style type="text/css">*{font-family:verdana; margin:12px;}input[type="text"]{width:400px; border:1px blue solid; padding:4px;}</style> <form method="post" enctype="multipart/form-data"> '; if( count($_FILES) > 0 && $_FILES['arq']['size'] > 0) { echo $cabecalho; $t = new chromaSquad(); $t->salvoParaArray( file_get_contents( $_FILES['arq']['tmp_name'] ) ); if(count($t->dados) < 3) die('Wrong file.'); echo 'Above you have your save file data, most of values are advanced. Maybe you just want to change the money? <br/><br/> Well... After that, click in the button and save the new file in the same folder. <hr/><br/><br/>'; foreach($t->dados as $i=>$k) echo $i.'<br/> <input type="text" name="'.$i.'" value="'.$k.'" /> <br/>'; echo '<hr/> <input type="submit" name="submit" value="Download edited file" /> '; }else{ if( count($_POST)>2 ){ unset($_POST['submit']); $t = new chromaSquad(); header('Content-Description: File Transfer'); header('Content-Type: application/octet-stream'); header('Content-Disposition: attachment; filename=new_save.csqd'); header('Content-Transfer-Encoding: binary'); $t->postParaArquivo( $_POST ); die(); } echo $cabecalho; ?> Please, send above the *.csqd file of your game. You find it in the "savedGames" directory of Chroma Squad Game. <br/> <input type="file" name="arq" /> <br/><br/> <input type="submit" value="send it" /> <br/> <?Php } echo '</form>';
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 46) Position 1 = 5, Position 2 = 10
Branch analysis from position: 5
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 44
Branch analysis from position: 11
2 jumps found. (Code = 43) Position 1 = 28, Position 2 = 29
Branch analysis from position: 28
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 29
2 jumps found. (Code = 77) Position 1 = 32, Position 2 = 41
Branch analysis from position: 32
2 jumps found. (Code = 78) Position 1 = 33, Position 2 = 41
Branch analysis from position: 33
1 jumps found. (Code = 42) Position 1 = 32
Branch analysis from position: 32
Branch analysis from position: 41
1 jumps found. (Code = 42) Position 1 = 73
Branch analysis from position: 73
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 41
Branch analysis from position: 44
2 jumps found. (Code = 43) Position 1 = 48, Position 2 = 71
Branch analysis from position: 48
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 71
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
filename:       /in/odmge
function name:  (null)
number of ops:  75
compiled vars:  !0 = $cabecalho, !1 = $t, !2 = $k, !3 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   32     0  E >   ASSIGN                                                   !0, '%0A++++%3Cstyle+type%3D%22text%2Fcss%22%3E%2A%7Bfont-family%3Averdana%3B+margin%3A12px%3B%7Dinput%5Btype%3D%22text%22%5D%7Bwidth%3A400px%3B+border%3A1px+blue+solid%3B+padding%3A4px%3B%7D%3C%2Fstyle%3E%0A++++%3Cform+method%3D%22post%22+enctype%3D%22multipart%2Fform-data%22%3E%0A'
   37     1        FETCH_R                      global              ~5      '_FILES'
          2        COUNT                                            ~6      ~5
          3        IS_SMALLER                                       ~7      0, ~6
          4      > JMPZ_EX                                          ~7      ~7, ->10
          5    >   FETCH_R                      global              ~8      '_FILES'
          6        FETCH_DIM_R                                      ~9      ~8, 'arq'
          7        FETCH_DIM_R                                      ~10     ~9, 'size'
          8        IS_SMALLER                                       ~11     0, ~10
          9        BOOL                                             ~7      ~11
         10    > > JMPZ                                                     ~7, ->44
   38    11    >   ECHO                                                     !0
   39    12        NEW                                              $12     'chromaSquad'
         13        DO_FCALL                                      0          
         14        ASSIGN                                                   !1, $12
   40    15        INIT_METHOD_CALL                                         !1, 'salvoParaArray'
         16        INIT_FCALL                                               'file_get_contents'
         17        FETCH_R                      global              ~15     '_FILES'
         18        FETCH_DIM_R                                      ~16     ~15, 'arq'
         19        FETCH_DIM_R                                      ~17     ~16, 'tmp_name'
         20        SEND_VAL                                                 ~17
         21        DO_ICALL                                         $18     
         22        SEND_VAR_NO_REF_EX                                       $18
         23        DO_FCALL                                      0          
   41    24        FETCH_OBJ_R                                      ~20     !1, 'dados'
         25        COUNT                                            ~21     ~20
         26        IS_SMALLER                                               ~21, 3
         27      > JMPZ                                                     ~22, ->29
         28    > > EXIT                                                     'Wrong+file.'
   42    29    >   ECHO                                                     'Above+you+have+your+save+file+data%2C+most+of+values+are+advanced.+Maybe+you+just+want+to+change+the+money%3F+%3Cbr%2F%3E%3Cbr%2F%3E+Well...+After+that%2C+click+in+the+button+and+save+the+new+file+in+the+same+folder.+%3Chr%2F%3E%3Cbr%2F%3E%3Cbr%2F%3E'
   43    30        FETCH_OBJ_R                                      ~23     !1, 'dados'
         31      > FE_RESET_R                                       $24     ~23, ->41
         32    > > FE_FETCH_R                                       ~25     $24, !2, ->41
         33    >   ASSIGN                                                   !3, ~25
         34        CONCAT                                           ~27     !3, '%3Cbr%2F%3E+%3Cinput+type%3D%22text%22+name%3D%22'
         35        CONCAT                                           ~28     ~27, !3
         36        CONCAT                                           ~29     ~28, '%22+value%3D%22'
         37        CONCAT                                           ~30     ~29, !2
         38        CONCAT                                           ~31     ~30, '%22+%2F%3E+%3Cbr%2F%3E'
         39        ECHO                                                     ~31
         40      > JMP                                                      ->32
         41    >   FE_FREE                                                  $24
   45    42        ECHO                                                     '%3Chr%2F%3E+%3Cinput+type%3D%22submit%22+name%3D%22submit%22+value%3D%22Download+edited+file%22+%2F%3E+'
         43      > JMP                                                      ->73
   47    44    >   FETCH_R                      global              ~32     '_POST'
         45        COUNT                                            ~33     ~32
         46        IS_SMALLER                                               2, ~33
         47      > JMPZ                                                     ~34, ->71
   48    48    >   FETCH_UNSET                                      $35     '_POST'
         49        UNSET_DIM                                                $35, 'submit'
   49    50        NEW                                              $36     'chromaSquad'
         51        DO_FCALL                                      0          
         52        ASSIGN                                                   !1, $36
   50    53        INIT_FCALL                                               'header'
         54        SEND_VAL                                                 'Content-Description%3A+File+Transfer'
         55        DO_ICALL                                                 
   51    56        INIT_FCALL                                               'header'
         57        SEND_VAL                                                 'Content-Type%3A+application%2Foctet-stream'
         58        DO_ICALL                                                 
   52    59        INIT_FCALL                                               'header'
         60        SEND_VAL                                                 'Content-Disposition%3A+attachment%3B+filename%3Dnew_save.csqd'
         61        DO_ICALL                                                 
   53    62        INIT_FCALL                                               'header'
         63        SEND_VAL                                                 'Content-Transfer-Encoding%3A+binary'
         64        DO_ICALL                                                 
   54    65        INIT_METHOD_CALL                                         !1, 'postParaArquivo'
         66        CHECK_FUNC_ARG                                           
         67        FETCH_FUNC_ARG               global              $43     '_POST'
         68        SEND_FUNC_ARG                                            $43
         69        DO_FCALL                                      0          
   55    70      > EXIT                                                     
   57    71    >   ECHO                                                     !0
   59    72        ECHO                                                     '++++Please%2C+send+above+the+%2A.csqd++file+of+your+game.+You+find+it+in+the+%22savedGames%22+directory+of+Chroma+Squad+Game.+%3Cbr%2F%3E%0A++++%3Cinput+type%3D%22file%22+name%3D%22arq%22+%2F%3E+%3Cbr%2F%3E%3Cbr%2F%3E%0A++++%3Cinput+type%3D%22submit%22+value%3D%22send+it%22+%2F%3E%0A++++%3Cbr%2F%3E%0A'
   65    73    >   ECHO                                                     '%3C%2Fform%3E'
         74      > RETURN                                                   1

Class chromaSquad:
Function chromasquad:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/odmge
function name:  chromaSquad
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   ASSIGN_OBJ                                               'dados'
          1        OP_DATA                                                  <array>
   14     2      > RETURN                                                   null

End of function chromasquad

Function salvoparaarray:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 7, Position 2 = 30
Branch analysis from position: 7
2 jumps found. (Code = 78) Position 1 = 8, Position 2 = 30
Branch analysis from position: 8
2 jumps found. (Code = 43) Position 1 = 16, Position 2 = 29
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 29
Branch analysis from position: 30
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 30
filename:       /in/odmge
function name:  salvoParaArray
number of ops:  32
compiled vars:  !0 = $conteudo, !1 = $t, !2 = $_t, !3 = $t2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   RECV                                             !0      
   16     1        INIT_FCALL                                               'explode'
          2        SEND_VAL                                                 '%23'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $4      
          5        ASSIGN                                                   !1, $4
   17     6      > FE_RESET_R                                       $6      !1, ->30
          7    > > FE_FETCH_R                                               $6, !2, ->30
   18     8    >   INIT_FCALL                                               'explode'
          9        SEND_VAL                                                 '%21'
         10        SEND_VAR                                                 !2
         11        DO_ICALL                                         $7      
         12        ASSIGN                                                   !3, $7
   19    13        COUNT                                            ~9      !3
         14        IS_SMALLER                                               1, ~9
         15      > JMPZ                                                     ~10, ->29
         16    >   INIT_METHOD_CALL                                         '_c'
         17        CHECK_FUNC_ARG                                           
         18        FETCH_DIM_FUNC_ARG                               $12     !3, 0
         19        SEND_FUNC_ARG                                            $12
         20        DO_FCALL                                      0  $13     
         21        INIT_METHOD_CALL                                         '_c'
         22        CHECK_FUNC_ARG                                           
         23        FETCH_DIM_FUNC_ARG                               $15     !3, 1
         24        SEND_FUNC_ARG                                            $15
         25        DO_FCALL                                      0  $16     
         26        FETCH_OBJ_W                                      $11     'dados'
         27        ASSIGN_DIM                                               $11, $13
         28        OP_DATA                                                  $16
   17    29    > > JMP                                                      ->7
         30    >   FE_FREE                                                  $6
   21    31      > RETURN                                                   null

End of function salvoparaarray

Function _c:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 35
Branch analysis from position: 35
2 jumps found. (Code = 44) Position 1 = 38, Position 2 = 12
Branch analysis from position: 38
2 jumps found. (Code = 43) Position 1 = 40, Position 2 = 45
Branch analysis from position: 40
1 jumps found. (Code = 42) Position 1 = 46
Branch analysis from position: 46
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 45
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
2 jumps found. (Code = 44) Position 1 = 38, Position 2 = 12
Branch analysis from position: 38
Branch analysis from position: 12
filename:       /in/odmge
function name:  _c
number of ops:  48
compiled vars:  !0 = $a, !1 = $d, !2 = $r, !3 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   22     0  E >   RECV                                             !0      
          1        RECV_INIT                                        !1      -1
   23     2        INIT_FCALL                                               'str_split'
          3        INIT_FCALL                                               'utf8_decode'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $4      
          6        SEND_VAR                                                 $4
          7        DO_ICALL                                         $5      
          8        ASSIGN                                                   !0, $5
          9        ASSIGN                                                   !2, ''
         10        ASSIGN                                                   !3, 0
         11      > JMP                                                      ->35
         12    >   INIT_FCALL                                               'chr'
         13        INIT_FCALL                                               'ord'
         14        FETCH_DIM_R                                      ~9      !0, !3
         15        SEND_VAL                                                 ~9
         16        DO_ICALL                                         $10     
         17        INIT_FCALL                                               'ord'
         18        INIT_FCALL                                               'substr'
         19        INIT_FCALL                                               'str_rot13'
         20        SEND_VAL                                                 'vOSnn95Lo8C1fDPMYKIUvrLcYZ8G699o'
         21        DO_ICALL                                         $11     
         22        SEND_VAR                                                 $11
         23        MOD                                              ~12     !3, 32
         24        SEND_VAL                                                 ~12
         25        SEND_VAL                                                 1
         26        DO_ICALL                                         $13     
         27        SEND_VAR                                                 $13
         28        DO_ICALL                                         $14     
         29        MUL                                              ~15     !1, $14
         30        ADD                                              ~16     $10, ~15
         31        SEND_VAL                                                 ~16
         32        DO_ICALL                                         $17     
         33        ASSIGN_OP                                     8          !2, $17
         34        PRE_INC                                                  !3
         35    >   COUNT                                            ~20     !0
         36        IS_SMALLER                                               !3, ~20
         37      > JMPNZ                                                    ~21, ->12
   24    38    >   IS_SMALLER                                               0, !1
         39      > JMPZ                                                     ~22, ->45
         40    >   INIT_FCALL                                               'utf8_encode'
         41        SEND_VAR                                                 !2
         42        DO_ICALL                                         $23     
         43        QM_ASSIGN                                        ~24     $23
         44      > JMP                                                      ->46
         45    >   QM_ASSIGN                                        ~24     !2
         46    > > RETURN                                                   ~24
   25    47*     > RETURN                                                   null

End of function _c

Function postparaarquivo:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 17
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 17
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
filename:       /in/odmge
function name:  postParaArquivo
number of ops:  19
compiled vars:  !0 = $a, !1 = $j, !2 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   27     0  E >   RECV                                             !0      
   28     1      > FE_RESET_R                                       $3      !0, ->17
          2    > > FE_FETCH_R                                       ~4      $3, !1, ->17
          3    >   ASSIGN                                                   !2, ~4
          4        INIT_METHOD_CALL                                         '_c'
          5        SEND_VAR_EX                                              !2
          6        SEND_VAL_EX                                              1
          7        DO_FCALL                                      0  $6      
          8        CONCAT                                           ~7      $6, '%21'
          9        INIT_METHOD_CALL                                         '_c'
         10        SEND_VAR_EX                                              !1
         11        SEND_VAL_EX                                              1
         12        DO_FCALL                                      0  $8      
         13        CONCAT                                           ~9      ~7, $8
         14        CONCAT                                           ~10     ~9, '%23'
         15        ECHO                                                     ~10
         16      > JMP                                                      ->2
         17    >   FE_FREE                                                  $3
   29    18      > RETURN                                                   null

End of function postparaarquivo

End of class chromaSquad.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
193.6 ms | 1417 KiB | 33 Q