Some C# for processing bin files and some mod ideas for BC_VUP_V3
Visual Studio, dotPeek
Do XOR op for the bin file and convert it to hex file
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;
namespace FileBin
{
internal class Program
{
static void Main(string[] args)
{
char[] ct = new char[16]
{
'0',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
'A',
'B',
'C',
'D',
'E',
'F'
};
String fileName = @"G:\temp\file.bin";
Console.WriteLine(fileName);
byte[] file = File.ReadAllBytes(fileName);
int fileSize = file.Length;
Console.WriteLine(fileSize.ToString());
byte[] fx = new byte[fileSize];
int i = 0;
int r = 0;
while (i < fileSize)
{
byte n = (byte)((uint)file[i] ^ 85U);
if ((byte)32 <= n && n <= (byte)126)
{
fx[r] = n;
r++;
}
i++;
}
StringBuilder sb = new StringBuilder();
foreach (byte n in fx)
{
if (n != 0)
{
int i1 = (int)n >> 4 & 15;
int i2 = (int)n & 15;
sb.Append(ct[i1]);
sb.Append(ct[i2]);
}
}
File.WriteAllText(@"G:\temp\bintostr.txt", sb.ToString(), Encoding.ASCII);
Console.WriteLine("Ok");
}
}
}
BC_VUP_V3 firmware update process first do some preps by sending many * cmds to the scanner, e.g. *BIN N, *SCB 1 ... after those ops the firmware trasfer process begins. BC_VUP_V3 does logging (usscLog), e.g. it is possible to add more logging e.g. fw data logging etc. After sending one chunk of fw data into scanner it reads it back from the device, e.g. it is possible to add logging of this data etc.
Comments
Post a Comment