Re: Update IPC
Posted: 14 Dec 2019, 23:03
Online community for electronics and microcontroller reverse engineering
https://microhacker.denkdose.de/
Hello, i try in my Arduino skect and work fine, in my kuga 1 need the key: (A8, 0, AF, 91, 24)Ursadon wrote: ↑25 May 2019, 16:38Hi! I apologize for the delay - I finished my studies at the instituteoscarboiro wrote: ↑30 Apr 2019, 08:49
After copy on my arduino sketch have this error: expected initializer before 'LFSR'
i need a LFSR library? the code are only to C# or is valid to arduino?
This is pseudo C code
Here is C code, which you can use - https://gist.github.com/Ursadon/8c55972 ... efa037fabb
Also:
1) I cracked all secret keys for (probably) all modules in Ford - https://gist.github.com/Ursadon/8941ff5 ... e09f060eec
For IPC use second key.
2) I made my own CANhacker, so the development process will go faster![]()
Code: Select all
Private Function generate_seed_response(ByVal s1 As Integer, ByVal s2 As Integer, ByVal s3 As Integer, ByVal s4 As Integer, ByVal s5 As Integer, ByVal seed As Integer) As Integer
Dim Or_ed_seed As Integer
Or_ed_seed = ((seed And &HFF0000) >> 16) Or (seed And &HFF00) Or (s1 << 24) Or (seed And &HFF) << 16
Dim mucked_value As UInt32 = &HC541A9
Dim a_bit, v9, v8, v10, v11, v12, v13, v14 As UInt32
For i As Int32 = 0 To 32 - 1
a_bit = ((Or_ed_seed >> i) And 1 Xor mucked_value And 1) << 23
v8 = v9 = v10 = (a_bit) Or (mucked_value >> 1)
mucked_value = v10 And &HEF6FD7 Or
((((v9 And &H100000) >> 20) Xor ((v8 And &H800000) >> 23)) << 20) Or
(((((mucked_value >> 1) And &H8000) >> 15) Xor ((v8 And &H800000) >> 23)) << 15) Or
(((((mucked_value >> 1) And &H1000) >> 12) Xor ((v8 And &H800000) >> 23)) << 12) Or
32 * ((((mucked_value >> 1) And &H20) >> 5) Xor ((v8 And &H800000) >> 23)) Or
8 * ((((mucked_value >> 1) And 8) >> 3) Xor ((v8 And &H800000) >> 23))
Next
For j As Integer = 0 To 32 - 1
v11 = ((((s5 << 24) Or (s4 << 16) Or s2 Or (s3 << 8)) >> j) And 1 Xor mucked_value And 1) << 23
v12 = v11 Or (mucked_value >> 1)
v13 = v11 Or (mucked_value >> 1)
v14 = v11 Or (mucked_value >> 1)
mucked_value = v14 And &HEF6FD7 Or
((((v13 And &H100000) >> 20) Xor ((v12 And &H800000) >> 23)) << 20) Or
(((((mucked_value >> 1) And &H8000) >> 15) Xor ((v12 And &H800000) >> 23)) << 15) Or
(((((mucked_value >> 1) And &H1000) >> 12) Xor ((v12 And &H800000) >> 23)) << 12) Or
32 * ((((mucked_value >> 1) And &H20) >> 5) Xor ((v12 And &H800000) >> 23)) Or
8 * ((((mucked_value >> 1) And 8) >> 3) Xor ((v12 And &H800000) >> 23))
Next
Return ((mucked_value And &HF0000) >> 16) Or 16 * (mucked_value And &HF) Or ((((mucked_value And &HF00000) >> 20) Or ((mucked_value And &HF000) >> 8)) << 8) Or ((mucked_value And &HFF0) >> 4 << 16)
End Function
Code: Select all
v8 = (a_bit) Or (mucked_value >> 1)
v9 = (a_bit) Or (mucked_value >> 1)
v10 = (a_bit) Or (mucked_value >> 1)
Code: Select all
Private Function generate_seed_response(ByVal s1 As Integer, ByVal s2 As Integer, ByVal s3 As Integer, ByVal s4 As Integer, ByVal s5 As Integer, ByVal seed As Integer) As Integer
Dim Or_ed_seed As Integer
Or_ed_seed = ((seed And &HFF0000) >> 16) Or (seed And &HFF00) Or (s1 << 24) Or (seed And &HFF) << 16
Dim mucked_value As UInt32 = &HC541A9
Dim a_bit, v9, v8, v10, v11, v12, v13, v14 As UInt32
For i As Int32 = 0 To 32 - 1
a_bit = ((Or_ed_seed >> i) And 1 Xor mucked_value And 1) << 23
v8 = (a_bit) Or (mucked_value >> 1)
v9 = (a_bit) Or (mucked_value >> 1)
v10 = (a_bit) Or (mucked_value >> 1)
mucked_value = v10 And &HEF6FD7 Or
((((v9 And &H100000) >> 20) Xor ((v8 And &H800000) >> 23)) << 20) Or
(((((mucked_value >> 1) And &H8000) >> 15) Xor ((v8 And &H800000) >> 23)) << 15) Or
(((((mucked_value >> 1) And &H1000) >> 12) Xor ((v8 And &H800000) >> 23)) << 12) Or
32 * ((((mucked_value >> 1) And &H20) >> 5) Xor ((v8 And &H800000) >> 23)) Or
8 * ((((mucked_value >> 1) And 8) >> 3) Xor ((v8 And &H800000) >> 23))
Next
For j As Integer = 0 To 32 - 1
v11 = ((((s5 << 24) Or (s4 << 16) Or s2 Or (s3 << 8)) >> j) And 1 Xor mucked_value And 1) << 23
v12 = v11 Or (mucked_value >> 1)
v13 = v11 Or (mucked_value >> 1)
v14 = v11 Or (mucked_value >> 1)
mucked_value = v14 And &HEF6FD7 Or
((((v13 And &H100000) >> 20) Xor ((v12 And &H800000) >> 23)) << 20) Or
(((((mucked_value >> 1) And &H8000) >> 15) Xor ((v12 And &H800000) >> 23)) << 15) Or
(((((mucked_value >> 1) And &H1000) >> 12) Xor ((v12 And &H800000) >> 23)) << 12) Or
32 * ((((mucked_value >> 1) And &H20) >> 5) Xor ((v12 And &H800000) >> 23)) Or
8 * ((((mucked_value >> 1) And 8) >> 3) Xor ((v12 And &H800000) >> 23))
Next
Return ((mucked_value And &HF0000) >> 16) Or 16 * (mucked_value And &HF) Or ((((mucked_value And &HF00000) >> 20) Or ((mucked_value And &HF000) >> 8)) << 8) Or ((mucked_value And &HFF0) >> 4 << 16)
End Function
Code: Select all
< AT L0
> AT L0
> OK
< AT E0
> AT E0
> OK
< AT H0
> OK
< AT S1
> OK
< AT D0
> OK
< AT AT0
> OK
< AT ST40
> OK
< AT TP6
> OK
< AT SH720
> OK
< AT AL
> OK
< AT CAF0
> OK
< 720 03 22 E6 10 00 00 00 00
> CAN ERROR
< AT WS
> ELM327 v1.4a
Good morningDGAlexandru wrote: ↑14 Feb 2020, 07:43 You can use ElmConfig to sniff their way of doing this - press the "Log" button then check "Full Information" and then check "Write to file" and choose a file.
This way you'll get all the info you need. You can stop the process after the SBL was sent.. if you don't want to wait for the full writing process to end.
elm_fullInfo.jpgCode: Select all
< AT L0 > AT L0 > OK < AT E0 > AT E0 > OK < AT H0 > OK < AT S1 > OK < AT D0 > OK < AT AT0 > OK < AT ST40 > OK < AT TP6 > OK < AT SH720 > OK < AT AL > OK < AT CAF0 > OK < 720 03 22 E6 10 00 00 00 00 > CAN ERROR < AT WS > ELM327 v1.4a