-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathCCFileClass.cs
51 lines (42 loc) · 1.64 KB
/
CCFileClass.cs
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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
namespace PatcherYRpp
{
[StructLayout(LayoutKind.Explicit, Size = 108)]
public struct CCFileClass
{
public unsafe AnsiString GetFileName()
{
var func = (delegate* unmanaged[Thiscall]<ref CCFileClass, IntPtr>)this.GetVirtualFunctionPointer(1);
return func(ref this);
}
public unsafe bool Exists(bool writeShared = false)
{
var func = (delegate* unmanaged[Thiscall]<ref CCFileClass, Bool, Bool>)this.GetVirtualFunctionPointer(5);
return func(ref this, writeShared);
}
public static unsafe void Constructor(Pointer<CCFileClass> pThis, string fileName)
{
var func = (delegate* unmanaged[Thiscall]<ref CCFileClass, IntPtr, void>)0x4739F0;
func(ref pThis.Ref, new AnsiString(fileName));
}
public static unsafe void Destructor(Pointer<CCFileClass> pThis)
{
var func = (delegate* unmanaged[Thiscall]<ref CCFileClass, Bool, void>)Helpers.GetVirtualFunctionPointer(pThis, 0);
func(ref pThis.Ref, false);
}
public unsafe IntPtr ReadWholeFile()
{
var func = (delegate* unmanaged[Thiscall]<ref CCFileClass, IntPtr>)0x4A3890;
return func(ref this);
}
[FieldOffset(12)] public int FilePointer;
[FieldOffset(16)] public int FileSize;
[FieldOffset(24)] public AnsiStringPointer FileName;
[FieldOffset(32)] public Bool FileNameAllocated;
}
}