Serial number not shared between DLLs in .NET Framework 4.8

Issues related to VMProtect
Post Reply
weloveayaka
Posts: 72
Joined: Wed Jul 05, 2023 6:21 am

Serial number not shared between DLLs in .NET Framework 4.8

Post by weloveayaka »

Hello!

Environment:
- .NET Framework 4.8
- VMProtect with .NET SDK
- Using VirtualizationLockByKey feature

Scenario:
- A.DLL calls VMProtect.SDK.SetSerialNumber(xxx)
- B.DLL references A.DLL (either by assembly reference or reflection)
- Both A.DLL and B.DLL use the same LicenseDataFile
- Both DLLs have methods protected with VirtualizationLockByKey

Problem:
B.DLL cannot access the serial number set by A.DLL:
- GetSerialNumberData() in B.DLL returns empty/null without calling SetSerialNumber in B.DLL
- VirtualizationLockByKey protected methods in B.DLL also fail

Expected behavior:
I want to call SetSerialNumber once in A.DLL, and have it work for the entire process: (if and only if they are using the same LicenseDataFile):
- GetSerialNumberData() should work in all DLLs
- VirtualizationLockByKey protected methods should work in all DLLs

Question:
In .NET Framework 4.8, is SetSerialNumber supposed to be process-wide or assembly-specific?
Is there a way to make the serial number accessible across all DLLs in the same process?
Or do I have to call SetSerialNumber separately in each DLL?
Admin
Site Admin
Posts: 2809
Joined: Mon Aug 21, 2006 8:19 pm
Location: Russia, E-burg
Contact:

Re: Serial number not shared between DLLs in .NET Framework 4.8

Post by Admin »

You should call VMProtectSetSerialNumber for each module where you use the licensing system.
weloveayaka
Posts: 72
Joined: Wed Jul 05, 2023 6:21 am

Re: Serial number not shared between DLLs in .NET Framework 4.8

Post by weloveayaka »

Okay, guess this is the only way. Thank you.
Post Reply