mirror of
https://github.com/spice2x/spice2x.github.io.git
synced 2026-10-07 18:38:57 -07:00
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:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user