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 


Need help guys. Cmp doesn't work :(

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

Joined: 26 Nov 2017
Posts: 1

PostPosted: Sun Nov 26, 2017 11:38 am    Post subject: Need help guys. Cmp doesn't work :( Reply with quote

Hey Guys,

I am trying now for hours to fix my health AOB injection for Titan Quest.
My problem is that the comparison between Friendly and Enemy doesn't work. I don't know what to do.



CE Help.png
 Description:
I hope that the picture is selfexplaining.
 Filesize:  337.01 KB
 Viewed:  3343 Time(s)

CE Help.png


Back to top
View user's profile Send private message
OldCheatEngineUser
Whateven rank
Reputation: 20

Joined: 01 Feb 2016
Posts: 1587

PostPosted: Sun Nov 26, 2017 1:55 pm    Post subject: Reply with quote

do you want to give friendly units unlimited health too? or only player?

if friendly and player want unlimited health, then friendly and player must be in 1 group.

if only player want unlimited health, then friendly and enemies should be in a group.

Raylands wrote:
My problem is that the comparison between Friendly and Enemy doesn't work. I don't know what to do.

there is only one comparison here, one cmp you made only.
to compare 1 (player&friendly) against 3 (enemies)
that what your uploaded img say, and your comments inside the script say the same.

_________________
About Me;
I Use CE Since Version 1.X, And Still Learning How To Use It Well!
Jul 26, 2020
STN wrote:
i am a sweetheart.
Back to top
View user's profile Send private message Visit poster's website
Prehistoricman
Advanced Cheater
Reputation: 0

Joined: 02 Aug 2016
Posts: 80

PostPosted: Sun Nov 26, 2017 5:24 pm    Post subject: Reply with quote

Put a breakpoint into your code, step through it and check what it does. Hopefully you should find something wrong with either your thinking or the code, and everything will make sense.
_________________
Er, hi
Back to top
View user's profile Send private message
atom0s
Moderator
Reputation: 198

Joined: 25 Jan 2006
Posts: 8517
Location: 127.0.0.1

PostPosted: Sun Nov 26, 2017 9:33 pm    Post subject: Reply with quote

Here is an old script of mine for TQ:AV for infinite health:

Code:

[ENABLE]
aobscanmodule(health1,Game.dll,F3 0F 11 87 34 07 00 00 F3 0F 10 87 3C 07 00 00)
aobscanmodule(health2,Game.dll,F3 0F 11 46 1C F3 0F 5C C1)
registersymbol(health1)
registersymbol(health2)
alloc(newmem1,1024,"Game.dll")
alloc(newmem2,1024,"Game.dll")
registersymbol(infiniteHealth)
label(infiniteHealth)
label(notplayer)
label(skip1)
label(skip2)
label(skip3)
label(rethere1)
registersymbol(oneHitKills)
label(oneHitKills)
label(skip4)
label(rethere2)

//
// Part 1 - CombatManager::ApplyDamage
// One hit kills and prevent player damage.
//
newmem1:
    // Check that this entity is the player..
    push eax
    mov eax, [playerPointer]
    mov eax, [eax+00000020]
    cmp eax, [edi+00000020]
    pop eax
    jne notplayer

    // Check if infinite health is enabled..
    cmp [infiniteHealth], 1
    jne skip1

    // Infinite health is enabled..
    //push [edi+00000778] // Max Health
    //pop [edi+00000734]  // Current Health
    pushad
    mov ecx, edi
    call GAME::Character::GetLifeLimit
    fstp [edi+00000734]
    popad
    jmp rethere1

    // Infinite health is disabled..
skip1:
    movss [edi+00000734], xmm0
    jmp rethere1

notplayer:
    // Check if one hit kills is enabled..
    cmp [oneHitKills], 1
    jne skip3

    // One hit kills is enabled..
    // Check if the attacker is the player..
    push eax
    mov eax, [playerPointer]
    mov eax, [eax+00000020]
    cmp eax, [ebx+000000BC] // Attacker id..
    pop eax
    jne skip2
    mov [edi+00000734], (float)0.0 // Set monster to 0 health..
    jmp rethere1

    // Check if the attacker is a player pet..
skip2:
    push eax
    push ecx
    push [ebx+000000BC]
    mov ecx, [Game.GAME::gGameEngine]
    call GAME::GameEngine::IsLocalPet
    test al, al
    pop ecx
    pop eax
    jz skip3
    mov [edi+00000734], (float)0.0 // Set monster to 0 health..
    jmp rethere1

    // One hit kill is disabled..
skip3:
    movss [edi+00000734], xmm0
    jmp rethere1

infiniteHealth:
    dd 0
oneHitKills:
    dd 0

health1:
    jmp newmem1
    nop
    nop
    nop
rethere1:

//
// Part 2 - Health tick update.
// Force set the players health to their max constantly.
//
newmem2:
    cmp [infiniteHealth], 1
    jne skip4
    cmp [playerPointer], ebp
    jne skip4

    // Set to the players max health..
    movss [esi+0000001C], xmm4
    subss xmm0, xmm1
    jmp rethere2

skip4:
    // Restore original code..
    movss [esi+0000001C], xmm0
    subss xmm0, xmm1
    jmp rethere2

health2:
    jmp newmem2
    db 90 90 90 90
rethere2:

[DISABLE]
health1:
    db F3 0F 11 87 34 07 00 00 F3 0F 10 87 3C 07 00 00
health2:
    db F3 0F 11 46 1C F3 0F 5C C1
dealloc(newmem1)
dealloc(newmem2)
unregistersymbol(health1)
unregistersymbol(health2)
unregistersymbol(infiniteHealth)
unregistersymbol(oneHitKills)


This makes use of two entries on a cheat table:

Infinite Health
Code:
[ENABLE]
infiniteHealth:
    dd 1

[DISABLE]
infiniteHealth:
    dd 0


One Hit Kills
Code:

[ENABLE]
oneHitKills:
    dd 1

[DISABLE]
oneHitKills:
    dd 0


These are from before the game was recently updated. So the offsets are probably off now as the player structure shifted some data around. Shouldn't be hard to fix them though. But this shows how to check for the player and so on.

Oh and here is the 'master' code for the player pointer:
Code:
[ENABLE]
aobscanmodule(mastercode,Game.dll,57 E8 ?? ?? ?? ?? A1 ?? ?? ?? ?? 8B 88 ?? ?? ?? ?? 8B 01)
registersymbol(mastercode)
alloc(newmem,1024,"Game.dll")
label(rethere)
registersymbol(playerPointer)
label(playerPointer)

/*
Extra thread variables. This is used for a few scripts that need to execute
code in their disable portions. We register the info here in the master code
script to ensure the area of memory is going to be available and safe from
dealloc calls that may create a race condition in the same script.
*/
alloc(threadGame,2048,"Game.dll")
registersymbol(threadGame)

newmem:
    // Store the player pointer..
    mov [playerPointer], ebx

    // Restore original code..
    mov eax, [Game.GAME::gGameEngine]
    mov ecx, [eax+0000123C]
    jmp rethere

playerPointer:
    dd 0

mastercode+6:
    jmp newmem
    db 90 90 90 90 90 90
rethere:

[DISABLE]
mastercode+6:
    mov eax, [Game.GAME::gGameEngine]
    mov ecx, [eax+0000123C]
dealloc(newmem)
dealloc(threadGame)
unregistersymbol(playerPointer)
unregistersymbol(mastercode)
unregistersymbol(threadGame)

_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
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