Skip to main content
Participant
May 15, 2018
Answered

AMF-message New type of object "Externalized object" this.readByte() == 168 What type of object ???

  • May 15, 2018
  • 2 replies
  • 1205 views

Good day!

Sorry for my bad english. I'm web developer and implementing work with AMF-message on client side (via javascript) Base JS library - https://github.com/jamesward/JSAMF/blob/master/web/web/amf.js Now i have expanded part of it and i have a problem with a new AMF-object "Externalized object" Screen for example: https://i.stack.imgur.com/m3pXd.png Paralelly i'm learning a documentation about format AMF3 https://en.wikipedia.org/wiki/Action_Message_Format In wikipedia we can see var marker = this.readByte(); His value between [0x00 .. 0x11]   Unknown format "Externalized object" has value 168 Nothing in documentation about it. Please help me.. How right read/write this object? Please source in flash, java or will send links for it

Ideally source on javascript. But i understand it's fantastic. Need to make himself

By the code:

1) this.readByte() => received value "168" //type of element

2) this.readUInt29() => received value "1" //value of element

3) this.readStringAMF3() => received value "undefined"

next I'm reading correctly inside objects and next I have a lot of problems..

Maximum that i can received - part of values of object values and i can not to correctly read. I think it's compressed data.

Can you help me?

How does right saves "Externalized object" in the bytes? If it's to compress - how I would to do to compress correctly?

This topic has been closed for replies.
Correct answer jeromiec83223024

There are AMF implementations in Flex and BlazeDS, both of which Adobe made open-source and donated to the Apache Foundation.  You should be able to use them for reference.  I still think you're decoding something wrong.  There's no constant that I can find that corresponds to the value that you're talking about.  I think that if you look at how externalized objects are handled in the decoding implementations, it should yield some useful clues.

There's a Java implementation in BlazeDS that you could use for reference. 

http://www.apache.org/dyn/closer.lua/flex/BlazeDS/4.7.3/blazeds-4.7.3-source-release.zip

Check out blazeds-4.7.3/core/src/main/java/flex/messaging/io/amf/

You might also check out the implementation in Flex:

http://www.apache.org/dyn/closer.lua/flex/4.16.1/apache-flex-sdk-4.16.1-src.tar.gz

apache-flex-sdk-4.16.1-src/frameworks/projects/rpc/src/mx/messaging/channels

2 replies

Legend
May 16, 2018

No doubt someone knows, or once knew, the information. What I doubt is that you will find a person who can and will answer your question. I'm pretty sure Adobe will not consider it their job to help you. I consider your demands optimistic at best. Still, it would be nice for me to be proved wrong in this case.

jeromiec83223024
jeromiec83223024Correct answer
Inspiring
May 16, 2018

There are AMF implementations in Flex and BlazeDS, both of which Adobe made open-source and donated to the Apache Foundation.  You should be able to use them for reference.  I still think you're decoding something wrong.  There's no constant that I can find that corresponds to the value that you're talking about.  I think that if you look at how externalized objects are handled in the decoding implementations, it should yield some useful clues.

There's a Java implementation in BlazeDS that you could use for reference. 

http://www.apache.org/dyn/closer.lua/flex/BlazeDS/4.7.3/blazeds-4.7.3-source-release.zip

Check out blazeds-4.7.3/core/src/main/java/flex/messaging/io/amf/

You might also check out the implementation in Flex:

http://www.apache.org/dyn/closer.lua/flex/4.16.1/apache-flex-sdk-4.16.1-src.tar.gz

apache-flex-sdk-4.16.1-src/frameworks/projects/rpc/src/mx/messaging/channels

Participant
May 18, 2018

All behaviours for types of:

161 - Externalized Object Reference

168 - Externalized Object

have been implemented. Thanks for all

John T Smith
Community Expert
Community Expert
May 15, 2018

The Lounge Forum is not for technical help, please provide the name of the program you are using so your message may be moved to the correct program forum... A program would be Photoshop or Dreamweaver or Muse or Premiere Pro or ???

Participant
May 15, 2018

AMF - it's a protokol exchange data between flash and server. Flash - it's a Adobe photoshop and other programs. So, I have a problem with exchange data between flash and server. Server sending a correctly packet of the bytes but i can not to correctly read it

Please transfer topic to right part of the forum

jeromiec83223024
Inspiring
May 16, 2018

Here's the AMF3 spec:

https://wwwimages2.adobe.com/content/dam/acom/en/devnet/pdf/amf-file-format-spec.pdf

As far as I know, it hasn't changed in many years.  The last update to this document that I can find is January 2013.

If you take a look at page 5, section 3 - AMF 3 Data Types, you'll see the list of valid markers and their codes.  As far as I can tell, 168 (0xA8), is way past the end of the valid range, suggesting that you (or the library you're using) is either not decoding the data correctly, or the data wasn't encoded correctly at the point of transmission.

There *is* an "undefined" type, which is what the string you've decoded says.  ECMAScript languages like ActionScript and JavaScript both support the notion of undefined as a type, but the corresponding marker code should be 0x00.

IMO, this isn't something new in the protocol.  It's data corruption.  That said, AMF is pretty old, and I'm not sure off the top of my head who the original authors were.  It didn't originate with Flash Player.  It's just a binary data transmission protocol that we have encoding/decoding support for, and our implementation works correctly (AFAIK).