3v4l.org

run code in 300+ PHP versions simultaneously
<?php function unWebSafeAndPad($oriString) { $pad = ""; if (strlen($oriString) % 4 == 2) { $pad = "=="; } else if (strlen($oriString) % 4 == 3) { $pad = "="; } $aftString=str_replace('-','+',$oriString); $aftString=str_replace('_','/',$aftString); $aftString .=$pad; return $aftString; } $win_price_org="WS9LmQAOGIAKhxmVAAoLX-7A2eImDaKldk0BHQ"; // (*) $encodePrice=urldecode($win_price_org); $safePrice=unWebSafeAndPad($encodePrice); $decodePrice= base64_decode($safePrice); $eKey='2d0aIoOnAp8ZSTXEuqPJEm2GgE4Qp2KHcvxAjRhelSU='; // (*) $eKey=base64_decode($eKey); $iKey='uoVj+Ii4LUInow4xos46phIE2yq3J4otQzcYTfMcmk4='; // (*) $iKey=base64_decode($iKey); $iv=substr($decodePrice,0,16); $p=substr($decodePrice,16,8); $sig=substr($decodePrice,24,4); $pricePad = hash_hmac('sha1',$iv,$eKey,true); $price = $p ^ $pricePad; $priceRaw=unpack('c*',($price)); echo $price;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rit9B
function name:  (null)
number of ops:  57
compiled vars:  !0 = $win_price_org, !1 = $encodePrice, !2 = $safePrice, !3 = $decodePrice, !4 = $eKey, !5 = $iKey, !6 = $iv, !7 = $p, !8 = $sig, !9 = $pricePad, !10 = $price, !11 = $priceRaw
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   ASSIGN                                                   !0, 'WS9LmQAOGIAKhxmVAAoLX-7A2eImDaKldk0BHQ'
   16     1        INIT_FCALL                                               'urldecode'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $13     
          4        ASSIGN                                                   !1, $13
   17     5        INIT_FCALL                                               'unwebsafeandpad'
          6        SEND_VAR                                                 !1
          7        DO_FCALL                                      0  $15     
          8        ASSIGN                                                   !2, $15
   18     9        INIT_FCALL                                               'base64_decode'
         10        SEND_VAR                                                 !2
         11        DO_ICALL                                         $17     
         12        ASSIGN                                                   !3, $17
   19    13        ASSIGN                                                   !4, '2d0aIoOnAp8ZSTXEuqPJEm2GgE4Qp2KHcvxAjRhelSU%3D'
   20    14        INIT_FCALL                                               'base64_decode'
         15        SEND_VAR                                                 !4
         16        DO_ICALL                                         $20     
         17        ASSIGN                                                   !4, $20
   21    18        ASSIGN                                                   !5, 'uoVj%2BIi4LUInow4xos46phIE2yq3J4otQzcYTfMcmk4%3D'
   22    19        INIT_FCALL                                               'base64_decode'
         20        SEND_VAR                                                 !5
         21        DO_ICALL                                         $23     
         22        ASSIGN                                                   !5, $23
   23    23        INIT_FCALL                                               'substr'
         24        SEND_VAR                                                 !3
         25        SEND_VAL                                                 0
         26        SEND_VAL                                                 16
         27        DO_ICALL                                         $25     
         28        ASSIGN                                                   !6, $25
   24    29        INIT_FCALL                                               'substr'
         30        SEND_VAR                                                 !3
         31        SEND_VAL                                                 16
         32        SEND_VAL                                                 8
         33        DO_ICALL                                         $27     
         34        ASSIGN                                                   !7, $27
   25    35        INIT_FCALL                                               'substr'
         36        SEND_VAR                                                 !3
         37        SEND_VAL                                                 24
         38        SEND_VAL                                                 4
         39        DO_ICALL                                         $29     
         40        ASSIGN                                                   !8, $29
   26    41        INIT_FCALL                                               'hash_hmac'
         42        SEND_VAL                                                 'sha1'
         43        SEND_VAR                                                 !6
         44        SEND_VAR                                                 !4
         45        SEND_VAL                                                 <true>
         46        DO_ICALL                                         $31     
         47        ASSIGN                                                   !9, $31
   27    48        BW_XOR                                           ~33     !7, !9
         49        ASSIGN                                                   !10, ~33
   28    50        INIT_FCALL                                               'unpack'
         51        SEND_VAL                                                 'c%2A'
         52        SEND_VAR                                                 !10
         53        DO_ICALL                                         $35     
         54        ASSIGN                                                   !11, $35
   29    55        ECHO                                                     !10
         56      > RETURN                                                   1

Function unwebsafeandpad:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 8
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
2 jumps found. (Code = 43) Position 1 = 12, Position 2 = 13
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
filename:       /in/rit9B
function name:  unWebSafeAndPad
number of ops:  28
compiled vars:  !0 = $oriString, !1 = $pad, !2 = $aftString
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
    3     1        ASSIGN                                                   !1, ''
    4     2        STRLEN                                           ~4      !0
          3        MOD                                              ~5      ~4, 4
          4        IS_EQUAL                                                 ~5, 2
          5      > JMPZ                                                     ~6, ->8
    5     6    >   ASSIGN                                                   !1, '%3D%3D'
          7      > JMP                                                      ->13
    6     8    >   STRLEN                                           ~8      !0
          9        MOD                                              ~9      ~8, 4
         10        IS_EQUAL                                                 ~9, 3
         11      > JMPZ                                                     ~10, ->13
    7    12    >   ASSIGN                                                   !1, '%3D'
    9    13    >   INIT_FCALL                                               'str_replace'
         14        SEND_VAL                                                 '-'
         15        SEND_VAL                                                 '%2B'
         16        SEND_VAR                                                 !0
         17        DO_ICALL                                         $12     
         18        ASSIGN                                                   !2, $12
   10    19        INIT_FCALL                                               'str_replace'
         20        SEND_VAL                                                 '_'
         21        SEND_VAL                                                 '%2F'
         22        SEND_VAR                                                 !2
         23        DO_ICALL                                         $14     
         24        ASSIGN                                                   !2, $14
   11    25        ASSIGN_OP                                     8          !2, !1
   12    26      > RETURN                                                   !2
   13    27*     > RETURN                                                   null

End of function unwebsafeandpad

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
176.28 ms | 1407 KiB | 26 Q