using System; using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Utilities; using Cpp2IlInjected; namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Engines { // Token: 0x02001CB0 RID: 7344 [Token(Token = "0x2001CB0")] public class TeaEngine : IBlockCipher { // Token: 0x0600B90A RID: 47370 RVA: 0x00294F60 File Offset: 0x00293160 [Token(Token = "0x600B90A")] [Address(RVA = "0x14B9990", Offset = "0x14B8790", VA = "0x1814B9990")] public TeaEngine() { this.Reset(); this._initialised = false; } // Token: 0x17001CF6 RID: 7414 // (get) Token: 0x0600B90B RID: 47371 RVA: 0x00294F7C File Offset: 0x0029317C [Token(Token = "0x17001CF6")] public virtual string AlgorithmName { [Token(Token = "0x600B90B")] [Address(RVA = "0x1E08C10", Offset = "0x1E07A10", VA = "0x181E08C10", Slot = "10")] get { return "TEA"; } } // Token: 0x17001CF7 RID: 7415 // (get) Token: 0x0600B90C RID: 47372 RVA: 0x00294F90 File Offset: 0x00293190 [Token(Token = "0x17001CF7")] public virtual bool IsPartialBlockOkay { [Token(Token = "0x600B90C")] [Address(RVA = "0x403930", Offset = "0x402730", VA = "0x180403930", Slot = "11")] get { } } // Token: 0x0600B90D RID: 47373 RVA: 0x00294FA0 File Offset: 0x002931A0 [Token(Token = "0x600B90D")] [Address(RVA = "0x4101D0", Offset = "0x40EFD0", VA = "0x1804101D0", Slot = "12")] public virtual int GetBlockSize() { return 8; } // Token: 0x0600B90E RID: 47374 RVA: 0x00294FB0 File Offset: 0x002931B0 [Token(Token = "0x600B90E")] [Address(RVA = "0x1E08690", Offset = "0x1E07490", VA = "0x181E08690", Slot = "13")] public virtual void Init(bool forEncryption, ICipherParameters parameters) { /* An exception occurred when decompiling this method (0600B90E) ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Void BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Engines.TeaEngine::Init(System.Boolean,BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.ICipherParameters) ---> System.Exception: Basic block has to end with unconditional control flow. { IL_66: stloc:ArgumentException(var_9_77, newobj:ArgumentException(ArgumentException::.ctor, call:string(string::Concat, ldstr:string("invalid parameter passed to TEA init - "), ldloc:string(var_8)))) } 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: 0x0600B90F RID: 47375 RVA: 0x00295038 File Offset: 0x00293238 [Token(Token = "0x600B90F")] [Address(RVA = "0x1E08830", Offset = "0x1E07630", VA = "0x181E08830", Slot = "14")] public virtual int ProcessBlock(byte[] inBytes, int inOff, byte[] outBytes, int outOff) { /* An exception occurred when decompiling this method (0600B90F) ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Int32 BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Engines.TeaEngine::ProcessBlock(System.Byte[],System.Int32,System.Byte[],System.Int32) ---> System.Exception: Basic block has to end with unconditional control flow. { IL_AE: stloc:InvalidOperationException(var_13_B5, newobj:InvalidOperationException(InvalidOperationException::.ctor, ldloc:string(var_12))) } 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: 0x0600B910 RID: 47376 RVA: 0x0000220F File Offset: 0x0000040F [Token(Token = "0x600B910")] [Address(RVA = "0x402080", Offset = "0x400E80", VA = "0x180402080", Slot = "15")] public virtual void Reset() { throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method."); } // Token: 0x0600B911 RID: 47377 RVA: 0x002950FC File Offset: 0x002932FC [Token(Token = "0x600B911")] [Address(RVA = "0x1E08C40", Offset = "0x1E07A40", VA = "0x181E08C40")] private void setKey(byte[] key) { int num = 0; uint num2 = Pack.BE_To_UInt32(key, num); this._a = num2; uint num3 = Pack.BE_To_UInt32(key, 4); this._b = num3; uint num4 = Pack.BE_To_UInt32(key, 8); this._c = num4; uint num5 = Pack.BE_To_UInt32(key, 12); this._d = num5; } // Token: 0x0600B912 RID: 47378 RVA: 0x0029514C File Offset: 0x0029334C [Token(Token = "0x600B912")] [Address(RVA = "0x1E08B20", Offset = "0x1E07920", VA = "0x181E08B20")] private int encryptBlock(byte[] inBytes, int inOff, byte[] outBytes, int outOff) { /* An exception occurred when decompiling this method (0600B912) ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Int32 BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Engines.TeaEngine::encryptBlock(System.Byte[],System.Int32,System.Byte[],System.Int32) ---> System.Exception: Basic block has to end with unconditional control flow. { Block_0: stloc:uint32(var_0_07, call:uint32(Pack::BE_To_UInt32, ldloc:uint8[](inBytes), ldloc:int32(inOff))) stloc:uint32(var_1_0F, call:uint32(Pack::BE_To_UInt32, ldloc:uint8[](inBytes), ldloc:int32(inOff))) stloc:uint32(var_2_16, ldfld:uint32(TeaEngine::_a, ldloc:TeaEngine(this))) stloc:uint32(var_3_1D, ldfld:uint32(TeaEngine::_b, ldloc:TeaEngine(this))) stloc:uint32(var_4_24, ldfld:uint32(TeaEngine::_c, ldloc:TeaEngine(this))) stloc:uint32(var_5_2C, ldfld:uint32(TeaEngine::_d, ldloc:TeaEngine(this))) stloc:uint32(var_1_31, add:uint32(ldloc:uint32(var_1_0F), ldloc:uint32(var_2_16))) stloc:uint32(var_1_35, add:uint32(ldloc:uint32(var_1_31), ldloc:uint32(var_3_1D))) stloc:uint32(var_0_39, add:uint32(ldloc:uint32(var_0_07), ldloc:uint32(var_1_35))) stloc:uint32(var_1_3D, ldloc:uint32(var_0_39)) stloc:uint32(var_1_42, add:uint32(ldloc:uint32(var_1_3D), ldloc:uint32(var_4_24))) stloc:uint32(var_1_47, add:uint32(ldloc:uint32(var_1_42), ldloc:uint32(var_5_2C))) stloc:uint32(var_1_4B, add:uint32(ldloc:uint32(var_1_47), ldloc:uint32(var_1_47))) } 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: 0x0600B913 RID: 47379 RVA: 0x002951A8 File Offset: 0x002933A8 [Token(Token = "0x600B913")] [Address(RVA = "0x1E08A30", Offset = "0x1E07830", VA = "0x181E08A30")] private int decryptBlock(byte[] inBytes, int inOff, byte[] outBytes, int outOff) { /* An exception occurred when decompiling this method (0600B913) ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Int32 BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Engines.TeaEngine::decryptBlock(System.Byte[],System.Int32,System.Byte[],System.Int32) ---> System.Exception: Basic block has to end with unconditional control flow. { Block_0: stloc:uint32(var_0_07, call:uint32(Pack::BE_To_UInt32, ldloc:uint8[](inBytes), ldloc:int32(inOff))) stloc:uint32(var_1_0F, call:uint32(Pack::BE_To_UInt32, ldloc:uint8[](inBytes), ldloc:int32(inOff))) stloc:uint32(var_2_16, ldfld:uint32(TeaEngine::_c, ldloc:TeaEngine(this))) stloc:uint32(var_3_1D, ldfld:uint32(TeaEngine::_d, ldloc:TeaEngine(this))) stloc:uint32(var_4_24, ldfld:uint32(TeaEngine::_a, ldloc:TeaEngine(this))) stloc:uint32(var_5_2C, ldfld:uint32(TeaEngine::_b, ldloc:TeaEngine(this))) stloc:uint32(var_1_2F, ldloc:uint32(var_0_07)) stloc:uint32(var_0_33, add:uint32(ldloc:uint32(var_0_07), ldloc:uint32(var_2_16))) stloc:uint32(var_1_37, add:uint32(ldloc:uint32(var_1_2F), ldloc:uint32(var_3_1D))) stloc:uint32(var_1_3B, sub:uint32(ldloc:uint32(var_1_37), ldloc:uint32(var_0_33))) stloc:uint32(var_0_3D, ldloc:uint32(var_1_3B)) stloc:uint32(var_0_42, add:uint32(ldloc:uint32(var_0_3D), ldloc:uint32(var_4_24))) stloc:uint32(var_1_47, add:uint32(ldloc:uint32(var_1_3B), ldloc:uint32(var_5_2C))) stloc:uint32(var_0_4B, sub:uint32(ldloc:uint32(var_0_42), ldloc:uint32(var_0_42))) } 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: 0x04007537 RID: 30007 [Token(Token = "0x4007537")] private const int rounds = 32; // Token: 0x04007538 RID: 30008 [Token(Token = "0x4007538")] private const int block_size = 8; // Token: 0x04007539 RID: 30009 [Token(Token = "0x4007539")] private const uint delta = 2654435769U; // Token: 0x0400753A RID: 30010 [Token(Token = "0x400753A")] private const uint d_sum = 3337565984U; // Token: 0x0400753B RID: 30011 [FieldOffset(Offset = "0x10")] [Token(Token = "0x400753B")] private uint _a; // Token: 0x0400753C RID: 30012 [FieldOffset(Offset = "0x14")] [Token(Token = "0x400753C")] private uint _b; // Token: 0x0400753D RID: 30013 [FieldOffset(Offset = "0x18")] [Token(Token = "0x400753D")] private uint _c; // Token: 0x0400753E RID: 30014 [FieldOffset(Offset = "0x1C")] [Token(Token = "0x400753E")] private uint _d; // Token: 0x0400753F RID: 30015 [FieldOffset(Offset = "0x20")] [Token(Token = "0x400753F")] private bool _initialised; // Token: 0x04007540 RID: 30016 [FieldOffset(Offset = "0x21")] [Token(Token = "0x4007540")] private bool _forEncryption; } }