I use GetPeerName and inet_ntoa, but the result is always incorrent. Anybody can give some code on that?
.data
SocketAddr sockaddr_in <>
SocketAddrSize dd 0 ;; This is the size of the above structure returned by accept()
.code
invoke accept, ListeningSocket, addr SocketAddr, addr SocketAddrSize
invoke inet_ntoa, dword ptr SocketAddr.sin_addr
invoke MessageBox, NULL, eax, NULL, NULL
The MessageBox should show you the dot notation of your client! I don't use GetPeerName because I like to store SocketAddr.sin_addr somewhere!
Otherwise show me the code you use and I'll take a look.
SocketAddr sockaddr_in <>
SocketAddrSize dd 0 ;; This is the size of the above structure returned by accept()
.code
invoke accept, ListeningSocket, addr SocketAddr, addr SocketAddrSize
invoke inet_ntoa, dword ptr SocketAddr.sin_addr
invoke MessageBox, NULL, eax, NULL, NULL
The MessageBox should show you the dot notation of your client! I don't use GetPeerName because I like to store SocketAddr.sin_addr somewhere!
Otherwise show me the code you use and I'll take a look.