Closed lndmnn closed 3 years ago
ConsoleUnlockECU.exe -s=1C5A3B4G -n=MED1775 -l=5 Unhandled exception. System.NullReferenceException: Object reference not set to an instance of an object. at UnlockECU.Definition.FindDefinition(List`1 definitions, String ecuName, Int32 accessLevel) at ConsoleUnlockECU.Program.Main(String[] args)
Hi ecumasterac,
Thanks for looking into UnlockECU.
Firstly, I forgot to push the latest UnlockECU that is used in Caesar, which includes the console application. In that newer version, there is a schema change to include the Alias
field to allow one definition to match multiple, different ECUs. I have updated the repository with the correct version now. Sorry for all that inconvenience!
I have reviewed your definition, and added the Alias schema changes (see bottom of the this post). The part to note is the addition of "Aliases": [],
The definition itself has an issue with MED1775, parameter X61. Since DL
is not a valid hex number, the key generation will fail.
{
"Key": "X61",
"Value": "DL",
"DataType": "Byte"
},
When the client is called with ConsoleUnlockECU.exe -s=1C5A3B4G -n=MED1775 -l=5
, the parameter format is not recognized. The recognized format would be ConsoleUnlockECU.exe -n MED1775 -l 5 -s 11223344
1C5A3B4G
is not a valid hex number and the generation process will fail.
To summarize:
"Aliases": [],
{
"EcuName": "MED1775",
"Aliases": [],
"AccessLevel": 5,
"SeedLength": 4,
"KeyLength": 4,
"Provider": "PowertrainSecurityAlgo",
"Origin": "MED1775_12_42_01_20174206104207",
"Parameters": [
{
"Key": "i1",
"Value": "2",
"DataType": "Int32"
},
{
"Key": "i2",
"Value": "3",
"DataType": "Int32"
},
{
"Key": "i3",
"Value": "1",
"DataType": "Int32"
},
{
"Key": "i4",
"Value": "0",
"DataType": "Int32"
},
{
"Key": "i5",
"Value": "0",
"DataType": "Int32"
},
{
"Key": "i6",
"Value": "1",
"DataType": "Int32"
},
{
"Key": "j1",
"Value": "7",
"DataType": "Int32"
},
{
"Key": "j2",
"Value": "0",
"DataType": "Int32"
},
{
"Key": "j3",
"Value": "1",
"DataType": "Int32"
},
{
"Key": "j4",
"Value": "4",
"DataType": "Int32"
},
{
"Key": "j5",
"Value": "2",
"DataType": "Int32"
},
{
"Key": "j6",
"Value": "3",
"DataType": "Int32"
},
{
"Key": "X00",
"Value": "23",
"DataType": "Byte"
},
{
"Key": "X01",
"Value": "56",
"DataType": "Byte"
},
{
"Key": "X02",
"Value": "A3",
"DataType": "Byte"
},
{
"Key": "X03",
"Value": "43",
"DataType": "Byte"
},
{
"Key": "X10",
"Value": "C3",
"DataType": "Byte"
},
{
"Key": "X11",
"Value": "D5",
"DataType": "Byte"
},
{
"Key": "X12",
"Value": "21",
"DataType": "Byte"
},
{
"Key": "X13",
"Value": "1",
"DataType": "Byte"
},
{
"Key": "X20",
"Value": "A6",
"DataType": "Byte"
},
{
"Key": "X21",
"Value": "71",
"DataType": "Byte"
},
{
"Key": "X22",
"Value": "77",
"DataType": "Byte"
},
{
"Key": "X23",
"Value": "92",
"DataType": "Byte"
},
{
"Key": "X30",
"Value": "A",
"DataType": "Byte"
},
{
"Key": "X31",
"Value": "B6",
"DataType": "Byte"
},
{
"Key": "X32",
"Value": "5F",
"DataType": "Byte"
},
{
"Key": "X33",
"Value": "F2",
"DataType": "Byte"
},
{
"Key": "X40",
"Value": "56",
"DataType": "Byte"
},
{
"Key": "X41",
"Value": "29",
"DataType": "Byte"
},
{
"Key": "X42",
"Value": "38",
"DataType": "Byte"
},
{
"Key": "X43",
"Value": "47",
"DataType": "Byte"
},
{
"Key": "X50",
"Value": "DA",
"DataType": "Byte"
},
{
"Key": "X51",
"Value": "5B",
"DataType": "Byte"
},
{
"Key": "X52",
"Value": "39",
"DataType": "Byte"
},
{
"Key": "X53",
"Value": "84",
"DataType": "Byte"
},
{
"Key": "X60",
"Value": "C0",
"DataType": "Byte"
},
{
"Key": "X61",
"Value": "00",
"DataType": "Byte"
},
{
"Key": "X62",
"Value": "25",
"DataType": "Byte"
},
{
"Key": "X63",
"Value": "68",
"DataType": "Byte"
},
{
"Key": "X70",
"Value": "E4",
"DataType": "Byte"
},
{
"Key": "X71",
"Value": "22",
"DataType": "Byte"
},
{
"Key": "X72",
"Value": "A3",
"DataType": "Byte"
},
{
"Key": "X73",
"Value": "F1",
"DataType": "Byte"
}
]
},
{
"EcuName": "VGS4NAG2",
"Aliases": [],
"AccessLevel": 9,
"SeedLength": 8,
"KeyLength": 4,
"Provider": "DaimlerStandardSecurityAlgo",
"Origin": "VGS4NAG2_vgs4nag2_sec_12_06_01",
"Parameters": [
{
"Key": "K",
"Value": "26791543",
"DataType": "ByteArray"
}
]
},
{
"EcuName": "VGS4NAG2",
"Aliases": [],
"AccessLevel": 5,
"SeedLength": 8,
"KeyLength": 4,
"Provider": "DaimlerStandardSecurityAlgo",
"Origin": "VGS4NAG2_vgs4nag2_1_12_06_01",
"Parameters": [
{
"Key": "K",
"Value": "335800",
"DataType": "ByteArray"
}
]
},
{
"EcuName": "VGS4NAG2",
"Aliases": [],
"AccessLevel": 11,
"SeedLength": 4,
"KeyLength": 4,
"Provider": "PowertrainSecurityAlgo",
"Origin": "VGS4NAG2_vgs4nag2_sec_12_06_01",
"Parameters": [
{
"Key": "i1",
"Value": "2",
"DataType": "Int32"
},
{
"Key": "i2",
"Value": "2",
"DataType": "Int32"
},
{
"Key": "i3",
"Value": "1",
"DataType": "Int32"
},
{
"Key": "i4",
"Value": "0",
"DataType": "Int32"
},
{
"Key": "i5",
"Value": "3",
"DataType": "Int32"
},
{
"Key": "i6",
"Value": "3",
"DataType": "Int32"
},
{
"Key": "j1",
"Value": "2",
"DataType": "Int32"
},
{
"Key": "j2",
"Value": "7",
"DataType": "Int32"
},
{
"Key": "j3",
"Value": "4",
"DataType": "Int32"
},
{
"Key": "j4",
"Value": "1",
"DataType": "Int32"
},
{
"Key": "j5",
"Value": "0",
"DataType": "Int32"
},
{
"Key": "j6",
"Value": "6",
"DataType": "Int32"
},
{
"Key": "X00",
"Value": "AB",
"DataType": "Byte"
},
{
"Key": "X01",
"Value": "3",
"DataType": "Byte"
},
{
"Key": "X02",
"Value": "5C",
"DataType": "Byte"
},
{
"Key": "X03",
"Value": "79",
"DataType": "Byte"
},
{
"Key": "X10",
"Value": "31",
"DataType": "Byte"
},
{
"Key": "X11",
"Value": "35",
"DataType": "Byte"
},
{
"Key": "X12",
"Value": "D3",
"DataType": "Byte"
},
{
"Key": "X13",
"Value": "2B",
"DataType": "Byte"
},
{
"Key": "X20",
"Value": "44",
"DataType": "Byte"
},
{
"Key": "X21",
"Value": "15",
"DataType": "Byte"
},
{
"Key": "X22",
"Value": "BD",
"DataType": "Byte"
},
{
"Key": "X23",
"Value": "F5",
"DataType": "Byte"
},
{
"Key": "X30",
"Value": "26",
"DataType": "Byte"
},
{
"Key": "X31",
"Value": "64",
"DataType": "Byte"
},
{
"Key": "X32",
"Value": "48",
"DataType": "Byte"
},
{
"Key": "X33",
"Value": "52",
"DataType": "Byte"
},
{
"Key": "X40",
"Value": "62",
"DataType": "Byte"
},
{
"Key": "X41",
"Value": "8D",
"DataType": "Byte"
},
{
"Key": "X42",
"Value": "E3",
"DataType": "Byte"
},
{
"Key": "X43",
"Value": "20",
"DataType": "Byte"
},
{
"Key": "X50",
"Value": "10",
"DataType": "Byte"
},
{
"Key": "X51",
"Value": "1F",
"DataType": "Byte"
},
{
"Key": "X52",
"Value": "5C",
"DataType": "Byte"
},
{
"Key": "X53",
"Value": "29",
"DataType": "Byte"
},
{
"Key": "X60",
"Value": "33",
"DataType": "Byte"
},
{
"Key": "X61",
"Value": "BE",
"DataType": "Byte"
},
{
"Key": "X62",
"Value": "E6",
"DataType": "Byte"
},
{
"Key": "X63",
"Value": "9F",
"DataType": "Byte"
},
{
"Key": "X70",
"Value": "F7",
"DataType": "Byte"
},
{
"Key": "X71",
"Value": "24",
"DataType": "Byte"
},
{
"Key": "X72",
"Value": "4",
"DataType": "Byte"
},
{
"Key": "X73",
"Value": "XE",
"DataType": "Byte"
}
]
}
Thanks for your great help! I've added some ECU's to the file and tested them successfully. Maybe you can include them into the branch. db.zip
Did you change anything to the ConsoleUnlockECU.exe? I executed this with WINE before without any issue, now it says that there is no NETCore.App installed.
Got it, thanks! I'll have to look into the definition updates tomorrow onwards since it's late here and I'm not with my computer right now.
In 1.1, the executable is a lean .NET 5 binary, whereas in the binary with Caesar, the .NET 5 runtime is included which makes the binary much bigger.
.NET 5 is natively supported on Linux, so it should be possible to run it directly without a translation layer like Wine. If that doesn't work as expected, you can temporarily reuse the "older" version that is included with Caesar.
Thanks for your reply. Worked with the older one now. I tested every new definition and got great success.
I have added your changes to db.json
in the repo ( https://github.com/jglim/UnlockECU/commit/3f0199b7bc64ca47656dd912ff0f3d002477dc16 ), and will include the updated database when I publish a next release. Thank you for your time and effort!
Hey there,
i added MED1775 and VGS4NAG2, but there is always an input error while using the PowertrainSecurityAlgorithm.
Do you have any idea? db.zip