Skip to content

Add uintptr_t and intptr_t data types (#134) #145

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

Closed
wants to merge 5 commits into from
Closed

Add uintptr_t and intptr_t data types (#134) #145

wants to merge 5 commits into from

Conversation

ghost
Copy link

@ghost ghost commented Jan 18, 2020

Since there is no real equivalent to size_t in .NET, I hesitated to add it.
The uintptr_t can be used and mapped to size_t if required, however.

I'm not entirely sure if I got everything, as there seems to be a lot of code relating to data types all over the place, but it seems to work for me.

If anything needs to be changed to get this merged in, just let me know and I'll fix it.

There is no real equivalent to size_t in .NET, so I hesitated to add it.
The uintptr_t can be used and mapped to size_t if required, however.
@ghost
Copy link
Author

ghost commented Jan 18, 2020

Mmm, seems like there's a minor bug. Hold off on merging until I can fix it (it's not displaying hexadecimal correctly, it shows 0x{base10} instead of base16. Seems to be an issue with the IntPtr/UIntPtr types themselves, they don't format nicely to strings like other integer types do.

@ghost
Copy link
Author

ghost commented Jan 18, 2020

Fixed, IntPtr has its own ToString(string) method which can take a format specifier, but UIntPtr does not, so I convert it to UInt32 or UInt64 to format it, depending on if RECLASSNET64 is defined. Seemed the most straight forward solution. I was also using the wrong macro name before, oops!

@@ -617,6 +619,12 @@ private void searchForEqualValuesToolStripMenuItem_Click(object sender, EventArg
case UInt64Node node:
comparer = new LongMemoryComparer(ScanCompareType.Equal, (long)node.ReadValueFromMemory(selectedNode.Memory), 0);
break;
case UIntPtrNode node:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's not correct? If you have a x86 process it should be an IntegerMemoryComparer and not the 64bit LongMemoryComparer.

@@ -6,16 +6,19 @@ namespace ReClassNET.Project
public class CppTypeMapping
{
public string TypeBool { get; set; } = "bool";
public string TypeSize { get; set; } = "size_t";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This type is never used.

@ghost ghost closed this May 8, 2020
@KN4CK3R
Copy link
Member

KN4CK3R commented May 9, 2020

Why did you close this PR?

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant