This commit is contained in:
niko
2026-04-12 16:51:38 +02:00
parent 1b6f6d81d0
commit c12fbe3fc6
17828 changed files with 2994770 additions and 0 deletions
@@ -0,0 +1,435 @@
using System;
using System.Runtime.CompilerServices;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Engines
{
// Token: 0x02001D7B RID: 7547
[Token(Token = "0x2001D7B")]
public class RC2Engine : IBlockCipher
{
// Token: 0x0600BBDB RID: 48091 RVA: 0x00296A2C File Offset: 0x00294C2C
[Token(Token = "0x600BBDB")]
[Address(RVA = "0x272C9C0", Offset = "0x272B9C0", VA = "0x18272C9C0")]
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: 0x0600BBDC RID: 48092 RVA: 0x00296B1C File Offset: 0x00294D1C
[Token(Token = "0x600BBDC")]
[Address(RVA = "0x272CDA0", Offset = "0x272BDA0", VA = "0x18272CDA0", Slot = "10")]
public virtual void Init(bool forEncryption, ICipherParameters parameters)
{
/*
An exception occurred when decompiling this method (0600BBDC)
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: 0x0600BBDD RID: 48093 RVA: 0x0000220F File Offset: 0x0000040F
[Token(Token = "0x600BBDD")]
[Address(RVA = "0x4242D0", Offset = "0x4232D0", VA = "0x1804242D0", Slot = "11")]
public virtual void Reset()
{
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
}
// Token: 0x17001D78 RID: 7544
// (get) Token: 0x0600BBDE RID: 48094 RVA: 0x00296B94 File Offset: 0x00294D94
[Token(Token = "0x17001D78")]
public virtual string AlgorithmName
{
[Token(Token = "0x600BBDE")]
[Address(RVA = "0x272D160", Offset = "0x272C160", VA = "0x18272D160", Slot = "12")]
get
{
return "RC2";
}
}
// Token: 0x17001D79 RID: 7545
// (get) Token: 0x0600BBDF RID: 48095 RVA: 0x00296BA8 File Offset: 0x00294DA8
[Token(Token = "0x17001D79")]
public virtual bool IsPartialBlockOkay
{
[Token(Token = "0x600BBDF")]
[Address(RVA = "0x424690", Offset = "0x423690", VA = "0x180424690", Slot = "13")]
get
{
}
}
// Token: 0x0600BBE0 RID: 48096 RVA: 0x00296BB8 File Offset: 0x00294DB8
[Token(Token = "0x600BBE0")]
[Address(RVA = "0x681E00", Offset = "0x680E00", VA = "0x180681E00", Slot = "14")]
public virtual int GetBlockSize()
{
return 8;
}
// Token: 0x0600BBE1 RID: 48097 RVA: 0x00296BC8 File Offset: 0x00294DC8
[Token(Token = "0x600BBE1")]
[Address(RVA = "0x272CFD0", Offset = "0x272BFD0", VA = "0x18272CFD0", Slot = "15")]
public virtual int ProcessBlock(byte[] input, int inOff, byte[] output, int outOff)
{
/*
An exception occurred when decompiling this method (0600BBE1)
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: 0x0600BBE2 RID: 48098 RVA: 0x00296C04 File Offset: 0x00294E04
[Token(Token = "0x600BBE2")]
[Address(RVA = "0x272D0D0", Offset = "0x272C0D0", VA = "0x18272D0D0")]
private int RotateWordLeft(int x, int y)
{
uint num;
num -= (uint)y;
return x;
}
// Token: 0x0600BBE3 RID: 48099 RVA: 0x00296C18 File Offset: 0x00294E18
[Token(Token = "0x600BBE3")]
[Address(RVA = "0x272C1B0", Offset = "0x272B1B0", VA = "0x18272C1B0")]
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: 0x0600BBE4 RID: 48100 RVA: 0x00296ECC File Offset: 0x002950CC
[Token(Token = "0x600BBE4")]
[Address(RVA = "0x272B9E0", Offset = "0x272A9E0", VA = "0x18272B9E0")]
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: 0x0600BBE5 RID: 48101 RVA: 0x00297044 File Offset: 0x00295244
[Token(Token = "0x600BBE5")]
[Address(RVA = "0x412370", Offset = "0x411370", VA = "0x180412370")]
public RC2Engine()
{
this.Reset();
}
// Token: 0x0600BBE6 RID: 48102 RVA: 0x00297058 File Offset: 0x00295258
// Note: this type is marked as 'beforefieldinit'.
[Token(Token = "0x600BBE6")]
[Address(RVA = "0x272D100", Offset = "0x272C100", VA = "0x18272D100")]
static RC2Engine()
{
byte[] array = new byte[256];
RuntimeHelpers.InitializeArray(array, fieldof(<PrivateImplementationDetails>.0392525BCB01691D1F319D89F2C12BF93A478467).FieldHandle);
RC2Engine.piTable = array;
}
// Token: 0x04007671 RID: 30321
[Token(Token = "0x4007671")]
private static readonly byte[] piTable;
// Token: 0x04007672 RID: 30322
[Token(Token = "0x4007672")]
private const int BLOCK_SIZE = 8;
// Token: 0x04007673 RID: 30323
[FieldOffset(Offset = "0x10")]
[Token(Token = "0x4007673")]
private int[] workingKey;
// Token: 0x04007674 RID: 30324
[FieldOffset(Offset = "0x18")]
[Token(Token = "0x4007674")]
private bool encrypting;
}
}