Reverse Engineering Knitting Machine Data
This page will attempt to describe methods of figuring out the internal data representation of data saved from knitting machines.
Additional information about Brother knitting machines can be found here
So far, all analysis of data formats has been done on the Brother model KH-930e machine. It's known that the Model KH-940 uses a different format, but it hasn't been figured out yet.
All software tools mentioned here are available in this git repository.
You are encouraged to fork this repository and contribute to the tools and to the information about the data formats.
PDDemulate External Disk Drive emulator
This python script (PDDemulate.py) emulates the Brother FB100 external disk drive. The knitting machine connection for the external drive is standard asynchronous serial data, but at non-standard (non-RS-232) voltages. In order to use it, you will need to build a serial adapter, as documented on this page. This emulator saves disk sectors to files on the host file system, for examination and modification.
The only way to get data in and out of these knitting machines is to save the knitting machine data to the emulator, examine and/or modify the emulator data files, then load these back into the knitting machine using the emulator.
Utilities for comparing different saved files
When comparing files, it's important to compare the data that represents one saved state of the knitting machine. For the KH-930 model, a single save writes two sectors of disk data. The PDDemulator script assumes this data structure, and automatically combines two saved sectors into one data file that is the actual saved data from the knitting machine. There is evidence that on the KH-940 model machine, a single save results in writing data to all disk sectors, implying that the saved data format is quite different. When attempting to reverse-engineer the data format, it's important to compare the entire set of data saved from the machine, by combining all the saved sectors into one larger data file.
There are a number of scripts in the file-analysis directory of the repository. Most were written for the KH-930 and will need changes to be used with other models of knitting machine. The following are of general use:
compare.py - compares two files and displays the differences between them side by side. filecombine.py - combines multiple sectors into a data file, probably needs to be copied and modified for different models makecsv.py - creates a csv file that can be imported into a spreadsheet for keeping notes, probably needs file length changed for different models
How to reverse engineer the data files
1. You must determine how many sectors are saved each time you save one "file" from the knitting machine. To do this, save files and see which sectors are written by the emulator. 2. You must combine the modified sectors into one file for comparison between different 'saves' from the knitting machine.
The reverse engineering process: