Git Product home page Git Product logo

Comments (6)

jamesward avatar jamesward commented on June 28, 2024

It's been a really long time since I worked with AMF so unfortunately I won't be much help. I vaguely remember there was debugish function in the amf.js lib to do like a hex dump some AMF data. Looking at that and the AMF spec might help.

from jsamf.

DoomTay avatar DoomTay commented on June 28, 2024

After doing some digging around, it seems the root cause is that readBytes() should be this.readBytes(). Though after fixing that, I found a different problem: the while (true) loop on line 818 runs infinitely. Setting it to breaks if the current position is bigger than the size of the data results in finally getting output, though the output is...weird. There are no messages, and the first header is messed up. Here's the first one

name: name: "mmand�
stroke
params	��
��thickness���x��d�alpha�?¶È´9X�c[...]
mustUnderstand: true
data: 1.1125369292704226e-308 

Probably something about the file parsing not matching the spec. I'll look into it later.

from jsamf.

jamesward avatar jamesward commented on June 28, 2024

I remember using an AMF dump tool a while back but I don't remember where I got it from. That might help when digging deeper.

from jsamf.

DoomTay avatar DoomTay commented on June 28, 2024

Okay, wow, I think I found the real reason for this weirdness: The AMFs I'm working with start off very differently from "regular" AMFs. This and one other AMF from the same project start off with the bytes 0a 0b 01 0f 63 6f 6d 6d 61 6e 64 06 0d 73 74 72 6f 6b 65 0d 70 61 72 61 6d 73 09

So right off the bat these files do something a little different than spec. Nonetheless, the original Flash thing handles these normally, hence why I didn't think to look at the contents of the files earlier (and why I'm not writing these files off as corrupted or anything like that)

from jsamf.

jamesward avatar jamesward commented on June 28, 2024

I wonder if it is AMF 1 and the spec & my impl is for AMF 3?

from jsamf.

DoomTay avatar DoomTay commented on June 28, 2024

After digging into the Flash object that makes use of these files, it looks like these are actually a series of AMF3 objects, processed via custom code.

So while decodeAMF would never have handled these particular files, the use of of ByteArray commands still comes in handy.

from jsamf.

Related Issues (4)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.