Add config option for mac address. Fixes issue 5694.
This commit is contained in:
parent
5ce7728b91
commit
f5a3379d71
|
@ -155,6 +155,7 @@ void SConfig::SaveSettings()
|
||||||
|
|
||||||
ini.Set("General", "RecursiveGCMPaths", m_RecursiveISOFolder);
|
ini.Set("General", "RecursiveGCMPaths", m_RecursiveISOFolder);
|
||||||
ini.Set("General", "NANDRoot", m_NANDPath);
|
ini.Set("General", "NANDRoot", m_NANDPath);
|
||||||
|
ini.Set("General", "WirelessMac", m_WirelessMac);
|
||||||
|
|
||||||
// Interface
|
// Interface
|
||||||
ini.Set("Interface", "ConfirmStop", m_LocalCoreStartupParameter.bConfirmStop);
|
ini.Set("Interface", "ConfirmStop", m_LocalCoreStartupParameter.bConfirmStop);
|
||||||
|
@ -282,6 +283,7 @@ void SConfig::LoadSettings()
|
||||||
m_NANDPath = File::GetUserPath(D_WIIROOT_IDX, m_NANDPath);
|
m_NANDPath = File::GetUserPath(D_WIIROOT_IDX, m_NANDPath);
|
||||||
DiscIO::cUIDsys::AccessInstance().UpdateLocation();
|
DiscIO::cUIDsys::AccessInstance().UpdateLocation();
|
||||||
DiscIO::CSharedContent::AccessInstance().UpdateLocation();
|
DiscIO::CSharedContent::AccessInstance().UpdateLocation();
|
||||||
|
ini.Get("General", "WirelessMac", &m_WirelessMac);
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
|
@ -75,6 +75,7 @@ struct SConfig : NonCopyable
|
||||||
bool m_ListKorea;
|
bool m_ListKorea;
|
||||||
bool m_ListTaiwan;
|
bool m_ListTaiwan;
|
||||||
bool m_ListUnknown;
|
bool m_ListUnknown;
|
||||||
|
std::string m_WirelessMac;
|
||||||
|
|
||||||
SysConf* m_SYSCONF;
|
SysConf* m_SYSCONF;
|
||||||
|
|
||||||
|
|
|
@ -46,6 +46,7 @@ it failed)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "WII_IPC_HLE_Device_net.h"
|
#include "WII_IPC_HLE_Device_net.h"
|
||||||
|
#include "../ConfigManager.h"
|
||||||
#include "FileUtil.h"
|
#include "FileUtil.h"
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
@ -276,11 +277,36 @@ bool CWII_IPC_HLE_Device_net_ncd_manage::IOCtlV(u32 _CommandAddress)
|
||||||
// No idea why the fifth and sixth bytes are left untouched.
|
// No idea why the fifth and sixth bytes are left untouched.
|
||||||
{
|
{
|
||||||
// hardcoded address as a fallback
|
// hardcoded address as a fallback
|
||||||
// TODO: Make this configurable? Different MAC addresses MIGHT be needed for requesting a user id or encrypting content with NWC24
|
|
||||||
const u8 default_address[] = { 0x00, 0x19, 0x1e, 0xfd, 0x71, 0x84 };
|
const u8 default_address[] = { 0x00, 0x19, 0x1e, 0xfd, 0x71, 0x84 };
|
||||||
|
|
||||||
INFO_LOG(WII_IPC_NET, "NET_NCD_MANAGE: IOCTLV_NCD_GETWIRELESSMACADDRESS");
|
INFO_LOG(WII_IPC_NET, "NET_NCD_MANAGE: IOCTLV_NCD_GETWIRELESSMACADDRESS");
|
||||||
|
|
||||||
|
if (!SConfig::GetInstance().m_WirelessMac.empty())
|
||||||
|
{
|
||||||
|
int x = 0;
|
||||||
|
int tmpaddress[6];
|
||||||
|
for (int i = 0; i < SConfig::GetInstance().m_WirelessMac.length() && x < 6; i++)
|
||||||
|
{
|
||||||
|
if (SConfig::GetInstance().m_WirelessMac[i] == ':' || SConfig::GetInstance().m_WirelessMac[i] == '-')
|
||||||
|
continue;
|
||||||
|
|
||||||
|
std::stringstream ss;
|
||||||
|
ss << std::hex << SConfig::GetInstance().m_WirelessMac[i];
|
||||||
|
if (SConfig::GetInstance().m_WirelessMac[i+1] != ':' && SConfig::GetInstance().m_WirelessMac[i+1] != '-')
|
||||||
|
{
|
||||||
|
ss << std::hex << SConfig::GetInstance().m_WirelessMac[i+1];
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
ss >> tmpaddress[x];
|
||||||
|
x++;
|
||||||
|
}
|
||||||
|
u8 address[6];
|
||||||
|
for (int i = 0; i < 6;i++)
|
||||||
|
address[i] = tmpaddress[i];
|
||||||
|
Memory::WriteBigEData(address, CommandBuffer.PayloadBuffer.at(1).m_Address, 4);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
#if defined(__linux__)
|
#if defined(__linux__)
|
||||||
const char *check_devices[3] = { "wlan0", "ath0", "eth0" };
|
const char *check_devices[3] = { "wlan0", "ath0", "eth0" };
|
||||||
int fd, ret;
|
int fd, ret;
|
||||||
|
@ -324,7 +350,6 @@ bool CWII_IPC_HLE_Device_net_ncd_manage::IOCtlV(u32 _CommandAddress)
|
||||||
|
|
||||||
if (SUCCEEDED(ret)) Memory::WriteBigEData(adapter_info->Address, CommandBuffer.PayloadBuffer.at(1).m_Address, 4);
|
if (SUCCEEDED(ret)) Memory::WriteBigEData(adapter_info->Address, CommandBuffer.PayloadBuffer.at(1).m_Address, 4);
|
||||||
else Memory::WriteBigEData(default_address, CommandBuffer.PayloadBuffer.at(1).m_Address, 4);
|
else Memory::WriteBigEData(default_address, CommandBuffer.PayloadBuffer.at(1).m_Address, 4);
|
||||||
|
|
||||||
delete[] adapter_info;
|
delete[] adapter_info;
|
||||||
#else
|
#else
|
||||||
Memory::WriteBigEData(default_address, CommandBuffer.PayloadBuffer.at(1).m_Address, 4);
|
Memory::WriteBigEData(default_address, CommandBuffer.PayloadBuffer.at(1).m_Address, 4);
|
||||||
|
|
Loading…
Reference in New Issue