-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathGenericList.cs
More file actions
73 lines (61 loc) · 2.17 KB
/
Copy pathGenericList.cs
File metadata and controls
73 lines (61 loc) · 2.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
namespace PatcherYRpp
{
[StructLayout(LayoutKind.Sequential)]
public struct GenericNode
{
public static unsafe void Constructor(Pointer<GenericNode> pThis)
{
var func = (delegate* unmanaged[Thiscall]<ref GenericNode, void>)0x40E320;
func(ref pThis.Ref);
}
public static unsafe void Destructor(Pointer<GenericNode> pThis)
{
var func = (delegate* unmanaged[Thiscall]<ref GenericNode, void>)Helpers.GetVirtualFunctionPointer(pThis, 0);
func(ref pThis.Ref);
}
public IntPtr Vfptr;
public IntPtr next;
public Pointer<GenericNode> Next { get => next; set => next = value; }
public IntPtr previous;
public Pointer<GenericNode> Prev { get => previous; set => previous = value; }
}
[StructLayout(LayoutKind.Sequential)]
public struct GenericList
{
public static unsafe void Constructor(Pointer<GenericNode> pThis)
{
var func = (delegate* unmanaged[Thiscall]<ref GenericNode, void>)0x52ACE0;
func(ref pThis.Ref);
}
public static unsafe void Destructor(Pointer<GenericNode> pThis)
{
var func = (delegate* unmanaged[Thiscall]<ref GenericNode, void>)Helpers.GetVirtualFunctionPointer(pThis, 0);
func(ref pThis.Ref);
}
public IntPtr Vfptr;
public GenericNode FirstNode;
public Pointer<GenericNode> First => FirstNode.Next;
public GenericNode LastNode;
public Pointer<GenericNode> Last => LastNode.Prev;
};
[StructLayout(LayoutKind.Sequential)]
public struct YRNode<T>
{
public Pointer<T> Next => Base.Next.Cast<T>();
public Pointer<T> Prev => Base.Prev.Cast<T>();
public GenericNode Base;
}
[StructLayout(LayoutKind.Sequential)]
public struct YRList<T>
{
public Pointer<T> First => Base.First.Cast<T>();
public Pointer<T> Last => Base.Last.Cast<T>();
public GenericList Base;
}
}