Files
niko c12fbe3fc6 m
2026-04-12 16:51:38 +02:00

246 lines
12 KiB
C#

using System;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using System.Text;
using Cpp2IlInjected;
using Microsoft.Win32.SafeHandles;
namespace Steamworks
{
// Token: 0x020017AF RID: 6063
[Token(Token = "0x20017AF")]
public class InteropHelp
{
// Token: 0x06008B2D RID: 35629 RVA: 0x0000220F File Offset: 0x0000040F
[Token(Token = "0x6008B2D")]
[Address(RVA = "0x4242D0", Offset = "0x4232D0", VA = "0x1804242D0")]
public static void TestIfPlatformSupported()
{
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
}
// Token: 0x06008B2E RID: 35630 RVA: 0x001D6770 File Offset: 0x001D4970
[Token(Token = "0x6008B2E")]
[Address(RVA = "0x9504D0", Offset = "0x94F4D0", VA = "0x1809504D0")]
public static void TestIfAvailableClient()
{
/*
An exception occurred when decompiling this method (06008B2E)
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Void Steamworks.InteropHelp::TestIfAvailableClient()
---> System.Exception: Basic block has to end with unconditional control flow.
{
IL_1B:
stloc:InvalidOperationException(var_2_25, newobj:InvalidOperationException(InvalidOperationException::.ctor, ldstr:string("Steamworks is not initialized.")))
}
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: 0x06008B2F RID: 35631 RVA: 0x001D67A4 File Offset: 0x001D49A4
[Token(Token = "0x6008B2F")]
[Address(RVA = "0x950580", Offset = "0x94F580", VA = "0x180950580")]
public static void TestIfAvailableGameServer()
{
/*
An exception occurred when decompiling this method (06008B2F)
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Void Steamworks.InteropHelp::TestIfAvailableGameServer()
---> System.Exception: Basic block has to end with unconditional control flow.
{
IL_1B:
stloc:InvalidOperationException(var_2_25, newobj:InvalidOperationException(InvalidOperationException::.ctor, ldstr:string("Steamworks GameServer is not initialized.")))
}
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: 0x06008B30 RID: 35632 RVA: 0x001D67D8 File Offset: 0x001D49D8
[Token(Token = "0x6008B30")]
[Address(RVA = "0x9503A0", Offset = "0x94F3A0", VA = "0x1809503A0")]
public static string PtrToStringUTF8(IntPtr nativeUtf8)
{
int num = 0;
if (!nativeUtf8.Equals(num))
{
int num2 = 0;
byte b = Marshal.ReadByte(nativeUtf8, num2);
num2++;
if (num2 != 0)
{
byte[] array = new byte[num2];
int length = array.Length;
int num3 = 0;
Marshal.Copy(nativeUtf8, array, num3, length);
Encoding utf = Encoding.UTF8;
}
return string.Empty;
}
throw new NullReferenceException();
}
// Token: 0x06008B31 RID: 35633 RVA: 0x001D6838 File Offset: 0x001D4A38
[Token(Token = "0x6008B31")]
[Address(RVA = "0x412370", Offset = "0x411370", VA = "0x180412370")]
public InteropHelp()
{
}
// Token: 0x020017B0 RID: 6064
[Token(Token = "0x20017B0")]
public class UTF8StringHandle : SafeHandleZeroOrMinusOneIsInvalid
{
// Token: 0x06008B32 RID: 35634 RVA: 0x001D684C File Offset: 0x001D4A4C
[Token(Token = "0x6008B32")]
[Address(RVA = "0x974950", Offset = "0x973950", VA = "0x180974950")]
public UTF8StringHandle(string str)
: base(true)
{
if (str != 0)
{
object obj = Encoding.UTF8.Clone();
byte[] array = new byte[str];
byte[] bytes = Encoding.UTF8.GetBytes(str);
IntPtr intPtr = Marshal.AllocHGlobal(array.Length);
int length = array.Length;
int num = 0;
Marshal.Copy(array, num, intPtr, length);
this.handle = intPtr;
return;
}
this.handle = (IntPtr)((ulong)0L);
}
// Token: 0x06008B33 RID: 35635 RVA: 0x001D68C4 File Offset: 0x001D4AC4
[Token(Token = "0x6008B33")]
[Address(RVA = "0x9748E0", Offset = "0x9738E0", VA = "0x1809748E0", Slot = "7")]
protected override bool ReleaseHandle()
{
this.Dispose();
Marshal.FreeHGlobal(this.handle);
return true;
}
}
// Token: 0x020017B1 RID: 6065
[Token(Token = "0x20017B1")]
public class SteamParamStringArray
{
// Token: 0x06008B34 RID: 35636 RVA: 0x001D68E4 File Offset: 0x001D4AE4
[Token(Token = "0x6008B34")]
[Address(RVA = "0x974570", Offset = "0x973570", VA = "0x180974570")]
public SteamParamStringArray(IList<string> strings)
{
if (strings != 0)
{
IntPtr[] array = new IntPtr[0];
int num = 0;
this.m_Strings = array;
if (num < array)
{
Encoding utf = Encoding.UTF8;
object obj = utf.Clone();
byte[] array2 = new byte[utf];
Encoding utf2 = Encoding.UTF8;
IntPtr[] strings2 = this.m_Strings;
IntPtr intPtr = Marshal.AllocHGlobal(array2.Length);
strings2[0] = intPtr;
IntPtr intPtr2 = this.m_Strings[num];
int num2 = 0;
int length = array2.Length;
Marshal.Copy(array2, num2, intPtr2, length);
num++;
}
int num3 = Marshal.SizeOf(typeof(IntPtr));
IntPtr intPtr3 = Marshal.AllocHGlobal(this.m_Strings.Length * num3);
IntPtr[] strings3 = this.m_Strings;
this.m_ptrStrings = intPtr3;
int length2 = strings3.Length;
int num4 = 0;
Marshal.Copy(strings3, num4, intPtr3, length2);
IntPtr intPtr4 = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(SteamParamStringArray_t)));
this.m_pSteamParamStringArray = intPtr4;
return;
}
int num5 = 0;
this.m_pSteamParamStringArray = (IntPtr)num5;
}
// Token: 0x06008B35 RID: 35637 RVA: 0x001D6A00 File Offset: 0x001D4C00
[Token(Token = "0x6008B35")]
[Address(RVA = "0x9743F0", Offset = "0x9733F0", VA = "0x1809743F0", Slot = "1")]
protected override void Finalize()
{
int num;
do
{
num = 0;
IntPtr[] strings = this.m_Strings;
if (num < strings.Length)
{
Marshal.FreeHGlobal(strings[num]);
num++;
}
int num2 = 0;
if (this.m_ptrStrings != (IntPtr)num2)
{
Marshal.FreeHGlobal(this.m_ptrStrings);
}
int num3 = 0;
if (this.m_pSteamParamStringArray != (IntPtr)num3)
{
Marshal.FreeHGlobal(this.m_pSteamParamStringArray);
}
base..ctor();
}
while (num != 0);
}
// Token: 0x06008B36 RID: 35638 RVA: 0x001D6A80 File Offset: 0x001D4C80
[Token(Token = "0x6008B36")]
[Address(RVA = "0x9748C0", Offset = "0x9738C0", VA = "0x1809748C0")]
public static implicit operator IntPtr(InteropHelp.SteamParamStringArray that)
{
return that.m_pSteamParamStringArray;
}
// Token: 0x04005B2E RID: 23342
[global::Cpp2IlInjected.FieldOffset(Offset = "0x10")]
[Token(Token = "0x4005B2E")]
private IntPtr[] m_Strings;
// Token: 0x04005B2F RID: 23343
[global::Cpp2IlInjected.FieldOffset(Offset = "0x18")]
[Token(Token = "0x4005B2F")]
private IntPtr m_ptrStrings;
// Token: 0x04005B30 RID: 23344
[global::Cpp2IlInjected.FieldOffset(Offset = "0x20")]
[Token(Token = "0x4005B30")]
private IntPtr m_pSteamParamStringArray;
}
}
}