if your program should work in the same way packet sniffers works, then you would need to use winsock api sockets, there are some articles about that, i remember i ran over some long time ago, try to google!