MED 17 , EDC 17 EEPROM CHECKSUM
kuebk:
Figured out myself what I was doing wrong, nevermind.
carservice:
HI
crypted CS, PIN, MAC algorithm ,You succeeded in the calculation?I did a lot of research, but it didn't work out.
carservice:
Quote from: H2Deetoo on July 10, 2018, 07:19:23 AM
You can deduct the XOR with known values.
It is calculated from unique ID from EDC17 from OTP area, so the XOR result is unique for each EDC.
I found the immo data in EEPROM and the encrypted bytes in the OTP area, but failed to compute.
sandor1987:
somebody found out how to calculate cs pin mac etc?
Matrosek:
Quote from: Ionut on September 21, 2017, 02:01:17 PM
Hi all, i`ve tried every possible combination and nothing seems to work....
For example this block
Code:
08 00 EB 04 94 53 00 00 FF B8 71 E0 EA 30 D0 E4 B1 8E 05 E4 35 AF 3E F2 8E 6A 09 9C A7 EF 80 E7 FC AE AE 56 AA 80 01 00 57 41 55 5A 5A 5A 38 54 37 42 41 30 39 37 36 36 31 48 EF E0 24 BA 6C 05 30 02 B6 6C 7D 43 97 A4 F9 B1 EF BF F7 74 FB 67 52 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 C1 4E 00 00 56 8D F6 1C
Tried with CRC32 with poly 0xEDB88320, initial value 0xC14E0000, bytes from 8 to 7F (119 bytes) and result is D7A854D and it should be 56 8D F6 1C.
With initial value just first 2 bytes (0xC14E), result is F219CCDD, with fist 2 bytes reversed, result is AA79A104 and with initial value 0x4EC10000 (each 2 bytes reversed) result is 418F9500
Here is the C# code used for CRC32:
Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace FwpCrc
{
class CRC32
{
uint[] table;
public uint ComputeChecksum(byte[] bytes, uint initialValue) {
uint crc = initialValue;
// uint crc = 0xffffffff;
for(int i = 0; i < bytes.Length; ++i) {
byte index = (byte)(((crc) & 0xff) ^ bytes[i]);
crc = (uint)((crc >> 8) ^ table[index]);
}
return ~crc;
}
public CRC32() {
uint poly = 0xEDB88320;
table = new uint[256];
uint temp = 0;
for(uint i = 0; i < table.Length; ++i) {
temp = i;
for(int j = 8; j > 0; --j) {
if((temp & 1) == 1) {
temp = (uint)((temp >> 1) ^ poly);
}else {
temp >>= 1;
}
}
table[i] = temp;
}
}
}
}
I`m doing something wrong?
Hi all, I used code from post #39 and CRC from post #38, but I get wrong CRCsum. What I'm doing wrong?
My code:
Code:
using System;
using System.IO;
using System.Text;
namespace TricoreCRC32Calculator
{
public class Program
{
public static void Main(string[] args)
{
while (true)
{
Console.WriteLine("\nCRC-Calculator...");
Console.Write("File name: ");
TricoreCRC32 CRC = new TricoreCRC32(Console.ReadLine());
Console.WriteLine(CRC);
uint initValue = 0x00000036;
uint result = CRC.ComputeChecksum(initValue);
Console.WriteLine("{0:X}", result);
Console.Write("Continue or exit: ");
if (Console.ReadLine() == "exit") break;
}
}
}
public class TricoreCRC32
{
private byte[] block = new byte[124];
private uint[] table = new uint[256];
private async void ReadBlock(string nameFile)
{
try
{
await new FileStream(nameFile, FileMode.Open).ReadAsync(block, 0, block.Length);
}
catch (FileNotFoundException)
{
Console.WriteLine("Not found file!");
}
catch (IOException)
{
Console.WriteLine("Another error!");
}
}
public TricoreCRC32(string nameFile)
{
ReadBlock(nameFile);
}
public override string ToString()
{
StringBuilder block = new StringBuilder();
for (int i = 0; i < 124; i++)
{
block.AppendFormat("{0:X}", this.block[i]);
block.Append(' ');
}
return "Block: " + block;
}
public uint ComputeChecksum(uint initialValue)
{
CreateTable();
uint crc = initialValue;
// uint crc = 0xffffffff;
for (int i = 0; i < block.Length; ++i)
{
byte index = (byte)(((crc) & 0xff) ^ block[i]);
crc = (uint)((crc >> 8) ^ table[index]);
}
return ~crc;
}
public uint[] CreateTable()
{
table = new uint[256];
uint poly = 0xEDB88320;
uint temp;
for (uint i = 0; i < table.Length; ++i)
{
temp = i;
for (int j = 8; j > 0; --j)
{
if ((temp & 1) == 1)
{
temp = (uint)((temp >> 1) ^ poly);
}
else
{
temp >>= 1;
}
}
table[i] = temp;
}
return table;
}
}
}
Right CRC is F2 78, but I get 42 0D 0B 00. Block file in attachments.
Navigation
[0] Message Index
[#] Next page
[*] Previous page