How are you setting up the socket in the game application? Can you post an example of your socket setup code?
Are you using the wildcard address and port when creating the socket? I'm guessing that if your game application doesn't bind to a specific IP address and port explicitly that may be the source of your problem.
Another question: are you trying to detect the local IP address, remote IP address or both?
If you're trying to detect the remote IP address this may be impossible unless the game application is using what's known as connected UDP sockets. This is where the client application calls connect on the UDP socket to create an association between the local and remote sockets in the underlying OS. This has certain advantages and drawbacks as listed in the above link.
Edit
Take a look at this SO post: PID from socket number on Windows?
This pretty much confirms what I thought - unless the game is using connected UDP sockets then the only way you'll be able to get the remote address is via packet sniffing.
Start up the game and run netstat -ap UDP
- if you see that there aren't any remote addresses listed then that would confirm the above suspicion.