163 lines
9.3 KiB
C#
163 lines
9.3 KiB
C#
using System;
|
|
using System.Runtime.InteropServices;
|
|
using Cpp2IlInjected;
|
|
|
|
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Modes
|
|
{
|
|
// Token: 0x02001658 RID: 5720
|
|
[Token(Token = "0x2001658")]
|
|
[StructLayout(3)]
|
|
public class CtsBlockCipher : BufferedBlockCipher
|
|
{
|
|
// Token: 0x0600986B RID: 39019 RVA: 0x0021C798 File Offset: 0x0021A998
|
|
[Token(Token = "0x600986B")]
|
|
[Address(RVA = "0x20E8B70", Offset = "0x20E7570", VA = "0x1820E8B70")]
|
|
public CtsBlockCipher(IBlockCipher cipher)
|
|
{
|
|
/*
|
|
An exception occurred when decompiling this method (0600986B)
|
|
|
|
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Void BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Modes.CtsBlockCipher::.ctor(BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.IBlockCipher)
|
|
|
|
---> System.Exception: Basic block has to end with unconditional control flow.
|
|
{
|
|
IL_3B:
|
|
stloc:ArgumentException(var_3_45, newobj:ArgumentException(ArgumentException::.ctor, ldstr:string("CtsBlockCipher can only accept ECB, or CBC ciphers")))
|
|
}
|
|
|
|
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: 0x0600986C RID: 39020 RVA: 0x0021C7EC File Offset: 0x0021A9EC
|
|
[Token(Token = "0x600986C")]
|
|
[Address(RVA = "0x1DDCDD0", Offset = "0x1DDB7D0", VA = "0x181DDCDD0", Slot = "26")]
|
|
public override int GetUpdateOutputSize(int length)
|
|
{
|
|
byte[] buf = this.buf;
|
|
int num = this.bufOff;
|
|
int length2 = buf.Length;
|
|
num += length;
|
|
if (length != 0)
|
|
{
|
|
return num - length;
|
|
}
|
|
return num - length2;
|
|
}
|
|
|
|
// Token: 0x0600986D RID: 39021 RVA: 0x0021C828 File Offset: 0x0021AA28
|
|
[Token(Token = "0x600986D")]
|
|
[Address(RVA = "0x20E8770", Offset = "0x20E7170", VA = "0x1820E8770", Slot = "25")]
|
|
public override int GetOutputSize(int length)
|
|
{
|
|
int bufOff = this.bufOff;
|
|
return bufOff + length;
|
|
}
|
|
|
|
// Token: 0x0600986E RID: 39022 RVA: 0x0021C844 File Offset: 0x0021AA44
|
|
[Token(Token = "0x600986E")]
|
|
[Address(RVA = "0x20E8780", Offset = "0x20E7180", VA = "0x1820E8780", Slot = "28")]
|
|
public override int ProcessByte(byte input, byte[] output, int outOff)
|
|
{
|
|
byte[] buf = this.buf;
|
|
int num = 0;
|
|
int bufOff = this.bufOff;
|
|
if (bufOff == buf.Length)
|
|
{
|
|
IBlockCipher cipher = this.cipher;
|
|
byte[] buf2 = this.buf;
|
|
int num2 = 0;
|
|
int num3 = this.blockSize;
|
|
Array.Copy(buf2, num3, buf2, num2, num3);
|
|
}
|
|
int num4 = bufOff + 1;
|
|
this.bufOff = num4;
|
|
return num;
|
|
}
|
|
|
|
// Token: 0x0600986F RID: 39023 RVA: 0x0021C8AC File Offset: 0x0021AAAC
|
|
[Token(Token = "0x600986F")]
|
|
[Address(RVA = "0x20E8880", Offset = "0x20E7280", VA = "0x1820E8880", Slot = "32")]
|
|
public override int ProcessBytes(byte[] input, int inOff, int length, byte[] output, int outOff)
|
|
{
|
|
/*
|
|
An exception occurred when decompiling this method (0600986F)
|
|
|
|
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Int32 BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Modes.CtsBlockCipher::ProcessBytes(System.Byte[],System.Int32,System.Int32,System.Byte[],System.Int32)
|
|
|
|
---> System.Exception: Basic block has to end with unconditional control flow.
|
|
{
|
|
IL_8C:
|
|
stloc:uint8[](var_15_95, ldfld:uint8[](BufferedBlockCipher::buf, ldloc:CtsBlockCipher[exp:BufferedBlockCipher](this)))
|
|
call:void(Array::Copy, ldloc:uint8[][exp:Array](input), ldloc:int32(inOff), ldloc:uint8[][exp:Array](var_15_95), ldloc:int32(var_13), ldloc:int32(length))
|
|
stloc:ArgumentException(var_16_AD, newobj:ArgumentException(ArgumentException::.ctor, ldstr:string("Can't have a negative input outLength!")))
|
|
}
|
|
|
|
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.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: 0x06009870 RID: 39024 RVA: 0x0021C968 File Offset: 0x0021AB68
|
|
[Token(Token = "0x6009870")]
|
|
[Address(RVA = "0x20E82E0", Offset = "0x20E6CE0", VA = "0x1820E82E0", Slot = "36")]
|
|
public override int DoFinal(byte[] output, int outOff)
|
|
{
|
|
for (;;)
|
|
{
|
|
int num = this.bufOff;
|
|
num += outOff;
|
|
IBlockCipher cipher = this.cipher;
|
|
int bufOff = this.bufOff;
|
|
byte[] array = new byte[0];
|
|
byte[] array2 = new byte[0];
|
|
IBlockCipher cipher2 = this.cipher;
|
|
if (cipher2 == 0 || cipher2 != 0)
|
|
{
|
|
byte[] buf = this.buf;
|
|
byte[] buf2 = this.buf;
|
|
IBlockCipher cipher3 = this.cipher;
|
|
IBlockCipher cipher4 = this.cipher;
|
|
int num2 = this.bufOff;
|
|
byte[] buf3 = this.buf;
|
|
if (num2 != buf3.Length)
|
|
{
|
|
num2++;
|
|
num2++;
|
|
byte[] buf4 = this.buf;
|
|
}
|
|
byte[] buf5 = this.buf;
|
|
num2 += buf5;
|
|
num2++;
|
|
IBlockCipher cipher5 = this.cipher;
|
|
if (cipher5 == 0 || cipher5 != 0)
|
|
{
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
int num3;
|
|
return num3;
|
|
}
|
|
|
|
// Token: 0x04006421 RID: 25633
|
|
[global::Cpp2IlInjected.FieldOffset(Offset = "0x28")]
|
|
[Token(Token = "0x4006421")]
|
|
private readonly int blockSize;
|
|
}
|
|
}
|