[chirp_devel] Linux USB sniffing

goldstar611 at hotmail.com
Thu Mar 5 16:51:46 PST 2020


I found the issue using your TSV file; you'll need to re-compile tidy.

In tidy.c find
  char buff[1000];
and change to
  char buff[100000];
then find
  char outbuff[1000];
and change to 
  char outbuff[100000];

One buffer isn't large enough for your trace file and the stack is getting over written which causes a segfault, unless the file is written in such a way that it starts executing code, but I digress.
I didn't drill down into which one is the real problem or verify that all of the data is there, so take it with a grain of salt :) But it doesn't crash anymore!

I'm going to enclose the regular expressions in quotes -- don't copy/use those, it's just to show you there's a trailing space in the replace string. Depending on your editor you may need to change \1
to $1

Search:       "([0-9a-f]{2})"
Replace with: "\1 "

Tony

On Thu, 2020-03-05 at 03:40 +0000, Ryan Fuller wrote:
> 
> 
> Hi Rich, I'm on mobile so no inline reply this time.
> 
> 
> 
> 
> 
> If you can copy/paste the TSV file to pastebin.com or similar place I can inspect the file and see what tidy is choking on.
> 
> 
> 
> 
> 
> As far as next steps go, it seems you are on the right track. Make a small change, get another radiotrace file and do a difference/comparison.
> 
> 
> 
> 
> 
> I have a regular expression I use (on my computer) that adds spaces in between the hex characters so graphical diff programs like Meld work better when they perform highlighting. I can pull that up
> if you (or anyone in chirp-devel) is interested.
> 
> 
> 
> 
> 
> Tony
> 
> From: Richard Gordon <rich at lowswr.com>
> 
> Sent: Wednesday, March 4, 2020 7:01:45 PM
> 
> To: goldstar611 at hotmail.com <goldstar611 at hotmail.com>
> 
> Cc: chirp_devel at intrepid.danplanet.com <chirp_devel at intrepid.danplanet.com>
> 
> Subject: Re: [chirp_devel] Linux USB sniffing
>  
> 
> 
> 
> 
> Thanks for the reply Tony.
> TShark version is 2.6.8.
> Yes, I have to remove the space between the dash and the i in the start_trace command. I also have to 'sudo modprobe usbmon' and 'touch cap.pcap'  before starting.
> (time goes by)
> I was trying to capture a read from the radio. If I run tidy on this data to stdout I can see where the fault takes place in the tsv but I don't know why.
> I had success sniffing a write to the radio and I now have a nice radiotrace file.
> What is the next step? I will make some subtle changes and figure out how the memories are laid out.
> 
> 
> Rich
> 
> 
> 
> 
> 
> 
> 
> 
> On Tue, Mar 3, 2020 at 7:49 PM <goldstar611 at hotmail.com> wrote:
> 
> 
> > Hi Rich,
> > 
> > 
> > 
> > I've added some thoughts in line.
> > 
> > 
> > 
> > Tony
> > 
> > 
> > 
> > On Tue, 2020-03-03 at 17:25 -0700, Richard Gordon via chirp_devel wrote:
> > 
> > > I really like Chirp and I thought I might try to help out with adding a new old radio.
> > 
> > > I recently bought a used Icom IC-V8 and I have a programming cable.
> > 
> > > Programming software runs fine under Wine.
> > 
> > > I followed the directions on the Linux USB sniffing page.
> > 
> > > I can capture fine and I end up with a cap.pcap file that is about 1 MB in size.
> > 
> > Did you have to update the start_trace.sh script and remove the space between the dash and the i? start_trace.sh didnt work for me until I did that
> > 
> > tshark - i usbmon$bus -w cap.pcap
> > 
> > vs
> > 
> > tshark -i usbmon$bus -w cap.pcap
> > 
> > > I can then run the first 2 commands in the clean script and end up with the capdev and capdev.tsv files.
> > 
> > > But when I try to run the tsv file through tidy, I get a segmentation fault but it does create an empty radiotrace.
> > 
> > Just ensuring that you are compiling tidy.c using the info at the wiki: 
> > https://chirp.danplanet.com/projects/chirp/wiki/DevelopersUSB_Sniffing_in_Linux
> > 
> > > Any ideas?
> > 
> > This doesn't help but I can reliably crash tidy with the non-tsv file so, maybe open up the TSV file in a text editor and ensure it "looks good"?
> > 
> > 
> > 
> > The c file is written with a pretty high expectation that the TSV file is perfect so I suspect the TSV file formatting.
> > 
> > 
> > 
> > What version of tshark are you using (tshark --version from a command line should be sufficient)
> > 
> > > Thanks,
> > 
> > > Rich Gordon k0eb
> > 
> > > 
> > 
> > > _______________________________________________
> > 
> > > chirp_devel mailing list
> > 
> > > chirp_devel at intrepid.danplanet.com
> > 
> > > 
> > http://intrepid.danplanet.com/mailman/listinfo/chirp_devel
> > 
> > > Developer docs: 
> > http://chirp.danplanet.com/projects/chirp/wiki/Developers
> > 
> > 
> > 
> 
> 
> 
> 
> 
> 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://intrepid.danplanet.com/pipermail/chirp_devel/attachments/20200305/035d22b9/attachment-0001.html 


More information about the chirp_devel mailing list