Skip to content

Commit

Permalink
VMWare Interference Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
krxdev-kaan committed Jul 1, 2020
1 parent 05fe334 commit 89125f1
Show file tree
Hide file tree
Showing 3 changed files with 79 additions and 97 deletions.
117 changes: 55 additions & 62 deletions WindowsClient/AqHaxCSGO/Forms/TCPForm.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

55 changes: 22 additions & 33 deletions WindowsClient/AqHaxCSGO/Forms/TCPForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
using AqHaxCSGO.Objects;
using static AqHaxCSGO.Objects.Globals;
using System.Diagnostics;
using System.Net.NetworkInformation;

namespace AqHaxCSGO
{
Expand Down Expand Up @@ -102,20 +103,38 @@ private void TCPForm_Load(object sender, EventArgs e)

private static IPAddress LocalIPAddress()
{
if (!System.Net.NetworkInformation.NetworkInterface.GetIsNetworkAvailable())
if (!NetworkInterface.GetIsNetworkAvailable())
{
return null;
}

IPHostEntry host = Dns.GetHostEntry(Dns.GetHostName());
foreach (NetworkInterface ni in NetworkInterface.GetAllNetworkInterfaces())
{
var addr = ni.GetIPProperties().GatewayAddresses.FirstOrDefault();
if (addr != null)
{
if (ni.NetworkInterfaceType == NetworkInterfaceType.Wireless80211 ||
ni.NetworkInterfaceType == NetworkInterfaceType.Ethernet)
{
foreach (UnicastIPAddressInformation ip in ni.GetIPProperties().UnicastAddresses)
{
if (ip.Address.AddressFamily == AddressFamily.InterNetwork)
{
return ip.Address;
}
}
}
}
}

IPHostEntry host = Dns.GetHostEntry(Dns.GetHostName());
return host.AddressList.FirstOrDefault(ip => ip.AddressFamily == AddressFamily.InterNetwork);
}

public void ExecuteServer()
{
IPHostEntry ipHost = Dns.GetHostEntry(Dns.GetHostName());
IPAddress ipAddr = LocalIPAddress();
IPAddress ipAddr = IPAddress.Any;
IPEndPoint localEndPoint = new IPEndPoint(ipAddr, 8080);

Socket listener = new Socket(ipAddr.AddressFamily,
Expand Down Expand Up @@ -333,36 +352,6 @@ private void SetTextOfLabel(string text, Color color)
}
}

private void SetOfLabel(string text, Color color)
{
if (this.label1.InvokeRequired)
{
this.label1.BeginInvoke((MethodInvoker)delegate ()
{
this.label1.Text = text;
this.label1.ForeColor = color;
});
}
else
{
this.label1.Text = text;
this.label1.ForeColor = color;
}
}

private void Button1_Click(object sender, EventArgs e)
{
if (Memory.Init())
{
SetOfLabel("CSGO Online", Color.Green);
IntPtr temp = AqHaxCSGO.Objects.Structs.Misc.handle;
}
else
{
SetOfLabel("CSGO Offline", Color.Red);
}
}

#region Some Shit For Loading State
[DllImport("kernel32.dll")]
static extern bool AllocConsole();
Expand Down
4 changes: 2 additions & 2 deletions WindowsClient/AqHaxCSGO/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@
[assembly: AssemblyCulture("")]
[assembly: ComVisible(false)]
[assembly: Guid("c72f644c-03dc-4323-a253-eb1ad4e924ff")]
[assembly: AssemblyVersion("2.1.0.0")]
[assembly: AssemblyFileVersion("2.1.0.0")]
[assembly: AssemblyVersion("2.1.1.0")]
[assembly: AssemblyFileVersion("2.1.1.0")]

0 comments on commit 89125f1

Please sign in to comment.