This is a static archive of our old Q&A Site. Please post any new questions and answers at ask.wireshark.org.

build with dissector plugin fails in Windows

0

Hi,

I have recently built a plugin dissector successfully in Linux. Now, I'm trying to compile and build the same plugin in Win environment. I have managed to setup my code environment and msbuild was executed successfully (without my plugin)

However, once I add my dissector to my project and try to build again, I get the following error:

Build FAILED.

   "C:\Development\wsbuild64\Wireshark.sln" (default target) (1) ->
   "C:\Development\wsbuild64\ALL_BUILD.vcxproj.metaproj" (default target) (2) ->
   "C:\Development\wsbuild64\plugins\map\map.vcxproj.metaproj" (default target) (62) ->
   "C:\Development\wsbuild64\plugins\map\map.vcxproj" (default target) (146) ->
   (CustomBuild target) ->
     C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.CppCommon.targets(170,5): error MSB6006: "cmd.exe" exited with code 1. [C:\Development\wsbuild64\plugins\map\map.vcxproj]

0 Warning(s) 1 Error(s)

I’ve gone through the procedure in README.plugins step by step. I’m using the ‘custom extension’ option. What am I missing here?

thanks

asked 03 Mar ‘17, 06:18

gerolima's gravatar image

gerolima
6225
accept rate: 50%

in fact this is what I get:

Generating plugin.c
110>  Traceback (most recent call last):
110>    File "C:\Development\wireshark\tools\make-dissector-reg.py", line 156, in <module>
110>      contents = file.read()
110>    File "C:\Python36\lib\encodings\cp1253.py", line 23, in decode
110>      return codecs.charmap_decode(input,self.errors,decoding_table)[0]
110>  UnicodeDecodeError: 'charmap' codec can't decode byte 0x9c in position 43319: character maps to <undefined>
110>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.CppCommon.targets(170,5): error MSB6006: "cmd.exe" exited with code 1.

Is this a python problem? (i’m using python 3)

(03 Mar ‘17, 10:21) gerolima

This sounds like you have an odd character in your source file that causes the code page issues. As Python3 has rearranged the deckchairs with regard to Unicode as default for strings this is unlikely to be an issue for Python2.

What is the character you have in your source file (looks to be 0x9c at position 43319)?

(04 Mar ‘17, 11:12) grahamb ♦


2 Answers:

0

Hi,

I had a look again as grahamb suggested. The problem was the following part

static const value_string fan[] = {
        {0x00, "FAN Off, ODU stops the fan (troubleshooting)"},
        {0x01, "FAN on, ODU runs the FAN at the speed specified in the "FAN Speed" parameter"},
        {0x02, "reserved for ODU internally"}, };

The double quotes inside the double quotes for the string created the problem. (ie. "FAN Speed")

many thanks for the support.

answered 05 Mar '17, 23:32

gerolima's gravatar image

gerolima
6225
accept rate: 50%

0

I was able to overcome this issue, by adding in the make-dissector-reg.py, in the open(file) function an extra argument for the encoding so that the script doesn't use the system's default encoding. Please consider this as a dirty solution

answered 04 Mar '17, 00:38

gerolima's gravatar image

gerolima
6225
accept rate: 50%