For the platform version, it's a bit easier these days in that you can query where property = 'db.version' for the platform (3.4.1 in your case) rather than cross referencing the build number.
For the application version, you can run the following:
select TRIAUTHORTX, TRIINSTALLDT, TRIVERSIONTX, TRIINSTALLATIONTYPELI from T_TRIAPPLICATIONVERSION1
It will show the initial installed application version and any upgrades to date. However, this will assume that you run all the patch helper DI files with each application upgrade to keep this application installation version up to date. This is a relatively new feature introduced in one of the later version 9 apps. So if you have an older initial install and app upgrades prior to version 10, those may not be listed and there was no easy way to tell the application version back then.
Thanks.