/// <summary> /// 加密,照搬E语言 /// </summary> /// <param name="ProcessID">进程ID</param> /// <param name="Address">地址</param> /// <param name="Data">加密数据</param> /// <param name="DecryptionAdd">解密基址</param> public static void Encryption(int ProcessID, uint Address, int Data, uint DecryptionAdd) { //声明变量 int encryptionid, offsetpara, offsetadd, data, tailofadd, decryptadd, ax, si = 0; encryptionid = ReadWriteCtr.ReadMemInt(ProcessID, Address); decryptadd = ReadWriteCtr.ReadMemInt(ProcessID, DecryptionAdd); offsetpara = ReadWriteCtr.ReadMemInt(ProcessID, (uint)(decryptadd + (encryptionid >> 16) * 4 + 36)); offsetadd = offsetpara + (encryptionid & 65535) * 4 + 8468; offsetpara = ReadWriteCtr.ReadMemInt(ProcessID, (uint)offsetadd); data = offsetpara & 65535; data = data + (data << 16); ax = offsetpara & 65535; tailofadd = (int)Address & 15; switch (tailofadd) { case 0: si = Data >> 16; si = si - ax; si = si + Data; break; case 4: si = (Data & 65535) - (Data >> 16); break; case 8: si = Data >> 16; si = si * Data; break; case 12: si = Data >> 16; si = si + Data; si = si + ax; break; default: return; } ax = si ^ ax; byte[] temp = BitConverter.GetBytes(ax); ReadWriteCtr.WriteMemByteArray(ProcessID, (uint)(offsetadd + 2), temp, temp.Length); ReadWriteCtr.WriteMemInt(ProcessID, Address + 4, data ^ Data); }
public static void 超级加密(int Address, int value, int type = 0) { int 加密ID = ReadWriteCtr.ReadMemInt(全局变量.进程ID, (uint)Address); int 偏移参数 = ReadWriteCtr.ReadMemInt(全局变量.进程ID, 基址.解密基址); 偏移参数 = ReadWriteCtr.ReadMemInt(全局变量.进程ID, (uint)(偏移参数 + (加密ID >> 16) * 4 + 36)); int 偏移地址 = 偏移参数 + (加密ID & 65535) * 4 + 8468; 偏移参数 = ReadWriteCtr.ReadMemInt(全局变量.进程ID, (uint)偏移地址); int data = 偏移参数 & 0xffff; data = data + (data << 16); short ax = (short)(偏移参数 & 0xffff); short si = 0; if (type == 0) { int 地址尾 = Address & 15; switch (地址尾) { case 0: si = (short)(value >> 16); si = (short)(si - ax); si = (short)(si + value); break; case 4: si = (short)((value & 0xFFFF) - (value >> 16));; break; case 8: si = (short)(value >> 16); si = (short)(si * value); break; case 12: si = (short)(value >> 16); si = (short)(si + value); si = (short)(si + ax); break; default: break; } } else if (type == 1) { si = (short)(value & 16); } else if (type == 2) { si = (short)value; } else if (type == 3) { si = (short)(value >> 16); si += (short)value; } else if (type == 4) { si = (short)(value >> 16); si = (short)(si + value & 0xFFFF); } ax = (short)(si ^ ax); byte[] temp = BitConverter.GetBytes(ax); ReadWriteCtr.WriteMemByteArray(全局变量.进程ID, (uint)(偏移地址 + 2), temp, temp.Length); data = data ^ value; int a = Address + (type != 4 ? 4 : 8); ReadWriteCtr.WriteMemInt(全局变量.进程ID, (uint)a, data); }