ghpr-asia / wsdf

Wireshark Dissector Framework
Apache License 2.0
16 stars 9 forks source link

Plugin registered but no protocols or dissectors added Wireshark 4.2.x #15

Open half2me opened 7 months ago

half2me commented 7 months ago

I'm having issues getting this to do anything. It just doesn't show up anywhere. The dissector tables look the same, and the protocol is not added to the list of protocols.

Here is my code I'm trying out:

#![allow(dead_code)]

use wsdf::{version, Protocol};

version!("0.0.2", 4, 2);

#[derive(Protocol)]
#[wsdf(
    proto_desc = "ANT+",
    proto_name = "antplus",
    proto_filter = "antplus",
    decode_from = [("usb.bulk", 0xFFFF)]
)]
struct AntPlus {
    sync: u8,
    payload_length: u8,
    class: u8,
    #[wsdf(len_field = "payload_length", subdissector = "antplus.class")]
    payload: Vec<u8>,
    checksum: u8,
}

It builds fine, I copy the file to ~/.local/lib/wireshark/plugins/4-2/epan/ant.so. And wireshark loads the plugin without issues.

Screenshot 2024-02-15 at 11 32 33

However nothing changes, the protocol is not added anywhere and the dissector table is unchanged:

Screenshot 2024-02-15 at 11 33 50 Screenshot 2024-02-15 at 11 34 28

What am I doing wrong? I tried the baby_udp example to see if it was just something in this code, but that protocol doesn't show up for me either :¯_(ツ)_/¯:

half2me commented 7 months ago

Compare that to the same thing written in lua which works perfectly:

--- requires https://github.com/Snaipe/wssdl/releases/download/v0.2.0/wssdl.lua
local wssdl = require 'wssdl'

ant_pkt = wssdl.packet {
    sync:u8():hex(),
    length:u8(),
    class:u8():hex(),
    payload:payload({ class, 'antplus.class' }, length * 8),
    checksum:u8():hex()
}

proto = ant_pkt:proto('antplus', 'ANT+ Protocol')

wssdl.dissect {
    usb.bulk:add { [0xFFFF] = proto }
}

Screenshot 2024-02-15 at 11 43 06 Screenshot 2024-02-15 at 11 43 19 Screenshot 2024-02-15 at 11 46 52