Menu

#1 Problem with replacing constantPool

open
nobody
None
5
2007-04-19
2007-04-19
Pjanssen
No

Hello Olivier,

first of all, thanks a lot for making the swfDotNet library, and making it publicly available.
I have however, got a little problem with it. I hope that you are willing to help me out. Before I start, I must admit that I don't have a lot of C experience, nor much knowledge about the 'internal' SWF structure. I do have enough (object oriented) programming experience though I believe, and one has got to start somewhere of course. :)

So, here's the problem:
I've made a swf file with some code in it in Flash. In this code, there are a couple of variables that I would like to be able to change/replace without having to use Flash. The program should be able to run on any windows machine.
So I wrote some code to do this (I'll insert the block at the end of the mail). After a lot of messing around (it's kind of hard without extensive documentation) I got something that did the trick, it decompiled the swf, replaced the variable in the constantPool and wrote everything back to a new swf.
The resulting swf however, is 'broken' after this. Something goes wrong somewhere, but I can't seem to figure out where or why. One thing I noticed is that the filesize changes slightly (a couple of bytes) when I run through the whole action without actually replacing the variable (so the swfs should remain exactly the same).

Could you perhaps help me with this problem?
Thanks a lot in advance!

Kind regards,

Pier Janssen
Pier.Janssen[ a t ]Planet.nl (also for MSN)

Discussion

  • Pjanssen

    Pjanssen - 2007-04-19

    Take a look at the function swfTest()

     
  • Pjanssen

    Pjanssen - 2007-04-20

    Logged In: YES
    user_id=1773910
    Originator: YES

    Update.
    I've fixed the problem. It turned out to be a problem with the way of inserting the string for the ActionConstantPool. I didn't realise that each record of the string[] should have one of the entries, rather than putting them all into one record. Quite silly of me not to see this straight away, but oh well...
    It shows how luxurious it is to have extensive documentation (I don't blame you of course, I understand how much (and not too exciting) work it must be to write it).

    Cheers,

    Pier

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.