There is a weird bug in AMFPHP regarding sending negative integers. If you try and send a number such as -87, it shows up as 4294967209 in php. I did some digging and found on the amfphp forums that it has to do with amfphp's readAmf3Int() method in AMFDeserialzer.php. Here is the updated function that was posted on the forum:

      function readAmf3Int()

          {
              $res = 0;
              $int = $this->readByte();
            
              if($int <128) {
                  return $int;
              } else {
                  $int = ($int & 0x7f) <<7;
                 
                  $tmp = $this->readByte();
                 
                  if($tmp <128) {
                      $int |= $tmp;
                  }else{
                      $int = ($int | ($tmp & 0x7f)) <<7;
                      $tmp = $this->readByte();
                      if($tmp <128){
                          $int |= $tmp;
                      }else{
                          $int = ($int | ($tmp & 0x7f)) <<8;
                          $tmp = $this->readByte();
                          $int |= $tmp;
                      }
                  }
              }
       
              $mask = 1<<28;
              $res = -($int & $mask) | $int;
       
              return $res;
          }

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-09-14
  • 2021-07-19
  • 2021-12-12
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-11-01
  • 2022-12-23
  • 2021-04-19
  • 2021-10-07
  • 2021-11-10
相关资源
相似解决方案