Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


New Search Type request

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine
View previous topic :: View next topic  
Author Message
oddgamer
Advanced Cheater
Reputation: 0

Joined: 19 Jan 2013
Posts: 60

PostPosted: Wed Nov 29, 2023 9:33 pm    Post subject: New Search Type request Reply with quote

I hope this is the right place to put this...

I, unfortunately, do not understand Assembler, but I'd like a search type for something I've seen in a few Unity games. Yes, there is a way around this, but it's annoying to do and has... other issues.

A value matches if the value and an exact copy of it exist back to back. Yes, you could do this with a group-value search. The problem with doing that is that there are several sorts of search function that make sense for values of this sort that are unavailable to a group search. For instance, checking that the value is unmodified would mean the value is still the same for both, which is a problem for Float values where the value of one might have changed a little bit while still being in the range but the other hasn't changed, which should rule it out... but doesn't. 'Decreased value', 'increased value', and so on... all of those are gone when using group searches, even though they make perfect sense here, because the numbers are duplicates of each other. All of this would, then, make finding the values vastly faster.

If anyone feels like taking on this challenge, I'd really appreciate it... and, please, if you're only going to do one type, make it single precision floats (not doubles). If you're willing to do two, 4-bytes would be the other one that comes up this way as well. You could call them 'Unity Float' and 'Unity 4-byte' or 'Duplicate Float'/'4-Byte'. Or whatever else, just offering names to make it easier.
Back to top
View user's profile Send private message
++METHOS
I post too much
Reputation: 92

Joined: 29 Oct 2010
Posts: 4197

PostPosted: Wed Nov 29, 2023 9:54 pm    Post subject: Reply with quote

Not sure that I am understanding you correctly, but would searching an array of bytes with wildcard fillers not work?
Back to top
View user's profile Send private message
oddgamer
Advanced Cheater
Reputation: 0

Joined: 19 Jan 2013
Posts: 60

PostPosted: Wed Nov 29, 2023 10:49 pm    Post subject: Reply with quote

++METHOS wrote:
Not sure that I am understanding you correctly, but would searching an array of bytes with wildcard fillers not work?


How would I write out the array of bytes for any number between 93.2 and 93.6? And then have it doubled? And then when I say it's changed, doesn't that just leave me without the useful tools of 'increased value' and 'decreased value' and so on that I'd like to use for the search? If it was just the same, exact values, and I knew exactly what those values were, I could just use a grouped search. If I'm looking for a 4-byte value of 37, a grouped search of "4:37 4:37" would find it, and sure I'd have to change both '37' searches when the value changed to 43, but I'm not sure how that's any better than searching for "00 00 00 25 00 00 00 25" and then changing that to "00 00 00 2B 00 00 00 2B", especially as I'd have to look up what the conversion is.

Now you might be tempted to suggest using a group search with a range to it, but there are problems here as well. Or, at least, it isn't as efficient as one might think. Again, if I am looking for a range of integer values between 100 and 140, one might suggest a grouped search of "4r:100-150 4r:100-150", but this comes up with the issue that "00 00 00 64 00 00 00 69" (100 then 105) is a valid search result... but shouldn't be because the two need to be the same value, not just in the same range of values.
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 152

Joined: 06 Jul 2014
Posts: 4717

PostPosted: Wed Nov 29, 2023 11:23 pm    Post subject: Reply with quote

Code:
alloc(ConvertRoutine,1024)
alloc(ConvertBackRoutine,1024)
alloc(TypeName,256)
alloc(ByteSize,4)
alloc(PreferedAlignment,4)
alloc(UsesFloat,1)
alloc(UsesString,1)
alloc(MaxStringSize,2)
alloc(CallMethod,1)

TypeName:
db 'Float Dup',0
ByteSize:
dd 8
PreferedAlignment:
dd 4
UsesFloat:
db 1
UsesString:
db 0
MaxStringSize:
dw #100
CallMethod:
db 1

//cdecl int ConvertRoutine(unsigned char *input, PTR_UINT address);
ConvertRoutine:
[64-bit]
mov eax,[rcx]
cmp eax,[rcx+4]
je @f
mov eax,(float)NaN
@@:
ret
[/64-bit]

//cdecl void ConvertBackRoutine(int i, PTR_UINT address, unsigned char *output);
ConvertBackRoutine:
[64-bit]
mov [r8],ecx
mov [r8+4],ecx
ret
[/64-bit]
4-byte is pretty much the exact same thing. Just change TypeName, UsesFloat (1 -> 0), and the "default" value for when it's wrong (maybe 0x80000000)
_________________
I don't know where I'm going, but I'll figure it out when I get there.
Back to top
View user's profile Send private message
oddgamer
Advanced Cheater
Reputation: 0

Joined: 19 Jan 2013
Posts: 60

PostPosted: Wed Nov 29, 2023 11:48 pm    Post subject: Reply with quote

Works perfectly! Thank you so much! Smile
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites