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 


Registering an asm pointer?

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

Joined: 29 Nov 2008
Posts: 918

PostPosted: Mon Jun 10, 2013 11:21 am    Post subject: Registering an asm pointer? Reply with quote

The asm i want to modify uses a direct memory position for its mov statement. Is there a way to register this easily so the the auto assembly can easily do it without a manual update?

mov [000D3D28],eax


Thats the op code im trying to edit and obviously the asm will need to be updated every time for the disable unless i can get an easy reference to it.

edit: So far the only thing i can think of is using lua in conjunction with it in order to do something
Back to top
View user's profile Send private message
Gniarf
Grandmaster Cheater Supreme
Reputation: 43

Joined: 12 Mar 2012
Posts: 1285

PostPosted: Mon Jun 10, 2013 3:59 pm    Post subject: Reply with quote

I'm not quite sure I understand what you mean, but if you mean that you want to make a backup of 000D3D28 to restore it properly when disabling your hack, here is something that makes a backup of the whole opcode:
Code:
[ENABLE]
globalalloc(backup,1024)

backup:
readmem(20000,6) //backup the 6 bytes at address 20000

20000:
//used to be mov [000D3D28],eax
nop
nop
nop
nop
nop
nop
 
 
[DISABLE]
unregistersymbol(backup) //does dealloc(backup)

20000:
readmem(backup,6) //restore 6 bytes from backup
Back to top
View user's profile Send private message
pox911
Grandmaster Cheater
Reputation: 28

Joined: 29 Nov 2008
Posts: 918

PostPosted: Mon Jun 10, 2013 5:46 pm    Post subject: Reply with quote

That could work. It wouldn't solve all problems down the road though but its a start. from the sounds of it though it doesn't have to be a global alloc.

Thanks. I'll poke around with it more. Razz im getting ready for the terraria update with a mouse position based monster vac.
Back to top
View user's profile Send private message
Gniarf
Grandmaster Cheater Supreme
Reputation: 43

Joined: 12 Mar 2012
Posts: 1285

PostPosted: Mon Jun 10, 2013 6:01 pm    Post subject: Reply with quote

pox911 wrote:
from the sounds of it though it doesn't have to be a global alloc.
I thought so aswell, but if you use alloc & dealloc CE will bitch about being unable to compile readmem(backup,6). Most likely it is because dealloc happens before readmem (and I guess symbol unregistering is done after both).

pox911 wrote:
It wouldn't solve all problems down the road though but its a start.
...Otherwise in AA script: luacall(registerSymbol("MySymbol",readInteger(AddressOfMovOpcode+2))) will make MySymbol=000D3D28.
Back to top
View user's profile Send private message
pox911
Grandmaster Cheater
Reputation: 28

Joined: 29 Nov 2008
Posts: 918

PostPosted: Mon Jun 10, 2013 6:33 pm    Post subject: Reply with quote

That wouldn't work for a different problem i have in a different script. I willpost an example of that problem after work
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: Tue Jun 11, 2013 5:12 am    Post subject: Reply with quote

We can use trick. For example, I used this trick for metro LL:


original code:
Code:

MetroLL.exe+5EBE3F - F3 0F59 15 A49ECD00   - mulss xmm2,[MetroLL.exe+8D9EA4]
MetroLL.exe+5EBE47 - F3 0F59 15 AC9CCD00   - mulss xmm2,[MetroLL.exe+8D9CAC]
MetroLL.exe+5EBE4F - F3 0F5C C2            - subss xmm0,xmm2
MetroLL.exe+5EBE53 - 0F2F 05 BC9CCD00      - comiss xmm0,[MetroLL.exe+8D9CBC]
MetroLL.exe+5EBE5A - F3 0F11 86 84010000   - movss [esi+00000184],xmm0


signature for aobscan:
F30F5915xxxxxxxxF30F5915xxxxxxxxF30F5CC20F2F05xxxxxxxxF30F118684010000

In our AA script we want to store value from MetroLL.exe+8D9EA4 in EAX .
mov eax,[XXXXXXXX] bytes will be: A1 and then address between []

A1 01EFCDAB - mov eax,[ABCDEF01]


So:
Code:

(...)
aobscan(AOB,F30F5915xxxxxxxxF30F5915xxxxxxxxF30F5CC20F2F05xxxxxxxxF30F118684010000)
label(AOBREGISTERED)
registersymbol(AOBREGISTERED)

label(memoryPosition)
registersymbol(memoryPosition)

[AOB+4]:         // skip F3 0F59 15
memoryPosition:

AOB:
AOBREGISTERED:
jmp newmem
nop
nop
nop
returnhere


newmem:

db A1                         //  our
dd memoryPosition     //      mov eax

// rest of code
(...)


[DISABLE]

AOBREGISTERED:
db F3 0F 59 15
dd memoryPosition

unregistersymbol(AOBREGISTERED)
unregistersymbol(memoryPosition)




Tricky part:
Code:
[AOB+4]:
memoryPosition:

_________________
Back to top
View user's profile Send private message MSN Messenger
pox911
Grandmaster Cheater
Reputation: 28

Joined: 29 Nov 2008
Posts: 918

PostPosted: Sun Jun 16, 2013 11:09 am    Post subject: Reply with quote

i tried the [AOB+4] thing and it says it couldnt compile it.


Error in line 20 ([00000000+4]Smile :This address specifier is not valid


edit: found a way to brute force it in there and it works Razz
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: Sun Jun 16, 2013 12:17 pm    Post subject: Reply with quote

Are you still using CE6.2?
_________________
Back to top
View user's profile Send private message MSN Messenger
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