3v4l.org

run code in 500+ PHP versions simultaneously
<?php function xor_encrypt($in) { $key = '<censored>'; $text = $in; $outText = ''; // Iterate through each character for($i=0;$i<strlen($text);$i++) { $outText .= $text[$i] ^ $key[$i % strlen($key)]; } return $outText; } $cookies ="EGAgHwQ1IxYYMSQYGSZxTUksPFVHYDEQCC0%2FGBlgaVVIJDURDSQ1VRY%3D"; $urlC = urldecode($cookies); $guess_key = ''; for ($i = 0; $i < strlen($known_plain); $i++) { $guess_key .= $cipher[$i] ^ $known_plain[$i]; } echo $guess_key; $step1 = base64_decode($urlC); $known_plain = '{"showpassword":"no"'; $tempdata = json_decode(xor_encrypt(base64_decode($urlC)), true);
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 = 8
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
2 jumps found. (Code = 44) Position 1 = 16, Position 2 = 8
Branch analysis from position: 16
Branch analysis from position: 8
filename:       /in/0fkhp
function name:  (null)
number of ops:  34
compiled vars:  !0 = $cookies, !1 = $urlC, !2 = $guess_key, !3 = $i, !4 = $cipher, !5 = $known_plain, !6 = $step1, !7 = $tempdata
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   16     0  E >   ASSIGN                                                       !0, 'EGAgHwQ1IxYYMSQYGSZxTUksPFVHYDEQCC0%252FGBlgaVVIJDURDSQ1VRY%253D'
   17     1        INIT_FCALL                                                   'urldecode'
          2        SEND_VAR                                                     !0
          3        DO_ICALL                                             $9      
          4        ASSIGN                                                       !1, $9
   19     5        ASSIGN                                                       !2, ''
   20     6        ASSIGN                                                       !3, 0
          7      > JMP                                                          ->13
   21     8    >   FETCH_DIM_R                                          ~13     !4, !3
          9        FETCH_DIM_R                                          ~14     !5, !3
         10        BW_XOR                                               ~15     ~13, ~14
         11        ASSIGN_OP                                         8          !2, ~15
   20    12        PRE_INC                                                      !3
         13    >   STRLEN                                               ~18     !5
         14        IS_SMALLER                                                   !3, ~18
         15      > JMPNZ                                                        ~19, ->8
   23    16    >   ECHO                                                         !2
   25    17        INIT_FCALL                                                   'base64_decode'
         18        SEND_VAR                                                     !1
         19        DO_ICALL                                             $20     
         20        ASSIGN                                                       !6, $20
   27    21        ASSIGN                                                       !5, '%7B%22showpassword%22%3A%22no%22'
   30    22        INIT_FCALL                                                   'json_decode'
         23        INIT_FCALL                                                   'xor_encrypt'
         24        INIT_FCALL                                                   'base64_decode'
         25        SEND_VAR                                                     !1
         26        DO_ICALL                                             $23     
         27        SEND_VAR                                                     $23
         28        DO_FCALL                                          0  $24     
         29        SEND_VAR                                                     $24
         30        SEND_VAL                                                     <true>
         31        DO_ICALL                                             $25     
         32        ASSIGN                                                       !7, $25
         33      > 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/0fkhp
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
-----------------------------------------------------------------------------------------
    3     0  E >   RECV                                                 !0      
    4     1        ASSIGN                                                       !1, '%3Ccensored%3E'
    5     2        ASSIGN                                                       !2, !0
    6     3        ASSIGN                                                       !3, ''
    9     4        ASSIGN                                                       !4, 0
          5      > JMP                                                          ->13
   10     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
    9    12        PRE_INC                                                      !4
         13    >   STRLEN                                               ~16     !2
         14        IS_SMALLER                                                   !4, ~16
         15      > JMPNZ                                                        ~17, ->6
   13    16    > > RETURN                                                       !3
   14    17*     > RETURN                                                       null

End of function xor_encrypt

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
133.66 ms | 488 KiB | 11 Q