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

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, 06:18

gerolima's gravatar image

gerolima
6125
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, 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, 11:12) grahamb ♦

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.

permanent link

answered 05 Mar, 23:32

gerolima's gravatar image

gerolima
6125
accept rate: 50%

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

permanent link

answered 04 Mar, 00:38

gerolima's gravatar image

gerolima
6125
accept rate: 50%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×637
×254
×193
×173
×110

question asked: 03 Mar, 06:18

question was seen: 626 times

last updated: 05 Mar, 23:32

p​o​w​e​r​e​d by O​S​Q​A