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 


Can't get CMP / compare to work. help pls?
Goto page Previous  1, 2
 
Post new topic   This topic is locked: you cannot edit posts or make replies.    Cheat Engine Forum Index -> General Gamehacking
View previous topic :: View next topic  
Author Message
LeFiXER
Grandmaster Cheater Supreme
Reputation: 20

Joined: 02 Sep 2011
Posts: 1053
Location: 0x90

PostPosted: Fri Sep 09, 2022 1:26 pm    Post subject: Reply with quote

mordax wrote:

if i would know how to fix, i wouldn't be here asking for help now, would I??
you trying to say that just because you say "fix your code" means that i magically will understand everything? thanks for being asshole!

also that originalcode is ORIGINAL code that game uses, there's nothing to fix you insult bag. go tell game developers to fix game code, because i didn't write it.

i only came here to ask help with compare. I DONT KNOW HOW TO FIX IT!
i don't know where the jump destination has to be!

I'm asking HOW DO I COMPARE 2 REGISTER VALUES and youre reply is "fix your code" WOW so useful, why didn't I think of that?
Obviously you are just trolling and you don't know yourself how to fix it. so please stop adding more insults if you don't know or are unwilling to help! your insults are not helping!


I'm not sure why you are being defensive and insulting. Both cooleko and parkourpenguin have explained what needs to be done in this thread. It would really help if you read up on basic assembly from either your favourite search engine, or from resources like the Cheat Engine Wiki. Here is a page that details exactly how to use the compare instruction.
Cheat Engine Wiki:CMP

No insults were said by cooleko nor parkourpenguin. If they were unwilling to help they would not have spent time responding to your request. Again, no insults were thrown around. You are bringing an attitude because no one here has given you step-by-step instructions on how to achieve what you want. I'm afraid you don't learn this way. Use the information you've been given to expand your knowledge by searching the terms, understanding what they mean and how you can apply your new found knowledge to practice. Throwing insults around shows you are not serious about learning these things and does not help you in progressing because it makes people less inclined to help you.
Back to top
View user's profile Send private message
cooleko
Grandmaster Cheater
Reputation: 11

Joined: 04 May 2016
Posts: 717

PostPosted: Fri Sep 09, 2022 5:48 pm    Post subject: Reply with quote

Here is an example of working code:

Code:
label(code)
label(return)
label(SaveShip)
newmem:

code:
  push eax
  mov eax, [rsi+28] //Set pointer to mycontrols
  cmp dword ptr [eax+1D8], (float)0 //compare lookYrotation to 0
  jne SaveShip
  movss [rsi+58],xmm5
  pop eax
  jmp return

SaveShip:
  mov [myShip], rsi
  movss [rsi+58],xmm5
  //40 40 40 9c
  mov eax, [rsi+28] //mycontrols
  mov eax, [eax+48] //myplayercontrols
  mov eax, [eax+40] //myengine
  add eax, A4
  mov [boost], eax
  mov eax, [rsi+28]
  mov eax, [eax+48]
  mov eax, [eax+40]
  add eax, 74
  mov [speed], eax
  pop eax
  jmp return


As you can see, I created a label for my jump and executed different code when I jumped vs when I did not jump.

Now, because you are such a lovable individual, I'm going to summarize the thread since I entered it. You are welcome.

mordox:
Quote:
I cannot get compares to work. Someone, please tell he how to make two compares work.


cooleko:
Quote:
Think sequentially:

Code:
CMP R9, 5
JNE Failure/Return
CMP R10, 10
JNE Failure/Return

...Your code should go here.

Failure/Return:



mordox:
Quote:
You are stupid, I tried that and it didnt work.
See? I tried this:


Code:
cmp r9,5
cmp r14,10
jne originalcode
mov rax,_health
mov [rax],rdi

originalcode:
mov rax,[rdi]
mov [rbx],rax
jmp return


ParkourPenguin: You didn't actually follow Cooleko's example, see:

Quote:
cooleko wrote:
Code:
cmp ...
jne ...
cmp ...
jne ...

mordax wrote:
Code:
cmp ...
cmp ...
jne ...



Cooleko:

Quote:
If you have two sequential compares as noted by Parkour, the first one does not have effect since the second one overwrites the results of the first so the jump only responds to the second one. You need to have a jump after each compare to make it useful.


mordax:

Quote:
Can you give me an example?


Cooleko:
Quote:

Two separate people have told you to add the jump after each compare, how hard can it be. Literally look at your code and ask yourself if you have a jump after each compare. Also, your code is wrong because because it doesn't match the originalcode so your outcome isn't going to work even when you fix your jumps.


mordax:

Quote:
You are such an asshole for not explaining it to me further.


Cooleko:

Quote:
I already explained it and provided examples. You can figure it out if you just take a deep breath and stop blaming me for your mistakes. Copy what I provided you, fix the jump labels to go where it needs to go, and make your code match the original code's structure.


Now, once again due to your lovability, I'll share this with you:

Code:
cmp r9,5
//mordox, you missed a jump here. Two separate people pointed it out in three different ways, here is a fourth.
cmp r14,10
jne originalcode
mov rax,_health
mov [rax],rdi
//mordox, your code doesn't appear to work. Check the original code below...  the original code writes rax into [rbx] without overwriting your health value first and you dont. Also, you arent jumping to a return so the original code is going to run anyway, undoing your edits (if it doesn't crash from writing into rdi to [rax], which the original code does not do.

originalcode:
mov rax,[rdi]
mov [rbx],rax
jmp return
Back to top
View user's profile Send private message
atom0s
Moderator
Reputation: 198

Joined: 25 Jan 2006
Posts: 8516
Location: 127.0.0.1

PostPosted: Sat Sep 10, 2022 2:51 pm    Post subject: Reply with quote

Moved as this has nothing to do with Lua.

I am also going to lock this thread because you want to create false reports, mordax, against the others here trying to help you.

Multiple people in this thread have taken time out of their day to sit and explain things to you. You were given multiple examples of how to solve your problem, with detailed explanations of what you're doing wrong. You continued to ignore that help and kept posting blocks of code that showed you weren't listening to them and just kept blindly copy/pasting things.

When they pointed out you weren't listening, you instead got an attitude and cocky towards them. You then complained about how they were helping and not just giving you code in a very childish/arrogant manner. Then to top that off, you tried to report both Park and cooleko after you resorted to being the asshole.

So no, neither of them will be punished, your reports were deleted and this thread is now locked. Take the time to actually read and listen to what the two of them told you. They gave you plenty of information on how to fix your code and do what you're asking, but you keep ignoring it.

If you wish to ask for help again, feel free to make a new thread, but keep in mind if you want to be an asshole to those trying to help you, it'll get locked as well.

_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   This topic is locked: you cannot edit posts or make replies.    Cheat Engine Forum Index -> General Gamehacking All times are GMT - 6 Hours
Goto page Previous  1, 2
Page 2 of 2

 
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