Skip to content

Commit 82e6311

Browse files
committed
将版本号修改为double类型
1 parent e04f58c commit 82e6311

File tree

10 files changed

+70
-70
lines changed

10 files changed

+70
-70
lines changed

Il2CppDumper/Attributes/VersionAttribute.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ namespace Il2CppDumper
55
[AttributeUsage(AttributeTargets.Field, AllowMultiple = true)]
66
class VersionAttribute : Attribute
77
{
8-
public float Min { get; set; } = 0;
9-
public float Max { get; set; } = 99;
8+
public double Min { get; set; } = 0;
9+
public double Max { get; set; } = 99;
1010
}
1111
}

Il2CppDumper/Config.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ public class Config
1414
public bool DummyDllAddToken = true;
1515
public bool RequireAnyKey = true;
1616
public bool ForceIl2CppVersion = false;
17-
public float ForceVersion = 24.3f;
17+
public double ForceVersion = 24.3;
1818
}
1919
}

Il2CppDumper/ExecutableFormats/Elf.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ public override bool Search()
106106
uint codeRegistration = 0;
107107
uint metadataRegistration = 0;
108108
var result = (uint)resultList[0];
109-
if (Version < 24f)
109+
if (Version < 24)
110110
{
111111
if (elfHeader.e_machine == EM_ARM)
112112
{
@@ -118,7 +118,7 @@ public override bool Search()
118118
metadataRegistration = ReadUInt32();
119119
}
120120
}
121-
else if (Version >= 24f)
121+
else if (Version >= 24)
122122
{
123123
if (elfHeader.e_machine == EM_ARM)
124124
{

Il2CppDumper/IO/BinaryStream.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ namespace Il2CppDumper
99
{
1010
public class BinaryStream : IDisposable
1111
{
12-
public float Version;
12+
public double Version;
1313
public bool Is32Bit;
1414
private Stream stream;
1515
private BinaryReader reader;

Il2CppDumper/Il2Cpp/Il2Cpp.cs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public abstract class Il2Cpp : BinaryStream
3838

3939
protected Il2Cpp(Stream stream) : base(stream) { }
4040

41-
public void SetProperties(float version, long maxMetadataUsages)
41+
public void SetProperties(double version, long maxMetadataUsages)
4242
{
4343
Version = version;
4444
this.maxMetadataUsages = maxMetadataUsages;
@@ -48,12 +48,12 @@ protected bool AutoPlusInit(ulong codeRegistration, ulong metadataRegistration)
4848
{
4949
if (codeRegistration != 0 && metadataRegistration != 0)
5050
{
51-
if (Version == 24.2f)
51+
if (Version == 24.2)
5252
{
5353
pCodeRegistration = MapVATR<Il2CppCodeRegistration>(codeRegistration);
5454
if (pCodeRegistration.reversePInvokeWrapperCount > 0x30000) //TODO
5555
{
56-
Version = 24.4f;
56+
Version = 24.4;
5757
codeRegistration -= PointerSize * 3;
5858
Console.WriteLine($"Change il2cpp version to: {Version}");
5959
}
@@ -64,7 +64,7 @@ protected bool AutoPlusInit(ulong codeRegistration, ulong metadataRegistration)
6464
var genericMethodPointersCount = genericMethodTable.Max(x => x.indices.methodIndex) + 1;
6565
if (pCodeRegistration.reversePInvokeWrapperCount == genericMethodPointersCount)
6666
{
67-
Version = 24.3f;
67+
Version = 24.3;
6868
codeRegistration -= Is32Bit ? 8u : 16u;
6969
Console.WriteLine($"Change il2cpp version to: {Version}");
7070
}
@@ -83,22 +83,22 @@ protected bool AutoPlusInit(ulong codeRegistration, ulong metadataRegistration)
8383
public virtual void Init(ulong codeRegistration, ulong metadataRegistration)
8484
{
8585
pCodeRegistration = MapVATR<Il2CppCodeRegistration>(codeRegistration);
86-
if (Version == 27f)
86+
if (Version == 27)
8787
{
8888
if (pCodeRegistration.reversePInvokeWrapperCount > 0x30000) //TODO
8989
{
90-
Version = 27.1f;
90+
Version = 27.1;
9191
codeRegistration -= PointerSize;
9292
Console.WriteLine($"Change il2cpp version to: {Version}");
9393
Console.WriteLine("CodeRegistration : {0:x}", codeRegistration);
9494
pCodeRegistration = MapVATR<Il2CppCodeRegistration>(codeRegistration);
9595
}
9696
}
97-
if (Version == 24.2f)
97+
if (Version == 24.2)
9898
{
9999
if (pCodeRegistration.reversePInvokeWrapperCount > 0x30000) //TODO
100100
{
101-
Version = 24.4f;
101+
Version = 24.4;
102102
codeRegistration -= PointerSize * 3;
103103
Console.WriteLine($"Change il2cpp version to: {Version}");
104104
Console.WriteLine("CodeRegistration : {0:x}", codeRegistration);
@@ -108,7 +108,7 @@ public virtual void Init(ulong codeRegistration, ulong metadataRegistration)
108108
{
109109
if (pCodeRegistration.codeGenModules == 0) //TODO
110110
{
111-
Version = 24.3f;
111+
Version = 24.3;
112112
Console.WriteLine($"Change il2cpp version to: {Version}");
113113
pCodeRegistration = MapVATR<Il2CppCodeRegistration>(codeRegistration);
114114
}
@@ -156,7 +156,7 @@ public virtual void Init(ulong codeRegistration, ulong metadataRegistration)
156156
types[i].Init();
157157
typeDic.Add(pTypes[i], types[i]);
158158
}
159-
if (Version >= 24.2f)
159+
if (Version >= 24.2)
160160
{
161161
var pCodeGenModules = MapVATR<ulong>(pCodeRegistration.codeGenModules, pCodeRegistration.codeGenModulesCount);
162162
codeGenModules = new Dictionary<string, Il2CppCodeGenModule>(pCodeGenModules.Length, StringComparer.Ordinal);
@@ -270,7 +270,7 @@ public Il2CppType GetIl2CppType(ulong pointer)
270270

271271
public ulong GetMethodPointer(string imageName, Il2CppMethodDefinition methodDef)
272272
{
273-
if (Version >= 24.2f)
273+
if (Version >= 24.2)
274274
{
275275
var methodToken = methodDef.token;
276276
var ptrs = codeGenModuleMethodPointers[imageName];

Il2CppDumper/Il2Cpp/Il2CppClass.cs

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ namespace Il2CppDumper
44
{
55
public class Il2CppCodeRegistration
66
{
7-
[Version(Max = 24.1f)]
7+
[Version(Max = 24.1)]
88
public long methodPointersCount;
9-
[Version(Max = 24.1f)]
9+
[Version(Max = 24.1)]
1010
public ulong methodPointers;
1111
[Version(Max = 21)]
1212
public ulong delegateWrappersFromNativeToManagedCount;
@@ -30,14 +30,14 @@ public class Il2CppCodeRegistration
3030
public ulong ccwMarshalingFunctions;
3131
public long genericMethodPointersCount;
3232
public ulong genericMethodPointers;
33-
[Version(Min = 24.4f, Max = 24.4f )]
34-
[Version(Min = 27.1f)]
33+
[Version(Min = 24.4, Max = 24.4)]
34+
[Version(Min = 27.1)]
3535
public ulong genericAdjustorThunks;
3636
public long invokerPointersCount;
3737
public ulong invokerPointers;
38-
[Version(Max = 24.4f)]
38+
[Version(Max = 24.4)]
3939
public long customAttributeCount;
40-
[Version(Max = 24.4f)]
40+
[Version(Max = 24.4)]
4141
public ulong customAttributeGenerators;
4242
[Version(Min = 21, Max = 22)]
4343
public long guidCount;
@@ -51,13 +51,13 @@ public class Il2CppCodeRegistration
5151
public ulong interopDataCount;
5252
[Version(Min = 23)]
5353
public ulong interopData;
54-
[Version(Min = 24.3f)]
54+
[Version(Min = 24.3)]
5555
public ulong windowsRuntimeFactoryCount;
56-
[Version(Min = 24.3f)]
56+
[Version(Min = 24.3)]
5757
public ulong windowsRuntimeFactoryTable;
58-
[Version(Min = 24.2f)]
58+
[Version(Min = 24.2)]
5959
public long codeGenModulesCount;
60-
[Version(Min = 24.2f)]
60+
[Version(Min = 24.2)]
6161
public ulong codeGenModules;
6262
}
6363

@@ -188,7 +188,7 @@ public class Union
188188

189189
public class Il2CppGenericClass
190190
{
191-
[Version(Max = 24.4f)]
191+
[Version(Max = 24.4)]
192192
public long typeDefinitionIndex; /* the generic type definition */
193193
[Version(Min = 27)]
194194
public ulong type; /* the generic type definition */
@@ -230,8 +230,8 @@ public class Il2CppGenericMethodIndices
230230
{
231231
public int methodIndex;
232232
public int invokerIndex;
233-
[Version(Min = 24.4f, Max = 24.4f)]
234-
[Version(Min = 27.1f)]
233+
[Version(Min = 24.4, Max = 24.4)]
234+
[Version(Min = 27.1)]
235235
public int adjustorThunk;
236236
};
237237

@@ -247,11 +247,11 @@ public class Il2CppCodeGenModule
247247
public ulong moduleName;
248248
public long methodPointerCount;
249249
public ulong methodPointers;
250-
[Version(Min = 24.4f, Max = 24.4f)]
251-
[Version(Min = 27.1f)]
250+
[Version(Min = 24.4, Max = 24.4)]
251+
[Version(Min = 27.1)]
252252
public long adjustorThunkCount;
253-
[Version(Min = 24.4f, Max = 24.4f)]
254-
[Version(Min = 27.1f)]
253+
[Version(Min = 24.4, Max = 24.4)]
254+
[Version(Min = 27.1)]
255255
public ulong adjustorThunks;
256256
public ulong invokerIndices;
257257
public ulong reversePInvokeWrapperCount;

Il2CppDumper/Il2Cpp/Metadata.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,15 +56,15 @@ public Metadata(Stream stream) : base(stream)
5656
{
5757
if (header.stringLiteralOffset == 264)
5858
{
59-
Version = 24.2f;
59+
Version = 24.2;
6060
header = ReadClass<Il2CppGlobalMetadataHeader>(0);
6161
}
6262
else
6363
{
6464
imageDefs = ReadMetadataClassArray<Il2CppImageDefinition>(header.imagesOffset, header.imagesCount);
6565
if (imageDefs.Any(x => x.token != 1))
6666
{
67-
Version = 24.1f;
67+
Version = 24.1;
6868
}
6969
}
7070
}
@@ -114,7 +114,7 @@ public Metadata(Stream stream) : base(stream)
114114
}
115115
}
116116
}
117-
if (Version <= 24.1f)
117+
if (Version <= 24.1)
118118
{
119119
rgctxEntries = ReadMetadataClassArray<Il2CppRGCTXDefinition>(header.rgctxEntriesOffset, header.rgctxEntriesCount);
120120
}

Il2CppDumper/Il2Cpp/MetadataClass.cs

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -46,21 +46,21 @@ public class Il2CppGlobalMetadataHeader
4646
public int interfaceOffsetsCount;
4747
public uint typeDefinitionsOffset; // Il2CppTypeDefinition
4848
public int typeDefinitionsCount;
49-
[Version(Max = 24.1f)]
49+
[Version(Max = 24.1)]
5050
public uint rgctxEntriesOffset; // Il2CppRGCTXDefinition
51-
[Version(Max = 24.1f)]
51+
[Version(Max = 24.1)]
5252
public int rgctxEntriesCount;
5353
public uint imagesOffset; // Il2CppImageDefinition
5454
public int imagesCount;
5555
public int assembliesOffset; // Il2CppAssemblyDefinition
5656
public int assembliesCount;
57-
[Version(Min = 19, Max = 24.4f)]
57+
[Version(Min = 19, Max = 24.4)]
5858
public uint metadataUsageListsOffset; // Il2CppMetadataUsageList
59-
[Version(Min = 19, Max = 24.4f)]
59+
[Version(Min = 19, Max = 24.4)]
6060
public int metadataUsageListsCount;
61-
[Version(Min = 19, Max = 24.4f)]
61+
[Version(Min = 19, Max = 24.4)]
6262
public uint metadataUsagePairsOffset; // Il2CppMetadataUsagePair
63-
[Version(Min = 19, Max = 24.4f)]
63+
[Version(Min = 19, Max = 24.4)]
6464
public int metadataUsagePairsCount;
6565
[Version(Min = 19)]
6666
public uint fieldRefsOffset; // Il2CppFieldRef
@@ -117,9 +117,9 @@ public class Il2CppImageDefinition
117117
[Version(Min = 19)]
118118
public uint token;
119119

120-
[Version(Min = 24.1f)]
120+
[Version(Min = 24.1)]
121121
public int customAttributeStart;
122-
[Version(Min = 24.1f)]
122+
[Version(Min = 24.1)]
123123
public uint customAttributeCount;
124124
}
125125

@@ -130,16 +130,16 @@ public class Il2CppTypeDefinition
130130
[Version(Max = 24)]
131131
public int customAttributeIndex;
132132
public int byvalTypeIndex;
133-
[Version(Max = 24.4f)]
133+
[Version(Max = 24.4)]
134134
public int byrefTypeIndex;
135135

136136
public int declaringTypeIndex;
137137
public int parentIndex;
138138
public int elementTypeIndex; // we can probably remove this one. Only used for enums
139139

140-
[Version(Max = 24.1f)]
140+
[Version(Max = 24.1)]
141141
public int rgctxStartIndex;
142-
[Version(Max = 24.1f)]
142+
[Version(Max = 24.1)]
143143
public int rgctxCount;
144144

145145
public int genericContainerIndex;
@@ -201,15 +201,15 @@ public class Il2CppMethodDefinition
201201
[Version(Max = 24)]
202202
public int customAttributeIndex;
203203
public int genericContainerIndex;
204-
[Version(Max = 24.1f)]
204+
[Version(Max = 24.1)]
205205
public int methodIndex;
206-
[Version(Max = 24.1f)]
206+
[Version(Max = 24.1)]
207207
public int invokerIndex;
208-
[Version(Max = 24.1f)]
208+
[Version(Max = 24.1)]
209209
public int delegateWrapperIndex;
210-
[Version(Max = 24.1f)]
210+
[Version(Max = 24.1)]
211211
public int rgctxStartIndex;
212-
[Version(Max = 24.1f)]
212+
[Version(Max = 24.1)]
213213
public int rgctxCount;
214214
public uint token;
215215
public ushort flags;
@@ -258,7 +258,7 @@ public class Il2CppPropertyDefinition
258258

259259
public class Il2CppCustomAttributeTypeRange
260260
{
261-
[Version(Min = 24.1f)]
261+
[Version(Min = 24.1)]
262262
public uint token;
263263
public int start;
264264
public int count;

0 commit comments

Comments
 (0)