3v4l.org

run code in 300+ PHP versions simultaneously
<?php function decrypt($a) { $strings = strtolower(strrev($a)); $MyKey = hexdec(substr($strings, 0, 4)) ^ hexdec('BFF') ^ hexdec('D77D'); $Temps = substr($strings, 4); unset($tmp); //echo $n; for ($i = 0; $i < strlen($Temps); $i+=6) { ++$n; $cal = ($n * $n) ^ hexdec("3E"); //echo chr(octdec(hexdec(substr($Temps, $i, 6))) ^ ($MyKey ^ hexdec("AFE43") ^ hexdec("399AA3") ^ $cal)) . "\n"; $tmp = $tmp . chr(octdec(hexdec(substr($Temps, $i, 6))) ^ ($MyKey ^ hexdec('AFE43') ^ hexdec('399AA3') ^ $cal)); } return $tmp; } echo decrypt('DEFBFD2EFBFDBCFBFD58FBFD56FBFD31FBFDDFEBFD3BEBFD48EBFD16EBFD83EBFD2DDBFDDFDBFDBCDBFDCBDBFD87DBFDB9DBFDB5DBFD76DBFDF6DBFDF5DBFDD5DBFD82ED'); define('__FLAG__', 'flag{hidden_flag}'); if(decrypt('pass') == 'pwning_the_phpreverse!') { __FLAG__; } ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 13, Position 2 = 15
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
filename:       /in/XsoK5
function name:  (null)
number of ops:  16
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   INIT_FCALL                                               'decrypt'
          1        SEND_VAL                                                 'DEFBFD2EFBFDBCFBFD58FBFD56FBFD31FBFDDFEBFD3BEBFD48EBFD16EBFD83EBFD2DDBFDDFDBFDBCDBFDCBDBFD87DBFDB9DBFDB5DBFD76DBFDF6DBFDF5DBFDD5DBFD82ED'
          2        DO_FCALL                                      0  $0      
          3        ECHO                                                     $0
   22     4        INIT_FCALL                                               'define'
          5        SEND_VAL                                                 '__FLAG__'
          6        SEND_VAL                                                 'flag%7Bhidden_flag%7D'
          7        DO_ICALL                                                 
   23     8        INIT_FCALL                                               'decrypt'
          9        SEND_VAL                                                 'pass'
         10        DO_FCALL                                      0  $2      
         11        IS_EQUAL                                                 $2, 'pwning_the_phpreverse%21'
         12      > JMPZ                                                     ~3, ->15
   25    13    >   FETCH_CONSTANT                                   ~4      '__FLAG__'
         14        FREE                                                     ~4
   27    15    > > RETURN                                                   1

Function decrypt:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 67
Branch analysis from position: 67
2 jumps found. (Code = 44) Position 1 = 70, Position 2 = 33
Branch analysis from position: 70
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 33
2 jumps found. (Code = 44) Position 1 = 70, Position 2 = 33
Branch analysis from position: 70
Branch analysis from position: 33
filename:       /in/XsoK5
function name:  decrypt
number of ops:  72
compiled vars:  !0 = $a, !1 = $strings, !2 = $MyKey, !3 = $Temps, !4 = $tmp, !5 = $i, !6 = $n, !7 = $cal
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
    4     1        INIT_FCALL                                               'strtolower'
          2        INIT_FCALL                                               'strrev'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $8      
          5        SEND_VAR                                                 $8
          6        DO_ICALL                                         $9      
          7        ASSIGN                                                   !1, $9
    5     8        INIT_FCALL                                               'hexdec'
          9        INIT_FCALL                                               'substr'
         10        SEND_VAR                                                 !1
         11        SEND_VAL                                                 0
         12        SEND_VAL                                                 4
         13        DO_ICALL                                         $11     
         14        SEND_VAR                                                 $11
         15        DO_ICALL                                         $12     
         16        INIT_FCALL                                               'hexdec'
         17        SEND_VAL                                                 'BFF'
         18        DO_ICALL                                         $13     
         19        BW_XOR                                           ~14     $12, $13
         20        INIT_FCALL                                               'hexdec'
         21        SEND_VAL                                                 'D77D'
         22        DO_ICALL                                         $15     
         23        BW_XOR                                           ~16     $15, ~14
         24        ASSIGN                                                   !2, ~16
    6    25        INIT_FCALL                                               'substr'
         26        SEND_VAR                                                 !1
         27        SEND_VAL                                                 4
         28        DO_ICALL                                         $18     
         29        ASSIGN                                                   !3, $18
    7    30        UNSET_CV                                                 !4
    9    31        ASSIGN                                                   !5, 0
         32      > JMP                                                      ->67
   11    33    >   PRE_INC                                                  !6
   12    34        MUL                                              ~22     !6, !6
         35        INIT_FCALL                                               'hexdec'
         36        SEND_VAL                                                 '3E'
         37        DO_ICALL                                         $23     
         38        BW_XOR                                           ~24     $23, ~22
         39        ASSIGN                                                   !7, ~24
   14    40        INIT_FCALL                                               'chr'
         41        INIT_FCALL                                               'octdec'
         42        INIT_FCALL                                               'hexdec'
         43        INIT_FCALL                                               'substr'
         44        SEND_VAR                                                 !3
         45        SEND_VAR                                                 !5
         46        SEND_VAL                                                 6
         47        DO_ICALL                                         $26     
         48        SEND_VAR                                                 $26
         49        DO_ICALL                                         $27     
         50        SEND_VAR                                                 $27
         51        DO_ICALL                                         $28     
         52        INIT_FCALL                                               'hexdec'
         53        SEND_VAL                                                 'AFE43'
         54        DO_ICALL                                         $29     
         55        BW_XOR                                           ~30     !2, $29
         56        INIT_FCALL                                               'hexdec'
         57        SEND_VAL                                                 '399AA3'
         58        DO_ICALL                                         $31     
         59        BW_XOR                                           ~32     $31, ~30
         60        BW_XOR                                           ~33     !7, ~32
         61        BW_XOR                                           ~34     $28, ~33
         62        SEND_VAL                                                 ~34
         63        DO_ICALL                                         $35     
         64        CONCAT                                           ~36     !4, $35
         65        ASSIGN                                                   !4, ~36
    9    66        ASSIGN_OP                                     1          !5, 6
         67    >   STRLEN                                           ~39     !3
         68        IS_SMALLER                                               !5, ~39
         69      > JMPNZ                                                    ~40, ->33
   16    70    > > RETURN                                                   !4
   18    71*     > RETURN                                                   null

End of function decrypt

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.47 ms | 1407 KiB | 29 Q