Getting the version number of an arbitrary address

Answered this question on reddit, thought you guys might like.