This commit is contained in:
niko
2026-04-08 23:40:05 +02:00
parent d6894bcbc7
commit 18dc73f922
7750 changed files with 1795369 additions and 0 deletions
@@ -0,0 +1,268 @@
using System;
using System.Runtime.InteropServices;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Utilities;
using Cpp2IlInjected;
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Engines
{
// Token: 0x020016B7 RID: 5815
[Token(Token = "0x20016B7")]
[StructLayout(3)]
public class HC256Engine : IStreamCipher
{
// Token: 0x06009BE5 RID: 39909 RVA: 0x00234210 File Offset: 0x00232410
[Token(Token = "0x6009BE5")]
[Address(RVA = "0x2122530", Offset = "0x2120F30", VA = "0x182122530")]
private uint Step()
{
uint num = this.cnt;
uint[] array = this.q;
int length = array.Length;
uint num2 = array[this];
uint num3 = num + 1U;
uint num4 = array[(int)num3];
uint[] array2 = this.p;
uint num5 = array[(int)num3];
num3 = num4;
num3 += num5;
uint[] array3 = this.q;
int length2 = array3.Length;
uint[] array4 = this.p;
int length3 = array4.Length;
num4 = num2;
num4 += (uint)256;
uint num6 = array4[(int)num4];
num4 = num2;
num4 += (uint)512;
num2 += (uint)768;
uint num7 = array4[(int)num2];
uint num8 = num + 1U;
uint[] array5 = this.q;
array3 += num6;
uint[] array6 = this.p;
int length4 = array6.Length;
uint[] array7 = this.q;
uint num9 = array6[(int)num2];
int length5 = array7.Length;
uint num10 = array7[(int)num9];
num2 = num9;
num9 = num2;
num9 += (uint)256;
uint num11 = array7[(int)num9];
num2 = num9;
num9 = num2;
num9 += (uint)512;
num2 = num9;
num2 += (uint)768;
num2 += num11;
num2 += num10;
uint num12 = this.cnt;
num12 += (uint)1;
this.cnt = num12;
return num2;
}
// Token: 0x06009BE6 RID: 39910 RVA: 0x00234370 File Offset: 0x00232570
[Token(Token = "0x6009BE6")]
[Address(RVA = "0x2121B40", Offset = "0x2120540", VA = "0x182121B40")]
private void Init()
{
/*
An exception occurred when decompiling this method (06009BE6)
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Void BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Engines.HC256Engine::Init()
---> System.Exception: Basic block has to end with unconditional control flow.
{
IL_1AF:
stloc:ArgumentException(var_38_1B9, newobj:ArgumentException(ArgumentException::.ctor, ldstr:string("The key must be 128/256 bits long")))
}
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: 0x170018D0 RID: 6352
// (get) Token: 0x06009BE7 RID: 39911 RVA: 0x00234538 File Offset: 0x00232738
[Token(Token = "0x170018D0")]
public virtual string AlgorithmName
{
[Token(Token = "0x6009BE7")]
[Address(RVA = "0x2122AB0", Offset = "0x21214B0", VA = "0x182122AB0", Slot = "9")]
get
{
return "HC-256";
}
}
// Token: 0x06009BE8 RID: 39912 RVA: 0x0023454C File Offset: 0x0023274C
[Token(Token = "0x6009BE8")]
[Address(RVA = "0x2121FA0", Offset = "0x21209A0", VA = "0x182121FA0", Slot = "10")]
public virtual void Init(bool forEncryption, ICipherParameters parameters)
{
/*
An exception occurred when decompiling this method (06009BE8)
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Void BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Engines.HC256Engine::Init(System.Boolean,BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.ICipherParameters)
---> System.Exception: Basic block has to end with unconditional control flow.
{
IL_7B:
stloc:ArgumentException(var_12_91, newobj:ArgumentException(ArgumentException::.ctor, call:string(string::Concat, ldstr:string("Invalid parameter passed to HC256 init - "), ldloc:string(var_11)), ldstr:string("parameters")))
}
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: 0x06009BE9 RID: 39913 RVA: 0x002345EC File Offset: 0x002327EC
[Token(Token = "0x6009BE9")]
[Address(RVA = "0x2121AD0", Offset = "0x21204D0", VA = "0x182121AD0")]
private byte GetByte()
{
if (this.idx == 0)
{
uint num = this.Step();
byte[] array = this.buf;
Pack.UInt32_To_LE(num, array);
}
byte[] array2 = this.buf;
int num2 = this.idx + 1;
this.idx = num2;
byte b;
return b;
}
// Token: 0x06009BEA RID: 39914 RVA: 0x00234638 File Offset: 0x00232838
[Token(Token = "0x6009BEA")]
[Address(RVA = "0x21222C0", Offset = "0x2120CC0", VA = "0x1821222C0", Slot = "11")]
public virtual void ProcessBytes(byte[] input, int inOff, int len, byte[] output, int outOff)
{
/*
An exception occurred when decompiling this method (06009BEA)
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Void BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Engines.HC256Engine::ProcessBytes(System.Byte[],System.Int32,System.Int32,System.Byte[],System.Int32)
---> System.Exception: Basic block has to end with unconditional control flow.
{
IL_54:
stloc:InvalidOperationException(var_7_5B, newobj:InvalidOperationException(InvalidOperationException::.ctor, ldloc:string(var_6)))
}
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: 0x06009BEB RID: 39915 RVA: 0x002346A4 File Offset: 0x002328A4
[Token(Token = "0x6009BEB")]
[Address(RVA = "0x21224A0", Offset = "0x2120EA0", VA = "0x1821224A0", Slot = "12")]
public virtual void Reset()
{
this.Init();
}
// Token: 0x06009BEC RID: 39916 RVA: 0x002346B8 File Offset: 0x002328B8
[Token(Token = "0x6009BEC")]
[Address(RVA = "0x21224B0", Offset = "0x2120EB0", VA = "0x1821224B0", Slot = "13")]
public virtual byte ReturnByte(byte input)
{
if (this.idx == 0)
{
uint num = this.Step();
byte[] array = this.buf;
Pack.UInt32_To_LE(num, array);
}
byte[] array2 = this.buf;
int num2 = this.idx + 1;
this.idx = num2;
byte b;
return b;
}
// Token: 0x06009BED RID: 39917 RVA: 0x00234704 File Offset: 0x00232904
[Token(Token = "0x6009BED")]
[Address(RVA = "0x7051F0", Offset = "0x703BF0", VA = "0x1807051F0")]
private static uint RotateRight(uint x, int bits)
{
return x;
}
// Token: 0x06009BEE RID: 39918 RVA: 0x00234714 File Offset: 0x00232914
[Token(Token = "0x6009BEE")]
[Address(RVA = "0x2122A30", Offset = "0x2121430", VA = "0x182122A30")]
public HC256Engine()
{
uint[] array = new uint[1024];
this.p = array;
uint[] array2 = new uint[1024];
this.q = array2;
byte[] array3 = new byte[4];
this.buf = array3;
base..ctor();
}
// Token: 0x04006648 RID: 26184
[global::Cpp2IlInjected.FieldOffset(Offset = "0x10")]
[Token(Token = "0x4006648")]
private uint[] p;
// Token: 0x04006649 RID: 26185
[global::Cpp2IlInjected.FieldOffset(Offset = "0x18")]
[Token(Token = "0x4006649")]
private uint[] q;
// Token: 0x0400664A RID: 26186
[global::Cpp2IlInjected.FieldOffset(Offset = "0x20")]
[Token(Token = "0x400664A")]
private uint cnt;
// Token: 0x0400664B RID: 26187
[global::Cpp2IlInjected.FieldOffset(Offset = "0x28")]
[Token(Token = "0x400664B")]
private byte[] key;
// Token: 0x0400664C RID: 26188
[global::Cpp2IlInjected.FieldOffset(Offset = "0x30")]
[Token(Token = "0x400664C")]
private byte[] iv;
// Token: 0x0400664D RID: 26189
[global::Cpp2IlInjected.FieldOffset(Offset = "0x38")]
[Token(Token = "0x400664D")]
private bool initialised;
// Token: 0x0400664E RID: 26190
[global::Cpp2IlInjected.FieldOffset(Offset = "0x40")]
[Token(Token = "0x400664E")]
private byte[] buf;
// Token: 0x0400664F RID: 26191
[global::Cpp2IlInjected.FieldOffset(Offset = "0x48")]
[Token(Token = "0x400664F")]
private int idx;
}
}