A Flash Developer Resource Site

Results 1 to 14 of 14

Thread: visual basic

  1. #1
    Junior Member
    Join Date
    Jul 2001
    Posts
    1
    has anyone ever seen an swf parser written in visual basic? i know a little bit of c but i don't know some of the stuff they use in the open source parsers, making it harder to learn. I am interested in writing an IDE for action script which you can read/write to the swf file from the ide. thanks

  2. #2
    Senior Member
    Join Date
    Jul 2000
    Posts
    503
    Flash Turbine...but it is pretty expensive.

    If you don't want to spend hundreds of dollars, there is no solution for reading SWF files (although bukoo can write SWF files from VB).

    My advice: Learn C++. C++ is not difficult to learn (you could do it in a week without too much trouble), but it is hundreds of times more powerful when you know how to use it. Also, languages such as JAVA and C# are both pretty much based off of the C++ concepts, so learning them is even easier once you know C++. You'll need to learn an OO language eventually, you may as well do it now.

    --Jesse

    PS: Also, if you are going to market your IDE, C++ is almost a requirement. VB is extremely slow in comparison, doesn't give you as much control, and is pretty much impossible to port to other OS's.

  3. #3
    Senior Member
    Join Date
    Jul 2000
    Posts
    126
    If you're planning to write ActionScript into a SWF you will need to write an ActionScript compiler. ActionScript is not stored as text but as compiled bytecode.

    Is anyone else out there planning to build an AS compiler ?

  4. #4
    Senior Member
    Join Date
    Jul 2000
    Posts
    126
    Oh .. and if anyone is thinking of building an action bytecode to ActionScript decompiler, I would be *very* interested.

  5. #5
    Senior Member
    Join Date
    Jul 2000
    Posts
    503
    Buraks already has a bytecode to actionscript decompiler out.

    --Jesse

  6. #6
    Senior Member
    Join Date
    Jul 2000
    Posts
    126
    Originally posted by JAEzell
    Buraks already has a bytecode to actionscript decompiler out.

    --Jesse
    Yes - but it costs money (which is not bad in itself) and it is not available as source or as a module that be called from other code.

  7. #7
    Senior Member
    Join Date
    Jul 2000
    Posts
    503
    True...there is also SWF Extractor by chironex...but that also costs money and the source is not available. In any case, if a company really needed actionscript support in their product, I'm sure that one of those two would be able to "share" their code/insight for a certain fee :-).

    --Jesse

  8. #8
    Registered User
    Join Date
    Feb 2001
    Posts
    13,041
    Hi,

    enter the old chinese in the game...
    Ming is opensource and has an actionscript compiler, and I think there is a decompiler (actually disassembler) as well
    If you need yet another swf parser that can handle actioncode, I've just upped my own to http://www.fontimages.f2s.com/private/swf.zip
    This is not freeware but rather beerware, so if anyone could manage to mail me a few bottles I would appreciate it

    Musicman

  9. #9
    Senior Member
    Join Date
    Feb 2001
    Posts
    140
    I've almost finished SWF Version5 action script decompiling. It's just the object creation - and that annoying enurmerate tag , I don't want to have to keep track of all the objects and there variables! especially when I'm only decompling, not executing -. I'm also very interested in creating an action script IDE. It's been on my mind for a long time.

  10. #10
    Senior Member
    Join Date
    Jul 2000
    Posts
    126
    Musicman: from what I can tell Ming has a C-like script compiler that only covers Flash 4 action code capabilities.

    Chironex: I'm also nearing completion on an AS decompiler for JavaSWF2 !!

    The enumerate action doesn't seem that hard.. you don't have to keep track of all the objects properties.. just recognize the following action code pattern:
    Code:
    for( n in x )
    {
        trace( x[n] );
    }
    ..compiles to..
    Code:
            lookupTable
                0:   "x"
                1:   "n"
            push           lookup( 0 )
            enumerate
        label1:
            register       0
            push           null
            typedEquals
            ifJump         "label0"
            push           lookup( 1 )
            push           register( 0 )
            setVariable
            push           lookup( 0 )
            getVariable
            push           lookup( 1 )
            getVariable
            getMember
            trace
            jump           "label1"
        label0:
            end

  11. #11
    Registered User
    Join Date
    Feb 2001
    Posts
    13,041
    Hi nmain,

    Ming with F5 support was released about a week ago (let's say as a public beta with fewer bugs than other public betas). I was using ming's CVS version for quite some time on a major project, and I know just one case where ming is generating wrong code. To be honest, I also know a case where Macromedia's output is "questionable" - and the latter one is more likely to happen.

    BTW: I would rate the output you show as "disassembly" rather than decompiling, but it is probably impossible to regenerate true actionscript from swf files

    Musicman

  12. #12
    Senior Member
    Join Date
    Feb 2001
    Posts
    140
    the output the nmain has given is exactly what the byte code is like, nmain has even formated it all and made it nice so we can read it, the big part is going from that garbage into action script, which is possible. But to eactly match the originally action script... up to swf verion 4 this is possible with out to much trouble. but the addition of the flash 5 actions, especially when produced with flash, makes it difficult -

    e.g there are only two program flow actions - if and jump.
    but there are about 6-8 different action script flow control blocks - if,else,while,do-while,for etc.
    It is possible to identify how flash makes up each of these, but when you use it on action script that flash didn't create you could run into problems.


  13. #13
    Senior Member
    Join Date
    Jul 2000
    Posts
    126
    Yes - the output was an action code dump from JavaSWF.
    The decompiler will (hopefully) produce proper ActionScript.

    The bytecode that Flash produces is reasonable to decompile - I totally agree that optimized bytecode produced by some other tool might be difficult to decompile.

    Anyway - decompilation is not vital. Compilation is the important thing.

    What would be really useful would be an ActionScript parser/compiler written in JavaScript/ActionScript...

  14. #14
    Registered User
    Join Date
    Feb 2001
    Posts
    13,041
    Hi,

    there has been a partial compiler - or lets say a clever eval function - as part of a debugger project. You will have to search the last 3 or 4 months here and at were-here.com, probably for keywords object-oriented and debugger

    Musicman

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center