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 


Noob Minesweeper script

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Gamehacking
View previous topic :: View next topic  
Author Message
Chase Payne
Grandmaster Cheater
Reputation: 1

Joined: 20 Mar 2008
Posts: 533

PostPosted: Sat Apr 19, 2008 12:36 am    Post subject: Noob Minesweeper script Reply with quote

Code:
[ENABLE]
//code from here to '[DISABLE]' will be used to enable the cheat

alloc(newmem,2048) //2kb should be enough
label(returnhere)
label(originalcode)
label(exit)
alloc(Mines,2048)
registersymbol(Mines)

01001E76:
jmp newmem
nop
returnhere:

newmem:
push eax
mov [010056a4],eax
mov [Mines],eax
pop eax
jmp returnhere //this is allocated memory, you have read,write,execute access
//place your code here


originalcode:
//mov [010056a4],ecx

exit:
jmp returnhere
 
 
[DISABLE]
dealloc(newmem)
dealloc(Mines)
unregistersymbol(Mines)
01001E76:
mov [010056a4],ecx
//code from here till the end of the code will be used to disable the cheat

I have tried everything to make this work, but the miens dont go to 1... they just lower to 12 or 24, and crash on beginner.... any sugesstions on how to make it work? I know its a worthless cript... but I'm trying to learn.
I will +rep the person who explains what I should do and very detailed.
Back to top
View user's profile Send private message
Psy
Grandmaster Cheater Supreme
Reputation: 1

Joined: 27 Mar 2008
Posts: 1366

PostPosted: Sat Apr 19, 2008 2:54 am    Post subject: Reply with quote

What are you using to do this?
Have you done this table or is it from someone else.

Without popping open minesweeper myself, this areas looks suspect:

Code:

mov [010056a4],eax
mov [Mines],eax
Back to top
View user's profile Send private message
Chase Payne
Grandmaster Cheater
Reputation: 1

Joined: 20 Mar 2008
Posts: 533

PostPosted: Sat Apr 19, 2008 9:51 am    Post subject: Reply with quote

What im trying to do is make the new adress Mines control how many mines you have. So I figured if I store the adress in EAX it might work.
Back to top
View user's profile Send private message
Psy
Grandmaster Cheater Supreme
Reputation: 1

Joined: 27 Mar 2008
Posts: 1366

PostPosted: Sat Apr 19, 2008 10:51 am    Post subject: Reply with quote

You're guessing what to do.

You can't just decide you will stick something into a register and hope for the best, coz its never gonna work.
Read tuts, study other AA scripts... you'll get better real quick Wink
Back to top
View user's profile Send private message
HalfPrime
Grandmaster Cheater
Reputation: 0

Joined: 12 Mar 2008
Posts: 532
Location: Right there...On your monitor

PostPosted: Sat Apr 19, 2008 11:25 am    Post subject: Reply with quote

Code:
mov [Mines],eax

Stores the value of EAX into the address pointed to by Mines
Code:
mov [010056a4],eax

this stores the value of EAX into the address pointed to by [010056a4] which I assume is the number of mines. Problem is, you just pushed EAX right before, so I have no idea what EAX is at that point.
Back to top
View user's profile Send private message
Chase Payne
Grandmaster Cheater
Reputation: 1

Joined: 20 Mar 2008
Posts: 533

PostPosted: Sat Apr 19, 2008 11:35 am    Post subject: Reply with quote

what do you mean? People say you always push the stack before changing anything so nothing screws up... even without push the script doesn't work.
Back to top
View user's profile Send private message
Labyrnth
Moderator
Reputation: 10

Joined: 28 Nov 2006
Posts: 6301

PostPosted: Sat Apr 19, 2008 12:19 pm    Post subject: Reply with quote

Chase when you change the address of how many mines you have , im sure you got to hit F2 on minesweeper to reset the game so it can not draw but 1 mine, If you change it after all the mines are drawn it will still have them all.
Back to top
View user's profile Send private message
Chase Payne
Grandmaster Cheater
Reputation: 1

Joined: 20 Mar 2008
Posts: 533

PostPosted: Sat Apr 19, 2008 10:45 pm    Post subject: Reply with quote

Did any of you actually tried the script... of course I know to hit f2 to make sure the mines update, but the idea of this script was to make the registered address ''mines'' to change the number of mines.
I'm not guessing what to do.
Quote:
Dark Byte wrote:
I am assuming you have read the info about auto assembler scripts in cheat tables: http://forum.cheatengine.org/viewtopic.php?t=4868

Let's continue with explaining the use of registersymbol and unregistersymbol.

When you have registered a symbol by either manually inputting it in the userdefined symbollist in the memory view, or by registering it by auto assemble script, you can then use it as if it is a normal address.

So, if you allocate some memory, and store a address there using the script, you can then easily access it by it's name.

Let's take a look at the auto assembler script of the pinball tutorial, and change it slightly:
Code:

[ENABLE]
//code from here to '[DISABLE]' will be used to enable the cheat
registersymbol(pointertoballs) //add "pointertoballs" to the userdefined symbollist

alloc(newmem,2048) //2kb should be enough
alloc(pointertoballs,4)


label(returnhere)
label(originalcode)
label(exit)

Pinball.exe+175b7:
jmp newmem
nop
returnhere:

newmem: //this is allocated memory, you have read,write,execute access
//place your code here
mov [pointertoballs],esi //store the base address to pointertoballs

originalcode:
mov [esi+00000146],eax

exit:
jmp returnhere
 
 
[DISABLE]
//code from here till the end of the code will be used to disable the cheat
unregistersymbol(pointertoballs)
dealloc(newmem)
dealloc(pointertoballs)

Pinball.exe+175b7:
mov [esi+00000146],eax


as you see, I allocated 4 extra bytes to store the register value of esi in, and registered that address, and deallocate that memory in the disable part, and unregister it (so it becomes useless after disabling it)

I could have used:
[qoute]
push eax
lea eax,[esi+146]
mov [pointertoballs],eax
pop eax

[/qoute]
to store the exact address, but let's keep it easy for people with only a little assembler knowledge


One downside is of course that after enabling the script, the address doesn't immediately hold the right value, but only after it has been executed. So keep that in mind.

Another thing is that addresses that use the symbolname pointertoballs only get updated after a few seconds, so the first few seconds it may be pointing at a old address. One way to get by this is rightclick and choose "force recheck symbols"

anyhow, when the script has been executed you can use it for all sorts of useful things, like a base pointer...

As you can clearly see his registered address is moving into esi. And it works. My question is how mine doesn't.
Back to top
View user's profile Send private message
HalfPrime
Grandmaster Cheater
Reputation: 0

Joined: 12 Mar 2008
Posts: 532
Location: Right there...On your monitor

PostPosted: Sun Apr 20, 2008 1:23 pm    Post subject: Reply with quote

Code:
mov [pointertoballs],esi //store the base address to pointertoballs

Is what you're missing. Mines is just garbage data so it's pointing to some random place in memory, not to where the mines are kept.
Back to top
View user's profile Send private message
Labyrnth
Moderator
Reputation: 10

Joined: 28 Nov 2006
Posts: 6301

PostPosted: Sun Apr 20, 2008 1:32 pm    Post subject: Reply with quote

Pointertoballs is a code cave.
And is getting filled with the bytes from esi.

Also another thing, chase in your script you still have the original address's code in place.

Try this script:
Code:

[ENABLE]
//code from here to '[DISABLE]' will be used to enable the cheat
registersymbol(pointertoballs) //add "pointertoballs" to the userdefined symbollist

alloc(newmem,2048) //2kb should be enough
alloc(pointertoballs,4)


label(returnhere)
label(originalcode)
label(exit)

Pinball.exe+175b7:
jmp newmem
nop
returnhere:

newmem: //this is allocated memory, you have read,write,execute access
//place your code here
mov [pointertoballs],esi //store the base address to pointertoballs
mov [esi+00000146],eax

originalcode:


exit:
jmp returnhere
 
 
[DISABLE]
//code from here till the end of the code will be used to disable the cheat

Pinball.exe+175b7:
mov [esi+00000146],eax
unregistersymbol(pointertoballs)
dealloc(newmem)
dealloc(pointertoballs)
Back to top
View user's profile Send private message
Chase Payne
Grandmaster Cheater
Reputation: 1

Joined: 20 Mar 2008
Posts: 533

PostPosted: Mon Apr 21, 2008 11:00 pm    Post subject: Reply with quote

this is the correct script Wink
Lab gave me a big hint... and I jsut realised it after I made this script ... bytes are writing to esi
Code:
[ENABLE]
//code from here to '[DISABLE]' will be used to enable the cheat

alloc(newmem,2048) //2kb should be enough
label(returnhere)
label(originalcode)
label(exit)
alloc(Mines,2048)
registersymbol(Mines)

01001E76:
jmp newmem
nop
returnhere:

newmem:
push ecx
mov [010056a4],ecx
mov ecx,#0
pop ecx
push eax
mov eax,#0
add eax,[Mines]
mov [010056a4],eax
pop eax
jmp returnhere //this is allocated memory, you have read,write,execute access
//place your code here


originalcode:
//mov [010056a4],ecx

exit:
jmp returnhere


[DISABLE]
dealloc(newmem)
dealloc(Mines)
unregistersymbol(Mines)
01001E76:
mov [010056a4],ecx
//code from here till the end of the code will be used to disable the cheat


I made mines 0, then I made the mines add from the new adress called MINES that's all I wanted.... but thanks for the help anyways Wink[
Quote:
You can't just decide you will stick something into a register and hope for the best

Well with this script you can just store something in eax and does what it's told....
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