MantisBT - Cheat Engine
View Issue Details
0000032Cheat Enginepublic2008-02-08 03:402008-02-09 17:14
ReporterWiccaan 
Assigned ToDark Byte 
PrioritynormalSeverityminorReproducibilityalways
StatusresolvedResolutionfixed 
PlatformOSOS Version
Summary0000032: Plugins Freeze Cheat Engine (Compiler Issue?)
DescriptionCopied the code from the example plugin and created a new project using Visual Studio 2005. The plugin compiles fine but Cheat Engine fails to load it.

Additional InformationThe first message box in the plugin shows:

    case DLL_PROCESS_ATTACH:
        MessageBox(0,"This plugin dll got loaded","C Plugin Example",MB_OK);
        break;

Then right after you click ok, Cheat Engine freezes. Tried removing all the code from the plugin to make it completely blank and the same thing still occurs.
Tags5.4.3 cheatengine
Attached Files

Notes
(0000049)
Dark Byte   
2008-02-09 00:22   
Does your dll implement AND export the: GetVersion, InitializePlugin and DisablePlugin functions? (Using normal C exportnames, so not those obfuscated c++ exportnames that have a @ in them with paramcount etc...)

GetVersion is called when adding to the list. Make sure that you have a 0-terminated string for the name etc..

(0000051)
Wiccaan   
2008-02-09 07:43   
Yes, I'm sure. It is the exact code copy pasted from the example-c project. Just compiled with VS2005.
(0000052)
Wiccaan   
2008-02-09 10:47   
Ok I have pin-pointed the issue that causes this to happen. You MUST compile as C code when compiling with VS2005. If you compile as C++ code, it will cause CE to freeze when attempting to load the plugin.

To set this option, goto:
Project -> Properties

Then click the + next to Configuration Properties, then click the + next to C/C++.
Then click on Advanced. There will be an option on the right labeled, "Compile As". Select "Compile As C Code (/TC)" and the plugin should load fine.
(0000053)
Dark Byte   
2008-02-09 17:14   
I think using a proper .def file should fix it as well. But yes, compiling as C is a solution as well

Issue History
2008-02-08 03:40WiccaanNew Issue
2008-02-09 00:22Dark ByteNote Added: 0000049
2008-02-09 00:22Dark ByteStatusnew => acknowledged
2008-02-09 07:43WiccaanNote Added: 0000051
2008-02-09 10:47WiccaanNote Added: 0000052
2008-02-09 17:14Dark ByteStatusacknowledged => resolved
2008-02-09 17:14Dark ByteResolutionopen => fixed
2008-02-09 17:14Dark ByteAssigned To => Dark Byte
2008-02-09 17:14Dark ByteNote Added: 0000053
2009-07-24 05:16longnhatvlTag Attached: 5.4.3 cheatengine