Is it realistic to deal with a huge undocumented code base for master's project?
I would be very wary of taking on this thesis topic.  There's a huge amount of programming effort here, but you're not trying to get an MS in software engineering, so this will necessarily be a project in which you spend most of your time doing work that is actually outside of your discipline.  Furthermore, there's a risk that either you'll never be able to understand various aspects of the code or that you'll misunderstand things and then make changes that break the code.