Code Monkey home page Code Monkey logo

Comments (2)

cpdt avatar cpdt commented on May 24, 2024

Hey, I think you might've made a mistake, that line should be reading the 08/09 bytes:

if (Encoding.ASCII.GetString(reader.ReadBytes(4)) != "FLhd")
throw new FlParseException("Invalid magic number", reader.BaseStream.Position);

This will read the first 4 bytes, 00-03.

// header + type
var headerLength = reader.ReadInt32();
if (headerLength != 6)
throw new FlParseException($"Expected header length 6, not {headerLength}", reader.BaseStream.Position);

This will read the next 4 bytes, 04-07 (Int32 is four bytes).

var type = reader.ReadInt16();
if (type != 0) throw new FlParseException($"Type {type} is not supported", reader.BaseStream.Position);

So this will then read bytes 08-09 (Int16 is only two bytes).

As for how it was reverse engineered, the basic parsing structure and some of the "event types" were from andrewrk's Node FL parser library (which is very out of date now) and the rest was just from changing different values in FL and seeing what changed. As far as I'm aware his library was based on an old implementation in LMMS (which doesn't exist anymore afaik) which was based on an old thread somewhere (which I haven't been able to find again) where an Image-Line employee talked about the basic structure.

I'll close this thread for now, but if you have any other questions please feel free to ask them!

from flparser.

JakubKoralewski avatar JakubKoralewski commented on May 24, 2024

I see it now, I somehow mistook a byte for 4 bits 😄.
Thanks for the patience and the detailed answer.

github.com/LMMS/lmms/pull/2904
Seems like it was a licensing problem.

from flparser.

Related Issues (12)

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.