Add HU45:7

This commit is contained in:
JinGen Lim 2023-02-04 21:15:41 +08:00
parent ce881e43a2
commit 77167943f0
2 changed files with 44 additions and 0 deletions

View File

@ -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";
}
}
}

View File

@ -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": [],