mirror of https://github.com/rusefi/UnlockECU.git
Add HU45:7
This commit is contained in:
parent
ce881e43a2
commit
77167943f0
|
@ -0,0 +1,34 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace UnlockECU
|
||||
{
|
||||
/// <summary>
|
||||
/// HU45Algo as found in HU45_hu45_sec_12_05_01, Intended for level 7 (CBF)
|
||||
/// No algo name was formally specified, this name is unofficial
|
||||
/// </summary>
|
||||
class HU45Algo : SecurityProvider
|
||||
{
|
||||
public override bool GenerateKey(byte[] inSeed, byte[] outKey, int accessLevel, List<Parameter> parameters)
|
||||
{
|
||||
if ((inSeed.Length != 2) || (outKey.Length != 2))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
// Levels, input and output length are not checked
|
||||
// Only 2 bytes are checked and modified
|
||||
int partial = ~(inSeed[0] + (inSeed[1] << 8)) - 0x307;
|
||||
outKey[0] = (byte)(partial >> 8);
|
||||
outKey[1] = (byte)(~inSeed[0] - 7);
|
||||
return true;
|
||||
}
|
||||
|
||||
public override string GetProviderName()
|
||||
{
|
||||
return "HU45Algo";
|
||||
}
|
||||
}
|
||||
}
|
|
@ -4204,6 +4204,16 @@
|
|||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"EcuName": "HU45",
|
||||
"Aliases": [],
|
||||
"AccessLevel": 7,
|
||||
"SeedLength": 2,
|
||||
"KeyLength": 2,
|
||||
"Provider": "HU45Algo",
|
||||
"Origin": "HU45_hu45_sec_12_05_01",
|
||||
"Parameters": []
|
||||
},
|
||||
{
|
||||
"EcuName": "HU7",
|
||||
"Aliases": [],
|
||||
|
|
Loading…
Reference in New Issue