Re: Unable to throw exception from method in encoded JS



Dave,
soz I reread the article and you are most likely correct. Amongst all
the blater and diagrams I found this little tid bit: "they load the
encoded script engine when they encounter encoded script". They appear
to use 2 diff engines...bizar. Well that means ditch the encoding since
the unstable nature of that engine is not worth the trouble. I would
rather have the world see my code work then have the world not see my
code and it fail.

Again thanks for the reply.

Regards,
Chris

ctauch wrote:
Dave Methvin wrote:
The two engines call each other's objects and pass some types of data
without problem, but other operations and tests fail. Exception handling may
be one of them. Another is "obj.constructor==Array" where obj is an Array
that came from one engine but you're checking Array of the other engine.
Basically, any check for object identity fails because the objects have been
created by two different engines. This can cause some really mysterious
behaviors.

I would dump the encoded JScript since it doesn't offer real security; there
are lots of decoders on the net. You could compress the code instead using
something like Dean Edwards's Packer and get the same level of obfuscation
without the two-engine headaches.

The two different engine theory sounds nice but I don't buy it. Why
have two engine code bases when all that has to happen is a decode
followed by a passing off to the same engine that handles "native"
scripts.

By no means have I drunk the MS kool-aide, but after reading this bit I
am less inclined to subscribe to your theory.

http://www.microsoft.com/mind/0899/scriptengine/scriptengine.asp

I am not sure where the problem lies and maybe someone from MS on the
board can provide an answer.

I can tell you that I only provided code for an example and tested it
for same failure I am seeing in beta code, needless to say that in the
same method in my beta code there is another throw that functions
correctly when the script is encoded or decoded.

At this point there appears tobe a bug in the MS supplied
decoding...but that's just my WAG at this point.

I do agree that encoding is next to usless, but it does allow for a
provider of scripts to somewhat ensure that none messed with the script
and introduced a bug post release.

.



Relevant Pages

  • Re: ScriptEngine (VB) sometimes fails a division under Windows Server
    ... Probably MS product support is the address for this question. ... The following lines of code creates the engine: ... // create script engine ... My program is built under Visual Studio 2005. ...
    (microsoft.public.win32.programmer.kernel)
  • Re: Adding script functions in the host application
    ... > to have only one instance of the macros for many engine instances. ... it creates a single script engine for a page (well, actually, a script ... engine for every language used on a page) and then calls ParseScriptText ...
    (microsoft.public.vc.atl)
  • Re: Multithreaded script host doesnt like Apartment threaded objects
    ... >> engine whenever another thread needs the same script. ... I do not marshall interface pointers between apartments, ... Now all your threads run in the same apartment, ...
    (microsoft.public.win32.programmer.ole)
  • Re: MySQL
    ... Then you can use it from inside MySQL or on the commandline ... it is crying out for a script wrapper to make it more flexible. ... you have the option to use a csv engine. ... So you can now select from your dbase files into a csv file. ...
    (alt.os.linux.suse)
  • Re: A Dual Engine Failure ? -- Chances are Astronomical..!
    ... systems actually fail to switch or be correctly in sync..... ... electrical, dual electronics, etc. ... The instruction from the cockpit went out ok, but it's transmission or action at the component level of engine control was changed which gave engine issues. ...
    (uk.politics.misc)

Quantcast