Well, now that Major did the heavy lifting, I'm seeing a bottom bracket maintenance tool for an english or french bicycle. It has a spanner to remove the bottom bracket bearing retainer rings, a crank retainer bolt 'socket' (the square hole), a tapered fork for forcing the cranks off the crankshaft, a serrated fitting for holding the main shaft (which is splined) or chasing the splines to clean them, and a pedal bolt wrench at the top end. Sometimes splined crankshafts would have opposing flats inboard of the cranks, which might explain the wrench-like fitting at the bottom of the 'fork'. This tool would have to be supplemented with a hammer, so it is unlikely it was intended for carrying on the bike.
(addendum: Only the least expensive bicycles use this kind of construction today. But, this type of crank used to be practically universal.)