oh dear
This commit is contained in:
+392
@@ -0,0 +1,392 @@
|
||||
using System;
|
||||
using System.Text;
|
||||
using Cpp2IlInjected;
|
||||
|
||||
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Abc
|
||||
{
|
||||
// Token: 0x02001ABF RID: 6847
|
||||
[Token(Token = "0x2001ABF")]
|
||||
internal class SimpleBigDecimal
|
||||
{
|
||||
// Token: 0x0600AA09 RID: 43529 RVA: 0x00252B9C File Offset: 0x00250D9C
|
||||
[Token(Token = "0x600AA09")]
|
||||
[Address(RVA = "0x1EDF220", Offset = "0x1EDE020", VA = "0x181EDF220")]
|
||||
public static SimpleBigDecimal GetInstance(BigInteger val, int scale)
|
||||
{
|
||||
return new SimpleBigDecimal(val.ShiftLeft(scale), scale);
|
||||
}
|
||||
|
||||
// Token: 0x0600AA0A RID: 43530 RVA: 0x00252BBC File Offset: 0x00250DBC
|
||||
[Token(Token = "0x600AA0A")]
|
||||
[Address(RVA = "0x1EDFB30", Offset = "0x1EDE930", VA = "0x181EDFB30")]
|
||||
public SimpleBigDecimal(BigInteger bigInt, int scale)
|
||||
{
|
||||
this.bigInt = bigInt;
|
||||
this.scale = scale;
|
||||
}
|
||||
|
||||
// Token: 0x0600AA0B RID: 43531 RVA: 0x00252BE8 File Offset: 0x00250DE8
|
||||
[Token(Token = "0x600AA0B")]
|
||||
[Address(RVA = "0xB96A90", Offset = "0xB95890", VA = "0x180B96A90")]
|
||||
private SimpleBigDecimal(SimpleBigDecimal limBigDec)
|
||||
{
|
||||
BigInteger bigInteger = limBigDec.bigInt;
|
||||
this.bigInt = bigInteger;
|
||||
int num = limBigDec.scale;
|
||||
this.scale = num;
|
||||
}
|
||||
|
||||
// Token: 0x0600AA0C RID: 43532 RVA: 0x00252C20 File Offset: 0x00250E20
|
||||
[Token(Token = "0x600AA0C")]
|
||||
[Address(RVA = "0x1EDEE80", Offset = "0x1EDDC80", VA = "0x181EDEE80")]
|
||||
private void CheckScale(SimpleBigDecimal b)
|
||||
{
|
||||
/*
|
||||
An exception occurred when decompiling this method (0600AA0C)
|
||||
|
||||
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Void BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Abc.SimpleBigDecimal::CheckScale(BestHTTP.SecureProtocol.Org.BouncyCastle.Math.EC.Abc.SimpleBigDecimal)
|
||||
|
||||
---> System.Exception: Basic block has to end with unconditional control flow.
|
||||
{
|
||||
IL_11:
|
||||
stloc:ArgumentException(var_1_1B, newobj:ArgumentException(ArgumentException::.ctor, ldstr:string("Only SimpleBigDecimal of same scale allowed in arithmetic operations")))
|
||||
}
|
||||
|
||||
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1852
|
||||
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1878
|
||||
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1878
|
||||
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1846
|
||||
at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.Optimize(DecompilerContext context, ILBlock method, AutoPropertyProvider autoPropertyProvider, StateMachineKind& stateMachineKind, MethodDef& inlinedMethod, AsyncMethodDebugInfo& asyncInfo, ILAstOptimizationStep abortBeforeStep) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 355
|
||||
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(IEnumerable`1 parameters, MethodDebugInfoBuilder& builder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 123
|
||||
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 88
|
||||
--- End of inner exception stack trace ---
|
||||
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 92
|
||||
at ICSharpCode.Decompiler.Ast.AstBuilder.AddMethodBody(EntityDeclaration methodNode, EntityDeclaration& updatedNode, MethodDef method, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, MethodKind methodKind) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstBuilder.cs:line 1663
|
||||
*/;
|
||||
}
|
||||
|
||||
// Token: 0x0600AA0D RID: 43533 RVA: 0x00252C48 File Offset: 0x00250E48
|
||||
[Token(Token = "0x600AA0D")]
|
||||
[Address(RVA = "0x1EDEDB0", Offset = "0x1EDDBB0", VA = "0x181EDEDB0")]
|
||||
public SimpleBigDecimal AdjustScale(int newScale)
|
||||
{
|
||||
int num = this.scale;
|
||||
if (newScale != num)
|
||||
{
|
||||
return new SimpleBigDecimal(this.bigInt.ShiftLeft(newScale), newScale);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
// Token: 0x0600AA0E RID: 43534 RVA: 0x00252C80 File Offset: 0x00250E80
|
||||
[Token(Token = "0x600AA0E")]
|
||||
[Address(RVA = "0x1EDEC70", Offset = "0x1EDDA70", VA = "0x181EDEC70")]
|
||||
public SimpleBigDecimal Add(SimpleBigDecimal b)
|
||||
{
|
||||
this.CheckScale(b);
|
||||
BigInteger bigInteger = this.bigInt;
|
||||
BigInteger bigInteger2 = b.bigInt;
|
||||
BigInteger bigInteger3 = bigInteger.Add(bigInteger2);
|
||||
int num = this.scale;
|
||||
return new SimpleBigDecimal(bigInteger3, num);
|
||||
}
|
||||
|
||||
// Token: 0x0600AA0F RID: 43535 RVA: 0x00252CC0 File Offset: 0x00250EC0
|
||||
[Token(Token = "0x600AA0F")]
|
||||
[Address(RVA = "0x1EDED10", Offset = "0x1EDDB10", VA = "0x181EDED10")]
|
||||
public SimpleBigDecimal Add(BigInteger b)
|
||||
{
|
||||
BigInteger bigInteger = this.bigInt;
|
||||
int num = this.scale;
|
||||
BigInteger bigInteger2 = b.ShiftLeft(num);
|
||||
BigInteger bigInteger3 = bigInteger.Add(bigInteger2);
|
||||
int num2 = this.scale;
|
||||
return new SimpleBigDecimal(bigInteger3, num2);
|
||||
}
|
||||
|
||||
// Token: 0x0600AA10 RID: 43536 RVA: 0x00252D04 File Offset: 0x00250F04
|
||||
[Token(Token = "0x600AA10")]
|
||||
[Address(RVA = "0x1EDF3D0", Offset = "0x1EDE1D0", VA = "0x181EDF3D0")]
|
||||
public SimpleBigDecimal Negate()
|
||||
{
|
||||
BigInteger bigInteger = this.bigInt.Negate();
|
||||
int num = this.scale;
|
||||
return new SimpleBigDecimal(bigInteger, num);
|
||||
}
|
||||
|
||||
// Token: 0x0600AA11 RID: 43537 RVA: 0x00252D34 File Offset: 0x00250F34
|
||||
[Token(Token = "0x600AA11")]
|
||||
[Address(RVA = "0x1EDF700", Offset = "0x1EDE500", VA = "0x181EDF700")]
|
||||
public SimpleBigDecimal Subtract(SimpleBigDecimal b)
|
||||
{
|
||||
BigInteger bigInteger = b.bigInt.Negate();
|
||||
int num = b.scale;
|
||||
SimpleBigDecimal simpleBigDecimal = new SimpleBigDecimal(bigInteger, num);
|
||||
this.CheckScale(simpleBigDecimal);
|
||||
BigInteger bigInteger2 = this.bigInt;
|
||||
BigInteger bigInteger3 = simpleBigDecimal.bigInt;
|
||||
BigInteger bigInteger4 = bigInteger2.Add(bigInteger3);
|
||||
int num2 = this.scale;
|
||||
return new SimpleBigDecimal(bigInteger4, num2);
|
||||
}
|
||||
|
||||
// Token: 0x0600AA12 RID: 43538 RVA: 0x00252D94 File Offset: 0x00250F94
|
||||
[Token(Token = "0x600AA12")]
|
||||
[Address(RVA = "0x1EDF660", Offset = "0x1EDE460", VA = "0x181EDF660")]
|
||||
public SimpleBigDecimal Subtract(BigInteger b)
|
||||
{
|
||||
BigInteger bigInteger = this.bigInt;
|
||||
int num = this.scale;
|
||||
BigInteger bigInteger2 = b.ShiftLeft(num);
|
||||
BigInteger bigInteger3 = bigInteger.Subtract(bigInteger2);
|
||||
int num2 = this.scale;
|
||||
return new SimpleBigDecimal(bigInteger3, num2);
|
||||
}
|
||||
|
||||
// Token: 0x0600AA13 RID: 43539 RVA: 0x00252DD8 File Offset: 0x00250FD8
|
||||
[Token(Token = "0x600AA13")]
|
||||
[Address(RVA = "0x1EDF330", Offset = "0x1EDE130", VA = "0x181EDF330")]
|
||||
public SimpleBigDecimal Multiply(SimpleBigDecimal b)
|
||||
{
|
||||
this.CheckScale(b);
|
||||
BigInteger bigInteger = this.bigInt;
|
||||
BigInteger bigInteger2 = b.bigInt;
|
||||
int num = 0;
|
||||
return new SimpleBigDecimal(bigInteger.Multiply(bigInteger2), num);
|
||||
}
|
||||
|
||||
// Token: 0x0600AA14 RID: 43540 RVA: 0x00252E10 File Offset: 0x00251010
|
||||
[Token(Token = "0x600AA14")]
|
||||
[Address(RVA = "0x1EDF2A0", Offset = "0x1EDE0A0", VA = "0x181EDF2A0")]
|
||||
public SimpleBigDecimal Multiply(BigInteger b)
|
||||
{
|
||||
BigInteger bigInteger = this.bigInt.Multiply(b);
|
||||
int num = this.scale;
|
||||
return new SimpleBigDecimal(bigInteger, num);
|
||||
}
|
||||
|
||||
// Token: 0x0600AA15 RID: 43541 RVA: 0x00252E40 File Offset: 0x00251040
|
||||
[Token(Token = "0x600AA15")]
|
||||
[Address(RVA = "0x1EDF020", Offset = "0x1EDDE20", VA = "0x181EDF020")]
|
||||
public SimpleBigDecimal Divide(SimpleBigDecimal b)
|
||||
{
|
||||
this.CheckScale(b);
|
||||
BigInteger bigInteger = this.bigInt;
|
||||
int num = this.scale;
|
||||
BigInteger bigInteger2 = bigInteger.ShiftLeft(num);
|
||||
BigInteger bigInteger3 = b.bigInt;
|
||||
BigInteger bigInteger4 = bigInteger2.Divide(bigInteger3);
|
||||
int num2 = this.scale;
|
||||
return new SimpleBigDecimal(bigInteger4, num2);
|
||||
}
|
||||
|
||||
// Token: 0x0600AA16 RID: 43542 RVA: 0x00252E94 File Offset: 0x00251094
|
||||
[Token(Token = "0x600AA16")]
|
||||
[Address(RVA = "0x1EDEF90", Offset = "0x1EDDD90", VA = "0x181EDEF90")]
|
||||
public SimpleBigDecimal Divide(BigInteger b)
|
||||
{
|
||||
BigInteger bigInteger = this.bigInt.Divide(b);
|
||||
int num = this.scale;
|
||||
return new SimpleBigDecimal(bigInteger, num);
|
||||
}
|
||||
|
||||
// Token: 0x0600AA17 RID: 43543 RVA: 0x00252EC4 File Offset: 0x002510C4
|
||||
[Token(Token = "0x600AA17")]
|
||||
[Address(RVA = "0x1EDF5D0", Offset = "0x1EDE3D0", VA = "0x181EDF5D0")]
|
||||
public SimpleBigDecimal ShiftLeft(int n)
|
||||
{
|
||||
BigInteger bigInteger = this.bigInt.ShiftLeft(n);
|
||||
int num = this.scale;
|
||||
return new SimpleBigDecimal(bigInteger, num);
|
||||
}
|
||||
|
||||
// Token: 0x0600AA18 RID: 43544 RVA: 0x00252EF4 File Offset: 0x002510F4
|
||||
[Token(Token = "0x600AA18")]
|
||||
[Address(RVA = "0x1EDEF40", Offset = "0x1EDDD40", VA = "0x181EDEF40")]
|
||||
public int CompareTo(SimpleBigDecimal val)
|
||||
{
|
||||
this.CheckScale(val);
|
||||
BigInteger bigInteger = this.bigInt;
|
||||
BigInteger bigInteger2 = val.bigInt;
|
||||
return bigInteger.CompareTo(bigInteger2);
|
||||
}
|
||||
|
||||
// Token: 0x0600AA19 RID: 43545 RVA: 0x00252F24 File Offset: 0x00251124
|
||||
[Token(Token = "0x600AA19")]
|
||||
[Address(RVA = "0x1EDEF00", Offset = "0x1EDDD00", VA = "0x181EDEF00")]
|
||||
public int CompareTo(BigInteger val)
|
||||
{
|
||||
BigInteger bigInteger = this.bigInt;
|
||||
int num = this.scale;
|
||||
BigInteger bigInteger2 = val.ShiftLeft(num);
|
||||
return bigInteger.CompareTo(bigInteger2);
|
||||
}
|
||||
|
||||
// Token: 0x0600AA1A RID: 43546 RVA: 0x00252F54 File Offset: 0x00251154
|
||||
[Token(Token = "0x600AA1A")]
|
||||
[Address(RVA = "0x1EDF1B0", Offset = "0x1EDDFB0", VA = "0x181EDF1B0")]
|
||||
public BigInteger Floor()
|
||||
{
|
||||
BigInteger bigInteger = this.bigInt;
|
||||
int num = this.scale;
|
||||
return bigInteger.ShiftRight(num);
|
||||
}
|
||||
|
||||
// Token: 0x0600AA1B RID: 43547 RVA: 0x00252F7C File Offset: 0x0025117C
|
||||
[Token(Token = "0x600AA1B")]
|
||||
[Address(RVA = "0x1EDF450", Offset = "0x1EDE250", VA = "0x181EDF450")]
|
||||
public BigInteger Round()
|
||||
{
|
||||
BigInteger one = BigInteger.One;
|
||||
SimpleBigDecimal simpleBigDecimal;
|
||||
simpleBigDecimal.bigInt = one;
|
||||
simpleBigDecimal.scale = (int)((ulong)1L);
|
||||
int num = this.scale;
|
||||
int num2 = simpleBigDecimal.scale;
|
||||
if (num != num2)
|
||||
{
|
||||
BigInteger bigInteger = simpleBigDecimal.bigInt;
|
||||
num -= num2;
|
||||
SimpleBigDecimal simpleBigDecimal2 = new SimpleBigDecimal(bigInteger.ShiftLeft(num), num);
|
||||
}
|
||||
SimpleBigDecimal simpleBigDecimal3 = this.Add(simpleBigDecimal);
|
||||
BigInteger bigInteger2 = simpleBigDecimal3.bigInt;
|
||||
int num3 = simpleBigDecimal3.scale;
|
||||
return bigInteger2.ShiftRight(num3);
|
||||
}
|
||||
|
||||
// Token: 0x17001B0C RID: 6924
|
||||
// (get) Token: 0x0600AA1C RID: 43548 RVA: 0x00253000 File Offset: 0x00251200
|
||||
[Token(Token = "0x17001B0C")]
|
||||
public int IntValue
|
||||
{
|
||||
[Token(Token = "0x600AA1C")]
|
||||
[Address(RVA = "0x1EDFBC0", Offset = "0x1EDE9C0", VA = "0x181EDFBC0")]
|
||||
get
|
||||
{
|
||||
BigInteger bigInteger = this.bigInt;
|
||||
int num = this.scale;
|
||||
return bigInteger.ShiftRight(num).IntValue;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x17001B0D RID: 6925
|
||||
// (get) Token: 0x0600AA1D RID: 43549 RVA: 0x00253030 File Offset: 0x00251230
|
||||
[Token(Token = "0x17001B0D")]
|
||||
public long LongValue
|
||||
{
|
||||
[Token(Token = "0x600AA1D")]
|
||||
[Address(RVA = "0x1EDFC00", Offset = "0x1EDEA00", VA = "0x181EDFC00")]
|
||||
get
|
||||
{
|
||||
BigInteger bigInteger = this.bigInt;
|
||||
int num = this.scale;
|
||||
return bigInteger.ShiftRight(num).LongValue;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x17001B0E RID: 6926
|
||||
// (get) Token: 0x0600AA1E RID: 43550 RVA: 0x00253060 File Offset: 0x00251260
|
||||
[Token(Token = "0x17001B0E")]
|
||||
public int Scale
|
||||
{
|
||||
[Token(Token = "0x600AA1E")]
|
||||
[Address(RVA = "0x40B720", Offset = "0x40A520", VA = "0x18040B720")]
|
||||
get
|
||||
{
|
||||
return this.scale;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x0600AA1F RID: 43551 RVA: 0x00253074 File Offset: 0x00251274
|
||||
[Token(Token = "0x600AA1F")]
|
||||
[Address(RVA = "0x1EDF800", Offset = "0x1EDE600", VA = "0x181EDF800", Slot = "3")]
|
||||
public override string ToString()
|
||||
{
|
||||
BigInteger bigInteger2;
|
||||
BigInteger bigInteger5;
|
||||
do
|
||||
{
|
||||
int num = this.scale;
|
||||
BigInteger bigInteger = this.bigInt;
|
||||
if (num == 0)
|
||||
{
|
||||
goto IL_111;
|
||||
}
|
||||
bigInteger2 = bigInteger.ShiftRight(num);
|
||||
BigInteger bigInteger3 = this.bigInt;
|
||||
int num2 = this.scale;
|
||||
BigInteger bigInteger4 = bigInteger2.ShiftLeft(num2);
|
||||
bigInteger5 = bigInteger3.Subtract(bigInteger4);
|
||||
if (this.bigInt.sign < 0)
|
||||
{
|
||||
BigInteger one = BigInteger.One;
|
||||
int num3 = this.scale;
|
||||
BigInteger bigInteger6 = one.ShiftLeft(num3).Subtract(bigInteger5);
|
||||
}
|
||||
}
|
||||
while (bigInteger2.sign != -1);
|
||||
BigInteger one2 = BigInteger.One;
|
||||
int hashCode = bigInteger2.Add(one2).GetHashCode();
|
||||
char[] array = new char[this.scale];
|
||||
string text = bigInteger5.ToString(2);
|
||||
int num4 = this.scale;
|
||||
int num5 = 0;
|
||||
int stringLength = text.m_stringLength;
|
||||
num4 -= stringLength;
|
||||
if (num4 > 0)
|
||||
{
|
||||
num5++;
|
||||
array[0] = '0';
|
||||
}
|
||||
if (stringLength > 0)
|
||||
{
|
||||
char c = text[num5];
|
||||
num5++;
|
||||
array[0] = c;
|
||||
}
|
||||
StringBuilder stringBuilder2;
|
||||
StringBuilder stringBuilder = stringBuilder2.Append(".");
|
||||
string text2;
|
||||
StringBuilder stringBuilder3 = stringBuilder2.Append(text2);
|
||||
IL_111:
|
||||
throw new NullReferenceException();
|
||||
}
|
||||
|
||||
// Token: 0x0600AA20 RID: 43552 RVA: 0x00253198 File Offset: 0x00251398
|
||||
[Token(Token = "0x600AA20")]
|
||||
[Address(RVA = "0x1EDF0D0", Offset = "0x1EDDED0", VA = "0x181EDF0D0", Slot = "0")]
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
if (this != obj)
|
||||
{
|
||||
if (obj != 0 && obj != 0)
|
||||
{
|
||||
BigInteger bigInteger = this.bigInt;
|
||||
bool flag;
|
||||
return flag;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
// Token: 0x0600AA21 RID: 43553 RVA: 0x002531C8 File Offset: 0x002513C8
|
||||
[Token(Token = "0x600AA21")]
|
||||
[Address(RVA = "0x1EDF1E0", Offset = "0x1EDDFE0", VA = "0x181EDF1E0", Slot = "2")]
|
||||
public override int GetHashCode()
|
||||
{
|
||||
this.bigInt.Finalize();
|
||||
throw new NullReferenceException();
|
||||
}
|
||||
|
||||
// Token: 0x04006C85 RID: 27781
|
||||
[FieldOffset(Offset = "0x10")]
|
||||
[Token(Token = "0x4006C85")]
|
||||
private readonly BigInteger bigInt;
|
||||
|
||||
// Token: 0x04006C86 RID: 27782
|
||||
[FieldOffset(Offset = "0x18")]
|
||||
[Token(Token = "0x4006C86")]
|
||||
private readonly int scale;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user