I have a problem with a source that i downloaded: I cant access the accounts that have password, it says that the username or password is incorrect. Instead, I can enter without password accounts database with any password. This has led me to think that the source encrypts passwords and I found a file that appears to be doing that same... but I'm learning C++ in the university and that source is coded in C# so i cant understand all the code and i need to do a script or something like this to encrypts passwords from web register. If you can tell me what that code does i will be very gratefull. From there i will make the script to encrypt the password (Javascript?).
That is the code:
Code:
namespace Conquer_Online_Server.Network.Cryptography
{
using System;
using System.Text;
public sealed class ConquerPasswordCryptpographer
{
private readonly byte[] key = new byte[0x200];
private static byte[] virtualKeyToScanCodeMap = new byte[] {
0, 0, 0, 70, 0, 0, 0, 0, 14, 15, 0, 0, 0x4c, 0x1c, 0, 0,
0x2a, 0x1d, 0x38, 0, 0x3a, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0,
0x39, 0x49, 0x51, 0x4f, 0x47, 0x4b, 0x48, 0x4d, 80, 0, 0, 0, 0x54, 0x52, 0x53, 0x63,
11, 2, 3, 4, 5, 6, 7, 8, 9, 10, 0, 0, 0, 0, 0, 0,
0, 30, 0x30, 0x2e, 0x20, 0x12, 0x21, 0x22, 0x23, 0x17, 0x24, 0x25, 0x26, 50, 0x31, 0x18,
0x19, 0x10, 0x13, 0x1f, 20, 0x16, 0x2f, 0x11, 0x2d, 0x15, 0x2c, 0x5b, 0x5c, 0x5d, 0, 0x5f,
0x52, 0x4f, 80, 0x51, 0x4b, 0x4c, 0x4d, 0x47, 0x48, 0x49, 0x37, 0x4e, 0, 0x4a, 0x53, 0x35,
0x3b, 60, 0x3d, 0x3e, 0x3f, 0x40, 0x41, 0x42, 0x43, 0x44, 0x57, 0x58, 100, 0x65, 0x66, 0x67,
0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 110, 0x76, 0, 0, 0, 0, 0, 0, 0, 0,
0x45, 70, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0x2a, 0x36, 0x1d, 0x1d, 0x38, 0x38, 0x6a, 0x69, 0x67, 0x68, 0x65, 0x66, 50, 0x20, 0x2e, 0x30,
0x19, 0x10, 0x24, 0x22, 0x6c, 0x6d, 0x6b, 0x21, 0, 0, 0x27, 13, 0x33, 12, 0x34, 0x35,
40, 0x73, 0x7e, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x1a, 0x56, 0x1b, 0x2b, 0x29,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0x71, 0x5c, 0x7b, 0, 0x6f, 90, 0,
0, 0x5b, 0, 0x5f, 0, 0x5e, 0, 0, 0, 0x5d, 0, 0x62, 0, 0, 0, 0
};
public byte[] Encrypt(byte[] data)
{
byte[] buffer = new byte[data.Length];
this.defaultPass.CopyTo(buffer, 0);
for (int i = 0; i < data.Length; i++)
{
byte num2 = data[i];
if ((data[i] >= 0x61) && (data[i] <= 0x7a)) //Si es minuscula, la pasa a mayuscula
{
data[i] = (byte)(data[i] - 0x20);
}
byte num3 = virtualKeyToScanCodeMap[data[i]];
if ((num2 >= 0x41) && (num2 <= 90))
{
num3 = (byte)(num3 + 0x80);
}
if (num3 == 0)
{
buffer[i] = 0;
return buffer;
}
int num4 = 0;
while (num4 <= 0xff)
{
byte num5 = this.key[num4 * 2];
if (num5 == num3)
{
goto Label_008C;
}
num4++;
}
continue;
Label_008C:
buffer[i] = (byte)num4;
}
return buffer;
}
}
}






