Since we can only guess anyway, I will add another possibility.
Everything, or at least some things, after the tower of Babel could have already been recorded. Also, these recordings could have included pre-flood information.
Today writers often create a work of their own which is based on the work of many others, including those who came before them. I have seen no reason to believe that the writing of Genesis as we have it could have not been the same.
Moses could even have had the post-tower information as it was written by eye-witnesses. Perhaps Abraham wrote about the travels of his father and himself. Abraham and his descendents had lots of people with them; perhaps any one of them recorded the events.
Since languages were confused after the tower of Babel, it seems unlikely that anyone could read any writings that were left from pre-tower times. However, such writings very well could have also existed, and the linguistically-confused people after that event could have retained much of the knowledge and re-written it.
As for pre-flood information, it is possible that Noah could have preserved some writings which could have been included in the pre-tower collections, but because our knowledge of the events from Adam to Lamech is so limited, that could just as easily have been passed down orally as has already been mentioned by Affable Geek.
Another thing worth noting is that, if you take the bible literally, including creation and flood, the farther back you go in history the less degraded the human genome would be and the better off people would have been physically, and even if not physically superior they at least lived longer and therefore had an easier time accumulating knowledge and information. This could have made it easy to keep things recorded mentally and passed on orally.
This answer has been a bit of a speculation, but I don't think the question can be answered otherwise, as can be seen by the other two answers. Unfortunately, we can only guess.