3v4l.org

run code in 300+ 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 = 52
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 49
Branch analysis from position: 49
2 jumps found. (Code = 44) Position 1 = 51, Position 2 = 11
Branch analysis from position: 51
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
2 jumps found. (Code = 44) Position 1 = 51, Position 2 = 11
Branch analysis from position: 51
Branch analysis from position: 11
Branch analysis from position: 52
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/r2DsY
function name:  b62e
number of ops:  54
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, ->52
    5     6    >   ASSIGN                                                   !1, ''
    6     7        STRLEN                                           ~10     !0
          8        ASSIGN                                                   !2, ~10
    7     9        ASSIGN                                                   !3, 0
         10      > JMP                                                      ->49
    8    11    >   INIT_FCALL                                               'substr'
         12        SEND_VAR                                                 !0
         13        SEND_VAR                                                 !3
         14        SEND_VAL                                                 8
         15        DO_ICALL                                         $13     
         16        ASSIGN                                                   !4, $13
    9    17        INIT_FCALL                                               'ceil'
         18        STRLEN                                           ~15     !4
         19        MUL                                              ~16     ~15, 8
         20        DIV                                              ~17     ~16, 6
         21        SEND_VAL                                                 ~17
         22        DO_ICALL                                         $18     
         23        ASSIGN                                                   !5, $18
   10    24        INIT_FCALL                                               'bin2hex'
         25        SEND_VAR                                                 !4
         26        DO_ICALL                                         $20     
         27        ASSIGN                                                   !6, $20
   11    28        INIT_FCALL_BY_NAME                                       'gmp_strval'
         29        INIT_FCALL_BY_NAME                                       'gmp_init'
         30        INIT_FCALL                                               'ltrim'
         31        SEND_VAR                                                 !6
         32        SEND_VAL                                                 '0'
         33        DO_ICALL                                         $22     
         34        SEND_VAR_NO_REF_EX                                       $22
         35        SEND_VAL_EX                                              16
         36        DO_FCALL                                      0  $23     
         37        SEND_VAR_NO_REF_EX                                       $23
         38        SEND_VAL_EX                                              62
         39        DO_FCALL                                      0  $24     
         40        ASSIGN                                                   !7, $24
   12    41        INIT_FCALL                                               'str_pad'
         42        SEND_VAR                                                 !7
         43        SEND_VAR                                                 !5
         44        SEND_VAL                                                 '0'
         45        SEND_VAL                                                 0
         46        DO_ICALL                                         $26     
         47        ASSIGN_OP                                     8          !1, $26
    7    48        ASSIGN_OP                                     1          !3, 8
         49    >   IS_SMALLER                                               !3, !2
         50      > JMPNZ                                                    ~29, ->11
   14    51    > > RETURN                                                   !1
   16    52    > > RETURN                                                   <false>
   17    53*     > 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 = 54
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 51
Branch analysis from position: 51
2 jumps found. (Code = 44) Position 1 = 53, Position 2 = 11
Branch analysis from position: 53
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
2 jumps found. (Code = 44) Position 1 = 53, Position 2 = 11
Branch analysis from position: 53
Branch analysis from position: 11
Branch analysis from position: 54
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/r2DsY
function name:  b62d
number of ops:  56
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, ->54
   22     6    >   ASSIGN                                                   !1, ''
   23     7        STRLEN                                           ~10     !0
          8        ASSIGN                                                   !2, ~10
   24     9        ASSIGN                                                   !3, 0
         10      > JMP                                                      ->51
   25    11    >   INIT_FCALL                                               'substr'
         12        SEND_VAR                                                 !0
         13        SEND_VAR                                                 !3
         14        SEND_VAL                                                 11
         15        DO_ICALL                                         $13     
         16        ASSIGN                                                   !4, $13
   26    17        INIT_FCALL                                               'floor'
         18        STRLEN                                           ~15     !4
         19        MUL                                              ~16     ~15, 6
         20        DIV                                              ~17     ~16, 8
         21        SEND_VAL                                                 ~17
         22        DO_ICALL                                         $18     
         23        ASSIGN                                                   !5, $18
   27    24        INIT_FCALL_BY_NAME                                       'gmp_strval'
         25        INIT_FCALL_BY_NAME                                       'gmp_init'
         26        INIT_FCALL                                               'ltrim'
         27        SEND_VAR                                                 !4
         28        SEND_VAL                                                 '0'
         29        DO_ICALL                                         $20     
         30        SEND_VAR_NO_REF_EX                                       $20
         31        SEND_VAL_EX                                              62
         32        DO_FCALL                                      0  $21     
         33        SEND_VAR_NO_REF_EX                                       $21
         34        SEND_VAL_EX                                              16
         35        DO_FCALL                                      0  $22     
         36        ASSIGN                                                   !6, $22
   28    37        INIT_FCALL                                               'str_pad'
         38        SEND_VAR                                                 !6
         39        MUL                                              ~24     !5, 2
         40        SEND_VAL                                                 ~24
         41        SEND_VAL                                                 '0'
         42        SEND_VAL                                                 0
         43        DO_ICALL                                         $25     
         44        ASSIGN                                                   !7, $25
   29    45        INIT_FCALL                                               'pack'
         46        SEND_VAL                                                 'H%2A'
         47        SEND_VAR                                                 !7
         48        DO_ICALL                                         $27     
         49        ASSIGN_OP                                     8          !1, $27
   24    50        ASSIGN_OP                                     1          !3, 11
         51    >   IS_SMALLER                                               !3, !2
         52      > JMPNZ                                                    ~30, ->11
   31    53    > > RETURN                                                   !1
   33    54    > > RETURN                                                   <false>
   34    55*     > 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:  10
compiled vars:  !0 = $str
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   57     0  E >   RECV                                             !0      
          1        INIT_FCALL                                               'strtr'
          2        SEND_VAR                                                 !0
          3        INIT_FCALL                                               'obf62rep'
          4        SEND_VAL                                                 1
          5        DO_FCALL                                      0  $1      
          6        SEND_VAR                                                 $1
          7        DO_ICALL                                         $2      
          8      > RETURN                                                   $2
          9*     > 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:  10
compiled vars:  !0 = $str
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   58     0  E >   RECV                                             !0      
          1        INIT_FCALL                                               'strtr'
          2        SEND_VAR                                                 !0
          3        INIT_FCALL                                               'obf62rep'
          4        SEND_VAL                                                 0
          5        DO_FCALL                                      0  $1      
          6        SEND_VAR                                                 $1
          7        DO_ICALL                                         $2      
          8      > RETURN                                                   $2
          9*     > 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.0.0


preferences:
163.02 ms | 1036 KiB | 34 Q