I'm glad that you like the patch.
About the source code: modified game files can be viewed by Notepad to see all the changes. The Launcher source code won't be released, because it could be stolen by people with bad intentions.
I'm glad that you like the patch.
Seems like they have some serious problem with this type of attacks in Russia, so maybe virus definitions are very "careful".Top 10 countries with most attacked users (% of total attacks)
Country % of users attacked worldwide*
1 Russian Federation 62.74
2 Kazakhstan 2.70
3 Austria 2.46
4 Uzbekistan 2.46
5 India 2.42
6 Germany 2.38
7 Ukraine 2.25
8 USA 2.05
9 Japan 1.64
10 South Africa 1.52
Code: Select all
void WindowsFirewallAddEE2Ports() {
HRESULT hrComInit = S_OK;
HRESULT hr = S_OK;
INetFwPolicy2 *pNetFwPolicy2 = NULL;
INetFwRules *pFwRules = NULL;
INetFwRule *pFwRule = NULL;
long CurrentProfilesBitMask = 0;
BSTR bstrRuleName = SysAllocString(L"Empire Earth II ver. 1.5 ports: 26000, 6500, 13139");
BSTR bstrRuleDescription = SysAllocString(L"Allow incoming network traffic over ports 26000, 6500, 13139 for Empire Earth II ver. 1.5 Multiplayer");
BSTR bstrRuleGroup = SysAllocString(L"Empire Earth II");
BSTR bstrRuleLPorts = SysAllocString(L"26000,6500,13139");
BSTR bstrRuleInterfaceType = SysAllocString(L"All");
hrComInit = CoInitializeEx(
0,
COINIT_APARTMENTTHREADED
);
if (hrComInit != RPC_E_CHANGED_MODE)
{
if (FAILED(hrComInit))
{
printf("CoInitializeEx failed: 0x%08lx\n", hrComInit);
goto Cleanup;
}
}
hr = WFCOMInitialize(&pNetFwPolicy2);
if (FAILED(hr))
{
goto Cleanup;
}
hr = pNetFwPolicy2->get_Rules(&pFwRules);
if (FAILED(hr))
{
printf("get_Rules failed: 0x%08lx\n", hr);
goto Cleanup;
}
hr = pNetFwPolicy2->get_CurrentProfileTypes(&CurrentProfilesBitMask);
if (FAILED(hr))
{
printf("get_CurrentProfileTypes failed: 0x%08lx\n", hr);
goto Cleanup;
}
if ((CurrentProfilesBitMask & NET_FW_PROFILE2_PUBLIC) &&
(CurrentProfilesBitMask != NET_FW_PROFILE2_PUBLIC))
{
CurrentProfilesBitMask ^= NET_FW_PROFILE2_PUBLIC;
}
hr = CoCreateInstance(
__uuidof(NetFwRule),
NULL,
CLSCTX_INPROC_SERVER,
__uuidof(INetFwRule),
(void**)&pFwRule);
if (FAILED(hr))
{
printf("CoCreateInstance for Firewall Rule failed: 0x%08lx\n", hr);
goto Cleanup;
}
// Populate the Firewall Rule object
//prevent duplicates:
pFwRules->Remove(bstrRuleName);
pFwRule->put_Name(bstrRuleName);
pFwRule->put_Description(bstrRuleDescription);
pFwRule->put_Protocol(NET_FW_IP_PROTOCOL_UDP);
pFwRule->put_LocalPorts(bstrRuleLPorts);
pFwRule->put_Grouping(bstrRuleGroup);
pFwRule->put_InterfaceTypes(bstrRuleInterfaceType);
pFwRule->put_Action(NET_FW_ACTION_ALLOW);
pFwRule->put_Enabled(VARIANT_TRUE);
// Add the Firewall Rule
hr = pFwRules->Add(pFwRule);
if (FAILED(hr))
{
printf("Firewall Rule Add failed: 0x%08lx\n", hr);
goto Cleanup;
}
Cleanup:
// Free BSTR's
SysFreeString(bstrRuleName);
SysFreeString(bstrRuleDescription);
SysFreeString(bstrRuleGroup);
SysFreeString(bstrRuleLPorts);
SysFreeString(bstrRuleInterfaceType);
if (pFwRule != NULL)
{
pFwRule->Release();
}
// Release the INetFwRules object
if (pFwRules != NULL)
{
pFwRules->Release();
}
if (pNetFwPolicy2 != NULL)
{
pNetFwPolicy2->Release();
}
if (SUCCEEDED(hrComInit))
{
CoUninitialize();
}
}