VB class with RVExtension@12 entry point ?.

Associate
Joined
10 Nov 2004
Posts
2,237
Location
Expat in Singapore
Hi,

So I have been doing a bit of mod writing for DayZ Epoch and am getting increasingly frustrated at the limitations placed by the supplied HiveExt.dll.

The .dll is opensource but written in C++ which I am not familiar with.

To this end I am beginning to see if I can build something with VB.net as a PoC for now. I have Visual Studio Express 2013 installed. I have the MySQL connector installed and the and loaded so the dll -> MySQL side should be ok.

The ARMA 2 / 3 engine expects any referenced dlls to contain an entry point of a form _RVExtension@12, with a following C signature:
Code:
void __stdcall RVExtension(char *output, int outputSize, const char *function);

So the questions are
Is it possible to create an entry point for a VB.net class to meet the criteria and if so how would I define it ?.

Info on extensions and ARMA can be found here.

Oh, I am also familiar with Arma2net but it seems there is no active development on it, it has issues with .n 4.5 and now requires mono. I find having so many 3rd party dependencies worrying.
 
Associate
Joined
7 Nov 2013
Posts
255
Location
Kent, England
I very much doubt it would be possible; an IL assembly (which VB.NET produces) requires the CLR to be loaded and running before JIT'ing can be performed and subsequently IL executed.

My advice would be to have a native C++ assembly with the required entry point which launches the CLR and then executes code from your IL assembly, this will require quite a bit of C/C++ knowledge.

I will post a small C/C++ snippet to do this in a moment.
 
Associate
Joined
7 Nov 2013
Posts
255
Location
Kent, England
This actually turned out to be much simpler than I initially believed it to be, the trick was to have a Mixed C++ assembly which contains both native and managed.

I have created a quick sample available at https://bitbucket.org/lukazoid/vbarmamod/.

The key functionality exists in https://bitbucket.org/lukazoid/vbarmamod/raw/master/ArmaMod.Hook/RVExtension.cpp where it exposes an unmanaged endpoint for Arma and invokes

Code:
ArmaMod::ModEntry::RVExtension

which is your VB.NET mod.

ArmaMod.HookLoader is a sample application which shows how Arma possibly loads the mods dynamically.
 
Last edited:
Back
Top Bottom