Archive | May, 2012

Analysing data files by drawing pictures

31 May

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.

Wallpaper design for the new house?

31 May

The product of my messing around with a graphics program.

Mechanics just don’t try as hard anymore

30 May

From “Popular Science” magazine, 1930.

 

 

And, the same magazine, 1940.

 

Salvador Dali, taking his pet anteater for a walk

29 May

Not your everyday sort of pet.

(Not sure where I swiped this image from, there’s many copies of it out on the aetherweb.)

 

A wonderful use for all those dismantled computer parts

29 May

One of Brenda Guyton‘s clever pieces.

 

The benefits of a classical education

28 May

 

Again, from an old Playboy magazine, I suspect.

Some (older) proverbs

27 May

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.

ENGLISH:

  1. Married in haste, we repent at leisure.
  2. Answer a fool according to his folly.
  3. One swallow does not make a summer.
  4. Out of the frying-pan into the fire.
  5. Robbing Peter to pay Paul.
  6. Birds of a feather flock together.
  7. First catch your hare.
  8. Sour grapes.
  9. Adding insult to injury.
  10. Curses come home to roost.
  11. Distance lends enchantment.
  12. Milk for babes.
  13. We can all endure the misfortunes of others.

AFRICAN:

  1. One tree does not make a forest.
  2. I nearly killed the bird. No one can eat nearly in a stew.
  3. Full-belly child says to hungry-belly child, “keep good cheer.”
  4. Distant firewood is good firewood.
  5. Ashes fly in the face of him who throws them.
  6. 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.
  7. Cocoanut is not good for birds to eat.
  8. He runs away from the sword and hides himself in the scabbard.
  9. A fool of Ika and an idiot from Iluka meet together to make friends.
  10. 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.”
  11. Quick loving a woman means quick not loving a woman.
  12. If the stomach is not strong, do not eat cockroaches.
  13. 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.