Sign in to follow this  

how to get a bytecode file ?

This topic is 3316 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

hello, geniuses: To run a script file , angelscript takes two steps. first, compile the source file into bytecode, second, run it. all happpen at run time. I want to separate the two steps. e.g. compile source before run time to get a bytecode file. Then , load the bytecode file and run , i think, it's faster when running, and source code can't be seen, it's safe. so ,what's the APIs to compile the script and save it ?? thanks.

Share this post


Link to post
Share on other sites
If you want security then you should not use precompiled bytecode. Use encryption instead.

The problem with the precompiled scripts is that it bypasses most of the compile time checks that the compile performs. So if you load a precompiled bytecode that have been manipulated by some hacker, you may actually open up your application to exploitations, such as buffer overruns, etc.

Now if you want to avoid the delay caused by compilations while loading scripts, but don't care about the potential security problem of hacked bytecode, then precompiled bytecode is the way to go. The security problem may be diminished somewhat by adding check-sums and other similar techniques to the precompiled bytecode.

Share this post


Link to post
Share on other sites
Well remembered. The saved bytecode is indeed highly platform dependent, as it is compiled to be compatible with the host application. Things such as pointer sizes and size of booleans (PPC use 4 bytes for a boolean) changes the bytecode.


Share this post


Link to post
Share on other sites
Quote:
Original post by dxj19831029
I remeber you motioned that the precompiled byte code is not platform independent, isn't it, Angel?
So think about this issue before you decide to use it.


perhaps you could compile the source code to byte code the first time the app is run on a machine, then store it in an encrypted archive of some kind.

Share this post


Link to post
Share on other sites

This topic is 3316 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this