davidgfnet / wireshark-whatsapp

Whatsapp dissector plugin for wireshark
Other
207 stars 68 forks source link

OS X build #23

Closed mgp25 closed 9 years ago

mgp25 commented 9 years ago

Hi there, im facing some issues building the plugin, maybe you can help me with this as i couldnt make it work:

OS X: Yosemite Wireshark ver: 1.12.1

Cmake:

MPB:build mgp25$ cmake ..
-- The C compiler identification is AppleClang 6.1.0.6020049
-- The CXX compiler identification is AppleClang 6.1.0.6020049
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Found PkgConfig: /opt/local/bin/pkg-config (found version "0.28") 
-- checking for one of the modules 'glib-2.0>=2.4.0'
-- Found GLib2: glib-2.0;intl /opt/local/include/glib-2.0;/opt/local/lib/glib-2.0/include;/opt/local/include
-- Looking for include file glib/gregex.h
-- Looking for include file glib/gregex.h - not found
-- Looking for include file glib/gchecksum.h
-- Looking for include file glib/gchecksum.h - not found
-- Found wireshark libs at /opt/local/include/wireshark
-- Found Gcrypt: /opt/local/lib/libgcrypt.dylib  
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/mgp25/Desktop/wireshark-whatsapp-master/build

Make:

MBP:build mgp25$ make
[ 20%] Generating plugin.c
Scanning dependencies of target whatsapp
[ 40%] Building C object CMakeFiles/whatsapp.dir/plugin.c.o
[ 60%] Building C object CMakeFiles/whatsapp.dir/packet-whatsapp.c.o
In file included from /Users/mgp25/Desktop/wireshark-whatsapp-master/packet-whatsapp.c:11:
In file included from /opt/local/include/wireshark/epan/packet.h:26:
In file included from /opt/local/include/wireshark/epan/proto.h:45:
In file included from /opt/local/include/wireshark/wsutil/nstime.h:30:
/opt/local/include/wireshark/wiretap/wtap.h:969:5: error: unknown type name
      'nstime_t'; did you mean 'time_t'?
    nstime_t            ts;
    ^~~~~~~~
    time_t
/usr/include/sys/_types/_time_t.h:30:26: note: 'time_t' declared here
typedef __darwin_time_t         time_t; 
                                ^
In file included from /Users/mgp25/Desktop/wireshark-whatsapp-master/packet-whatsapp.c:11:
In file included from /opt/local/include/wireshark/epan/packet.h:26:
In file included from /opt/local/include/wireshark/epan/proto.h:45:
/opt/local/include/wireshark/wsutil/nstime.h:109:54: warning: declaration of
      'struct wtap_nstime' will not be visible outside of this function
      [-Wvisibility]
WS_DLL_PUBLIC double wtap_nstime_to_sec(const struct wtap_nstime *nstime);
                                                     ^
In file included from /Users/mgp25/Desktop/wireshark-whatsapp-master/packet-whatsapp.c:11:
In file included from /opt/local/include/wireshark/epan/packet.h:26:
In file included from /opt/local/include/wireshark/epan/proto.h:47:
/opt/local/include/wireshark/epan/tvbuff.h:39:10: fatal error: 
      'wsutil/ws_mempbrk.h' file not found
#include "wsutil/ws_mempbrk.h"
         ^
1 warning and 2 errors generated.
make[2]: *** [CMakeFiles/whatsapp.dir/packet-whatsapp.c.o] Error 1
make[1]: *** [CMakeFiles/whatsapp.dir/all] Error 2
make: *** [all] Error 2

Regards

davidgfnet commented 9 years ago

My gut asks me for a MacOS joke right now but I'll refrain myself. Why don't you try at wireshark's mailing list? Seems some problem with wireshark's headers and your OS, right?

mgp25 commented 9 years ago

Sure, thanks

Nokius commented 9 years ago

I tried it today and I fixed the issues @mgp25 had see ( here the workoraound https://gist.github.com/Nokius/475d339cb3bcd6e0636e)

cmake output:

X:build user$ cmake  -DWIRESHARK_INCLUDE_DIRS="/Users/user/Downloads/wireshark-whatsapp/wireshark-1.12.6/" ..
-- The C compiler identification is GNU 4.2.1
-- The CXX compiler identification is GNU 4.2.1
-- Checking whether C compiler has -isysroot
-- Checking whether C compiler has -isysroot - yes
-- Checking whether C compiler supports OSX deployment target flag
-- Checking whether C compiler supports OSX deployment target flag - yes
-- Check for working C compiler: /Developer/usr/bin/cc
-- Check for working C compiler: /Developer/usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Checking whether CXX compiler has -isysroot
-- Checking whether CXX compiler has -isysroot - yes
-- Checking whether CXX compiler supports OSX deployment target flag
-- Checking whether CXX compiler supports OSX deployment target flag - yes
-- Check for working CXX compiler: /Developer/usr/bin/c++
-- Check for working CXX compiler: /Developer/usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found PkgConfig: /usr/local/bin/pkg-config (found version "0.28")
-- checking for one of the modules 'glib-2.0>=2.4.0'
-- Found GLib2: glib-2.0;intl /usr/local/Cellar/glib/2.44.1/include/glib-2.0;/usr/local/Cellar/glib/2.44.1/lib/glib-2.0/include;/usr/local/opt/gettext/include
-- Looking for include file glib/gregex.h
-- Looking for include file glib/gregex.h - not found
-- Looking for include file glib/gchecksum.h
-- Looking for include file glib/gchecksum.h - not found
-- Found Gcrypt: /usr/local/lib/libgcrypt.dylib
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/user/Downloads/wireshark-whatsapp/build

Make output:

X:build user$ make
[ 16%] Generating plugin.c
Scanning dependencies of target whatsapp
[ 33%] Building C object CMakeFiles/whatsapp.dir/plugin.c.o
[ 50%] Building C object CMakeFiles/whatsapp.dir/packet-whatsapp.c.o
In file included from /Users/user/Downloads/wireshark-whatsapp/wireshark-1.12.6/epan/proto.h:41,
                 from /Users/user/Downloads/wireshark-whatsapp/wireshark-1.12.6/epan/packet.h:26,
                 from /Users/user/Downloads/wireshark-whatsapp/packet-whatsapp.c:11:
/Developer/usr/bin/../lib/gcc/i686-apple-darwin10/4.2.1/include/varargs.h:4:2: error: #error "GCC no longer implements <varargs.h>."
/Developer/usr/bin/../lib/gcc/i686-apple-darwin10/4.2.1/include/varargs.h:5:2: error: #error "Revise your code to use <stdarg.h>."
In file included from /usr/local/Cellar/glib/2.44.1/include/glib-2.0/glib/gtypes.h:32,
                 from /usr/local/Cellar/glib/2.44.1/include/glib-2.0/glib/galloca.h:32,
                 from /usr/local/Cellar/glib/2.44.1/include/glib-2.0/glib.h:30,
                 from /Users/user/Downloads/wireshark-whatsapp/wireshark-1.12.6/epan/proto.h:44,
                 from /Users/user/Downloads/wireshark-whatsapp/wireshark-1.12.6/epan/packet.h:26,
                 from /Users/user/Downloads/wireshark-whatsapp/packet-whatsapp.c:11:
/usr/local/Cellar/glib/2.44.1/lib/glib-2.0/include/glibconfig.h:103:1: warning: "GLIB_MINOR_VERSION" redefined
In file included from /Users/user/Downloads/wireshark-whatsapp/packet-whatsapp.c:10:
/Users/user/Downloads/wireshark-whatsapp/wireshark-1.12.6/config.h:50:1: warning: this is the location of the previous definition
In file included from /usr/local/Cellar/glib/2.44.1/include/glib-2.0/glib/gtypes.h:32,
                 from /usr/local/Cellar/glib/2.44.1/include/glib-2.0/glib/galloca.h:32,
                 from /usr/local/Cellar/glib/2.44.1/include/glib-2.0/glib.h:30,
                 from /Users/user/Downloads/wireshark-whatsapp/wireshark-1.12.6/epan/proto.h:44,
                 from /Users/user/Downloads/wireshark-whatsapp/wireshark-1.12.6/epan/packet.h:26,
                 from /Users/user/Downloads/wireshark-whatsapp/packet-whatsapp.c:11:
/usr/local/Cellar/glib/2.44.1/lib/glib-2.0/include/glibconfig.h:104:1: warning: "GLIB_MICRO_VERSION" redefined
In file included from /Users/user/Downloads/wireshark-whatsapp/packet-whatsapp.c:10:
/Users/user/Downloads/wireshark-whatsapp/wireshark-1.12.6/config.h:47:1: warning: this is the location of the previous definition
In file included from /Users/user/Downloads/wireshark-whatsapp/wireshark-1.12.6/epan/packet.h:26,
                 from /Users/user/Downloads/wireshark-whatsapp/packet-whatsapp.c:11:
/Users/user/Downloads/wireshark-whatsapp/wireshark-1.12.6/epan/proto.h:113: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘void’
/Users/user/Downloads/wireshark-whatsapp/packet-whatsapp.c:85: error: expected ‘;’, ‘,’ or ‘)’ before ‘_U_’
/Users/user/Downloads/wireshark-whatsapp/packet-whatsapp.c:85: error: expected ‘;’, ‘,’ or ‘)’ before ‘_U_’
/Users/user/Downloads/wireshark-whatsapp/packet-whatsapp.c:86: error: expected ‘;’, ‘,’ or ‘)’ before ‘_U_’
/Users/user/Downloads/wireshark-whatsapp/packet-whatsapp.c:86: error: expected ‘;’, ‘,’ or ‘)’ before ‘_U_’
/Users/user/Downloads/wireshark-whatsapp/packet-whatsapp.c:96: error: expected ‘;’, ‘,’ or ‘)’ before ‘_U_’
/Users/user/Downloads/wireshark-whatsapp/packet-whatsapp.c:105: error: expected ‘;’, ‘,’ or ‘)’ before ‘_U_’
/Users/user/Downloads/wireshark-whatsapp/packet-whatsapp.c: In function ‘proto_register_whatsapp’:
/Users/user/Downloads/wireshark-whatsapp/packet-whatsapp.c:405: error: ‘fld_chk_cb’ undeclared (first use in this function)
/Users/user/Downloads/wireshark-whatsapp/packet-whatsapp.c:405: error: (Each undeclared identifier is reported only once
/Users/user/Downloads/wireshark-whatsapp/packet-whatsapp.c:405: error: for each function it appears in.)
/Users/user/Downloads/wireshark-whatsapp/packet-whatsapp.c:405: error: ‘wa_userpass_uats_username_set_cb’ undeclared (first use in this function)
/Users/user/Downloads/wireshark-whatsapp/packet-whatsapp.c:405: error: ‘wa_userpass_uats_username_tostr_cb’ undeclared (first use in this function)
/Users/user/Downloads/wireshark-whatsapp/packet-whatsapp.c:406: error: ‘wa_userpass_uats_password_set_cb’ undeclared (first use in this function)
/Users/user/Downloads/wireshark-whatsapp/packet-whatsapp.c:406: error: ‘wa_userpass_uats_password_tostr_cb’ undeclared (first use in this function)
/Users/user/Downloads/wireshark-whatsapp/packet-whatsapp.c:418: error: ‘waup_copy_cb’ undeclared (first use in this function)
/Users/user/Downloads/wireshark-whatsapp/packet-whatsapp.c:422: warning: passing argument 9 of ‘uat_new’ from incompatible pointer type
make[2]: *** [CMakeFiles/whatsapp.dir/packet-whatsapp.c.o] Error 1
make[1]: *** [CMakeFiles/whatsapp.dir/all] Error 2
make: *** [all] Error 2

is this happening due to the glib issue? Thanks for your feedback.

OSX: SnowLeapard wireshark: 1.12.6