4 Replies Latest reply on Jul 8, 2008 6:58 AM by prabakarz

    Doubt regarding fetching the values popped of the stack for a getURL2 Call

    prabakarz
      Hi All,
      Is there any ways to get the popped values (url and target) from the stack which had been popped off during the getURL2 Call?

        • 1. Re: Doubt regarding fetching the values popped of the stack for a getURL2 Call
          robdillon Most Valuable Participant
          I'm guessing that you are looking at a function that pulls an item from an array. If the function puts that value into a variable, then you can ask the variable for its value. Showing us the actual code that you are talking about will go a long way toward making your question more meaningful.
          • 2. Re: Doubt regarding fetching the values popped of the stack for a getURL2 Call
            prabakarz Level 1
            Hi Rob,
            Thanks for the reply. I have been working on replacing the system calls that opens up a web page in Flash. So, as far as i know, getURL and getURL2 are the two calls which is supported by AS 1.0. In AS3.0, navigateToURL does the work which i said. What I am doing is, am injecting a method (say myOpenUrl) which does some manipulations on the url that is passed as a parameter to either of these methods. So, my duty is to replace the default method call (getURL or getURL2) to my method call which looks as follows

            getURL(" http://www.adobe.com", "");

            After replacement, it will look like
            myOpenUrl(" http://adobe.com","");

            So the url redirection happens via the method which i injected. This scenario has been handled for getURL and navigateToURL(). But, when i have variables used in the getURL method whose values are resolved at runtime, then the compiler by default converts the getURL call into getURL2 call. I noticed this change when i decompiled a SWF file which i used. Please have a look at this, if i have the AS code as follows,

            var tempUrl = ''' http://www.adobe.com/' + 'forums';
            var target = '';
            getURL(tempUrl, target);

            After compilation, the bytecode source looked like follows


            push 'temp', ' http://www.adobe.com/', 'forums'
            add
            varEquals
            push 'temp'
            getVariable
            push 'target'
            getVariable
            getURL2 0, 6043
            end

            In such a case, while parsing the SWF file, before sensing that, the getURL2 call is going to open a web page, the values had already been popped off the stack. So, I am not able to handle this scenario. If there are any possibilities to find the variable names used in the getURL2 call, it would be fine.

            Any help on this issue would be a great help to me. So please help me on this.

            Thanks,
            Prabakaran Srinivasan.





            • 3. Re: Doubt regarding fetching the values popped of the stack for a getURL2 Call
              robdillon Most Valuable Participant
              If you're asking if there is a way to get into the bytecode of the compiled .swf to alter it, I'm sure that there is, but I'm not familiar with anything that might help you.

              There's a typo in this line: var tempUrl = ''' http://www.adobe.com/' + 'forums'; , the initial quote is a single and a double, or a double and a single. I'm guessing that this is not the root of the problem, which, and I'm guessing again, is that the url is not being resolved correctly.

              By specifying an empty string for the target parameter, are you trying to open a new window? Or do you want to use this parameter when needed?
              • 4. Re: Doubt regarding fetching the values popped of the stack for a getURL2 Call
                prabakarz Level 1
                Hi Rob,
                What you say are my typo errors. I just looked at the bytecode and typed it. I have no issues with the single quote or double quote. I think my explanation is not clear. Actually, iam trying to redirect the getURL calls to my own method and make some modifications to the url and then call the getURL with the updated URL. But, when there are variables used in the getURL(Eg: getURL(url, target)) call instead of constant absolute URL values(Eg: getURL(' http://www.adobe.com',' ')), the getURL call gets converted into getURL2 automatically by the compiler. I am able to replace the latter case with my method call. But for the former case, the variables are popped off the stack and then the method call comes in. I found this, when i parsed the SWF using an open source java framework. I want to handle this scenario too. So can you please suggest me any ways of getting the variable used as a url in the getURL2 call?

                Hope this explanation is clear?

                Thanks,
                Prabakaran Srinivasan.