Not many people have to analyse completely undocumented data files to see what they are – but, every now and then, I do.
One surprisingly useful technique is to map the possible values of a byte (0 to 255) to unique colours, then display the file as a picture, one pixel per byte.
Here’s an old data file:
But, that’s just drawing the pixels out at a random width (250 pixels wide, in this case).
Starting a new line after every 269 pixels, you get this:
Note the diagonal lines. Since the lines are at 45 degrees, and slanting top-left to bottom right, you can tell that the display width needs to be 1 more pixel wide.
Drawing the file out with 270 pixel rows, one gets:
Nice vertical lines show that one has found the record size, the first step on decoding the data.
Other types of file don’t display so nicely. Here’s a couple of graphics files (a .gif and a .png)
No obvious patterning, but there’s still information to gain. In particular, it’s clear that both files have a header section which has much more structure than the image data that follows it. The fact that a file contains two or more different types of data can be very useful – sometimes you would have to step through hundreds of pages with a hex editor to spot it.
The product of my messing around with a graphics program.
From “Popular Science” magazine, 1930.
And, the same magazine, 1940.
Not your everyday sort of pet.
(Not sure where I swiped this image from, there’s many copies of it out on the aetherweb.)
Again, from an old Playboy magazine, I suspect.
This was two lists of proverbs, one English and the other African, published as a competition (to match them up) in Popular Science magazine in 1926.
- Married in haste, we repent at leisure.
- Answer a fool according to his folly.
- One swallow does not make a summer.
- Out of the frying-pan into the fire.
- Robbing Peter to pay Paul.
- Birds of a feather flock together.
- First catch your hare.
- Sour grapes.
- Adding insult to injury.
- Curses come home to roost.
- Distance lends enchantment.
- Milk for babes.
- We can all endure the misfortunes of others.
- One tree does not make a forest.
- I nearly killed the bird. No one can eat nearly in a stew.
- Full-belly child says to hungry-belly child, “keep good cheer.”
- Distant firewood is good firewood.
- Ashes fly in the face of him who throws them.
- If the boy says he wants to tie the water with a string, ask him if he means the water in the pot or the water in the lagoon.
- Cocoanut is not good for birds to eat.
- He runs away from the sword and hides himself in the scabbard.
- A fool of Ika and an idiot from Iluka meet together to make friends.
- The ground-pig said: “I do not feel so angry with the man who killed me as with the man who dashed me on the ground after.”
- Quick loving a woman means quick not loving a woman.
- If the stomach is not strong, do not eat cockroaches.
- No one should draw water from the spring to supply the river.
Interesting both in the comparison between cultures, and in way some of the once-common English proverbs have faded away.