解析AMF3对象

时间:2012-08-21 09:02:36

标签: parsing object actionscript amf

我正在尝试解码包含AMF3的AMF0消息..一切都很好  除了理解U29格式和字符串编码的方式  在AMF4

  channel=3  size=134  pkttype=0x11  time=1973

  00000: 00 02 00 14 73 65 6E 64  55 6E 69 76 65 72 73 61  6C 4D 65 73     ....sendUniversalMes
  00020: 73 61 67 65 00 00 00 00  00 00 00 00 00 05 02 00  11 6D 62 5F     sage.............mb_
  00040: 31 32 32 31 30 5F 37 35  39 32 33 33 38 30 05 00  40 58 C0 00     12210_75923380..@X..
  00060: 00 00 00 00 11 0A 0B 01  09 68 62 69 64 04 81 CF  5E 09 73 72     .........hbid...^.sr
  00080: 63 65 06 49 63 37 62 39  32 33 65 65 2D 30 61 30  38 2D 34 62     ce.Ic7b923ee-0a08-4b
  00100: 61 32 2D 38 65 37 63 2D  63 38 32 61 39 33 64 37  37 31 34 32     a2-8e7c-c82a93d77142
  00120: 09 68 62 64 6C 04 00 09  74 65 78 74 01 01                        .hbdl...text..

  first byte I skip 
  02 = string
  00 14 = length of string ( 20 characters , sendUniversalMessage )
  00 00 00 00 00 00 00 00 00 = number = 0
  05 = null
  02 = string
  00 11 = length of string ( 17 characters , mb_12210_75923380 )
  05 = null
  00 40 58 C0 00 00 00 00 00 = number = 99
  11 = AMV+

  here is where I have problems

  0A = AMF3 object 
  now I need to do a readU29 which starts with
  0B = what does this mean
  01 = what does this mean
  09 = what does this mean

  where is the length of the string 'hbid' ?

1 个答案:

答案 0 :(得分:3)

在U29中

,如果第一个字节的值小于128,则它适合第一个字节。所以你必须把它读作3个不同的u29,值得0B,01,09。

0B:有关对象类型的详细信息。看起来你对那个字节不太感兴趣而且它很复杂,所以传递。

01:LSB表示这不是字符串引用。然后01>> 1 = 0是类名的长度。这意味着空字符串,这意味着这是一个匿名(无类型)对象。

09:= 00001001. LSB也表示这不是字符串引用。然后1001>> 1 = 0100 = 4是字符串长度。

希望有所帮助

相关问题