CaringCaribou / caringcaribou

A friendly car security exploration tool for the CAN bus
GNU General Public License v3.0
738 stars 193 forks source link

adding pattern of positive response in uds service_discovery #59

Closed shutingrz closed 3 years ago

shutingrz commented 5 years ago

Currently, service_discovery expects only when the ECU response is Negative Response.
If a Positive Response is returned, the value of msg.data [2] will be the value of Response Data or Padding.

"Toyota Prius C" responds to TesterPresents as follows (output of candump):

  can0 TX - - 7E0 [8] 01 3E 00 00 00 00 00 00 '.> ......'
  can0 RX - - 7E8 [8] 01 7E 00 00 00 00 00 00 '. ~ ......'

At this time, the value of msg.data [2] is 00, and service_id cannot be acquired normally.

This commit fix the problem.

When Response ID is other than 0x7F (Negative Response), it is always Positive Response, so you can get service_id by subtracting 0x40.

RoninDusette commented 4 years ago

I fixed the merge commit since it was just chillin for a year. Linky below: https://github.com/CaringCaribou/caringcaribou/pull/60