3v4l.org

run code in 300+ PHP versions simultaneously
<?php $c1="ClVLIh4ASCsCBE8lAxMacFMZV2hdVVotEhhUJQNVAmhSFl4sFxJeaAw="; $c2="GkAQCQ0UEQMQEhUMEwZBW0ANDkBPQwAEAg0PDhBBW0BAUVJTUVJBHA=="; function xor_encrypt($in) { $key = 'abc'; $text = $in; $outText = ''; // Iterate through each character for($i=0;$i<strlen($text);$i++) { $outText .= $text[$i] ^ $key[$i % strlen($key)]; } return $outText; } $defdata = array( "showpassword"=>"no", "bgcolor"=>"#00000"); #decode $tmp= json_decode(xor_encrypt($c2), true); if (is_array($tmp)) { print $tmp['showpassword']; print $tmp['bgcolor']; } else print "Error!"; print " <> "; #encode print xor_encrypt(json_encode($defdata));
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 13, Position 2 = 18
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 19
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/HpfWa
function name:  (null)
number of ops:  28
compiled vars:  !0 = $c1, !1 = $c2, !2 = $defdata, !3 = $tmp
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'ClVLIh4ASCsCBE8lAxMacFMZV2hdVVotEhhUJQNVAmhSFl4sFxJeaAw%3D'
    4     1        ASSIGN                                                   !1, 'GkAQCQ0UEQMQEhUMEwZBW0ANDkBPQwAEAg0PDhBBW0BAUVJTUVJBHA%3D%3D'
   19     2        ASSIGN                                                   !2, <array>
   21     3        INIT_FCALL                                               'json_decode'
          4        INIT_FCALL                                               'xor_encrypt'
          5        SEND_VAR                                                 !1
          6        DO_FCALL                                      0  $7      
          7        SEND_VAR                                                 $7
          8        SEND_VAL                                                 <true>
          9        DO_ICALL                                         $8      
         10        ASSIGN                                                   !3, $8
   22    11        TYPE_CHECK                                  128          !3
         12      > JMPZ                                                     ~10, ->18
   23    13    >   FETCH_DIM_R                                      ~11     !3, 'showpassword'
         14        ECHO                                                     ~11
   24    15        FETCH_DIM_R                                      ~12     !3, 'bgcolor'
         16        ECHO                                                     ~12
         17      > JMP                                                      ->19
   25    18    >   ECHO                                                     'Error%21'
   26    19    >   ECHO                                                     '+%3C%3E+'
   29    20        INIT_FCALL                                               'xor_encrypt'
         21        INIT_FCALL                                               'json_encode'
         22        SEND_VAR                                                 !2
         23        DO_ICALL                                         $13     
         24        SEND_VAR                                                 $13
         25        DO_FCALL                                      0  $14     
         26        ECHO                                                     $14
         27      > RETURN                                                   1

Function xor_encrypt:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
2 jumps found. (Code = 44) Position 1 = 16, Position 2 = 6
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
2 jumps found. (Code = 44) Position 1 = 16, Position 2 = 6
Branch analysis from position: 16
Branch analysis from position: 6
filename:       /in/HpfWa
function name:  xor_encrypt
number of ops:  18
compiled vars:  !0 = $in, !1 = $key, !2 = $text, !3 = $outText, !4 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
    7     1        ASSIGN                                                   !1, 'abc'
    8     2        ASSIGN                                                   !2, !0
    9     3        ASSIGN                                                   !3, ''
   12     4        ASSIGN                                                   !4, 0
          5      > JMP                                                      ->13
   13     6    >   FETCH_DIM_R                                      ~9      !2, !4
          7        STRLEN                                           ~10     !1
          8        MOD                                              ~11     !4, ~10
          9        FETCH_DIM_R                                      ~12     !1, ~11
         10        BW_XOR                                           ~13     ~9, ~12
         11        ASSIGN_OP                                     8          !3, ~13
   12    12        PRE_INC                                                  !4
         13    >   STRLEN                                           ~16     !2
         14        IS_SMALLER                                               !4, ~16
         15      > JMPNZ                                                    ~17, ->6
   16    16    > > RETURN                                                   !3
   17    17*     > RETURN                                                   null

End of function xor_encrypt

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
195.94 ms | 1403 KiB | 19 Q