Skip to content

Wireshark bluetooth controller dissector plugin #118

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 2, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions packet_parse/nxbt/AUTHORS
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
(These are Github usernames)
Author:
Poohl

Credit for Figuring out the protocol to:
CTCaer
riking
Psyvern
pbsds
wormyrocks
mart1nro
65 changes: 65 additions & 0 deletions packet_parse/nxbt/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# CMakeLists.txt
#
# Wireshark - Network traffic analyzer
# By Gerald Combs <[email protected]>
# Copyright 1998 Gerald Combs
#
# SPDX-License-Identifier: GPL-2.0-or-later
#

include(WiresharkPlugin)

# Plugin name and version info (major minor micro extra)
set_module_info(nxbt 0 1 0 0)

set(DISSECTOR_SRC
packet-nxbt.c
)

set(PLUGIN_FILES
plugin.c
${DISSECTOR_SRC}
)

set_source_files_properties(
${PLUGIN_FILES}
PROPERTIES
COMPILE_FLAGS "${WERROR_COMMON_FLAGS}"
)

include_directories(${CMAKE_CURRENT_SOURCE_DIR})

register_plugin_files(plugin.c
plugin
${DISSECTOR_SRC}
)

add_plugin_library(nxbt epan)

target_link_libraries(nxbt epan)

install_plugin(nxbt epan)

# file(GLOB DISSECTOR_HEADERS RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "*.h")
CHECKAPI(
NAME
nxbt
SWITCHES
-g abort -g termoutput
SOURCES
${DISSECTOR_SRC}
${DISSECTOR_HEADERS}
)

#
# Editor modelines - https://www.wireshark.org/tools/modelines.html
#
# Local variables:
# c-basic-offset: 8
# tab-width: 8
# indent-tabs-mode: t
# End:
#
# vi: set shiftwidth=8 tabstop=8 noexpandtab:
# :indentSize=8:tabSize=8:noTabs=false:
#
48 changes: 48 additions & 0 deletions packet_parse/nxbt/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@

# NXBT Bluetooth communication dissector

Plugin for Wireshark to dissect the bluetooth communication between a Controller and the Nintendo Switch (NX)

## How to install

Unless there is a compiled binary available for your version of Wireshark, you
need to compile wireshark from source. below is how one would do this.

Get Wireshark and dependencies
```
# apt-get install wireshark-dev Ninja
$ git clone https://gitlab.com/wireshark/wireshark.git
```

Copy this plugin into place
```
cp -r <this folder> wireshark/plugins/epan/
```

setup the build environment (in here `wireshark-build`).
Other make utilities are available, I used `ninja`.
```
mkdir wireshark-build
cd wireshark-build
cmake -DCUSTOM_PLUGIN_SRC_DIR="plugins/epan/nxbt" -G ninja ../wireshark
```

compile the entire thing, this takes 10-30 mins the first time.
```
ninja
```

to run this Wireshark, run
```
./run/wireshark
```

or instead copy the compiled plugin in `./run/plugins/<version>/epan/nxbt.so`
to your local wireshark's plugin directory, e.g. `~/.local/lib/wireshark/plugins`.

## If it isn't picked up

If it shows as HID, ignore this protocoll or disable it, then restart.

If you didn't actually capture bluetooth traffic, you might have to change the
dissectortable rules in `proto_reg_handoff_nxbt`.
Loading