>netstat -a -b
I think it was... but the software concerned has to be running.
Just do a netstat /? to get the scoop.
But to scan your computer for what programs are installed/present and what ports they might use is a mammoth undertaking. I don't think I ever heard of anybody attempting such a thing.
Just think of scanning netcat on disk and trying to figure out what port it is using? You can't tell. It can use them all.
Actually netcat can get part of the job you want done.
Those are the network diagnostic tools I reccomend. netstat, netcat and wireshark.
You can look at your firewall rules, but to divine what port(s) a program uses without running it or looking at the source or documentation would be quite a trick.
There is also dxport which you can use to force directx to use an explicitly assigned 2 out of the broad 100 port range it wants.
Also, check the UPnP settings on your router. This sounds kind of like a UPnP issue. I can't imagine who thought UPnP was a good idea.
edit: Um, you use four different IM services and expect to be able to play games?
Do you use Trillian or Pidgin? I certainly hope you have not installed four separate IM programs from MSN, Yahoo, ICQ, AOL and Yahoo? (holy f). If you have then best of luck cleaning up that mess.
edit: I'm pretty sure symantec still considers netcat a virus. So heads up on that. It is not. It can be used by someone who has assumed control of your PC but they have to assume control of your PC first see. When it comes to Symantec the solution is much worse than the problem.
Some links for you:
http://netcat.sourceforge.net/http://en.wikipedia.org/wiki/Netcathttp://nc110.sourceforge.net/http://joncraton.org/blog/netcat-for-windows(first three for history and info, you want the fourth one - netcat is great for port scanning)
Re IMs:
http://www.trillian.im/http://www.pidgin.im/I have used neither, but surely one is better than four. (hopefully yoou're already using a universal IM client...) I'd look at IM as the first suspect application for the gaming interference.