Hack Forums
[C#] [OPEN SOURCE] DexVEG - Bytecode virtual machine - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444)
+--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151)
+---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118)
+---- Thread: [C#] [OPEN SOURCE] DexVEG - Bytecode virtual machine (/showthread.php?tid=1747094)



[OPEN SOURCE] DexVEG - Bytecode virtual machine - hgdfhsdgdfgdfh - Sep 21, 2011

Google code project: http://code.google.com/p/dexveg/
License: GNU LGPL

Now I'm releasing this project as open source.
Source is available from google code SVN repository.
Binary releases will be released on google code too.


Features
- Functions

- External functions (functions defined in .NET host can be called by executing bytecode)

- External function libraries/classes (you can derive a .NET class from IVMLibrary to easily create collection of functions to be provided for bytecode)

- Possible to call bytecode functions from host .NET program ( = bytecode can be used to script functionality for host)

- NEW: Bytecode includes/libraries: include another compiled bytecode file and use functions it provides (like DLLs)
- Local variables

- File information (name, author, version, hash) Note: compiler doesnt support adding that information yet, it currently just adds default

- Wide range of operations/opcodes:
Math opcodes
Stack load ( (U)Int8, 16, 32, 64, Float, String)
Conditional jumps
Arrays
Local variables
etc.

Coming

- Just-in-time compiler (compiler bytecode to MSIL code on runtime for speed)

- Open source assembler/compiler (current one sucks, code is messy)

- Array data initializers (currently array data is initially null but in future its possible to define static initial data for array)

- More advanced security and general settings for VM (you can define what bytecode is allowed to do)




* - DragonHunter - Sep 21, 2011

looks like a nice project u got there but just 1 question... I see in the program.cs at line 23
dv.LoadImageFromByteArray(File.ReadAllBytes(@"..\..\..\..\DexCS\DexCS\bin\Debug\test.txt.dve"));

how can we make some .dve file to execute ?
and how to even use that thing to like coding in it or something
Or u gotta upload that yet anyways goodluck 🤝


* - hgdfhsdgdfgdfh - Sep 21, 2011

Yeah I'm going to upload the assembler/compiler but first I need to make the code more clean, because its really a mess.
Thanks for replying :P


* - ki113d - Sep 21, 2011

Very nice. Can't wait until you have done a bit more work on it :)

Also what svn client do you use to upload to google?


* - Surpintine - Sep 21, 2011

Lol, your_byte_code->msil_byte_code->native assembly

Gonna be slow as shit i can tell you that much. Only application to this project is for educational purposes, which is probably why you are doing it, so good job :)

BTW, this project might get confused with http://www.dalvikvm.com/ because both are a virtual machine, and DalivkVM uses the .dex extension, even though your vm works alot different.


* - hgdfhsdgdfgdfh - Sep 22, 2011

Its faster to EXECUTE dynamically generated MSIL method than to interpret the bytecode in loop.
Disadvantage is that it takes time to generate the MSIL method and therefore JIT compiling to MSIL can actually degrade performance with small and fast executing bytecode functions.

And yes, you are right this project is mainly for educational purposes. Thanks for comment :P