
Originally Posted by
WasserEsser
FindPattern is to 99,9% a typical pattern matching function which iterates over a memory segment and compares the bytes to a given pattern and returns you the address at where it found the pattern if it did find it
I have a function called CoffeeMaker(), then it means it makes me coffee, to all intents and purposes. Right? That's a good conjecture. Why do you insist that you know what _his_ FindPattern() implementation is, when you actually don't?

Originally Posted by
WasserEsser
This won't be a negative value because pointers can't be negative
Let me repeat it once again: pointers can't be negative (never said that). However, intptr_t and uintptr_t types convert these pointers in a long int. Can integers be negative? Yes.

Originally Posted by
WasserEsser
uintptr_t is perfectly reasonable for this case
If he is trying to do pointer arithmetics, yes it may be. Else, no it isn't. uintptr_t / intptr_t are used just for pointer arithmetics (and very rarely), they convert your pointers to integers, something that you don't need to have (you don't need those addresses stored as integers) if you actually don't need to do integer arithmetics to pointers.

Originally Posted by
WasserEsser
There are downsides to using intptr_t over uintptr_t, though. This thread is in no way focused on working with negative values, ever.
I'd suggest you to stop reading from wikis (Stackoverflow, in this case) and post the first thing you understand about the disadvantages of my suggestions just to oppose. I am a Stackoverflow user with an high reputation, I can publicly write intptr_t is bad - does this mean it is right, just because it's Stackoverflow or whichever other good programming forum? In fact, you should document yourself from a reference.
Forget about preferences and prejudices. If intptr_t exists, it means it has purpose to exist. If it was just a bad and useless alternative to uintptr_t, I don't think it would have existed.

Originally Posted by
WasserEsser
That's opinion based. I would have prefered a uint32_t/uint64_t here as well, but it's not wrong to use uintptr_t in this case. It is however
completely unnecessary to use intptr_t instead of uintptr_t when you will never ever work with negative values and you will have to deal with intptr_t not
being able to cover positive numbers as large as a uintptr_t is capable of hold.
It's nothing about opinion based. Firstoff, you can't say which you would have preferred, since he hasn't still posted his implementation of FindPattern(), secondly, if it's impossible to work with negative values then try to answer why intptr_t does exist. It's simple: you CAN work with negative values. Both uintptr_t and intptr_t have two different meanings, and they are needed in similar but different scopes.

Originally Posted by
WasserEsser
Why would you even convert this pointer, pointing to a memory region you want to access someday, into a signed long? There is absolutely no reason
to do this.
It's what intptr_t does, while uintptr_t converts your pointer into an unsigned long. You suggest to use uintptr_t but then you say there is no reason to deal with converted pointers to signed/unsigned long s (when it actually does), it's a bit incoherent.
However, TL;DR, summarizing: uintptr_t and intptr_t are used for integer arithmetics on pointers (so I've supposed OP was using them for that). I've just
said that intptr_t may be needed in some cases when you do integer arithmetics on pointers, but I'm not even sure he knows what he is doing.