public static byte[] KeyToByteArray(LoadKey keyin) { byte[] b = new byte[44]; b[0] = keyin.Sector; b[1] = keyin.Block; b[2] = keyin.keyab; for (int i = 0; i < 40; i++) { b[i + 3] = keyin.Data[i]; } b[43] = keyin.RequestAll; return(b); }
public static LoadKey ByteArrayToKey(byte[] byteIn) { LoadKey newKey = new LoadKey(); newKey.Sector = byteIn[0]; newKey.Block = byteIn[1]; newKey.keyab = byteIn[2]; for (int i = 0; i < 40; i++) { newKey.Data[i] = byteIn[i + 3]; } newKey.RequestAll = byteIn[43]; return(newKey); }