3v4l.org

run code in 300+ PHP versions simultaneously
<?php function encrypt($str) { $cryptedstr = ""; srand(3284724); for ($i =0; $i < strlen($str); $i++) { $temp = ord(substr($str,$i,1)) ^ rand(0, 255); while(strlen($temp)<3) { $temp = "0".$temp; } $cryptedstr .= $temp. ""; } return base64_encode($cryptedstr); } function decrypt ($str) { srand(3284724); if(preg_match('%^[a-zA-Z0-9/+]*={0,2}$%',$str)) { $str = base64_decode($str); if ($str != "" && $str != null && $str != false) { $decStr = ""; for ($i=0; $i < strlen($str); $i+=3) { $array[$i/3] = substr($str,$i,3); } foreach($array as $s) { $a = $s ^ rand(0, 255); $decStr .= chr($a); } return $decStr; } return false; } return false; } echo encrypt('Admin\' UNION SELECT password,1,2,3,4 FROM level3_users WHERE username=\'Admin');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/gqo28
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   48     0  E >   INIT_FCALL                                               'encrypt'
          1        SEND_VAL                                                 'Admin%27+UNION+SELECT+password%2C1%2C2%2C3%2C4+FROM+level3_users+WHERE+username%3D%27Admin'
          2        DO_FCALL                                      0  $0      
          3        ECHO                                                     $0
          4      > RETURN                                                   1

Function encrypt:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 30
Branch analysis from position: 30
2 jumps found. (Code = 44) Position 1 = 33, Position 2 = 7
Branch analysis from position: 33
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 24
Branch analysis from position: 24
2 jumps found. (Code = 44) Position 1 = 27, Position 2 = 22
Branch analysis from position: 27
2 jumps found. (Code = 44) Position 1 = 33, Position 2 = 7
Branch analysis from position: 33
Branch analysis from position: 7
Branch analysis from position: 22
2 jumps found. (Code = 44) Position 1 = 27, Position 2 = 22
Branch analysis from position: 27
Branch analysis from position: 22
filename:       /in/gqo28
function name:  encrypt
number of ops:  38
compiled vars:  !0 = $str, !1 = $cryptedstr, !2 = $i, !3 = $temp
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    5     1        ASSIGN                                                   !1, ''
    6     2        INIT_FCALL                                               'srand'
          3        SEND_VAL                                                 3284724
          4        DO_ICALL                                                 
    7     5        ASSIGN                                                   !2, 0
          6      > JMP                                                      ->30
    9     7    >   INIT_FCALL                                               'ord'
          8        INIT_FCALL                                               'substr'
          9        SEND_VAR                                                 !0
         10        SEND_VAR                                                 !2
         11        SEND_VAL                                                 1
         12        DO_ICALL                                         $7      
         13        SEND_VAR                                                 $7
         14        DO_ICALL                                         $8      
         15        INIT_FCALL                                               'rand'
         16        SEND_VAL                                                 0
         17        SEND_VAL                                                 255
         18        DO_ICALL                                         $9      
         19        BW_XOR                                           ~10     $8, $9
         20        ASSIGN                                                   !3, ~10
   11    21      > JMP                                                      ->24
   13    22    >   CONCAT                                           ~12     '0', !3
         23        ASSIGN                                                   !3, ~12
   11    24    >   STRLEN                                           ~14     !3
         25        IS_SMALLER                                               ~14, 3
         26      > JMPNZ                                                    ~15, ->22
   15    27    >   CONCAT                                           ~16     !3, ''
         28        ASSIGN_OP                                     8          !1, ~16
    7    29        PRE_INC                                                  !2
         30    >   STRLEN                                           ~19     !0
         31        IS_SMALLER                                               !2, ~19
         32      > JMPNZ                                                    ~20, ->7
   17    33    >   INIT_FCALL                                               'base64_encode'
         34        SEND_VAR                                                 !1
         35        DO_ICALL                                         $21     
         36      > RETURN                                                   $21
   18    37*     > RETURN                                                   null

End of function encrypt

Function decrypt:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 52
Branch analysis from position: 9
2 jumps found. (Code = 46) Position 1 = 15, Position 2 = 17
Branch analysis from position: 15
2 jumps found. (Code = 46) Position 1 = 18, Position 2 = 20
Branch analysis from position: 18
2 jumps found. (Code = 43) Position 1 = 21, Position 2 = 51
Branch analysis from position: 21
1 jumps found. (Code = 42) Position 1 = 33
Branch analysis from position: 33
2 jumps found. (Code = 44) Position 1 = 36, Position 2 = 24
Branch analysis from position: 36
2 jumps found. (Code = 77) Position 1 = 37, Position 2 = 49
Branch analysis from position: 37
2 jumps found. (Code = 78) Position 1 = 38, Position 2 = 49
Branch analysis from position: 38
1 jumps found. (Code = 42) Position 1 = 37
Branch analysis from position: 37
Branch analysis from position: 49
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 49
Branch analysis from position: 24
2 jumps found. (Code = 44) Position 1 = 36, Position 2 = 24
Branch analysis from position: 36
Branch analysis from position: 24
Branch analysis from position: 51
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 20
Branch analysis from position: 17
Branch analysis from position: 52
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/gqo28
function name:  decrypt
number of ops:  54
compiled vars:  !0 = $str, !1 = $decStr, !2 = $i, !3 = $array, !4 = $s, !5 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   RECV                                             !0      
   22     1        INIT_FCALL                                               'srand'
          2        SEND_VAL                                                 3284724
          3        DO_ICALL                                                 
   23     4        INIT_FCALL                                               'preg_match'
          5        SEND_VAL                                                 '%25%5E%5Ba-zA-Z0-9%2F%2B%5D%2A%3D%7B0%2C2%7D%24%25'
          6        SEND_VAR                                                 !0
          7        DO_ICALL                                         $7      
          8      > JMPZ                                                     $7, ->52
   25     9    >   INIT_FCALL                                               'base64_decode'
         10        SEND_VAR                                                 !0
         11        DO_ICALL                                         $8      
         12        ASSIGN                                                   !0, $8
   26    13        IS_NOT_EQUAL                                     ~10     !0, ''
         14      > JMPZ_EX                                          ~10     ~10, ->17
         15    >   IS_NOT_EQUAL                                     ~11     !0, null
         16        BOOL                                             ~10     ~11
         17    > > JMPZ_EX                                          ~10     ~10, ->20
         18    >   BOOL                                             ~12     !0
         19        BOOL                                             ~10     ~12
         20    > > JMPZ                                                     ~10, ->51
   28    21    >   ASSIGN                                                   !1, ''
   30    22        ASSIGN                                                   !2, 0
         23      > JMP                                                      ->33
   32    24    >   DIV                                              ~15     !2, 3
         25        INIT_FCALL                                               'substr'
         26        SEND_VAR                                                 !0
         27        SEND_VAR                                                 !2
         28        SEND_VAL                                                 3
         29        DO_ICALL                                         $17     
         30        ASSIGN_DIM                                               !3, ~15
         31        OP_DATA                                                  $17
   30    32        ASSIGN_OP                                     1          !2, 3
         33    >   STRLEN                                           ~19     !0
         34        IS_SMALLER                                               !2, ~19
         35      > JMPNZ                                                    ~20, ->24
   35    36    > > FE_RESET_R                                       $21     !3, ->49
         37    > > FE_FETCH_R                                               $21, !4, ->49
   37    38    >   INIT_FCALL                                               'rand'
         39        SEND_VAL                                                 0
         40        SEND_VAL                                                 255
         41        DO_ICALL                                         $22     
         42        BW_XOR                                           ~23     !4, $22
         43        ASSIGN                                                   !5, ~23
   38    44        INIT_FCALL                                               'chr'
         45        SEND_VAR                                                 !5
         46        DO_ICALL                                         $25     
         47        ASSIGN_OP                                     8          !1, $25
   35    48      > JMP                                                      ->37
         49    >   FE_FREE                                                  $21
   41    50      > RETURN                                                   !1
   43    51    > > RETURN                                                   <false>
   45    52    > > RETURN                                                   <false>
   46    53*     > RETURN                                                   null

End of function decrypt

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.81 ms | 1407 KiB | 30 Q