3v4l.org

run code in 300+ PHP versions simultaneously
<?php function mymodule_decrypt_value($string) { // Si es una cadena vacía no hay nada que hacer if (empty($string)) { return FALSE; } $key ="12EstaClave34es56dificil489ssswf"; $iv ="Imphartoz.37hAES"; if (empty($key)) { watchdog('mymodule', 'No hay una clave para descifrar.', array(), WATCHDOG_ERROR); return FALSE; } if (empty($iv)) { watchdog('mymodule', 'No hay un vector de inicialización para descifrar.', array(), WATCHDOG_ERROR); return FALSE; } $plaintext_dec = mcrypt_decrypt(MCRYPT_RIJNDAEL_128, $key, base64_decode($string), MCRYPT_MODE_CBC, $iv); // Eliminar el padding return mymodule_unpadPKCS7($plaintext_dec); } function mymodule_unpadPKCS7($data) { $last = substr($data, -1); return substr($data, 0, strlen($data) - ord($last)); } mymodule_decrypt_value("V36B+ya6eMwElOoxswqGBw=="); echo "<h1>Hello, PHP!</h1>"; ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/7Xo8n
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   33     0  E >   INIT_FCALL                                               'mymodule_decrypt_value'
          1        SEND_VAL                                                 'V36B%2Bya6eMwElOoxswqGBw%3D%3D'
          2        DO_FCALL                                      0          
   34     3        ECHO                                                     '%3Ch1%3EHello%2C+PHP%21%3C%2Fh1%3E'
   35     4      > RETURN                                                   1

Function mymodule_decrypt_value:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 4
Branch analysis from position: 3
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 16
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
2 jumps found. (Code = 43) Position 1 = 18, Position 2 = 26
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 26
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/7Xo8n
function name:  mymodule_decrypt_value
number of ops:  44
compiled vars:  !0 = $string, !1 = $key, !2 = $iv, !3 = $plaintext_dec
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    5     1        ISSET_ISEMPTY_CV                                         !0
          2      > JMPZ                                                     ~4, ->4
    6     3    > > RETURN                                                   <false>
    9     4    >   ASSIGN                                                   !1, '12EstaClave34es56dificil489ssswf'
   10     5        ASSIGN                                                   !2, 'Imphartoz.37hAES'
   12     6        ISSET_ISEMPTY_CV                                         !1
          7      > JMPZ                                                     ~7, ->16
   13     8    >   INIT_FCALL_BY_NAME                                       'watchdog'
          9        SEND_VAL_EX                                              'mymodule'
         10        SEND_VAL_EX                                              'No+hay+una+clave+para+descifrar.'
         11        SEND_VAL_EX                                              <array>
         12        FETCH_CONSTANT                                   ~8      'WATCHDOG_ERROR'
         13        SEND_VAL_EX                                              ~8
         14        DO_FCALL                                      0          
   14    15      > RETURN                                                   <false>
   17    16    >   ISSET_ISEMPTY_CV                                         !2
         17      > JMPZ                                                     ~10, ->26
   18    18    >   INIT_FCALL_BY_NAME                                       'watchdog'
         19        SEND_VAL_EX                                              'mymodule'
         20        SEND_VAL_EX                                              'No+hay+un+vector+de+inicializaci%C3%B3n+para+descifrar.'
         21        SEND_VAL_EX                                              <array>
         22        FETCH_CONSTANT                                   ~11     'WATCHDOG_ERROR'
         23        SEND_VAL_EX                                              ~11
         24        DO_FCALL                                      0          
   19    25      > RETURN                                                   <false>
   21    26    >   INIT_FCALL_BY_NAME                                       'mcrypt_decrypt'
         27        FETCH_CONSTANT                                   ~13     'MCRYPT_RIJNDAEL_128'
         28        SEND_VAL_EX                                              ~13
         29        SEND_VAR_EX                                              !1
         30        INIT_FCALL                                               'base64_decode'
         31        SEND_VAR                                                 !0
         32        DO_ICALL                                         $14     
         33        SEND_VAR_NO_REF_EX                                       $14
         34        FETCH_CONSTANT                                   ~15     'MCRYPT_MODE_CBC'
         35        SEND_VAL_EX                                              ~15
         36        SEND_VAR_EX                                              !2
         37        DO_FCALL                                      0  $16     
         38        ASSIGN                                                   !3, $16
   24    39        INIT_FCALL_BY_NAME                                       'mymodule_unpadPKCS7'
         40        SEND_VAR_EX                                              !3
         41        DO_FCALL                                      0  $18     
         42      > RETURN                                                   $18
   25    43*     > RETURN                                                   null

End of function mymodule_decrypt_value

Function mymodule_unpadpkcs7:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/7Xo8n
function name:  mymodule_unpadPKCS7
number of ops:  18
compiled vars:  !0 = $data, !1 = $last
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   27     0  E >   RECV                                             !0      
   28     1        INIT_FCALL                                               'substr'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 -1
          4        DO_ICALL                                         $2      
          5        ASSIGN                                                   !1, $2
   29     6        INIT_FCALL                                               'substr'
          7        SEND_VAR                                                 !0
          8        SEND_VAL                                                 0
          9        STRLEN                                           ~4      !0
         10        INIT_FCALL                                               'ord'
         11        SEND_VAR                                                 !1
         12        DO_ICALL                                         $5      
         13        SUB                                              ~6      ~4, $5
         14        SEND_VAL                                                 ~6
         15        DO_ICALL                                         $7      
         16      > RETURN                                                   $7
   30    17*     > RETURN                                                   null

End of function mymodule_unpadpkcs7

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.06 ms | 1403 KiB | 20 Q