Many episodes, u have seen Tobi asking Zetsu "Have u record down the battle?"
From here, u can see Tobi rely on Zetsu to see any recent events, or perhaps even from 1st Hokage era onward.
Thats how he managed to get so many data and can pretend to be Madara.
Or should i say, Tobi is the...