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 a little help

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

Joined: 24 Dec 2014
Posts: 1

PostPosted: Wed Dec 24, 2014 9:19 am    Post subject: Need a little help Reply with quote

I'm just starting to get into the nitty gritty of CE and decided, since I've figured out pointers and all that, that it was time to figure out coding and aobs. I've watched a lot of videos and have read a lot of tuts, but nothing I've found helped me figure out my current problem. For everything I've seen, it has always been taught, find the memory, then use a code injection template within the auto assembler. For the most part, that works out fine, except now.

Now, I seem to be having an issue where I can't seem to change only 2 bytes. Nothing I do works and this messes up everything, including causing the game to crash because some of the stuff it removes is required. Anyways, let me post my code;

Code:

[ENABLE]


alloc(newmem,$1000)
label(returnhere)
label(exit)
aobscan(AoBPotion, FF 08 59 59 E8)

newmem: //this is allocated memory, you have read,write,execute access
//place your code here

exit:
jmp returnhere

AoBPotion:
label(Inf_Potions)

Inf_Potions:
registersymbol(Inf_Potions)
jmp newmem
nop
nop
nop
nop
returnhere:

[DISABLE]
Inf_Potions:
dec [eax]
pop ecx
pop ecx
call Darksiders2.Scaleform::Render::Matrix4x4<float>::SetIdentity+80
dealloc(newmem)
unregistersymbol(Inf_Potions)


{
Darksiders2.Scaleform::Event::IsSignaled+2231C3 - 83 4D FC FF           - or dword ptr [ebp-04],-01
Darksiders2.Scaleform::Event::IsSignaled+2231C7 - 59                    - pop ecx
Darksiders2.Scaleform::Event::IsSignaled+2231C8 - 57                    - push edi
Darksiders2.Scaleform::Event::IsSignaled+2231C9 - 56                    - push esi
Darksiders2.Scaleform::Event::IsSignaled+2231CA - E8 5ECBC6FF           - call Darksiders2.Scaleform::Render::Matrix4x4<float>::SetIdentity+C8A76
Darksiders2.Scaleform::Event::IsSignaled+2231CF - 8B 86 3C030000        - mov eax,[esi+0000033C]
Darksiders2.Scaleform::Event::IsSignaled+2231D5 - FF 08                 - dec [eax] << Injection Point -- Decreasing Wrath Potion
Darksiders2.Scaleform::Event::IsSignaled+2231D7 - 59                    - pop ecx
Darksiders2.Scaleform::Event::IsSignaled+2231D8 - 59                    - pop ecx
Darksiders2.Scaleform::Event::IsSignaled+2231D9 - E8 5941BAFF           - call Darksiders2.Scaleform::Render::Matrix4x4<float>::SetIdentity+80
Darksiders2.Scaleform::Event::IsSignaled+2231DE - 8B C8                 - mov ecx,eax
Darksiders2.Scaleform::Event::IsSignaled+2231E0 - E8 7D4AC8FF           - call Darksiders2.Scaleform::Render::Matrix4x4<float>::SetIdentity+E09AB
Darksiders2.Scaleform::Event::IsSignaled+2231E5 - 8B 8E 3C030000        - mov ecx,[esi+0000033C]
Darksiders2.Scaleform::Event::IsSignaled+2231EB - 89 41 04              - mov [ecx+04],eax
Darksiders2.Scaleform::Event::IsSignaled+2231EE - 8B 86 3C030000        - mov eax,[esi+0000033C]
Darksiders2.Scaleform::Event::IsSignaled+2231F4 - 39 18                 - cmp [eax],ebx
}


The instructions underneath Inf_Potions are the original instructions given by the Template. I have tried everything including cutting it down to 0 nop's, but no luck, it still removes way to much. I've also included the list of the surrounding memory (learned within a tut, decided it was a good idea), which should be helpful in narrowing down what I am doing wrong. Anyways, what I am looking for is replacing the injection point (dec [eax]) with 2 nop and only those two bytes.

Any and all help you can provide, will help me to learn from this, and will also be very much appreciated.
Back to top
View user's profile Send private message
Nemexia55
Expert Cheater
Reputation: 0

Joined: 28 Jan 2014
Posts: 160

PostPosted: Wed Dec 24, 2014 10:00 am    Post subject: Reply with quote

your code looks wired,
have you found an address for amount of potions?

_________________
Back to top
View user's profile Send private message
mgr.inz.Player
I post too much
Reputation: 222

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

PostPosted: Wed Dec 24, 2014 11:10 am    Post subject: Reply with quote

Sometimes it is better to choose other hackpoint (injection point).
In many cases it hasn't to be the same instruction you got by using "find out what .... this address".

In your case, you can try here:
Code:
Darksiders2.Scaleform::Event::IsSignaled+2231C8 - 57                    - push edi
Darksiders2.Scaleform::Event::IsSignaled+2231C9 - 56                    - push esi
Darksiders2.Scaleform::Event::IsSignaled+2231CA - E8 5ECBC6FF           - call Darksiders2.Scaleform::Render::Matrix4x4<float>::SetIdentity+C8A76
Darksiders2.Scaleform::Event::IsSignaled+2231CF - 8B 86 3C030000        - mov eax,[esi+0000033C] << Injection Point
Darksiders2.Scaleform::Event::IsSignaled+2231D5 - FF 08                 - dec [eax] << Decreasing Wrath Potion
Darksiders2.Scaleform::Event::IsSignaled+2231D7 - 59                    - pop ecx
Darksiders2.Scaleform::Event::IsSignaled+2231D8 - 59                    - pop ecx
Darksiders2.Scaleform::Event::IsSignaled+2231D9 - E8 5941BAFF           - call Darksiders2.Scaleform::Render::Matrix4x4<float>::SetIdentity+80


So, you want to eliminate effect of "dec [eax]". Solution:
Code:
[ENABLE]

aobscan(INJECT,8B 86 3C 03 00 00 FF 08 59 59 ) // should be unique
registersymbol(INJECT)
alloc(newmem,$1000)

label(return)

newmem:
  mov eax,[esi+0000033C] // orig code
  inc [eax]
  jmp return

INJECT:
  jmp newmem
  nop
return:

[DISABLE]

INJECT:
  db 8B 86 3C 03 00 00

unregistersymbol(INJECT)
dealloc(newmem)


after enabling above script, the flow will be:
Code:
...
...
push edi
push esi
call Darksiders2.Scaleform::Render::Matrix4x4<float>::SetIdentity+C8A76
jmp addressOfAllocatedMemory (allocated by CheatEngine)


mov eax,[esi+0000033C]
inc [eax]
jmp return (will return to "Darksiders2.Scaleform::Event::IsSignaled+2231D5")


dec [eax]
pop ecx
pop ecx
call Darksiders2.Scaleform::Render::Matrix4x4<float>::SetIdentity+80
...
...



The game will do inc and dec (+1-1 = 0) instead of only dec (-1). Wrath Potion count shouldn't decrease.

EDIT:
You can also use simple NOPping:

Code:
[ENABLE]
aobscan(INJECT,FF 08 59 59 E8 xx xx xx xx 8B C8)
registersymbol(INJECT)

INJECT:
nop
nop

[DISABLE]
INJECT:
db FF 08

unregistersymbol(INJECT)

_________________
Back to top
View user's profile Send private message MSN Messenger
Gniarf
Grandmaster Cheater Supreme
Reputation: 43

Joined: 12 Mar 2012
Posts: 1285

PostPosted: Wed Dec 24, 2014 11:23 am    Post subject: Reply with quote

@Eyanosa:
2 things that you might want to know:
-alloc is only useful when you want to ADD code, like when you want to insert a few words in the middle of a sentence in a hand-written dissertation. You don't need it when you just want to remove/disable part of the code.
-My guess is that your code didn't work because you forgot to put the two pop ecx and call ***SetIdentity+80 under newmem in the [enable] section.

Here's how I'd have written your script:
Code:
[ENABLE]
//aobscan(AoBPotion, FF 08 59 59 E8) //better avoid to include the bytes you modify in the aob
aobscan(AoBPotion, 8b 86 * * 0 0 * * 59 59)
registersymbol(AoBPotion)

AoBPotion+6: //+6 because our aob is at mov eax,[esi+0000033C] which starts 6 bytes before the thing we want to modify
nop //overwrite the dec [eax]
nop


[DISABLE]
unregistersymbol(AoBPotion)

AoBPotion+6:
dec [eax]

{
Darksiders2.Scaleform::Event::IsSignaled+2231C3 - 83 4D FC FF           - or dword ptr [ebp-04],-01
Darksiders2.Scaleform::Event::IsSignaled+2231C7 - 59                    - pop ecx
Darksiders2.Scaleform::Event::IsSignaled+2231C8 - 57                    - push edi
Darksiders2.Scaleform::Event::IsSignaled+2231C9 - 56                    - push esi
Darksiders2.Scaleform::Event::IsSignaled+2231CA - E8 5ECBC6FF           - call Darksiders2.Scaleform::Render::Matrix4x4<float>::SetIdentity+C8A76
Darksiders2.Scaleform::Event::IsSignaled+2231CF - 8B 86 3C030000        - mov eax,[esi+0000033C] <<aob signature starts here
Darksiders2.Scaleform::Event::IsSignaled+2231D5 - FF 08                 - dec [eax] << Injection Point -- Decreasing Wrath (and health) Potion
Darksiders2.Scaleform::Event::IsSignaled+2231D7 - 59                    - pop ecx
Darksiders2.Scaleform::Event::IsSignaled+2231D8 - 59                    - pop ecx
Darksiders2.Scaleform::Event::IsSignaled+2231D9 - E8 5941BAFF           - call Darksiders2.Scaleform::Render::Matrix4x4<float>::SetIdentity+80
Darksiders2.Scaleform::Event::IsSignaled+2231DE - 8B C8                 - mov ecx,eax
Darksiders2.Scaleform::Event::IsSignaled+2231E0 - E8 7D4AC8FF           - call Darksiders2.Scaleform::Render::Matrix4x4<float>::SetIdentity+E09AB
Darksiders2.Scaleform::Event::IsSignaled+2231E5 - 8B 8E 3C030000        - mov ecx,[esi+0000033C]
Darksiders2.Scaleform::Event::IsSignaled+2231EB - 89 41 04              - mov [ecx+04],eax
Darksiders2.Scaleform::Event::IsSignaled+2231EE - 8B 86 3C030000        - mov eax,[esi+0000033C]
Darksiders2.Scaleform::Event::IsSignaled+2231F4 - 39 18                 - cmp [eax],ebx
}


EDIT: ah, crap, mgr.inz.Player beat me to it.

_________________
DO NOT PM me if you want help on making/fixing/using a hack.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Gamehacking 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