There are some PC-based chip testers that can do this; I use one at work often. But the chips need to be working, and must be physically removed from the circuit board and placed into the tester's socket. Even then, it's not always 100% accurate. It'll give you a good ballpark starting place. There are several instances of different TTL chips doing the same job and having the same pinout (such as 7404 and 7414), but the tester won't be able to tell the difference. It also won't be able to differentiate between standard TTL, LS, C, HC, and so on.
This is the tester's so-called "auto-locate" function. It can also test a TTL chip if you enter in the real part number, but even then it's not 100% accurate. I once placed a 7400 chip that had an input shorted to ground, and the tester thought it was good! (All test equipment will lie to you at some time or another.)
But there's a chance that the manufacturer may have printed the chips' part numbers on the underside of the chips. They do that sometimes, and whoever sanded off the numbers from the top may not have done so to the other side.