3v4l.org

run code in 300+ PHP versions simultaneously
<?php function decrypt($a) { $a1 = strtolower(strrev($a)); $a2 = hexdec(substr($a1,0, 4)) ^ hexdec('BFF') ^ hexdec('D77D'); $a3 = substr($a2,4); $a4 = ""; $a5 = 0; for($a5=0;$a5<strlen($a3);$a5+=6){ $a6 = ++$a5; } $mul=$a6 * $a6; $a7=$mul ^ hexdec('6E'); $ans = octdec(hexdec(substr($a3,0,6))) ^ hexdec('AFE43') ^ hexdec('399AA3') ^ $a7 ^ octdec(hexdec(substr($a3,0,6))); return $a4 . chr($ans); } define('__FLAG__', 'flag{hidden_flag}'); if(decrypt($_REQUEST['pass']) == 'pwning_the_phpreverse!') { __FLAG__; } ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 13
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
filename:       /in/TDnqO
function name:  (null)
number of ops:  14
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   29     0  E >   INIT_FCALL                                               'define'
          1        SEND_VAL                                                 '__FLAG__'
          2        SEND_VAL                                                 'flag%7Bhidden_flag%7D'
          3        DO_ICALL                                                 
   30     4        INIT_FCALL                                               'decrypt'
          5        FETCH_R                      global              ~1      '_REQUEST'
          6        FETCH_DIM_R                                      ~2      ~1, 'pass'
          7        SEND_VAL                                                 ~2
          8        DO_FCALL                                      0  $3      
          9        IS_EQUAL                                                 $3, 'pwning_the_phpreverse%21'
         10      > JMPZ                                                     ~4, ->13
   32    11    >   FETCH_CONSTANT                                   ~5      '__FLAG__'
         12        FREE                                                     ~5
   34    13    > > RETURN                                                   1

Function decrypt:
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 = 40, Position 2 = 34
Branch analysis from position: 40
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 34
2 jumps found. (Code = 44) Position 1 = 40, Position 2 = 34
Branch analysis from position: 40
Branch analysis from position: 34
filename:       /in/TDnqO
function name:  decrypt
number of ops:  86
compiled vars:  !0 = $a, !1 = $a1, !2 = $a2, !3 = $a3, !4 = $a4, !5 = $a5, !6 = $a6, !7 = $mul, !8 = $a7, !9 = $ans
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                                         $10     
          5        SEND_VAR                                                 $10
          6        DO_ICALL                                         $11     
          7        ASSIGN                                                   !1, $11
    5     8        INIT_FCALL                                               'hexdec'
          9        INIT_FCALL                                               'substr'
         10        SEND_VAR                                                 !1
         11        SEND_VAL                                                 0
         12        SEND_VAL                                                 4
         13        DO_ICALL                                         $13     
         14        SEND_VAR                                                 $13
         15        DO_ICALL                                         $14     
         16        INIT_FCALL                                               'hexdec'
         17        SEND_VAL                                                 'BFF'
         18        DO_ICALL                                         $15     
         19        BW_XOR                                           ~16     $14, $15
         20        INIT_FCALL                                               'hexdec'
         21        SEND_VAL                                                 'D77D'
         22        DO_ICALL                                         $17     
         23        BW_XOR                                           ~18     $17, ~16
         24        ASSIGN                                                   !2, ~18
    6    25        INIT_FCALL                                               'substr'
         26        SEND_VAR                                                 !2
         27        SEND_VAL                                                 4
         28        DO_ICALL                                         $20     
         29        ASSIGN                                                   !3, $20
    7    30        ASSIGN                                                   !4, ''
    8    31        ASSIGN                                                   !5, 0
    9    32        ASSIGN                                                   !5, 0
         33      > JMP                                                      ->37
   10    34    >   PRE_INC                                          ~25     !5
         35        ASSIGN                                                   !6, ~25
    9    36        ASSIGN_OP                                     1          !5, 6
         37    >   STRLEN                                           ~28     !3
         38        IS_SMALLER                                               !5, ~28
         39      > JMPNZ                                                    ~29, ->34
   12    40    >   MUL                                              ~30     !6, !6
         41        ASSIGN                                                   !7, ~30
   13    42        INIT_FCALL                                               'hexdec'
         43        SEND_VAL                                                 '6E'
         44        DO_ICALL                                         $32     
         45        BW_XOR                                           ~33     !7, $32
         46        ASSIGN                                                   !8, ~33
   15    47        INIT_FCALL                                               'octdec'
         48        INIT_FCALL                                               'hexdec'
         49        INIT_FCALL                                               'substr'
         50        SEND_VAR                                                 !3
         51        SEND_VAL                                                 0
         52        SEND_VAL                                                 6
         53        DO_ICALL                                         $35     
         54        SEND_VAR                                                 $35
         55        DO_ICALL                                         $36     
         56        SEND_VAR                                                 $36
         57        DO_ICALL                                         $37     
         58        INIT_FCALL                                               'hexdec'
         59        SEND_VAL                                                 'AFE43'
         60        DO_ICALL                                         $38     
         61        BW_XOR                                           ~39     $37, $38
         62        INIT_FCALL                                               'hexdec'
         63        SEND_VAL                                                 '399AA3'
         64        DO_ICALL                                         $40     
         65        BW_XOR                                           ~41     $40, ~39
         66        BW_XOR                                           ~42     !8, ~41
         67        INIT_FCALL                                               'octdec'
         68        INIT_FCALL                                               'hexdec'
         69        INIT_FCALL                                               'substr'
         70        SEND_VAR                                                 !3
         71        SEND_VAL                                                 0
         72        SEND_VAL                                                 6
         73        DO_ICALL                                         $43     
         74        SEND_VAR                                                 $43
         75        DO_ICALL                                         $44     
         76        SEND_VAR                                                 $44
         77        DO_ICALL                                         $45     
         78        BW_XOR                                           ~46     $45, ~42
         79        ASSIGN                                                   !9, ~46
   16    80        INIT_FCALL                                               'chr'
         81        SEND_VAR                                                 !9
         82        DO_ICALL                                         $48     
         83        CONCAT                                           ~49     !4, $48
         84      > RETURN                                                   ~49
   17    85*     > RETURN                                                   null

End of function decrypt

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
171.94 ms | 1398 KiB | 28 Q