106 lines
5.1 KiB
C#
106 lines
5.1 KiB
C#
using System;
|
|
using System.IO;
|
|
using System.Runtime.InteropServices;
|
|
using Cpp2IlInjected;
|
|
|
|
namespace BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls
|
|
{
|
|
// Token: 0x0200155E RID: 5470
|
|
[Token(Token = "0x200155E")]
|
|
[StructLayout(3)]
|
|
public class HeartbeatMessage
|
|
{
|
|
// Token: 0x06009175 RID: 37237 RVA: 0x00204678 File Offset: 0x00202878
|
|
[Token(Token = "0x6009175")]
|
|
[Address(RVA = "0x1E88630", Offset = "0x1E87030", VA = "0x181E88630")]
|
|
public HeartbeatMessage(byte type, byte[] payload, int paddingLength)
|
|
{
|
|
do
|
|
{
|
|
base..ctor();
|
|
}
|
|
while (payload == 0 || payload.Length >= 65536);
|
|
this.mType = type;
|
|
this.mPaddingLength = paddingLength;
|
|
this.mPayload = payload;
|
|
}
|
|
|
|
// Token: 0x06009176 RID: 37238 RVA: 0x002046C4 File Offset: 0x002028C4
|
|
[Token(Token = "0x6009176")]
|
|
[Address(RVA = "0x1E881C0", Offset = "0x1E86BC0", VA = "0x181E881C0", Slot = "4")]
|
|
public virtual void Encode(TlsContext context, Stream output)
|
|
{
|
|
TlsUtilities.WriteUint8(this.mType, output);
|
|
TlsUtilities.CheckUint16(this.mPayload.Length);
|
|
TlsUtilities.WriteUint16(this.mPayload.Length, output);
|
|
byte[] array = this.mPayload;
|
|
int num = output.ReadByte();
|
|
byte[] array2 = new byte[this.mPaddingLength];
|
|
int num2 = output.ReadByte();
|
|
}
|
|
|
|
// Token: 0x06009177 RID: 37239 RVA: 0x00204728 File Offset: 0x00202928
|
|
[Token(Token = "0x6009177")]
|
|
[Address(RVA = "0x1E88320", Offset = "0x1E86D20", VA = "0x181E88320")]
|
|
public static HeartbeatMessage Parse(Stream input)
|
|
{
|
|
/*
|
|
An exception occurred when decompiling this method (06009177)
|
|
|
|
ICSharpCode.Decompiler.DecompilerException: Error decompiling BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls.HeartbeatMessage BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls.HeartbeatMessage::Parse(System.IO.Stream)
|
|
|
|
---> System.Exception: Basic block has to end with unconditional control flow.
|
|
{
|
|
IL_69:
|
|
stloc:TlsFatalAlert(var_7_70, newobj:TlsFatalAlert(TlsFatalAlert::.ctor, ldloc:uint64[exp:uint8](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: 0x040060DA RID: 24794
|
|
[global::Cpp2IlInjected.FieldOffset(Offset = "0x10")]
|
|
[Token(Token = "0x40060DA")]
|
|
protected readonly byte mType;
|
|
|
|
// Token: 0x040060DB RID: 24795
|
|
[global::Cpp2IlInjected.FieldOffset(Offset = "0x18")]
|
|
[Token(Token = "0x40060DB")]
|
|
protected readonly byte[] mPayload;
|
|
|
|
// Token: 0x040060DC RID: 24796
|
|
[global::Cpp2IlInjected.FieldOffset(Offset = "0x20")]
|
|
[Token(Token = "0x40060DC")]
|
|
protected readonly int mPaddingLength;
|
|
|
|
// Token: 0x0200155F RID: 5471
|
|
[Token(Token = "0x200155F")]
|
|
internal class PayloadBuffer : MemoryStream
|
|
{
|
|
// Token: 0x06009178 RID: 37240 RVA: 0x002047A8 File Offset: 0x002029A8
|
|
[Token(Token = "0x6009178")]
|
|
[Address(RVA = "0x1E88ED0", Offset = "0x1E878D0", VA = "0x181E88ED0")]
|
|
internal byte[] ToTruncatedByteArray(int payloadLength)
|
|
{
|
|
bool canWrite = this.CanWrite;
|
|
byte[] array;
|
|
return array;
|
|
}
|
|
|
|
// Token: 0x06009179 RID: 37241 RVA: 0x002047C0 File Offset: 0x002029C0
|
|
[Token(Token = "0x6009179")]
|
|
[Address(RVA = "0x1E39980", Offset = "0x1E38380", VA = "0x181E39980")]
|
|
public PayloadBuffer()
|
|
{
|
|
}
|
|
}
|
|
}
|
|
}
|