using System; using System.Runtime.CompilerServices; using Cpp2IlInjected; namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Engines { // Token: 0x02001C9B RID: 7323 [Token(Token = "0x2001C9B")] public class RC2Engine : IBlockCipher { // Token: 0x0600B80D RID: 47117 RVA: 0x0028D920 File Offset: 0x0028BB20 [Token(Token = "0x600B80D")] [Address(RVA = "0x1DD7370", Offset = "0x1DD6170", VA = "0x181DD7370")] private int[] GenerateWorkingKey(byte[] key, int bits) { int[] array = new int[128]; int num = 0; int num2 = key.Length; if (num != num2) { num++; byte b; array[0] = (int)b; } uint num3; if (num2 < (int)num3) { int num4 = num2 - 1; int num5 = array[num4]; int length = array.Length; byte[] array2 = RC2Engine.piTable; num++; int num6 = array[num]; num6 += num5; num2++; byte b2; array[0] = (int)b2; } byte[] array3 = RC2Engine.piTable; num3 -= (uint)num; byte b3; array[0] = (int)b3; uint num7; num7 -= (uint)num; int length2 = array.Length; byte[] array4 = RC2Engine.piTable; int num8 = array[(int)num7]; byte b4; array[0] = (int)b4; int[] array5 = new int[64]; int length3 = array5.Length; if (num != length3) { int length4 = array.Length; num++; num += 2; int num9; array5[0] = num9; } return array5; } // Token: 0x0600B80E RID: 47118 RVA: 0x0028DA10 File Offset: 0x0028BC10 [Token(Token = "0x600B80E")] [Address(RVA = "0x1DD7750", Offset = "0x1DD6550", VA = "0x181DD7750", Slot = "10")] public virtual void Init(bool forEncryption, ICipherParameters parameters) { /* An exception occurred when decompiling this method (0600B80E) ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Void BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Engines.RC2Engine::Init(System.Boolean,BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.ICipherParameters) ---> System.Exception: Basic block has to end with unconditional control flow. { IL_56: stloc:ArgumentException(var_12_67, newobj:ArgumentException(ArgumentException::.ctor, call:string(string::Concat, ldstr:string("invalid parameter passed to RC2 init - "), ldloc:string(var_11)))) } 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: 0x0600B80F RID: 47119 RVA: 0x0000220F File Offset: 0x0000040F [Token(Token = "0x600B80F")] [Address(RVA = "0x402080", Offset = "0x400E80", VA = "0x180402080", Slot = "11")] public virtual void Reset() { throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method."); } // Token: 0x17001CDB RID: 7387 // (get) Token: 0x0600B810 RID: 47120 RVA: 0x0028DA88 File Offset: 0x0028BC88 [Token(Token = "0x17001CDB")] public virtual string AlgorithmName { [Token(Token = "0x600B810")] [Address(RVA = "0x1DD7B10", Offset = "0x1DD6910", VA = "0x181DD7B10", Slot = "12")] get { return "RC2"; } } // Token: 0x17001CDC RID: 7388 // (get) Token: 0x0600B811 RID: 47121 RVA: 0x0028DA9C File Offset: 0x0028BC9C [Token(Token = "0x17001CDC")] public virtual bool IsPartialBlockOkay { [Token(Token = "0x600B811")] [Address(RVA = "0x403930", Offset = "0x402730", VA = "0x180403930", Slot = "13")] get { } } // Token: 0x0600B812 RID: 47122 RVA: 0x0028DAAC File Offset: 0x0028BCAC [Token(Token = "0x600B812")] [Address(RVA = "0x4101D0", Offset = "0x40EFD0", VA = "0x1804101D0", Slot = "14")] public virtual int GetBlockSize() { return 8; } // Token: 0x0600B813 RID: 47123 RVA: 0x0028DABC File Offset: 0x0028BCBC [Token(Token = "0x600B813")] [Address(RVA = "0x1DD7980", Offset = "0x1DD6780", VA = "0x181DD7980", Slot = "15")] public virtual int ProcessBlock(byte[] input, int inOff, byte[] output, int outOff) { /* An exception occurred when decompiling this method (0600B813) ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Int32 BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Engines.RC2Engine::ProcessBlock(System.Byte[],System.Int32,System.Byte[],System.Int32) ---> System.Exception: Basic block has to end with unconditional control flow. { IL_25: stloc:InvalidOperationException(var_1_2F, newobj:InvalidOperationException(InvalidOperationException::.ctor, ldstr:string("RC2 engine not initialised"))) } 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: 0x0600B814 RID: 47124 RVA: 0x0028DAF8 File Offset: 0x0028BCF8 [Token(Token = "0x600B814")] [Address(RVA = "0x1DD7A80", Offset = "0x1DD6880", VA = "0x181DD7A80")] private int RotateWordLeft(int x, int y) { uint num; num -= (uint)y; return x; } // Token: 0x0600B815 RID: 47125 RVA: 0x0028DB0C File Offset: 0x0028BD0C [Token(Token = "0x600B815")] [Address(RVA = "0x1DD6B60", Offset = "0x1DD5960", VA = "0x181DD6B60")] private void EncryptBlock(byte[] input, int inOff, byte[] outBytes, int outOff) { int length = input.Length; byte b; byte b2; b += b2; byte b3; b3 += b2; byte b4; b4 += b2; int num = inOff + 1; int[] array = this.workingKey; byte b5; byte b6; b5 += b6; int i = 0; int length2 = array.Length; b6 = b; int num2 = array[i]; num2 += (int)b6; b6 = b3; num2 += (int)b5; b6 = (byte)((int)b6 + num2); b5 = b6; b6 += b6; b6 = b5; int num3; num3 += (int)b6; b6 = b5; num3 += (int)b4; b6 = (byte)((int)b6 + num3); b4 = b6; b6 = b4; int num4; num4 += (int)b6; b6 = b5; num4 += (int)b3; b6 = (byte)((int)b6 + num4); b3 = b6; i += 3; int num5 = array[i]; b6 = b3; i += 4; num5 += (int)b6; b6 = b4; num5 += (int)b; b6 = (byte)((int)b6 + num5); b = b6; while (i <= 16) { } b6 = b; int num6 = array[(int)b6]; num6 += (int)b5; b4 = b3; b6 = b; uint num8; int num7 = array[(int)num8]; num7 += (int)b6; b6 = b3; num7 += num6; b6 = (byte)((int)b6 + num7); b5 = b6; b6 += b6; uint num9 = num8 + 1U; int num10 = array[(int)num9]; b6 = b5; num10 += (int)b6; b6 = b; num10 += (int)b4; b6 = (byte)((int)b6 + num10); b4 = b6; int num11 = array[(int)b6]; b6 = b4; num11 += (int)b6; b6 = b4; num11 += (int)b3; b6 = (byte)((int)b6 + num11); b3 = b6; num8 += (uint)3; int num12 = array[(int)num8]; b6 = b3; num8 += (uint)4; num12 += (int)b6; b6 = b4; num12 += (int)b; b6 = (byte)((int)b6 + num12); b = b6; b6 = b; while (num8 <= (uint)40) { } int num13 = array[(int)b6]; num13 += (int)b5; b4 = b3; b6 = b; uint num15; int num14 = array[(int)num15]; num14 += (int)b6; b6 = b3; num14 += num13; b6 = (byte)((int)b6 + num14); b5 = b6; b6 += b6; uint num16 = num15 + 1U; int num17 = array[(int)num16]; b6 = b5; num17 += (int)b6; b6 = b; num17 += (int)b4; b6 = (byte)((int)b6 + num17); b4 = b6; int num18 = array[(int)b6]; b6 = b4; num18 += (int)b6; b6 = b5; num18 += (int)b3; b6 = (byte)((int)b6 + num18); b3 = b6; num15 += (uint)3; int num19 = array[(int)num15]; b6 = b3; num15 += (uint)4; num19 += (int)b6; b6 = b4; num19 += (int)b; b6 = (byte)((int)b6 + num19); b = b6; } // Token: 0x0600B816 RID: 47126 RVA: 0x0028DDC0 File Offset: 0x0028BFC0 [Token(Token = "0x600B816")] [Address(RVA = "0x1DD6390", Offset = "0x1DD5190", VA = "0x181DD6390")] private void DecryptBlock(byte[] input, int inOff, byte[] outBytes, int outOff) { int length = input.Length; byte b; byte b2; b += b2; byte b3; b3 += b2; byte b4; b4 += b2; int num = inOff + 1; int[] array = this.workingKey; byte b5; byte b6; b5 += b6; int length2 = array.Length; b = b3; b6 = b3; b -= b6; b6 = b4; b -= b6; b3 = b; b = b4; b6 = b4; b3 -= b6; b6 = b4; b3 -= b6; uint num3; uint num2 = num3 + 1U; b4 = b; b4 -= b5; b5 = b; b4 -= b5; b5 = b; b5 -= b5; b5 = b3; b5 -= b5; while (num3 >= (uint)44) { } b5 = b3; b5 = b4; b5 = b; b = b3; b5 = b3; b -= b5; b5 = b4; b -= b5; b3 = b; b = b4; b5 = b4; b3 -= b5; b5 = b4; b3 -= b5; uint num5; uint num4 = num5 + 1U; b4 = b; b4 -= b5; b5 = b; b4 -= b5; b5 = b; b5 -= b5; b5 = b3; b5 -= b5; while (num5 >= (uint)20) { } b5 = b3; b5 = b4; b5 = b; b = b3; b5 = b3; b -= b5; b5 = b4; b -= b5; b3 = b; b = b4; b5 = b4; b3 -= b5; b3 -= b5; uint num7; uint num6 = num7 + 1U; b4 = b; b4 -= b5; b5 = b; b4 -= b5; b5 = b; b5 -= b5; b5 = b3; b5 -= b5; array[0] = (int)b5; } // Token: 0x0600B817 RID: 47127 RVA: 0x0028DF38 File Offset: 0x0028C138 [Token(Token = "0x600B817")] [Address(RVA = "0x3F5100", Offset = "0x3F3F00", VA = "0x1803F5100")] public RC2Engine() { this.Reset(); } // Token: 0x0600B818 RID: 47128 RVA: 0x0028DF4C File Offset: 0x0028C14C // Note: this type is marked as 'beforefieldinit'. [Token(Token = "0x600B818")] [Address(RVA = "0x1DD7AB0", Offset = "0x1DD68B0", VA = "0x181DD7AB0")] static RC2Engine() { byte[] array = new byte[256]; RuntimeHelpers.InitializeArray(array, fieldof(.0392525BCB01691D1F319D89F2C12BF93A478467).FieldHandle); RC2Engine.piTable = array; } // Token: 0x040074B8 RID: 29880 [Token(Token = "0x40074B8")] private static readonly byte[] piTable; // Token: 0x040074B9 RID: 29881 [Token(Token = "0x40074B9")] private const int BLOCK_SIZE = 8; // Token: 0x040074BA RID: 29882 [FieldOffset(Offset = "0x10")] [Token(Token = "0x40074BA")] private int[] workingKey; // Token: 0x040074BB RID: 29883 [FieldOffset(Offset = "0x18")] [Token(Token = "0x40074BB")] private bool encrypting; } }