scripts
This commit is contained in:
+260
@@ -0,0 +1,260 @@
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
using Cpp2IlInjected;
|
||||
|
||||
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Engines
|
||||
{
|
||||
// Token: 0x020016C1 RID: 5825
|
||||
[Token(Token = "0x20016C1")]
|
||||
[StructLayout(3)]
|
||||
public class RC532Engine : IBlockCipher
|
||||
{
|
||||
// Token: 0x06009C4F RID: 40015 RVA: 0x00237114 File Offset: 0x00235314
|
||||
[Token(Token = "0x6009C4F")]
|
||||
[Address(RVA = "0x212C840", Offset = "0x212B240", VA = "0x18212C840")]
|
||||
public RC532Engine()
|
||||
{
|
||||
this.Reset();
|
||||
this._noRounds = (int)((ulong)12L);
|
||||
}
|
||||
|
||||
// Token: 0x170018DE RID: 6366
|
||||
// (get) Token: 0x06009C50 RID: 40016 RVA: 0x00237134 File Offset: 0x00235334
|
||||
[Token(Token = "0x170018DE")]
|
||||
public virtual string AlgorithmName
|
||||
{
|
||||
[Token(Token = "0x6009C50")]
|
||||
[Address(RVA = "0x212C860", Offset = "0x212B260", VA = "0x18212C860", Slot = "10")]
|
||||
get
|
||||
{
|
||||
return "RC5-32";
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x170018DF RID: 6367
|
||||
// (get) Token: 0x06009C51 RID: 40017 RVA: 0x00237148 File Offset: 0x00235348
|
||||
[Token(Token = "0x170018DF")]
|
||||
public virtual bool IsPartialBlockOkay
|
||||
{
|
||||
[Token(Token = "0x6009C51")]
|
||||
[Address(RVA = "0x413970", Offset = "0x412370", VA = "0x180413970", Slot = "11")]
|
||||
get
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x06009C52 RID: 40018 RVA: 0x00237158 File Offset: 0x00235358
|
||||
[Token(Token = "0x6009C52")]
|
||||
[Address(RVA = "0x56E570", Offset = "0x56CF70", VA = "0x18056E570", Slot = "12")]
|
||||
public virtual int GetBlockSize()
|
||||
{
|
||||
return 8;
|
||||
}
|
||||
|
||||
// Token: 0x06009C53 RID: 40019 RVA: 0x00237168 File Offset: 0x00235368
|
||||
[Token(Token = "0x6009C53")]
|
||||
[Address(RVA = "0x212C220", Offset = "0x212AC20", VA = "0x18212C220", Slot = "13")]
|
||||
public virtual void Init(bool forEncryption, ICipherParameters parameters)
|
||||
{
|
||||
/*
|
||||
An exception occurred when decompiling this method (06009C53)
|
||||
|
||||
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Void BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Engines.RC532Engine::Init(System.Boolean,BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.ICipherParameters)
|
||||
|
||||
---> System.Exception: Basic block has to end with unconditional control flow.
|
||||
{
|
||||
IL_4A:
|
||||
stloc:ArgumentException(var_8_5B, newobj:ArgumentException(ArgumentException::.ctor, call:string(string::Concat, ldstr:string("invalid parameter passed to RC532 init - "), ldloc:string(var_7))))
|
||||
}
|
||||
|
||||
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: 0x06009C54 RID: 40020 RVA: 0x002371D4 File Offset: 0x002353D4
|
||||
[Token(Token = "0x6009C54")]
|
||||
[Address(RVA = "0x212C450", Offset = "0x212AE50", VA = "0x18212C450", Slot = "14")]
|
||||
public virtual int ProcessBlock(byte[] input, int inOff, byte[] output, int outOff)
|
||||
{
|
||||
if (this.forEncryption)
|
||||
{
|
||||
int num;
|
||||
return num;
|
||||
}
|
||||
int num2;
|
||||
return num2;
|
||||
}
|
||||
|
||||
// Token: 0x06009C55 RID: 40021 RVA: 0x0000220F File Offset: 0x0000040F
|
||||
[Token(Token = "0x6009C55")]
|
||||
[Address(RVA = "0x3C9F60", Offset = "0x3C8960", VA = "0x1803C9F60", Slot = "15")]
|
||||
public virtual void Reset()
|
||||
{
|
||||
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
|
||||
}
|
||||
|
||||
// Token: 0x06009C56 RID: 40022 RVA: 0x002371F0 File Offset: 0x002353F0
|
||||
[Token(Token = "0x6009C56")]
|
||||
[Address(RVA = "0x212C4C0", Offset = "0x212AEC0", VA = "0x18212C4C0")]
|
||||
private void SetKey(byte[] key)
|
||||
{
|
||||
int num = key.Length;
|
||||
num += 3;
|
||||
int[] array = new int[key];
|
||||
int num2 = 0;
|
||||
int length = key.Length;
|
||||
if (num2 != length)
|
||||
{
|
||||
num2 += key;
|
||||
num2 -= key;
|
||||
num2++;
|
||||
}
|
||||
int[] array2 = new int[this._noRounds];
|
||||
this._S = array2;
|
||||
int p = RC532Engine.P32;
|
||||
array2[0] = p;
|
||||
int[] s = this._S;
|
||||
uint num3;
|
||||
int[] s2;
|
||||
if (num3 < (uint)s.Length)
|
||||
{
|
||||
int length2 = s.Length;
|
||||
uint num4 = num3 - 1U;
|
||||
int num5 = s[(int)num4];
|
||||
int length3 = s.Length;
|
||||
num3 += (uint)1;
|
||||
int num6 = RC532Engine.Q32;
|
||||
num6 += num5;
|
||||
s[0] = num6;
|
||||
s2 = this._S;
|
||||
}
|
||||
int length4 = s2.Length;
|
||||
if (array.Length > length4)
|
||||
{
|
||||
}
|
||||
if (num3 > (uint)0)
|
||||
{
|
||||
s2[0] = 0;
|
||||
int num7 = array[num2];
|
||||
num7 += 0;
|
||||
num7 += num2;
|
||||
array[0] = num7;
|
||||
int[] s3 = this._S;
|
||||
num2++;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x06009C57 RID: 40023 RVA: 0x00237300 File Offset: 0x00235500
|
||||
[Token(Token = "0x6009C57")]
|
||||
[Address(RVA = "0x212BEB0", Offset = "0x212A8B0", VA = "0x18212BEB0")]
|
||||
private int EncryptBlock(byte[] input, int inOff, byte[] outBytes, int outOff)
|
||||
{
|
||||
int num = this.BytesToWord(input, inOff);
|
||||
int[] s = this._S;
|
||||
int length = s.Length;
|
||||
int num2 = s[0];
|
||||
num2 += num;
|
||||
int length2 = input.Length;
|
||||
byte b = input[input];
|
||||
num = inOff + 7;
|
||||
int noRounds = this._noRounds;
|
||||
uint num4;
|
||||
uint num3 = num4 + 1U;
|
||||
byte b2;
|
||||
b = b2;
|
||||
int num5 = s[(int)num3];
|
||||
num5 += (int)b;
|
||||
uint num6 = num3 + 1U;
|
||||
num4 += (uint)1;
|
||||
num3 += (uint)2;
|
||||
while (num4 <= (uint)noRounds)
|
||||
{
|
||||
}
|
||||
throw new NullReferenceException();
|
||||
}
|
||||
|
||||
// Token: 0x06009C58 RID: 40024 RVA: 0x0023738C File Offset: 0x0023558C
|
||||
[Token(Token = "0x6009C58")]
|
||||
[Address(RVA = "0x212BB50", Offset = "0x212A550", VA = "0x18212BB50")]
|
||||
private int DecryptBlock(byte[] input, int inOff, byte[] outBytes, int outOff)
|
||||
{
|
||||
int num = this.BytesToWord(input, inOff);
|
||||
int length = input.Length;
|
||||
num = inOff + 7;
|
||||
int i = this._noRounds;
|
||||
int length2 = this._S.Length;
|
||||
byte b2;
|
||||
byte b = b2 + 1;
|
||||
while (i >= 1)
|
||||
{
|
||||
}
|
||||
int[] s = this._S;
|
||||
byte b3;
|
||||
this._S[0] = (int)b3;
|
||||
throw new NullReferenceException();
|
||||
}
|
||||
|
||||
// Token: 0x06009C59 RID: 40025 RVA: 0x002373EC File Offset: 0x002355EC
|
||||
[Token(Token = "0x6009C59")]
|
||||
[Address(RVA = "0x212C480", Offset = "0x212AE80", VA = "0x18212C480")]
|
||||
private int RotateLeft(int x, int y)
|
||||
{
|
||||
return x;
|
||||
}
|
||||
|
||||
// Token: 0x06009C5A RID: 40026 RVA: 0x002373FC File Offset: 0x002355FC
|
||||
[Token(Token = "0x6009C5A")]
|
||||
[Address(RVA = "0x212C4A0", Offset = "0x212AEA0", VA = "0x18212C4A0")]
|
||||
private int RotateRight(int x, int y)
|
||||
{
|
||||
return x;
|
||||
}
|
||||
|
||||
// Token: 0x06009C5B RID: 40027 RVA: 0x0023740C File Offset: 0x0023560C
|
||||
[Token(Token = "0x6009C5B")]
|
||||
[Address(RVA = "0x1F5DF90", Offset = "0x1F5C990", VA = "0x181F5DF90")]
|
||||
private int BytesToWord(byte[] src, int srcOff)
|
||||
{
|
||||
int length = src.Length;
|
||||
int num = srcOff + 1;
|
||||
throw new NullReferenceException();
|
||||
}
|
||||
|
||||
// Token: 0x06009C5C RID: 40028 RVA: 0x0023742C File Offset: 0x0023562C
|
||||
[Token(Token = "0x6009C5C")]
|
||||
[Address(RVA = "0x1F5DEF0", Offset = "0x1F5C8F0", VA = "0x181F5DEF0")]
|
||||
private void WordToBytes(int word, byte[] dst, int dstOff)
|
||||
{
|
||||
int num = dstOff + 1;
|
||||
}
|
||||
|
||||
// Token: 0x04006687 RID: 26247
|
||||
[global::Cpp2IlInjected.FieldOffset(Offset = "0x10")]
|
||||
[Token(Token = "0x4006687")]
|
||||
private int _noRounds;
|
||||
|
||||
// Token: 0x04006688 RID: 26248
|
||||
[global::Cpp2IlInjected.FieldOffset(Offset = "0x18")]
|
||||
[Token(Token = "0x4006688")]
|
||||
private int[] _S;
|
||||
|
||||
// Token: 0x04006689 RID: 26249
|
||||
[Token(Token = "0x4006689")]
|
||||
private static readonly int P32;
|
||||
|
||||
// Token: 0x0400668A RID: 26250
|
||||
[Token(Token = "0x400668A")]
|
||||
private static readonly int Q32;
|
||||
|
||||
// Token: 0x0400668B RID: 26251
|
||||
[global::Cpp2IlInjected.FieldOffset(Offset = "0x20")]
|
||||
[Token(Token = "0x400668B")]
|
||||
private bool forEncryption;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user