Page 1 of 1

VMProtect v3.7.2 build 1530 - .NET application crashes with Import Protection

Posted: Thu Oct 13, 2022 1:58 am
by Zirak
Hello,

I have attached a project of a test app that crashes in the latest version of VMProtect, this project used to run perfectly fine with version v3.5.1.1387.

It seems like when Import Protection is turned on the application crashes when it tries to access the static string "SymLink", and if you comment out line# 11 in Test.cs it will run perfectly fine.
VMPTest.7z
(451.24 KiB) Downloaded 194 times
Kindly advise on a fix.

Thank you,
Zirak

Re: VMProtect v3.7.2 build 1530 - .NET application crashes with Import Protection

Posted: Fri Oct 14, 2022 10:11 am
by Admin
Fixed in the 1531 build.

Re: VMProtect v3.7.2 build 1530 - .NET application crashes with Import Protection

Posted: Fri Oct 14, 2022 2:51 pm
by Zirak
Hi,

With the latest build 1531 it looks like it doesn't even reach the first Console.WriteLine() anymore, seems to crash almost immediately for the same VMPTest project that I attached previously. (I am testing in Release build)
VMPTestFail.png
VMPTestFail.png (27.17 KiB) Viewed 2820 times

On another project (that was packing fine previously) is causing a new issue with this build on VMProtect:
VMPTestFail2.png
VMPTestFail2.png (1.45 KiB) Viewed 2818 times

Re: VMProtect v3.7.2 build 1530 - .NET application crashes with Import Protection

Posted: Fri Oct 14, 2022 5:20 pm
by Zirak
Build 1532 seems to fix the original issue and now appears to run my test project completely fine, but the new issue that was introduced in Build 1531 (Runtime error at CompileToVM: add) when trying to compile my other project in VMProtect still appears to occur. I'm not sure how easy it is for you to isolate the changes between Build 1530 and 1531to see what causes this issue.

Re: VMProtect v3.7.2 build 1530 - .NET application crashes with Import Protection

Posted: Fri Oct 14, 2022 5:23 pm
by Admin
Do you use the "Lock To Serial Number" feature?

Re: VMProtect v3.7.2 build 1530 - .NET application crashes with Import Protection

Posted: Fri Oct 14, 2022 5:27 pm
by Zirak
I'm not sure if I see a "Lock To Serial Number" feature, but I have the "Lock to HWID" turned off.

I do check for a serial number programmatically, but I don't think this code should break the ability for VMProtect to compile, not sure..
Example Code:

Code: Select all

SerialState st = SDK.SetSerialNumber(File.ReadAllText("serialkey.dat"));
if (st == SerialState.Success)
{
	SerialState st2 = VMProtect.SDK.GetSerialNumberState();
	if (st2 == SerialState.Success)
	{
		VMProtect.SerialNumberData sd;
		if (VMProtect.SDK.GetSerialNumberData(out sd) && sd.State == SerialState.Success)
		{
			byte[] userData = sd.UserData;
			if (userData != null)
			{
				//stuff here
			}
		}
	}
}

And this is what my VMP file looks like:

Code: Select all

<?xml version="1.0" encoding="UTF-8" ?>
<Document Version="2">
    <Protection InputFileName=".\bin\Release\net6.0-windows\Project.dll" Options="466888" VMCodeSectionName=".???" OutputFileName=".\bin\Release\net6.0-windows\Project.dll">
        <Messages>
            <Message Id="0">Error (0).</Message>
            <Message Id="1">Error (1).</Message>
            <Message Id="2">Error (2).</Message>
            <Message Id="3">Error (3).</Message>
            <Message Id="4">Error (4).</Message>
        </Messages>
        <Folders />
        <Procedures>
        </Procedures>
        <Objects />
    </Protection>
    <DLLBox>
        <Folders />
    </DLLBox>
    <Script />
    <LicenseManager ProductCode="REMOVED" Algorithm="RSA" Bits="4096" PublicExp="REMOVED" PrivateExp="REMOVED">
    </LicenseManager>
</Document>

Re: VMProtect v3.7.2 build 1530 - .NET application crashes with Import Protection

Posted: Fri Oct 14, 2022 5:32 pm
by Admin
I mean the following code:

Code: Select all

[Obfuscation(Feature="virtualizationlockbykey" ...)]
It looks like this:
screen.png
screen.png (5.5 KiB) Viewed 2798 times

Re: VMProtect v3.7.2 build 1530 - .NET application crashes with Import Protection

Posted: Fri Oct 14, 2022 5:35 pm
by Zirak
Oh yes, I have that on my initial function:

Code: Select all

[Obfuscation(Feature = "virtualizationlockbykey", Exclude = false)]
Would this not be needed if I'm doing my own check for serial key? Strange that it wasn't happening on build 1530 and prior releases though.

Re: VMProtect v3.7.2 build 1530 - .NET application crashes with Import Protection

Posted: Fri Oct 14, 2022 6:25 pm
by Admin
Please try the 1533 build.

Re: VMProtect v3.7.2 build 1530 - .NET application crashes with Import Protection

Posted: Fri Oct 14, 2022 7:19 pm
by Zirak
Latest build appears to work, thank you for the swift support.