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

How can I get the Wireshark install directory from within a wireshark dissector? My dissector relies on some external libraries and I would like to avoid hard coding "C:Program FilesWiresharkPluginsFooDebendancies"

Thank you for your time, Brandon

asked 25 Jul '11, 08:09

officialhopsof's gravatar image

officialhopsof
318812
accept rate: 100%


You can use one of the routines in epan/filesystem.c, for example get_plugin_dir().

Not that you should normally be doing any such thing in a dissector...

permanent link

answered 25 Jul '11, 14:05

JeffMorriss's gravatar image

JeffMorriss ♦
6.2k572
accept rate: 27%

include <epan/filesystem.c>

Causes linker errors, specifically:
error LNK2019: unresolved external symbol _ws_stdio_stat64 referenced in function _test_for_directory
error LNK2019: unresolved external symbol _utf_16to8 referenced in function _init_progfile_dir
error LNK2019: unresolved external symbol _getenv_utf8 referenced in function _get_datafile_dir
error LNK2019: unresolved external symbol _ws_stdio_remove referenced in function _delete_directory
error LNK2019: unresolved external symbol _ws_stdio_rename referenced in function _rename_persconffile_profile

(26 Jul '11, 12:56) officialhopsof

error LNK2019: unresolved external symbol _ws_stdio_mkdir referenced in function _create_persconffile_profile
packet-vmf.obj : error LNK2019: unresolved external symbol imp[email protected] referenced in function _get_persdatafile_dir
error LNK2019: unresolved external symbol _ws_stdio_unlink referenced in function _deletefile
error LNK2019: unresolved external symbol _ws_stdio_open referenced in function _copy_file_binary_mode

But this appears like it's what I want.

(26 Jul '11, 12:56) officialhopsof

It's an atrocity to #include a C file. Include the header instead.

(26 Jul '11, 13:03) bstn

Oh! That was a typo I didn't spot! Thanks!

(26 Jul '11, 13:24) officialhopsof
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
×58
×21
×10
×10

question asked: 25 Jul '11, 08:09

question was seen: 2,290 times

last updated: 26 Jul '11, 13:24

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