3v4l.org

run code in 500+ PHP versions simultaneously
<?php function b62e($str) { if(mb_check_encoding($str, 'ASCII')) { $out = ''; $len = strlen($str); for($i=0; $i<$len; $i+=8) { $chunk = substr($str, $i, 8); $outlen = ceil( strlen($chunk)*8/6 );// 8bit/char in, 6bits/char out, round up $hex = bin2hex($chunk);// gmp won't convert from binary, so go via hex $raw = gmp_strval(gmp_init(ltrim($hex, '0'), 16), 62);// gmp doesn't like leading 0s $out .= str_pad($raw, $outlen, '0', STR_PAD_LEFT); } return $out; } return false;// unicode chars not supported } function b62d($str) { if(mb_check_encoding($str, 'ASCII')) { $out = ''; $len = strlen($str); for ($i=0; $i<$len; $i+=11) { $chunk = substr($str, $i, 11); $outlen = floor( strlen($chunk)*6/8 ); //6bit/char in, 8bits/char out, round down $raw = gmp_strval(gmp_init(ltrim($chunk, '0'), 62), 16); //gmp doesn't like leading 0s $pad = str_pad($raw, $outlen * 2, '0', STR_PAD_LEFT); //double output length as as we're going via hex (4bits/char) $out .= pack('H*', $pad); //same as hex2bin } return $out; } return false;// unicode chars not supported } function obf62rep($which){// make array before translate string $rep = []; $str1 = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; $str2 = 'GHIJKLMNqrstuvwx01OPQRSTUVWXYZhijklmnop23456789abcdefgyzABCDEF'; if($which){// while obfuscate from-->to $fr = str_split($str1); $to = $str2; }else{// while de-obfuscate to-->from $fr = str_split($str2); $to = $str1; } foreach($fr as $k=>$v){// make array tr-->to $rep[$v] = $to[$k]; } return $rep; } function obf62e($str){return strtr($str, obf62rep(1));}// translate string = obfuscate function obf62d($str){return strtr($str, obf62rep(0));}// translate back = deobfuscate function ob62e($str){return obf62e(b62e($str));}// encode base62 + obfuscate function ob62d($str){return b62d(obf62d($str));}// decode base62 + deobfuscate define('TAB',"\t--->\t"); for($i=0; $i<17; $i++){ $encoded = b62e($i); $encoded_obf= obf62e($encoded); $decoded_obf= obf62d($encoded_obf); $decoded = b62d($decoded_obf); echo $i.TAB.$encoded.TAB.$encoded_obf.TAB.$decoded_obf.TAB.$decoded.PHP_EOL; } //
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 37
Branch analysis from position: 37
2 jumps found. (Code = 44) Position 1 = 39, Position 2 = 6
Branch analysis from position: 39
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
2 jumps found. (Code = 44) Position 1 = 39, Position 2 = 6
Branch analysis from position: 39
Branch analysis from position: 6
filename:       /in/r2DsY
function name:  (null)
number of ops:  40
compiled vars:  !0 = $i, !1 = $encoded, !2 = $encoded_obf, !3 = $decoded_obf, !4 = $decoded
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   69     0  E >   INIT_FCALL                                                   'define'
          1        SEND_VAL                                                     'TAB'
          2        SEND_VAL                                                     '%09---%3E%09'
          3        DO_ICALL                                                     
   71     4        ASSIGN                                                       !0, 0
          5      > JMP                                                          ->37
   72     6    >   INIT_FCALL                                                   'b62e'
          7        SEND_VAR                                                     !0
          8        DO_FCALL                                          0  $7      
          9        ASSIGN                                                       !1, $7
   73    10        INIT_FCALL                                                   'obf62e'
         11        SEND_VAR                                                     !1
         12        DO_FCALL                                          0  $9      
         13        ASSIGN                                                       !2, $9
   74    14        INIT_FCALL                                                   'obf62d'
         15        SEND_VAR                                                     !2
         16        DO_FCALL                                          0  $11     
         17        ASSIGN                                                       !3, $11
   75    18        INIT_FCALL                                                   'b62d'
         19        SEND_VAR                                                     !3
         20        DO_FCALL                                          0  $13     
         21        ASSIGN                                                       !4, $13
   76    22        FETCH_CONSTANT                                       ~15     'TAB'
         23        CONCAT                                               ~16     !0, ~15
         24        CONCAT                                               ~17     ~16, !1
         25        FETCH_CONSTANT                                       ~18     'TAB'
         26        CONCAT                                               ~19     ~17, ~18
         27        CONCAT                                               ~20     ~19, !2
         28        FETCH_CONSTANT                                       ~21     'TAB'
         29        CONCAT                                               ~22     ~20, ~21
         30        CONCAT                                               ~23     ~22, !3
         31        FETCH_CONSTANT                                       ~24     'TAB'
         32        CONCAT                                               ~25     ~23, ~24
         33        CONCAT                                               ~26     ~25, !4
         34        CONCAT                                               ~27     ~26, '%0A'
         35        ECHO                                                         ~27
   71    36        PRE_INC                                                      !0
         37    >   IS_SMALLER                                                   !0, 17
         38      > JMPNZ                                                        ~29, ->6
   80    39    > > RETURN                                                       1

Function b62e:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 49
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 46
Branch analysis from position: 46
2 jumps found. (Code = 44) Position 1 = 48, Position 2 = 11
Branch analysis from position: 48
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
2 jumps found. (Code = 44) Position 1 = 48, Position 2 = 11
Branch analysis from position: 48
Branch analysis from position: 11
Branch analysis from position: 49
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/r2DsY
function name:  b62e
number of ops:  51
compiled vars:  !0 = $str, !1 = $out, !2 = $len, !3 = $i, !4 = $chunk, !5 = $outlen, !6 = $hex, !7 = $raw
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   RECV                                                 !0      
    4     1        INIT_FCALL                                                   'mb_check_encoding'
          2        SEND_VAR                                                     !0
          3        SEND_VAL                                                     'ASCII'
          4        DO_ICALL                                             $8      
          5      > JMPZ                                                         $8, ->49
    5     6    >   ASSIGN                                                       !1, ''
    6     7        STRLEN                                               ~10     !0
          8        ASSIGN                                                       !2, ~10
    7     9        ASSIGN                                                       !3, 0
         10      > JMP                                                          ->46
    8    11    >   FRAMELESS_ICALL_3                substr              ~13     !0, !3
         12        OP_DATA                                                      8
         13        ASSIGN                                                       !4, ~13
    9    14        INIT_FCALL                                                   'ceil'
         15        STRLEN                                               ~15     !4
         16        MUL                                                  ~16     ~15, 8
         17        DIV                                                  ~17     ~16, 6
         18        SEND_VAL                                                     ~17
         19        DO_ICALL                                             $18     
         20        ASSIGN                                                       !5, $18
   10    21        INIT_FCALL                                                   'bin2hex'
         22        SEND_VAR                                                     !4
         23        DO_ICALL                                             $20     
         24        ASSIGN                                                       !6, $20
   11    25        INIT_FCALL_BY_NAME                                           'gmp_strval'
         26        INIT_FCALL_BY_NAME                                           'gmp_init'
         27        INIT_FCALL                                                   'ltrim'
         28        SEND_VAR                                                     !6
         29        SEND_VAL                                                     '0'
         30        DO_ICALL                                             $22     
         31        SEND_VAR_NO_REF_EX                                           $22
         32        SEND_VAL_EX                                                  16
         33        DO_FCALL                                          0  $23     
         34        SEND_VAR_NO_REF_EX                                           $23
         35        SEND_VAL_EX                                                  62
         36        DO_FCALL                                          0  $24     
         37        ASSIGN                                                       !7, $24
   12    38        INIT_FCALL                                                   'str_pad'
         39        SEND_VAR                                                     !7
         40        SEND_VAR                                                     !5
         41        SEND_VAL                                                     '0'
         42        SEND_VAL                                                     0
         43        DO_ICALL                                             $26     
         44        ASSIGN_OP                                         8          !1, $26
    7    45        ASSIGN_OP                                         1          !3, 8
         46    >   IS_SMALLER                                                   !3, !2
         47      > JMPNZ                                                        ~29, ->11
   14    48    > > RETURN                                                       !1
   16    49    > > RETURN                                                       <false>
   17    50*     > RETURN                                                       null

End of function b62e

Function b62d:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 51
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 48
Branch analysis from position: 48
2 jumps found. (Code = 44) Position 1 = 50, Position 2 = 11
Branch analysis from position: 50
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
2 jumps found. (Code = 44) Position 1 = 50, Position 2 = 11
Branch analysis from position: 50
Branch analysis from position: 11
Branch analysis from position: 51
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/r2DsY
function name:  b62d
number of ops:  53
compiled vars:  !0 = $str, !1 = $out, !2 = $len, !3 = $i, !4 = $chunk, !5 = $outlen, !6 = $raw, !7 = $pad
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   20     0  E >   RECV                                                 !0      
   21     1        INIT_FCALL                                                   'mb_check_encoding'
          2        SEND_VAR                                                     !0
          3        SEND_VAL                                                     'ASCII'
          4        DO_ICALL                                             $8      
          5      > JMPZ                                                         $8, ->51
   22     6    >   ASSIGN                                                       !1, ''
   23     7        STRLEN                                               ~10     !0
          8        ASSIGN                                                       !2, ~10
   24     9        ASSIGN                                                       !3, 0
         10      > JMP                                                          ->48
   25    11    >   FRAMELESS_ICALL_3                substr              ~13     !0, !3
         12        OP_DATA                                                      11
         13        ASSIGN                                                       !4, ~13
   26    14        INIT_FCALL                                                   'floor'
         15        STRLEN                                               ~15     !4
         16        MUL                                                  ~16     ~15, 6
         17        DIV                                                  ~17     ~16, 8
         18        SEND_VAL                                                     ~17
         19        DO_ICALL                                             $18     
         20        ASSIGN                                                       !5, $18
   27    21        INIT_FCALL_BY_NAME                                           'gmp_strval'
         22        INIT_FCALL_BY_NAME                                           'gmp_init'
         23        INIT_FCALL                                                   'ltrim'
         24        SEND_VAR                                                     !4
         25        SEND_VAL                                                     '0'
         26        DO_ICALL                                             $20     
         27        SEND_VAR_NO_REF_EX                                           $20
         28        SEND_VAL_EX                                                  62
         29        DO_FCALL                                          0  $21     
         30        SEND_VAR_NO_REF_EX                                           $21
         31        SEND_VAL_EX                                                  16
         32        DO_FCALL                                          0  $22     
         33        ASSIGN                                                       !6, $22
   28    34        INIT_FCALL                                                   'str_pad'
         35        SEND_VAR                                                     !6
         36        MUL                                                  ~24     !5, 2
         37        SEND_VAL                                                     ~24
         38        SEND_VAL                                                     '0'
         39        SEND_VAL                                                     0
         40        DO_ICALL                                             $25     
         41        ASSIGN                                                       !7, $25
   29    42        INIT_FCALL                                                   'pack'
         43        SEND_VAL                                                     'H%2A'
         44        SEND_VAR                                                     !7
         45        DO_ICALL                                             $27     
         46        ASSIGN_OP                                         8          !1, $27
   24    47        ASSIGN_OP                                         1          !3, 11
         48    >   IS_SMALLER                                                   !3, !2
         49      > JMPNZ                                                        ~30, ->11
   31    50    > > RETURN                                                       !1
   33    51    > > RETURN                                                       <false>
   34    52*     > RETURN                                                       null

End of function b62d

Function obf62rep:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 11
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
2 jumps found. (Code = 77) Position 1 = 17, Position 2 = 23
Branch analysis from position: 17
2 jumps found. (Code = 78) Position 1 = 18, Position 2 = 23
Branch analysis from position: 18
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
Branch analysis from position: 23
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 23
Branch analysis from position: 11
2 jumps found. (Code = 77) Position 1 = 17, Position 2 = 23
Branch analysis from position: 17
Branch analysis from position: 23
filename:       /in/r2DsY
function name:  obf62rep
number of ops:  26
compiled vars:  !0 = $which, !1 = $rep, !2 = $str1, !3 = $str2, !4 = $fr, !5 = $to, !6 = $v, !7 = $k
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   38     0  E >   RECV                                                 !0      
   39     1        ASSIGN                                                       !1, <array>
   40     2        ASSIGN                                                       !2, '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
   41     3        ASSIGN                                                       !3, 'GHIJKLMNqrstuvwx01OPQRSTUVWXYZhijklmnop23456789abcdefgyzABCDEF'
   42     4      > JMPZ                                                         !0, ->11
   43     5    >   INIT_FCALL                                                   'str_split'
          6        SEND_VAR                                                     !2
          7        DO_ICALL                                             $11     
          8        ASSIGN                                                       !4, $11
   44     9        ASSIGN                                                       !5, !3
   42    10      > JMP                                                          ->16
   46    11    >   INIT_FCALL                                                   'str_split'
         12        SEND_VAR                                                     !3
         13        DO_ICALL                                             $14     
         14        ASSIGN                                                       !4, $14
   47    15        ASSIGN                                                       !5, !2
   49    16    > > FE_RESET_R                                           $17     !4, ->23
         17    > > FE_FETCH_R                                           ~18     $17, !6, ->23
         18    >   ASSIGN                                                       !7, ~18
   50    19        FETCH_DIM_R                                          ~21     !5, !7
         20        ASSIGN_DIM                                                   !1, !6
         21        OP_DATA                                                      ~21
   49    22      > JMP                                                          ->17
         23    >   FE_FREE                                                      $17
   52    24      > RETURN                                                       !1
   53    25*     > RETURN                                                       null

End of function obf62rep

Function obf62e:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/r2DsY
function name:  obf62e
number of ops:  7
compiled vars:  !0 = $str
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   57     0  E >   RECV                                                 !0      
          1        INIT_FCALL                                                   'obf62rep'
          2        SEND_VAL                                                     1
          3        DO_FCALL                                          0  $1      
          4        FRAMELESS_ICALL_2                strtr               ~2      !0, $1
          5      > RETURN                                                       ~2
          6*     > RETURN                                                       null

End of function obf62e

Function obf62d:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/r2DsY
function name:  obf62d
number of ops:  7
compiled vars:  !0 = $str
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   58     0  E >   RECV                                                 !0      
          1        INIT_FCALL                                                   'obf62rep'
          2        SEND_VAL                                                     0
          3        DO_FCALL                                          0  $1      
          4        FRAMELESS_ICALL_2                strtr               ~2      !0, $1
          5      > RETURN                                                       ~2
          6*     > RETURN                                                       null

End of function obf62d

Function ob62e:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/r2DsY
function name:  ob62e
number of ops:  9
compiled vars:  !0 = $str
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   61     0  E >   RECV                                                 !0      
          1        INIT_FCALL                                                   'obf62e'
          2        INIT_FCALL                                                   'b62e'
          3        SEND_VAR                                                     !0
          4        DO_FCALL                                          0  $1      
          5        SEND_VAR                                                     $1
          6        DO_FCALL                                          0  $2      
          7      > RETURN                                                       $2
          8*     > RETURN                                                       null

End of function ob62e

Function ob62d:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/r2DsY
function name:  ob62d
number of ops:  9
compiled vars:  !0 = $str
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   62     0  E >   RECV                                                 !0      
          1        INIT_FCALL                                                   'b62d'
          2        INIT_FCALL                                                   'obf62d'
          3        SEND_VAR                                                     !0
          4        DO_FCALL                                          0  $1      
          5        SEND_VAR                                                     $1
          6        DO_FCALL                                          0  $2      
          7      > RETURN                                                       $2
          8*     > RETURN                                                       null

End of function ob62d

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
157.11 ms | 2305 KiB | 32 Q