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

Issues related to VMProtect
Post Reply
Zirak
Posts: 6
Joined: Sat Jan 15, 2022 1:51 am

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

Post 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 180 times
Kindly advise on a fix.

Thank you,
Zirak
Admin
Site Admin
Posts: 2566
Joined: Mon Aug 21, 2006 8:19 pm
Location: Russia, E-burg
Contact:

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

Post by Admin »

Fixed in the 1531 build.
Zirak
Posts: 6
Joined: Sat Jan 15, 2022 1:51 am

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

Post 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 2701 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 2699 times
Zirak
Posts: 6
Joined: Sat Jan 15, 2022 1:51 am

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

Post 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.
Admin
Site Admin
Posts: 2566
Joined: Mon Aug 21, 2006 8:19 pm
Location: Russia, E-burg
Contact:

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

Post by Admin »

Do you use the "Lock To Serial Number" feature?
Zirak
Posts: 6
Joined: Sat Jan 15, 2022 1:51 am

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

Post 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>
Admin
Site Admin
Posts: 2566
Joined: Mon Aug 21, 2006 8:19 pm
Location: Russia, E-burg
Contact:

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

Post 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 2679 times
Zirak
Posts: 6
Joined: Sat Jan 15, 2022 1:51 am

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

Post 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.
Admin
Site Admin
Posts: 2566
Joined: Mon Aug 21, 2006 8:19 pm
Location: Russia, E-burg
Contact:

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

Post by Admin »

Please try the 1533 build.
Zirak
Posts: 6
Joined: Sat Jan 15, 2022 1:51 am

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

Post by Zirak »

Latest build appears to work, thank you for the swift support.
Post Reply