Re: Unable to throw exception from method in encoded JS
- From: "ctauch" <chris_t1@xxxxxxxxxxxx>
- Date: 22 Nov 2006 17:06:47 -0800
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.
.
- References:
- Unable to throw exception from method in encoded JS
- From: chris_t1
- Re: Unable to throw exception from method in encoded JS
- From: Dave Methvin
- Re: Unable to throw exception from method in encoded JS
- From: ctauch
- Unable to throw exception from method in encoded JS
- Prev by Date: Re: Unable to throw exception from method in encoded JS
- Next by Date: Re: SciTE and vbscript
- Previous by thread: Re: Unable to throw exception from method in encoded JS
- Next by thread: Re: Child processes terminating when script ends..
- Index(es):
Relevant Pages
|