network: NIC spoof (#911)

## Link to GitHub Issue or related Pull Request, if one exists
#0

## Description of change
Spoof a valid NIC, so games can use a local server completely offline.
Previously this was impossible on macOS wine, or it required km-test
loopback adapter on Windows.

## Testing
Tested DDR (32bit/64bit) and SDVX on Windows 10 and macOS Tahoe.
Enabling -nicspoof and -icmphook connects to airgapped 127.0.0.1.
This commit is contained in:
drmext
2026-09-10 20:00:07 +00:00
committed by GitHub
parent f11b9d0189
commit 531e7a54b3
6 changed files with 570 additions and 0 deletions
+10
View File
@@ -84,6 +84,7 @@
#include "hooks/lang.h"
#include "hooks/networkhook.h"
#include "hooks/icmphook_net.h"
#include "hooks/nicspoof.h"
#include "hooks/unisintrhook.h"
#include "launcher/launcher.h"
#include "launcher/logger.h"
@@ -257,6 +258,7 @@ int main_implementation(int argc, char *argv[]) {
bool load_stubs = false;
bool netfix_disable = false;
bool icmphook_enable = false;
bool nicspoof_enable = false;
bool lang_disable = false;
std::string process_priority_str = "high";
bool cardio_enabled = false;
@@ -799,6 +801,9 @@ int main_implementation(int argc, char *argv[]) {
if (options[launcher::Options::EnableICMPHook].value_bool()) {
icmphook_enable = true;
}
if (options[launcher::Options::EnableNICSpoof].value_bool()) {
nicspoof_enable = true;
}
if (options[launcher::Options::DisableACPHook].value_bool()) {
lang_disable = true;
}
@@ -2558,6 +2563,11 @@ int main_implementation(int argc, char *argv[]) {
icmphook_net_init();
}
// NIC spoof (opt-in; fake Ethernet with no real NIC)
if (nicspoof_enable) {
nicspoof_init();
}
// net fix
if (!netfix_disable) {
networkhook_init();