Print the HwId

Post here messages if you have any problems with working of Enigma Protector
Post Reply
BackGroup
Posts: 4
Joined: Tue Dec 29, 2020 5:56 am

Print the HwId

Post by BackGroup »

Dears
I'm trying to print on screen the HwId, I use C# and call this method as documentation:

public class Enigma_IDE
{
[DllImport("enigma_ide.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.StdCall)]
public static extern string EP_RegHardwareIDW();
}

using it like this:
string hwId = Enigma_IDE.EP_RegHardwareIDW();
Console.WriteLine(hwId);

The method return nothing
where I'm making mistake??
Enigma
Site Admin
Posts: 2939
Joined: Wed Aug 20, 2008 2:24 pm

Re: Print the HwId

Post by Enigma »

Hi, you need to protect the file first.

Enigma API functions work only in protected file. If the file is not protected, all functions returns zero or just fail.
BackGroup
Posts: 4
Joined: Tue Dec 29, 2020 5:56 am

Re: Print the HwId

Post by BackGroup »

Dear Thanks I have solved the issue.
But a I have a question, every time that I want to test some code I constricted to protect the file and run the app, this comports continuous code changing otherwise the the method EP_RegHardwareID() return an empty value and through an exception.
is there any easy way to interact with enigma_ide.dll without protecting it all the times, maybe load something or some extension in Visual Studio?
Enigma
Site Admin
Posts: 2939
Joined: Wed Aug 20, 2008 2:24 pm

Re: Print the HwId

Post by Enigma »

Hi, currently there is no such way, but we are working on that and hope it will appear in next version update!
Enigma
Site Admin
Posts: 2939
Joined: Wed Aug 20, 2008 2:24 pm

Re: Print the HwId

Post by Enigma »

Just to update the thread. We have made a solution for above question.

Starting from version 6.90, you could place a file enigma_ide.ini/enigma_ide64.ini into the folder with enigma_ide.dll/enigma_ide64.dll

INI files contain settings that are used by the dll to emilate the protection.

You can specify any settings for dlls to return from Enigma API when the files is not protected, while debugging.

Please contact us at support@enigmaprotector.com to obtain this new version.
Post Reply