Crash with sample HardwareID C#

Post here messages if you have any problems with working of Enigma Protector
Post Reply
overenigma
Posts: 13
Joined: Wed Oct 24, 2018 12:55 am

Crash with sample HardwareID C#

Post by overenigma » Wed Oct 24, 2018 2:16 am

Hi, I compiled the sample in VS2017 fine, and it crashes on startup with "Unable to load DLL 'enginma_ide.dll".

I have checked, there is a enginma_ide.dll at the folder root, and I place a copy in the bin\Debug and bin\Release folder too.

C:\Program Files (x86)\The Enigma Protector\Examples\HardwareID\C# (.NET)

************** Exception Text **************
System.BadImageFormatException: An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)
at Enigma_IDE.EP_RegHardwareID()
at Enigma_IDE.EP_RegistrationHardwareID()
at Test.frmMain.frmMain_Load(Object sender, EventArgs e)
at System.Windows.Forms.Form.OnLoad(EventArgs e)
at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
at System.Windows.Forms.Control.CreateControl()
at System.Windows.Forms.Control.WmShowWindow(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

engimacrash.jpg
engimacrash.jpg (87.96 KiB) Viewed 484 times

Enigma
Site Admin
Posts: 2385
Joined: Wed Aug 20, 2008 2:24 pm

Re: Crash with sample HardwareID C#

Post by Enigma » Wed Oct 24, 2018 10:31 am

Hi, you need to protect the file before you run it. Note, Enigma API will work only after protection.

If you would like to run it unprotected, compile the problem with x86 CPU (there is Any CPU now).
There is some specific for .net files which are compiled with Any CPU feature.

overenigma
Posts: 13
Joined: Wed Oct 24, 2018 12:55 am

Re: Crash with sample HardwareID C#

Post by overenigma » Wed Oct 24, 2018 5:08 pm

Hmm, I recompiled to x64, and protect it (default settings with hardware lock, demo version)

It still crashes on startup. If I add enigma_ide.dll in the VirtualBox Files, it just silently quit after the "Click on the window to continue execution"

ilya01
Posts: 105
Joined: Tue Oct 07, 2014 2:31 am

Re: Crash with sample HardwareID C#

Post by ilya01 » Wed Oct 24, 2018 7:08 pm

Make sure that your enigma_ide.dll is 64 bit

overenigma
Posts: 13
Joined: Wed Oct 24, 2018 12:55 am

Re: Crash with sample HardwareID C#

Post by overenigma » Thu Oct 25, 2018 12:59 am

This is the interesting part, I download the 64bit protector, it installs in c:\program Files (x86), which means it's 32bit?

I used dependency walker to check, and the dll does seems to be 32bit. All of them
-2018-10-25 08_55_44.jpg
-2018-10-25 08_55_44.jpg (205.28 KiB) Viewed 464 times

overenigma
Posts: 13
Joined: Wed Oct 24, 2018 12:55 am

Re: Crash with sample HardwareID C#

Post by overenigma » Thu Oct 25, 2018 1:10 am

Ok, I saw the problem. There is a enigma_ide64.dl but the sample folder supply the 32bit dll and dllimports it. Solved

Enigma
Site Admin
Posts: 2385
Joined: Wed Aug 20, 2008 2:24 pm

Re: Crash with sample HardwareID C#

Post by Enigma » Thu Oct 25, 2018 9:43 am

overenigma wrote:
Thu Oct 25, 2018 12:59 am
I used dependency walker to check, and the dll does seems to be 32bit. All of them
Enigma Protector itself is 32 bit application (x86 and x64 versions), but this does not matter. They are used for protection of 32 bit and 64 bit files.
overenigma wrote:
Thu Oct 25, 2018 1:10 am
Ok, I saw the problem. There is a enigma_ide64.dl but the sample folder supply the 32bit dll and dllimports it. Solved
Please note, enigma_ide64.dll is used if your .net application is compiled with x64 CPU.
We still recommend to use x86 version of Enigma and compile your .net application with x86 CPU.

Post Reply