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 


I need help with cmps

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine
View previous topic :: View next topic  
Author Message
SrmsReis
How do I cheat?
Reputation: 0

Joined: 28 Feb 2021
Posts: 7
Location: Brazil

PostPosted: Fri Mar 26, 2021 3:46 pm    Post subject: I need help with cmps Reply with quote

Im tryng to make a code with cmps but the dedicate keep crashing, I am very new to cheat engine so idk what is happening

[code]

registersymbol(GN)
alloc(GN,04)
alloc(9mm,$100)
alloc(Uzi,$100)
alloc(MP5,$100)
alloc(Magnum,$100)
alloc(M16,$100)
alloc(AK47,$100)
alloc(comps,$100)

//////////////////////////arm////////////////////////
comps:
cmp [GN],0
je AK47
cmp [GN],2
je M16
cmp [GN],4
je Magnum
cmp [GN],6
je MP5
cmp [GN],8
je Uzi
cmp [GN],10
je 9mm

AK47:
"subrosadedicated024d.exe"+4A0BC:
push 00
jmp exit

M16:
"subrosadedicated024d.exe"+4A0BC:
push 02
jmp exit

Magnum:
"subrosadedicated024d.exe"+4A0BC:
push 04
jmp exit

MP5:
"subrosadedicated024d.exe"+4A0BC:
push 06
jmp exit

Uzi:
"subrosadedicated024d.exe"+4A0BC:
push 08
jmp exit

9mm:
"subrosadedicated024d.exe"+4A0BC:
push 0A
jmp exit

exit:



Screenshot_166.png
 Description:
 Filesize:  10.84 KB
 Viewed:  1253 Time(s)

Screenshot_166.png


Back to top
View user's profile Send private message
TheyCallMeTim13
Wiki Contributor
Reputation: 50

Joined: 24 Feb 2017
Posts: 976
Location: Pluto

PostPosted: Fri Mar 26, 2021 4:11 pm    Post subject: This post has 1 review(s) Reply with quote

Well, "GN" is never set. And after the compares you have no return of any kind, so if the value isn't one listed then it runs whatever is after that (likely zeros). Plus all the gun labels are never written to so when you jump to those it's likely zeros (you write to the addresses below the labels). And not sure if CE fixes this for you or not, but you register a symbol ("GN") that doesn't exists yet then you create the symbol and allocate the memory for it. And I'm assuming the push to the stack is dealt with by the game later, if not that's a problem as well.

EDIT: And on a side note you allocate a lot more memory then you need, you could easily just use one allocation. I think CE still allocates 1000 bytes per call (might just be a windows thing). So that's 7000 bytes for less than 100 bytes of code.

_________________
Back to top
View user's profile Send private message Visit poster's website
Dark Byte
Site Admin
Reputation: 458

Joined: 09 May 2003
Posts: 25298
Location: The netherlands

PostPosted: Fri Mar 26, 2021 5:01 pm    Post subject: This post has 1 review(s) Reply with quote

the allocs are fine. CE groups all allocs together into one alloc and designates the addresses based on the size and the order they appear in


But you're not allocating or labeling "exit" which is going to be a problem, as there is a global function in windows called "exit"

So, when you jump to Exit, you're jumping to that function

_________________
Do not ask me about online cheats. I don't know any and wont help finding them.

Like my help? Join me on Patreon so i can keep helping
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