3v4l.org

run code in 300+ PHP versions simultaneously
<?php /** * PHP profile is a PHP profiling tool for your Web applications. * Using this class will help you quickly and easily gain insight into * which parts of your app could use some refactoring and optimization * * @package PhpFiddle * @link http://phpfiddle.org * @since 2012 */ class utils { public static function rc4($key, $str) { $s = array(); for ($i = 0; $i < 256; $i++) { $s[$i] = $i; } $j = 0; for ($i = 0; $i < 256; $i++) { $j = ($j + $s[$i] + ord($key[$i % strlen($key)])) % 256; $x = $s[$i]; $s[$i] = $s[$j]; $s[$j] = $x; } $i = 0; $j = 0; $res = ''; for ($y = 0; $y < strlen($str); $y++) { $i = ($i + 1) % 256; $j = ($j + $s[$i]) % 256; $x = $s[$i]; $s[$i] = $s[$j]; $s[$j] = $x; $res .= $str[$y] ^ chr($s[($s[$i] + $s[$j]) % 256]); } return $res; } } echo "<h1>Hello, PHP!</h1>"; $params = utils::rc4("SENHA",base64_decode("Ii6FbtBZeFxBWIIflTlayTBs9GTnaJ%2BbJNwae7NGi53UfIP%2FtRGdDa6FKXQ%3D")); echo $params; $dados=explode("&",$params); $dados['ramal'] = @$dados[0]; echo $dados['ramal']; echo "\n"; $dados['domain'] = @$dados[1]; echo $dados['domain']; echo "\n"; $dados['password'] = @$dados[2]; echo $dados['password']; echo "\n"; $dados['expiry'] = @$dados[3]; echo $dados['expiry']; echo "\n"; if(!isset($dados['domain'])){ echo "Não foi possivel validar o acesso!<br>Feche a janela e tente novamente."; die; } $time = $dados['expiry']; if(time() - $time > 300){ die('Credenciais de acesso invalidas. Recarregue a pagina e tente novamente.'); } ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 50, Position 2 = 52
Branch analysis from position: 50
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 52
2 jumps found. (Code = 43) Position 1 = 59, Position 2 = 60
Branch analysis from position: 59
1 jumps found. (Code = 79) Position 1 = -2
Branch analysis from position: 60
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/0Ql0e
function name:  (null)
number of ops:  61
compiled vars:  !0 = $params, !1 = $dados, !2 = $time
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   42     0  E >   ECHO                                                     '%3Ch1%3EHello%2C+PHP%21%3C%2Fh1%3E'
   43     1        INIT_STATIC_METHOD_CALL                                  'utils', 'rc4'
          2        SEND_VAL                                                 'SENHA'
          3        INIT_FCALL                                               'base64_decode'
          4        SEND_VAL                                                 'Ii6FbtBZeFxBWIIflTlayTBs9GTnaJ%252BbJNwae7NGi53UfIP%252FtRGdDa6FKXQ%253D'
          5        DO_ICALL                                         $3      
          6        SEND_VAR                                                 $3
          7        DO_FCALL                                      0  $4      
          8        ASSIGN                                                   !0, $4
   44     9        ECHO                                                     !0
   45    10        INIT_FCALL                                               'explode'
         11        SEND_VAL                                                 '%26'
         12        SEND_VAR                                                 !0
         13        DO_ICALL                                         $6      
         14        ASSIGN                                                   !1, $6
   46    15        BEGIN_SILENCE                                    ~9      
         16        FETCH_DIM_R                                      ~10     !1, 0
         17        END_SILENCE                                              ~9
         18        ASSIGN_DIM                                               !1, 'ramal'
         19        OP_DATA                                                  ~10
   47    20        FETCH_DIM_R                                      ~11     !1, 'ramal'
         21        ECHO                                                     ~11
   48    22        ECHO                                                     '%0A'
   49    23        BEGIN_SILENCE                                    ~13     
         24        FETCH_DIM_R                                      ~14     !1, 1
         25        END_SILENCE                                              ~13
         26        ASSIGN_DIM                                               !1, 'domain'
         27        OP_DATA                                                  ~14
   50    28        FETCH_DIM_R                                      ~15     !1, 'domain'
         29        ECHO                                                     ~15
   51    30        ECHO                                                     '%0A'
   52    31        BEGIN_SILENCE                                    ~17     
         32        FETCH_DIM_R                                      ~18     !1, 2
         33        END_SILENCE                                              ~17
         34        ASSIGN_DIM                                               !1, 'password'
         35        OP_DATA                                                  ~18
   53    36        FETCH_DIM_R                                      ~19     !1, 'password'
         37        ECHO                                                     ~19
   54    38        ECHO                                                     '%0A'
   55    39        BEGIN_SILENCE                                    ~21     
         40        FETCH_DIM_R                                      ~22     !1, 3
         41        END_SILENCE                                              ~21
         42        ASSIGN_DIM                                               !1, 'expiry'
         43        OP_DATA                                                  ~22
   56    44        FETCH_DIM_R                                      ~23     !1, 'expiry'
         45        ECHO                                                     ~23
   57    46        ECHO                                                     '%0A'
   58    47        ISSET_ISEMPTY_DIM_OBJ                         0  ~24     !1, 'domain'
         48        BOOL_NOT                                         ~25     ~24
         49      > JMPZ                                                     ~25, ->52
   59    50    >   ECHO                                                     'N%C3%A3o+foi+possivel+validar+o+acesso%21%3Cbr%3EFeche+a+janela+e+tente+novamente.'
   60    51      > EXIT                                                     
   63    52    >   FETCH_DIM_R                                      ~26     !1, 'expiry'
         53        ASSIGN                                                   !2, ~26
   64    54        INIT_FCALL                                               'time'
         55        DO_ICALL                                         $28     
         56        SUB                                              ~29     $28, !2
         57        IS_SMALLER                                               300, ~29
         58      > JMPZ                                                     ~30, ->60
   65    59    > > EXIT                                                     'Credenciais+de+acesso+invalidas.+Recarregue+a+pagina+e+tente+novamente.'
   69    60    > > RETURN                                                   1

Class utils:
Function rc4:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
2 jumps found. (Code = 44) Position 1 = 10, Position 2 = 5
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 32
Branch analysis from position: 32
2 jumps found. (Code = 44) Position 1 = 34, Position 2 = 13
Branch analysis from position: 34
1 jumps found. (Code = 42) Position 1 = 65
Branch analysis from position: 65
2 jumps found. (Code = 44) Position 1 = 68, Position 2 = 39
Branch analysis from position: 68
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 39
2 jumps found. (Code = 44) Position 1 = 68, Position 2 = 39
Branch analysis from position: 68
Branch analysis from position: 39
Branch analysis from position: 13
2 jumps found. (Code = 44) Position 1 = 34, Position 2 = 13
Branch analysis from position: 34
Branch analysis from position: 13
Branch analysis from position: 5
2 jumps found. (Code = 44) Position 1 = 10, Position 2 = 5
Branch analysis from position: 10
Branch analysis from position: 5
filename:       /in/0Ql0e
function name:  rc4
number of ops:  70
compiled vars:  !0 = $key, !1 = $str, !2 = $s, !3 = $i, !4 = $j, !5 = $x, !6 = $res, !7 = $y
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   15     2        ASSIGN                                                   !2, <array>
   16     3        ASSIGN                                                   !3, 0
          4      > JMP                                                      ->8
   17     5    >   ASSIGN_DIM                                               !2, !3
          6        OP_DATA                                                  !3
   16     7        PRE_INC                                                  !3
          8    >   IS_SMALLER                                               !3, 256
          9      > JMPNZ                                                    ~12, ->5
   19    10    >   ASSIGN                                                   !4, 0
   20    11        ASSIGN                                                   !3, 0
         12      > JMP                                                      ->32
   21    13    >   FETCH_DIM_R                                      ~15     !2, !3
         14        ADD                                              ~16     !4, ~15
         15        INIT_FCALL                                               'ord'
         16        STRLEN                                           ~17     !0
         17        MOD                                              ~18     !3, ~17
         18        FETCH_DIM_R                                      ~19     !0, ~18
         19        SEND_VAL                                                 ~19
         20        DO_ICALL                                         $20     
         21        ADD                                              ~21     ~16, $20
         22        MOD                                              ~22     ~21, 256
         23        ASSIGN                                                   !4, ~22
   22    24        FETCH_DIM_R                                      ~24     !2, !3
         25        ASSIGN                                                   !5, ~24
   23    26        FETCH_DIM_R                                      ~27     !2, !4
         27        ASSIGN_DIM                                               !2, !3
         28        OP_DATA                                                  ~27
   24    29        ASSIGN_DIM                                               !2, !4
         30        OP_DATA                                                  !5
   20    31        PRE_INC                                                  !3
         32    >   IS_SMALLER                                               !3, 256
         33      > JMPNZ                                                    ~30, ->13
   26    34    >   ASSIGN                                                   !3, 0
   27    35        ASSIGN                                                   !4, 0
   28    36        ASSIGN                                                   !6, ''
   29    37        ASSIGN                                                   !7, 0
         38      > JMP                                                      ->65
   30    39    >   ADD                                              ~35     !3, 1
         40        MOD                                              ~36     ~35, 256
         41        ASSIGN                                                   !3, ~36
   31    42        FETCH_DIM_R                                      ~38     !2, !3
         43        ADD                                              ~39     !4, ~38
         44        MOD                                              ~40     ~39, 256
         45        ASSIGN                                                   !4, ~40
   32    46        FETCH_DIM_R                                      ~42     !2, !3
         47        ASSIGN                                                   !5, ~42
   33    48        FETCH_DIM_R                                      ~45     !2, !4
         49        ASSIGN_DIM                                               !2, !3
         50        OP_DATA                                                  ~45
   34    51        ASSIGN_DIM                                               !2, !4
         52        OP_DATA                                                  !5
   35    53        FETCH_DIM_R                                      ~47     !1, !7
         54        INIT_FCALL                                               'chr'
         55        FETCH_DIM_R                                      ~48     !2, !3
         56        FETCH_DIM_R                                      ~49     !2, !4
         57        ADD                                              ~50     ~48, ~49
         58        MOD                                              ~51     ~50, 256
         59        FETCH_DIM_R                                      ~52     !2, ~51
         60        SEND_VAL                                                 ~52
         61        DO_ICALL                                         $53     
         62        BW_XOR                                           ~54     $53, ~47
         63        ASSIGN_OP                                     8          !6, ~54
   29    64        PRE_INC                                                  !7
         65    >   STRLEN                                           ~57     !1
         66        IS_SMALLER                                               !7, ~57
         67      > JMPNZ                                                    ~58, ->39
   37    68    > > RETURN                                                   !6
   38    69*     > RETURN                                                   null

End of function rc4

End of class utils.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.82 ms | 1408 KiB | 23 Q