xsharp.eu • VO Code Translate to X#
Page 1 of 1

VO Code Translate to X#

Posted: Sun Dec 29, 2019 3:57 pm
by rjpajaron
Hello,

How to write this to X#:

Code: Select all

	hDll := _VOLoadLibrary("DLL.dll")
	
	IF hDll != NULL_PTR
		pProcAdr := GetProcAddress(hDll,PSZ("StartFunction"))
		IF pProcAdr != NULL_PTR
			PCALL(pProcAdr)
		ENDIF
	ELSE
		? "Could not load DLL.dll."+CRLF2;
					+"That's bad news..."
		
		hDll := NULL_PTR
	ENDIF

XSharpLoadLibrary return an Assembly.

Thanks a lot....

---

Rene

VO Code Translate to X#

Posted: Sun Dec 29, 2019 4:10 pm
by Chris
Hi Rene,

Yeah, with XSharpLoadLibrary() you can only load a .Net library, not Win32 ones. For your sample, simply declare a _DLL FUNC, specifying the dll in the declaration as you would do also in VO and the simply call the function normally, with a simple "StartFunction()".

You can still use LoadLibrary() and PCALL() etc, but there's really no point to, also with the _DLL statement the dll will be loaded only when needed anyway, and you will have in addition compile time checking.

Edit: Well the above is assuming you want to call a Win32 function indeed. Or maybe you just want to call another function written in X# in another library? If that's the case, again better just reference the dll and call the function directly. Again, the dll will be loaded in memory only when it will be actually needed.

VO Code Translate to X#

Posted: Mon Dec 30, 2019 2:43 am
by rjpajaron
Hi Chris,

All VO codes will be move to X#. I am done "porting" to X#, building it to become an app began yesterday and a lot of "errors" mostly on ADS API calls and missing "DEFINES"

Your comments below reminds me of something. The DLL that to be loaded on is "secure key" DLL. It could be VO or C but this time I might move it to X# to minimized problems but I need an "obfuscator". Do you something to recommend?
Chris wrote:Hi Rene,

Yeah, with XSharpLoadLibrary() you can only load a .Net library, not Win32 ones. For your sample, simply declare a _DLL FUNC, specifying the dll in the declaration as you would do also in VO and the simply call the function normally, with a simple "StartFunction()".

You can still use LoadLibrary() and PCALL() etc, but there's really no point to, also with the _DLL statement the dll will be loaded only when needed anyway, and you will have in addition compile time checking.

Edit: Well the above is assuming you want to call a Win32 function indeed. Or maybe you just want to call another function written in X# in another library? If that's the case, again better just reference the dll and call the function directly. Again, the dll will be loaded in memory only when it will be actually needed.

VO Code Translate to X#

Posted: Mon Dec 30, 2019 1:56 pm
by Chris
Hi Rene,

Not myself. I have never used one, but I know several people here have been using obfuscators for a few years now, hopefully someone will step in!

VO Code Translate to X#

Posted: Mon Dec 30, 2019 7:54 pm
by vzeljko
I use neo-ConfuserEx obfuscator and for me it works fine.
It is free and open-source.
https://github.com/XenocodeRCE/neo-ConfuserEx

Zeljko