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 store address and write to it
Goto page 1, 2  Next
 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine
View previous topic :: View next topic  
Author Message
erfg1
Cheater
Reputation: 0

Joined: 14 Jul 2013
Posts: 49

PostPosted: Wed Feb 22, 2017 10:30 pm    Post subject: AoB store address and write to it Reply with quote

I want to be able to write to an address's value and find it via AoB scan.

When I try to save this script it says it won't be able to inject. I have been searching up and down for a solution but I cannot locate anything about it.

Code:
[ENABLE]
//code from here to '[DISABLE]' will be used to enable the cheat
alloc(newmem,2048)
label(returnhere)
label(exit)

newmem: //this is allocated memory, you have read,write,execute access
aobscan(findit,88 86 87 00 00 00 E8 F1 FA FF FF 84 C0 0F 94 C0)
movss [ecx+1C],xmm0
push eax
mov eax,(float)1908
mov [findit],eax
pop eax

exit:
jmp returnhere

//"Game.dll"+3DA35
aobscan(start,F3 0F 11 41 1C F3 0F 10 41 24 F3 0F 58 C1 F3 0F)
start:
jmp newmem
returnhere:


 
 
[DISABLE]
//code from here till the end of the code will be used to disable the cheat
dealloc(newmem)
"Game.dll"+3DA35:
movss [ecx+1C],xmm0

_________________
OPEN SOURCE C# WINDOWS TRAINER DLL: http://forum.cheatengine.org/viewtopic.php?p=5665803

OPEN SOURCE OBJECTIVE-C MACOS TRAINER DYLIB: https://github.com/erfg12/memory-dylib
Back to top
View user's profile Send private message Visit poster's website
SunBeam
I post too much
Reputation: 65

Joined: 25 Feb 2005
Posts: 4022
Location: Romania

PostPosted: Thu Feb 23, 2017 7:48 am    Post subject: Reply with quote

Try this:

Code:
[ENABLE]

aobscanmodule( findit, Game.dll, 888687000000E8F1FAFFFF84C00F94C0 )
registersymbol( findit )
alloc( newmem, 2048, Game.dll )
label( PTR )
registersybmol( PTR )
label( const )
label( back )

newmem:
movss [ecx+1C],xmm0
push eax
mov [PTR],ecx // store pointer
mov eax,[const] // get 1908
mov [ecx+1C],eax // write it
pop eax
jmp back

const:
dd (float)1908

//"Game.dll"+3DA35
findit:
jmp newmem
back:
// add NOPs here to normalize code
 
[DISABLE]

//"Game.dll"+3DA35:
findit:
movss [ecx+1C],xmm0

unregistersybmol( PTR )
dealloc( newmem )
unregistersymbol( findit )

You can now add a new address to the list, type in PTR and give it a name. This will be your base pointer. Adding 1 level to it, offset 1C, would point to your location where you want to write the 1908.

BR,
Sun
Back to top
View user's profile Send private message
erfg1
Cheater
Reputation: 0

Joined: 14 Jul 2013
Posts: 49

PostPosted: Thu Feb 23, 2017 4:20 pm    Post subject: Reply with quote

I tried modifying it a bit but the game froze.

Code:
[ENABLE]

aobscanmodule( findit, Game.dll, 888687000000E8F1FAFFFF84C00F94C0 )
registersymbol( findit )
alloc( newmem, 2048, Game.dll )
registersymbol( PTR )
//label( PTR )
alloc(PTR,4)
label( const )
label( back )

newmem:
movss [ecx+1C],xmm0
push eax
mov [PTR],ecx // store pointer
mov eax,[const] // get 1908
mov [ecx+1C],eax // write it
pop eax
jmp back

const:
dd (float)1908

//"Game.dll"+3DA35
findit:
jmp newmem
back:
// add NOPs here to normalize code

[DISABLE]

//"Game.dll"+3DA35:
findit:
movss [ecx+1C],xmm0

//unregistersybmol( PTR )
dealloc( newmem )
unregistersymbol( findit )


There was an error when trying to save the script you provided:



Capture.PNG
 Description:
 Filesize:  5.04 KB
 Viewed:  14052 Time(s)

Capture.PNG



_________________
OPEN SOURCE C# WINDOWS TRAINER DLL: http://forum.cheatengine.org/viewtopic.php?p=5665803

OPEN SOURCE OBJECTIVE-C MACOS TRAINER DYLIB: https://github.com/erfg12/memory-dylib
Back to top
View user's profile Send private message Visit poster's website
SunBeam
I post too much
Reputation: 65

Joined: 25 Feb 2005
Posts: 4022
Location: Romania

PostPosted: Thu Feb 23, 2017 5:26 pm    Post subject: Reply with quote

Forgot to declare PTR:

Code:
[ENABLE]

aobscanmodule( findit, Game.dll, 888687000000E8F1FAFFFF84C00F94C0 )
registersymbol( findit )
alloc( newmem, 2048, Game.dll )
label( PTR )
registersybmol( PTR )
label( const )
label( back )

newmem:
movss [ecx+1C],xmm0
push eax
mov [PTR],ecx // store pointer
mov eax,[const] // get 1908
mov [ecx+1C],eax // write it
pop eax
jmp back

const:
dd (float)1908

PTR:
dd 0

//"Game.dll"+3DA35
findit:
jmp newmem
back:
 
[DISABLE]

//"Game.dll"+3DA35:
findit:
movss [ecx+1C],xmm0

unregistersybmol( PTR )
dealloc( newmem )
unregistersymbol( findit )

Make sure the aobscan pattern "888687000000E8F1FAFFFF84C00F94C0" is unique. If there's too many results found, you'll have to add to it to make it unique.

BR,
Sun
Back to top
View user's profile Send private message
erfg1
Cheater
Reputation: 0

Joined: 14 Jul 2013
Posts: 49

PostPosted: Thu Feb 23, 2017 6:19 pm    Post subject: Reply with quote

Here is my modified code:

Code:
[ENABLE]

aobscanmodule( findit, Game.dll, ??????????000000000000000000C84101??????0000964300003944 )
registersymbol( findit )
alloc( newmem, 2048, Game.dll )
label( PTR )
registersymbol( PTR )
label( const )
label( back )

newmem:
movss [ecx+1C],xmm0
push eax
mov [PTR],ecx // store pointer
mov eax,[const] // get 1908
mov [ecx+1C],eax // write it
pop eax
jmp back

const:
dd (float)1908

PTR:
dd 0

//"Game.dll"+3DA35
findit:
jmp newmem
back:

[DISABLE]

//"Game.dll"+3DA35:
findit:
movss [ecx+1C],xmm0

unregistersymbol( PTR )
dealloc( newmem )
unregistersymbol( findit )


The active checkbox cant be checked so something must be wrong.

_________________
OPEN SOURCE C# WINDOWS TRAINER DLL: http://forum.cheatengine.org/viewtopic.php?p=5665803

OPEN SOURCE OBJECTIVE-C MACOS TRAINER DYLIB: https://github.com/erfg12/memory-dylib
Back to top
View user's profile Send private message Visit poster's website
++METHOS
I post too much
Reputation: 92

Joined: 29 Oct 2010
Posts: 4197

PostPosted: Thu Feb 23, 2017 6:28 pm    Post subject: Reply with quote

Quote:
??????????000000000000000000C84101??????0000964300003944

FYI - any wildcard variables at the beginning or end of an AOB signature serve no purpose.
Back to top
View user's profile Send private message
erfg1
Cheater
Reputation: 0

Joined: 14 Jul 2013
Posts: 49

PostPosted: Thu Feb 23, 2017 10:07 pm    Post subject: Reply with quote

I'm pretty new to the scripting system in cheat engine, but I saw something about LUA and ASM can be on the same script. So, I made this...

Code:
[ENABLE]
{$lua}
local res = AOBScan("?? ?? ?? ?? ?? 00 00 00 00 00 00 00 00 00 C8 41 01 ?? ?? ?? 00 00 96 43 00 00 ?? ?? 00 00 00 00 00 00 00 00 BC 5F ?? 56 ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? 00 00 00 00 BC 5F ?? 56 ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? 00 00 00 00 00 00 00 00 00 00 48 42 00 00 48 42 00 00 48 42 00 00 7A 4300 00 7A 43 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 96 43 00 00 00 00 1F 85 6B 3F 00 00 A0 3F 00 00 A0 3F CD CC 4C BD 00 00 82 42")
if res == nil then return end
registerSymbol('myCurHP',res[0])

{$asm}
[DISABLE]
unregistersymbol(myCurHP)
dealloc(myCurHP)


Now I can use myCurHP for my characters HP.

_________________
OPEN SOURCE C# WINDOWS TRAINER DLL: http://forum.cheatengine.org/viewtopic.php?p=5665803

OPEN SOURCE OBJECTIVE-C MACOS TRAINER DYLIB: https://github.com/erfg12/memory-dylib
Back to top
View user's profile Send private message Visit poster's website
SunBeam
I post too much
Reputation: 65

Joined: 25 Feb 2005
Posts: 4022
Location: Romania

PostPosted: Fri Feb 24, 2017 4:46 am    Post subject: Reply with quote

So, you're still in need of help or figured it out?..
Back to top
View user's profile Send private message
erfg1
Cheater
Reputation: 0

Joined: 14 Jul 2013
Posts: 49

PostPosted: Fri Feb 24, 2017 7:23 am    Post subject: Reply with quote

Only issue I'm having is unregistering the symbol. I run an lua script to unregistered it but it won't do it.

Also, do lua scripts auto execute when you open the .CT files?

_________________
OPEN SOURCE C# WINDOWS TRAINER DLL: http://forum.cheatengine.org/viewtopic.php?p=5665803

OPEN SOURCE OBJECTIVE-C MACOS TRAINER DYLIB: https://github.com/erfg12/memory-dylib
Back to top
View user's profile Send private message Visit poster's website
SunBeam
I post too much
Reputation: 65

Joined: 25 Feb 2005
Posts: 4022
Location: Romania

PostPosted: Fri Feb 24, 2017 8:20 am    Post subject: Reply with quote

If symbol was not registered to begin with, then unregistering won't work. As for LUA, scripts do auto-run; you can disable this in CE's settings (General Settings -> Ask to run lua scripts from tables; Always run lua scripts from tables).
Back to top
View user's profile Send private message
++METHOS
I post too much
Reputation: 92

Joined: 29 Oct 2010
Posts: 4197

PostPosted: Fri Feb 24, 2017 9:59 am    Post subject: Reply with quote

erfg1 wrote:
Code:
[ENABLE]
{$lua}
local res = AOBScan("?? ?? ?? ?? ?? 00 00 00 00 00 00 00 00 00 C8 41 01 ?? ?? ?? 00 00 96 43 00 00 ?? ?? 00 00 00 00 00 00 00 00 BC 5F ?? 56 ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? 00 00 00 00 BC 5F ?? 56 ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? 00 00 00 00 00 00 00 00 00 00 48 42 00 00 48 42 00 00 48 42 00 00 7A 4300 00 7A 43 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 96 43 00 00 00 00 1F 85 6B 3F 00 00 A0 3F 00 00 A0 3F CD CC 4C BD 00 00 82 42")
if res == nil then return end
registerSymbol('myCurHP',res[0])

{$asm}
[DISABLE]
unregistersymbol(myCurHP)
dealloc(myCurHP)

++METHOS wrote:
Quote:
??????????000000000000000000C84101??????0000964300003944

FYI - any wildcard variables at the beginning or end of an AOB signature serve no purpose.
Back to top
View user's profile Send private message
STN
I post too much
Reputation: 42

Joined: 09 Nov 2005
Posts: 2672

PostPosted: Fri Feb 24, 2017 11:03 am    Post subject: Reply with quote

++METHOS wrote:
erfg1 wrote:
Code:
[ENABLE]
{$lua}
local res = AOBScan("?? ?? ?? ?? ?? 00 00 00 00 00 00 00 00 00 C8 41 01 ?? ?? ?? 00 00 96 43 00 00 ?? ?? 00 00 00 00 00 00 00 00 BC 5F ?? 56 ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? 00 00 00 00 BC 5F ?? 56 ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? 00 00 00 00 00 00 00 00 00 00 48 42 00 00 48 42 00 00 48 42 00 00 7A 4300 00 7A 43 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 96 43 00 00 00 00 1F 85 6B 3F 00 00 A0 3F 00 00 A0 3F CD CC 4C BD 00 00 82 42")
if res == nil then return end
registerSymbol('myCurHP',res[0])

{$asm}
[DISABLE]
unregistersymbol(myCurHP)
dealloc(myCurHP)

++METHOS wrote:
Quote:
??????????000000000000000000C84101??????0000964300003944

FYI - any wildcard variables at the beginning or end of an AOB signature serve no purpose.


I guess he wants to start from the first byte (res:) even if ignoring it instead of adding offsets (res+1234:).

Or maybe he doesn't understand what you're talking about.

_________________
Cheat Requests/Tables- Fearless Cheat Engine
https://fearlessrevolution.com
Back to top
View user's profile Send private message
erfg1
Cheater
Reputation: 0

Joined: 14 Jul 2013
Posts: 49

PostPosted: Fri Feb 24, 2017 1:14 pm    Post subject: Reply with quote

@SunBeam I think it's currently registered. How can I tell? It shows the old address it used to be when I made the LUA script the first time. I want it to unregister and then re-register.

@STN @++METHOS Yup, I put the byte masks there so it would start at that address.

_________________
OPEN SOURCE C# WINDOWS TRAINER DLL: http://forum.cheatengine.org/viewtopic.php?p=5665803

OPEN SOURCE OBJECTIVE-C MACOS TRAINER DYLIB: https://github.com/erfg12/memory-dylib
Back to top
View user's profile Send private message Visit poster's website
++METHOS
I post too much
Reputation: 92

Joined: 29 Oct 2010
Posts: 4197

PostPosted: Fri Feb 24, 2017 1:20 pm    Post subject: This post has 1 review(s) Reply with quote

erfg1 wrote:
@SunBeam I think it's currently registered. How can I tell?
-In memory viewer, Ctrl+U to bring up user-defined symbols.
Back to top
View user's profile Send private message
erfg1
Cheater
Reputation: 0

Joined: 14 Jul 2013
Posts: 49

PostPosted: Fri Feb 24, 2017 3:56 pm    Post subject: Reply with quote

@++METHOS Thanks! That helped a lot!

Looks like when I save the .CT after applying the lua script that symbol is saved along with it.

I was using...

Code:
[DISABLE]
unregisterSymbol(myCurHP)


which was wrong, I should have used..

Code:
[DISABLE]
unregisterSymbol('myCurHP')


So my problem is fixed. Thanks everyone who helped me! Razz

_________________
OPEN SOURCE C# WINDOWS TRAINER DLL: http://forum.cheatengine.org/viewtopic.php?p=5665803

OPEN SOURCE OBJECTIVE-C MACOS TRAINER DYLIB: https://github.com/erfg12/memory-dylib
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
Goto page 1, 2  Next
Page 1 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