Wireshark unable to load customized plugin
Steps followed:
Downloaded Wireshark(3.0.5) source, created build environment and build successfully without my custom dissector plugin.
Implemented custom plugin according to developer guide.
Build Wireshark with custom plugin, created xxx.dll for plugin then created installer using NSIS.
Custom Wireshark installer created and installed on system.
After installation while loading plugins, an error occurs "Couldn't load plugin 'xxx.dll :C:\Program Files (x86)\Wireshark\plugins\3.0\epan\xxx.dll':Specified module could not be found.
I verified the location where global plugins reside path "C:\Program Files (x86)\Wireshark\plugins\3.0\epan\xxx.dll" is there.
I'm unable to find root cause for the issue. If anybody has an idea, please share.
- Build on Windows 7 professional
- 32 bit installer
- Installed on windows 10, 7
Ran tests on installer found below info:
-- End stdout for command ('D:\\wsbuild32\\run\\RelWithDebInfo\\tshark.exe', '-G', 'decodes') --
-- Begin stderr for command ('D:\\wsbuild32\\run\\RelWithDebInfo\\tshark.exe', '-G', 'decodes') --
tshark: Couldn't load plugin 'xyz.dll': '\wsbuild32\run\RelWithDebInfo\plugins\3.0\epan\xyz.dll': The specified module could not be found.
-- End stderr for command ('\\wsbuild32\\run\\RelWithDebInfo\\tshark.exe', '-G', 'decodes') --
<end of output>
Test time = 44.46 sec
The test output you show seems to be running from the build, not the installer. Has your dissector ever worked on the build system?
Yes, its at build time test will open wireshark then it will load all plugins. same thing will happen if install same installer on target system.
After installation, if I open wireshark every time same issue happening , could not able to figure out what is the root cause for this issue.
I used snacc compiler to generate c++ code from asn1 schema then created messages dll ,lib by using generated c++ asn1 code, included at linking time to plugin module then perfectly generated plugin dll (xyz.dll) along wireshark source with VS2017.
Please let me know if there is any tools to find exact root cause.
Just to confirm, your dissector plugin also depends on another dll? If so, is that dll included in the Wireshark install you're creating so that it's subsequently copied to the target machine?
Yes, its depends on other dll. included to wireshark as well
3 stages
then installed on target system.
So xyz.dll is on the target system, installed by the Wireshark installer. are the other dll's you mention also installed on the target system. i.e. asn1.dll and messages.dll?
You must ensure that all dependent dll's required by your plugin are also installed on the target system, note that the compilation of other code may also add dependencies on other compiler libraries which may not be present on the target system. You can check the dependencies by using a tool such as dependency walker.
Conformed that all dependency dlls are linked to target dll.
Cross checked:
1)Copied all the dependency dlls to "D:\wsbuild32\run\RelWithDebInfo then modified Wireshark.nsi script accordingly.
2)Created installer, installed on target system and successfully loads all the dependency dll while opening wireshark.
3)While loading my plugin, its throwing an error "Duplicate protocol filter_name "xyz"! This might be caused by an inappropriate plugin or a development error."
4)I understand that dependency data already present in my plug in dll, if I'm wrong please suggest.