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 


AOB Script Issue

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Discussions
View previous topic :: View next topic  
Author Message
ubiByte
Advanced Cheater
Reputation: 1

Joined: 08 Mar 2013
Posts: 57

PostPosted: Sat May 02, 2015 6:17 pm    Post subject: AOB Script Issue Reply with quote

Hi, I have been reading so many tutorials in the tutorials section I am really starting to master cheating games, it's pretty awesome. Thanks to everyone who put up tutorials they have been extremely helpful.

There is one problem that I have run into however that I can't seem to figure out. Check out this code below, I am using this for infinite consumables which works fine but there's a problem with it.

Code:
[ENABLE]
aobscan(items, 88 54 37 08 8B 0D 5C 38 3C 03 8B 79 18 3B 77 04)
alloc(newmem, $1000)
label(return)

newmem:
nop
//mov [edi+esi+08],dl
mov ecx,[033C385C]
jmp return

items:
jmp newmem
nop
nop
nop
nop
nop
return:
registersymbol(items)

[DISABLE]
items:
db 88 54 37 08 8B 0D 5C 38 3C 03
unregistersymbol(items)
dealloc(newmem)


The problem is this game changes memory locations every time the game restarts. So right now this cheat works great, but when I turn off the game and turn it back on even though I am using AOB we have this code here:

Code:
mov ecx,[033C385C]


The 033C385C will change every time the game is reset. So how can I use my script without having to change the address manually, I know I can't use questions marks like you can inside of the aobscan function. Any ideas?
Back to top
View user's profile Send private message
justa_dude
Grandmaster Cheater
Reputation: 23

Joined: 29 Jun 2010
Posts: 893

PostPosted: Sat May 02, 2015 6:57 pm    Post subject: Reply with quote

Read the variable (pointer to somewhere in the data segment for a global variable/static member, I'm pretty sure) into memory using a decorated (symbol/module) name for the address.
_________________
A nagy kapu mellett, mindig van egy kis kapu.
----------------------
Come on...
Back to top
View user's profile Send private message
ubiByte
Advanced Cheater
Reputation: 1

Joined: 08 Mar 2013
Posts: 57

PostPosted: Sat May 02, 2015 7:05 pm    Post subject: Reply with quote

I'm not quite sure what you mean, you want me to create a symbol for 033C385C? but that address will change every restart. Can you clarify please, I don't think I understood you right.
Back to top
View user's profile Send private message
Geri
Moderator
Reputation: 111

Joined: 05 Feb 2010
Posts: 5627

PostPosted: Sat May 02, 2015 7:23 pm    Post subject: Reply with quote

I guess

mov ecx,[033C385C]

is the original code and it's not necessary for your cheat, so you could try to change the point of code injection to not include this code.

And you can also try to look around in registers or stack to see if any of them contains this address (or an address close to this one). Eg if it happens that eax is always equal to the address you need, you can just replace this code with

mov ecx,[eax]

_________________
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
ubiByte
Advanced Cheater
Reputation: 1

Joined: 08 Mar 2013
Posts: 57

PostPosted: Sat May 02, 2015 7:45 pm    Post subject: Reply with quote

Hey thanks Geri, I have tried replacing that piece of code but if I remove that the game crashes, it seems it needs to use that address, I'll give you the rest here.

Code:
07BAE287 - 88 54 37 08           - mov [edi+esi+08],dl
07BAE28B - 8B 0D 5C383C03        - mov ecx,[033C385C] : [024D5D6C]
07BAE291 - 8B 79 18              - mov edi,[ecx+18]
07BAE294 - 3B 77 04              - cmp esi,[edi+04]
07BAE297 - 73 40                 - jae 07BAE2D9


That's what follows after that part, but like I said taking out the mov ecx, [033C385C] kills the game.
Back to top
View user's profile Send private message
Geri
Moderator
Reputation: 111

Joined: 05 Feb 2010
Posts: 5627

PostPosted: Sat May 02, 2015 7:47 pm    Post subject: Reply with quote

What is above your code? You could shift the code injection to include the code you need and the code above it.
If that code is more suitable for an aob script.

_________________
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
ubiByte
Advanced Cheater
Reputation: 1

Joined: 08 Mar 2013
Posts: 57

PostPosted: Sat May 02, 2015 8:12 pm    Post subject: Reply with quote

Above it is this:

Code:
07BAE265 - E8 A289F567           - call System.Math::Max
07BAE26A - DD 5D D8              - fstp qword ptr [ebp-28]
07BAE26D - DD 45 D8              - fld qword ptr [ebp-28]
07BAE270 - DD 5D D8              - fstp qword ptr [ebp-28]
07BAE273 - F2 0F10 45 D8         - movsd xmm0,[ebp-28]
07BAE278 - F2 0F2C D0            - cvttsd2si edx,xmm0
07BAE27C - 81 E2 FF000000        - and edx,000000FF
07BAE282 - 3B 77 04              - cmp esi,[edi+04]
07BAE285 - 73 52                 - jae 07BAE2D9


Can you explain what you mean by shifting the code, I'm not an expert or anything just figuring things out one at a time Razz
Back to top
View user's profile Send private message
Zanzer
I post too much
Reputation: 126

Joined: 09 Jun 2013
Posts: 3278

PostPosted: Sat May 02, 2015 8:38 pm    Post subject: Reply with quote

Since you're just NOP'ing the instruction:
Code:
[ENABLE]
aobscan(items, 88 54 37 08 8B 0D * * * * 8B 79 18 3B 77 04)
items:
db 90 90 90 90
registersymbol(items)

[DISABLE]
items:
db 88 54 37 08
unregistersymbol(items)
Back to top
View user's profile Send private message
ubiByte
Advanced Cheater
Reputation: 1

Joined: 08 Mar 2013
Posts: 57

PostPosted: Sat May 02, 2015 8:50 pm    Post subject: Reply with quote

Zanzer wrote:
Since you're just NOP'ing the instruction:
Code:
[ENABLE]
aobscan(items, 88 54 37 08 8B 0D * * * * 8B 79 18 3B 77 04)
items:
db 90 90 90 90
registersymbol(items)

[DISABLE]
items:
db 88 54 37 08
unregistersymbol(items)


I didn't think about that I guess that would work in this case, but in the future what is the best way to deal with this situation? what if I didn't nop it and wrote a script to do something, how do you deal with this problem? I just want to learn.
Back to top
View user's profile Send private message
Zanzer
I post too much
Reputation: 126

Joined: 09 Jun 2013
Posts: 3278

PostPosted: Sat May 02, 2015 8:54 pm    Post subject: Reply with quote

Code:
[ENABLE]
aobscan(items, 88 54 37 08 8B 0D * * * * 8B 79 18 3B 77 04)
alloc(newmem, $1000)
label(return)
label(backup)

newmem:
nop
//mov [edi+esi+08],dl
readmem(items+4,6)
//mov ecx,[033C385C]
jmp return

backup:
readmem(items+4,6)

items:
jmp newmem
nop
nop
nop
nop
nop
return:
registersymbol(items)
registersymbol(backup)

[DISABLE]
items:
db 88 54 37 08
readmem(backup,6)
unregistersymbol(items)
unregistersymbol(backup)
dealloc(newmem)
Back to top
View user's profile Send private message
ubiByte
Advanced Cheater
Reputation: 1

Joined: 08 Mar 2013
Posts: 57

PostPosted: Sat May 02, 2015 9:03 pm    Post subject: Reply with quote

Code:
readmem(items+4,6)


backup:
readmem(items+4,6)


Can you explain what you did there please?
Back to top
View user's profile Send private message
Geri
Moderator
Reputation: 111

Joined: 05 Feb 2010
Posts: 5627

PostPosted: Sat May 02, 2015 9:11 pm    Post subject: Reply with quote

In this case, you could make a code injection to include

07BAE285 - 73 52 - jae 07BAE2D9
07BAE287 - 88 54 37 08 - mov [edi+esi+08],dl

instead.
But you have to change that relative jump to not be a static jump as CE compiles it. I have described everything for it in this tutorial:

http://www.szemelyesintegracio.hu/cheats/41-game-hacking-articles/507-aobscan-instruction

_________________
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
ubiByte
Advanced Cheater
Reputation: 1

Joined: 08 Mar 2013
Posts: 57

PostPosted: Sun May 03, 2015 11:40 am    Post subject: Reply with quote

I've actually noticed something very interesting here, look at this:

aobscan(items, 88 54 37 08 8B 0D 5C 38 3C 03 8B 79 18 3B 77 04)

mov ecx,[033C385C]

I restarted the game several times just to make sure, and it is the case every single time. The 9th byte shown in the aobscan is always the one that gets replaced right after mov ecx, [03__385C]. Now my question is can I somehow copy the 9th byte and put it in that location in my script? If so how can I do something like this?
Back to top
View user's profile Send private message
Zanzer
I post too much
Reputation: 126

Joined: 09 Jun 2013
Posts: 3278

PostPosted: Sun May 03, 2015 1:56 pm    Post subject: Reply with quote

readmem(items+8, 1)
Reads the [1] byte at the address [items+8] into your code wherever it is placed.
Back to top
View user's profile Send private message
ubiByte
Advanced Cheater
Reputation: 1

Joined: 08 Mar 2013
Posts: 57

PostPosted: Sun May 03, 2015 2:32 pm    Post subject: Reply with quote

Zanzer wrote:
readmem(items+8, 1)
Reads the [1] byte at the address [items+8] into your code wherever it is placed.


Just a few questions
Shouldn't it be items+9? or does it start counting from zero? Also how would I implement that into my code?

I can use readmem(items+8, 1) to grab 3C in this case if I am not mistaken. But how do I use that, is it possible to create a variable to hold that value like you can in java or vb or something like that?

mov ecx, [03[items+8]385C] --> you can't actually do anything like this right?

Code:
[ENABLE]
aobscan(combo, FF 40 64 8B 15 5C 38 ?? 03 D9 45 0C DD 9D 10 FF FF FF)
alloc(newmem, $1000)
label(return)

newmem:
add [eax+64], #3
mov edx,[0332385C]
jmp return

combo:
jmp newmem
nop
nop
nop
nop
return:
registersymbol(combo)

[DISABLE]
combo:
db FF 40 64 8B 15 5C 38 61 03
unregistersymbol(combo)
dealloc(newmem)


How would I use readmem(items+7,1) here for example to insert into mov edx, [03__385C] into that spot?

I have this figured out in my head only if I could code it. I want to basically use readmem(items+7,1) grab that value which in the example I just gave would be whatever the ?? turns out to be. Once I grab that, put that into mov edx, [03__385C] into that spot somehow.
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 Discussions 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