Skip to content

Commit 4435a44

Browse files
AP: cleanup
1 parent b6cb2f4 commit 4435a44

File tree

6 files changed

+28
-0
lines changed

6 files changed

+28
-0
lines changed

auto_psy/bridge.py

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# This script bridges two CAN interfaces, so that anything received on one is
2+
# sent on the other, and vice-versa.
3+
14
from __future__ import print_function
25
import sys
36
import can

auto_psy/hideous.py

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# This ugly python script is designed to scan the OBD2 / UDS range looking for
2+
# things the board responds to. It includes a list of standard packets that the
3+
# board already randomly emits, so we can filter those out.
4+
15
from __future__ import print_function
26
import sys
37
import can

auto_psy/nonce.py

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# This is the seed->key function that the board uses to determine if we're
2+
# allowed security access. I transcribed this in case we needed to get it right
3+
# on the first try. Turns out to have been wasted effort.
4+
15
def nswap(c):
26
return (c>>4) | (c<<4 & 0xf0)
37

auto_psy/notes.md

+8
Original file line numberDiff line numberDiff line change
@@ -499,6 +499,14 @@ Examples:
499499
- possibly it tracks number of attempts and you'd need to reset if exceeded
500500

501501
What we have might be a custom variant
502+
### Online References
503+
https://hackaday.com/2013/10/29/can-hacking-protocols/
504+
- service ids
505+
- CAN frame format
506+
https://automotiveembeddedsite.wordpress.com/uds/
507+
- more details
508+
https://en.wikipedia.org/wiki/ISO_15765-2
509+
- correct framing rules
502510

503511
## Can Setup
504512
ip link show dev can0

auto_psy/rom-dump.py

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# This code is to dump a section of firmware, assuming we already have security
2+
# access. It's "good enough" code, I'm sure I could have refined it, but there
3+
# wasn't any need. Re-running it until I happened to get clean "uploads" was
4+
# good enough.
5+
16
from __future__ import print_function
27
import sys
38
import can

auto_psy/security-access.py

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# This script enabled "Security Access" to the chosen AID. The original version
2+
# brute-forced the key space, but post-dump, I changed it to compute the
3+
# correct response on the first try.
4+
15
from __future__ import print_function
26
import sys
37
import can

0 commit comments

Comments
 (0)