
Originally Posted by
Eperty123
Note
AKTools now relies on my server for handling IPs which means you need an active internet connection to be able to convert your IPs. This way class A IPs (e.g. 10.10.12.3) should theoretically be supported. Haven't tested it so let me know.
Just noticed this file is different from the one in the thread http://forum.ragezone.com/f937/aura-...files-1158070/ which didn't work for me, I have not tried your up to date file here, but you might be able to see if that is still a issue.
So my network uses 10.0.0.x and AKTools didn't work for me, so I looked into your code and found the issue.

A0 00 06 so basically it was converting it to 160.0.6.0 or A0 00 06 00, because an IP is 4 bytes in memory.
So the way I fixed it was by using the IPAddress class, so when you catch it from the text box:
Code:
var ip = IPAddress.Parse(iUserIp.Text);
setting the other box to the bytes:
Code:
iIpToBytes.Text = BitConverter.ToString(ip.GetAddressBytes());
And to use the ip to patch the files(because the last entry needs to be 0):
Code:
var lastOctetToZero = ip.GetAddressBytes();
lastOctetToZero[3] = 0;
Now it works for me with 10.0.0.x IP, hopefully you're still around and can update your tool :)
And instead of converting things to string to compare, it might be easier to do something like this, example for loginserver:
Code:
var ipLastOctetToZero = ip.GetAddressBytes();
ipLastOctetToZero[3] = 0;
using (var fileStream = File.Open(filename, FileMode.Open, FileAccess.ReadWrite))
{
using (var binaryWriter = new BinaryWriter(fileStream))
using (var binaryReader = new BinaryReader(fileStream))
{
binaryReader.BaseStream.Seek(baseJump, SeekOrigin.Begin);
var current = binaryReader.ReadByte();
if (current == 0xCC)
{
binaryWriter.BaseStream.Position = 202276;
binaryWriter.Write(ipLastOctetToZero);
binaryWriter.BaseStream.Position = 203060;
binaryWriter.Write(ipLastOctetToZero);
return;
}
Console.WriteLine("Incompatible file...");
}
}
Hope it helps ;)