-
Notifications
You must be signed in to change notification settings - Fork 18
Unity 2022.3.10 offsets and/or changes #20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -81,16 +81,16 @@ private ConcurrentDictionary<IntPtr, TypeDefinition> CreateTypeDefinitions() | |
| { | ||
| var definitions = new ConcurrentDictionary<IntPtr, TypeDefinition>(); | ||
| int classCache = this.Process.MonoLibraryOffsets.ImageClassCache; | ||
| var classCacheSize = this.ReadUInt32(classCache + this.Process.MonoLibraryOffsets.HashTableSize); | ||
| var classCacheTableArray = this.ReadPtr(classCache + this.Process.MonoLibraryOffsets.HashTableTable); | ||
| var classCacheSize = this.ReadUInt32(/*classCache + this.Process.MonoLibraryOffsets.HashTableSize*/1256); | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Here I only know the good values for |
||
| var classCacheTableArray = this.ReadPtr(1264/*classCache + this.Process.MonoLibraryOffsets.HashTableTable*/); | ||
|
|
||
| for (var tableItem = 0; | ||
| tableItem < (classCacheSize * this.Process.SizeOfPtr); | ||
| tableItem += this.Process.SizeOfPtr) | ||
| { | ||
| for (var definition = this.Process.ReadPtr(classCacheTableArray + tableItem); | ||
| definition != IntPtr.Zero; | ||
| definition = this.Process.ReadPtr(definition + this.Process.MonoLibraryOffsets.TypeDefinitionNextClassCache)) | ||
| definition = this.Process.ReadPtr(definition + /*this.Process.MonoLibraryOffsets.TypeDefinitionNextClassCache*/264)) | ||
| { | ||
| definitions.GetOrAdd(definition, new TypeDefinition(this, definition)); | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -65,6 +65,7 @@ public TypeDefinition([NotNull] AssemblyImage image, IntPtr address) | |
| // Get the generic type arguments | ||
| if (this.TypeInfo.TypeCode == TypeCode.GENERICINST) | ||
| { | ||
| this.fieldCount = this.ReadInt32(96); | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Here I can't simply use 96 for the |
||
| var monoGenericClassAddress = this.TypeInfo.Data; | ||
| var monoClassAddress = this.Process.ReadPtr(monoGenericClassAddress); | ||
| this.Image.GetTypeDefinition(monoClassAddress); | ||
|
|
@@ -159,7 +160,7 @@ public TValue GetStaticValue<TValue>(string fieldName) | |
| try | ||
| { | ||
| var vTableMemorySize = this.Process.SizeOfPtr * this.VTableSize; | ||
| var valuePtr = this.Process.ReadPtr(this.VTable + this.Process.MonoLibraryOffsets.VTable + vTableMemorySize); | ||
| var valuePtr = this.Process.ReadPtr(this.VTable + /*this.Process.MonoLibraryOffsets.VTable*/72 + vTableMemorySize); | ||
| return field.GetValue<TValue>(valuePtr); | ||
| } | ||
| catch (Exception e) | ||
|
|
@@ -193,7 +194,7 @@ private IReadOnlyList<FieldDefinition> GetFields() | |
| } | ||
|
|
||
| var fields = new List<FieldDefinition>(); | ||
| if (this.ClassKind == MonoClassKind.GInst) | ||
| if (this.ClassKind is MonoClassKind.GInst or MonoClassKind.GParam) | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This isn't simply an offset change |
||
| { | ||
| fields.AddRange(this.GetGeneric().GetFields()); | ||
| } | ||
|
|
@@ -248,13 +249,15 @@ private IEnumerable<TypeDefinition> NestedHierarchy() | |
|
|
||
| private TypeDefinition GetGeneric() | ||
| { | ||
| if (this.ClassKind != MonoClassKind.GInst) | ||
| if (this.ClassKind is MonoClassKind.GInst or MonoClassKind.GParam) | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This isn't simply an offset change |
||
| { | ||
| var genericContainerPtr = this.ReadPtr(this.Process.MonoLibraryOffsets.TypeDefinitionMonoGenericClass); | ||
| return this.Image.GetTypeDefinition(this.Process.ReadPtr(genericContainerPtr)); | ||
| } | ||
| else | ||
| { | ||
| return null; | ||
| } | ||
|
|
||
| var genericContainerPtr = this.ReadPtr(this.Process.MonoLibraryOffsets.TypeDefinitionMonoGenericClass); | ||
| return this.Image.GetTypeDefinition(this.Process.ReadPtr(genericContainerPtr)); | ||
| } | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -308,8 +308,7 @@ private int GetSize(TypeCode typeCode) | |
|
|
||
| case TypeCode.U: | ||
| case TypeCode.U4: | ||
| return sizeof(uint); | ||
|
|
||
| return 8; | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This doesn't seem to be bound to offsets |
||
| case TypeCode.I8: | ||
| return sizeof(long); | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.