![]() |
Plugin not Recognized by NSIS
Hello,
I'm compiling a NSIS plugin in Watcom using C++. I'm exporting a simple NSIS function: PHP Code:
http://i.gyazo.com/af29352caf9ab10d58a55c630cb4ca9b.png The file is being built as a DLL: http://i.gyazo.com/bfb0566d76a126c6d060e06a9bcc931e.png when I try to compile: Quote:
I'm not sure exactly how NSIS's compiler resolves a plugin function, but I assume that it looks for the presence of the DLL -> make sure that it's a DLL -> presence of an export matching the function name -> done Any idea what the problem is here? Here's a download to Test.dll: https://www.sendspace.com/file/4kz9ip Many thanks |
The VirtualSize field in the IMAGE_SECTION_HEADER for IMAGE_DIRECTORY_ENTRY_EXPORT is zero which is why makensis fails to find the export.
I don't know if your compiler/linker fails to follow the PE spec or if it is OK to set it to zero even though it contains initialized data, if that is the case then it is a bug in makensis. Edit: I changed the way makensis looks for the exports section, should be fixed in the next release... |
Sounds great, Anders. Where can I acquire this new makensis?
Many thanks |
Unless you compile it yourself you have to wait until the next release, next year probably. It is also probably possible to patch v2.46 with a hex editor if you can figure out which bytes to change or patch your dll after linking. Your final option is to use a different linker. Mingw and Visual Studio can both be used for free...
|
Ok I see. Can you please just tell me what source file needs to be changed? I'll go ahead and compile it myself
edit: I assume this is the line that needs to be changed: http://i.gyazo.com/25f0611ed45e8bdc40802f0ecc7cd133.png ? Thanks again |
It's been committed in svn: http://sourceforge.net/p/nsis/code/6569/.
|
Thanks very much Jason and Anders. All settled now.
|
Patch for v3.0b1: 8B 52 08 8B --> 8B 52 10 8B (sort of untested) I believe the code in 2.46 is @ 00019EA6 but I'm not sure if it is possible to patch it.
Your plugin crashed on exit when I tested it, make sure the function is cdecl and not stdcall. |
| All times are GMT. The time now is 17:19. |
Copyright © 1999 - 2010 Nullsoft. All Rights Reserved.