Page 1 of 1
compiler
Posted: Wed May 26, 2004 12:39 pm
by okman
guyz i was deciding to create some sort of program like pb itself using pb. an idea striked me. is it possible to alter a text file which has been embedded into another program using pb. my concept is here. its not always necessary to create a full machine code exe. this is very basic. i create an exe which has a text file embedded in it. i rename the extension to be something else. i make another program. you can write code in that prgram. the program will then compile it, not really do it. it will create a text file containing my code and encrypt/compress {watever} it. then create the copy of the exe containing text file and replace the text file resource with the text file containing code. then the pre programmed exe is programmed to decrypt the embedded text file and read all the commands in it and execute it. is this realy possible? quite simple uh.
Posted: Wed May 26, 2004 1:29 pm
by blueznl
sounds like an interpreter, with source code included...
yes, it can be done
but why would you?
Posted: Wed May 26, 2004 1:48 pm
by Kale
Im assuming that you are talking about embedding another language in your exe? This has been done with Lua before:
viewtopic.php?t=8056
To modify data held inside an exe try this link for a simple way of doing it:
viewtopic.php?t=9744
Posted: Thu May 27, 2004 9:38 am
by GedB
This approach definately workds. Visual Dialogscript used it very well (don't know about now).
I think Blueznl does have a point though.
I think one of the things PB shows is that scripting langauges aren't really necessary. Purebasic is just as flexible and agile, but produces executables that are smaller and faster.
Posted: Thu May 27, 2004 10:03 am
by BalrogSoft
Take a look to my language ScriptVM, the source code is available, dowload it on
http://www.balrogsoftware.com/scriptvm, the scriptvm.pb file begins reading the virtual code file added to the executable, and svm-comp.pb generates the virtual code and the executable with the code attached, if you dont need to generate a virtual code, you only need to join an exe and a text file, you can take a look to the line 321 on my compiler, it shows how to create the executable with the file attached. You can take also to this:
viewtopic.php?t=8573, I hope it help you...