Created
September 3, 2022 14:31
-
-
Save brainstorm/32d91ceccc824b4153b8c29a70c86ced to your computer and use it in GitHub Desktop.
Revisions
-
brainstorm created this gist
Sep 3, 2022 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,19 @@ usb_printer_epson_protocol = Proto("USB_PRINTER_EPSON", "USB printer EPSON") local printjob_payload = ProtoField.none("usb_printer_epson.payload", "Payload", base.HEX) usb_printer_epson_protocol.fields = { printjob_payload } function usb_printer_epson_protocol.dissector(buffer, pinfo, tree) length = buffer:len() --- We are only interested on the 16KB BULK transfers as they contain the PDF being sent? if length < 10000 then return end pinfo.cols.protocol = usb_printer_epson_protocol.name local subtree = tree:add(usb_printer_epson_protocol, buffer(), "USB Printer EPSON") subtree:add_le(printjob_payload, buffer(0,length)) end DissectorTable.get("usb.bulk"):add(0xffff, usb_printer_epson_protocol)