ravahn / machina

Network capture library for realtime TCP/IP decoding from a windows application. Includes an extension library to support FFXIV data capture.
GNU General Public License v3.0
212 stars 78 forks source link

add support for running under wine #5

Closed Toyoyo closed 5 years ago

Toyoyo commented 5 years ago

I've been spending the last few days trying to get a well known FFXIV parser to work under wine.

Here's the catch: Under winsock, to listen on raw sockets, one have to open them as socket(AF_INET, SOCK_RAW, IPPROTO_IP), then call WSPIoctl with SIO_RCVALL.

The problem is: that can't be done in Linux, where you have to specify IPPROTO_TCP/UDP/ICMP.

This can't really be (easily) solved in wine, because there's no way to know what protocol will be used at the time you map the socket() call.

Fortunately, at least for FFXIV, we know it's using a TCP stream, so we can just use that.

Also, SIO_RCVALL isn't supported in wine, and is not needed in the corresponding Linux code to capture packets on the socket.

This commit makes "Network" capture mode work under ACT/FFXIV_ACT_Plugin.

Toyoyo commented 5 years ago

Added an updated one, keeping this one open would make no sense