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 


[Bug Report] Between [a] ... [b] mixed up

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

Joined: 03 Jun 2008
Posts: 283
Location: The Netherlands

PostPosted: Mon Mar 03, 2014 4:56 pm    Post subject: [Bug Report] Between [a] ... [b] mixed up Reply with quote

When you have the 'between' values search, and you look for values between -1000 and 1000, cheat engine gives 0 results, when you look for between 1000 and -1000 wrong results are given (values above 1000 and below -1000). I don't know what causes this behaviour and IMHO is shouldn't matter which order is used and has to work correctly, right?

I hope this will be fixed soon! Smile
Back to top
View user's profile Send private message
Geri
Moderator
Reputation: 111

Joined: 05 Feb 2010
Posts: 5636

PostPosted: Mon Mar 03, 2014 5:06 pm    Post subject: Reply with quote

I have used this feature so many times, but it seems I have never used it with negative values. Embarassed
_________________
My trainers can be found here: http://www.szemelyesintegracio.hu/cheats

If you are interested in any of my crappy articles/tutorials about CE and game hacking, you can find them here:
http://www.szemelyesintegracio.hu/cheats/41-game-hacking-articles

Don't request cheats or updates.
Back to top
View user's profile Send private message
mgr.inz.Player
I post too much
Reputation: 218

Joined: 07 Nov 2008
Posts: 4438
Location: W kraju nad Wisla. UTC+01:00

PostPosted: Mon Mar 03, 2014 5:12 pm    Post subject: Reply with quote

Probably because of sign bit.

I think you need this setting:
"show values as if they are signed" in CE options (general settings)

But, unfortunately, it is ignored by "between" scans.



In MemScan.pas

Code:
function TScanner.ByteBetween(newvalue,oldvalue: pointer):boolean;
begin
  result:=(pbyte(newvalue)^>=byte(value)) and (pbyte(newvalue)^<=byte(value2));
end;

function TScanner.WordBetween(newvalue,oldvalue: pointer):boolean;
begin
  result:=(pword(newvalue)^>=word(value)) and (pword(newvalue)^<=word(value2));
end;

function TScanner.DWordBetween(newvalue,oldvalue: pointer):boolean;
begin
  result:=(pdword(newvalue)^>=dword(value)) and (pdword(newvalue)^<=dword(value2));
end;

function TScanner.QWordBetween(newvalue,oldvalue: pointer):boolean;
begin
  result:=(PQWORD(newvalue)^>=uint64(value)) and (PQWORD(newvalue)^<=uint64(value2));
end;


and there are *****BetweenPercentage functions.



So, 4byte scan between -1000 and 1000 will be in fact: between 4294966296 and 1000


As we know, we can not find value which is bigger than 4294966296 and at the same time smaller than 1000.


Doing scan between 1000 and -1000 will be in fact: between 1000 and 4294966296




EDIT:

looks like there is workaround, use AA customType:
Code:
alloc(ConvertRoutine,1024)
alloc(ConvertBackRoutine,1024)
alloc(TypeName,256)
alloc(ByteSize,4)

TypeName:
db 'signed int32',0

ByteSize:
dd 4

ConvertRoutine:
[64-bit]
mov eax,[rcx]
ret
[/64-bit]

[32-bit]
push ebp
mov ebp,esp
mov eax,[ebp+8]
mov eax,[eax]
pop ebp
ret 4
[/32-bit]


ConvertBackRoutine:
[64-bit]
mov [rdx],ecx
ret
[/64-bit]

[32-bit]
push ebp
mov ebp,esp
push eax
push ebx
mov eax,[ebp+8]
mov ebx,[ebp+c]
mov [ebx],eax
pop ebx
pop eax
pop ebp
ret 8
[/32-bit]



and do not forget to enable "show values as if they are signed" in CE options (general settings).

Note: it will also find tremendous amount of zeros.

_________________
Back to top
View user's profile Send private message MSN Messenger
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