예제 #1
0
파일: cap.cs 프로젝트: svendahl/cap
		public static byte[] encode(byte[] data)
		{
			var input = new byte[data.Length - 2];
			Array.Copy(data, 2, input, 0, input.Length);
			var loadaddress = (ushort)(data[0] | data[1] << 8);

			var output = new tobinary(input, model.parse(input), loadaddress).output;

			if (!verify(data, output))
			{
				throw new Exception("verify fail");
			}

			return output;
		}
예제 #2
0
        public static byte[] encode(byte[] data)
        {
            var input = new byte[data.Length - 2];

            Array.Copy(data, 2, input, 0, input.Length);
            var loadaddress = (ushort)(data[0] | data[1] << 8);

            var output = new tobinary(input, new path(input).output(), loadaddress).output;

            if (!verify(data, output))
            {
                throw new Exception("verify fail");
            }

            return(output);
        }