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 


[CE ASM] Help on storing register value in allocated...

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
Nuclear898
Grandmaster Cheater Supreme
Reputation: 0

Joined: 04 Jun 2006
Posts: 1597
Location: The Netherlands

PostPosted: Mon Jul 14, 2008 6:10 am    Post subject: [CE ASM] Help on storing register value in allocated... Reply with quote

I need some help,
I'm trying to store the value stored in the EAX register in my registered symbol 'storageX'

I tried this:

alloc(storageX, 4)
registersymbol(storageX)

storageX:
db 00 00 00 00

blablabla:
mov eax, [0086000] // just a random pointer
mov eax, [eax+49c] //just arandom pointer offset
mov storageX, [eax]

but it gives an error when trying to assemble to cheat table
Cannot execute line 34: (mov 0000000, [eax])


how do I solve this?
Back to top
View user's profile Send private message
DoomsDay
Grandmaster Cheater
Reputation: 0

Joined: 06 Jan 2007
Posts: 768
Location: %HomePath%

PostPosted: Mon Jul 14, 2008 6:36 am    Post subject: Reply with quote

mov storageX, [eax] equals to mov [storageX], [eax], which is invalid
Code:
[Enable]
Alloc(Mem,128)
Label(Code)
  Label(start)
Label(Data)
  Label(StorageX)
  RegisterSymbol(StorageX)

Mem:
  Code:
    start:
      mov  eax,[0086000]
      mov  eax,[eax+0000049C]
      push [eax]
      pop  [StorageX]
  Data:
    StorageX:
      dd 00

[Disable]
Dealloc(Mem)
UnregisterSymbol(StorageX)
Back to top
View user's profile Send private message
Nuclear898
Grandmaster Cheater Supreme
Reputation: 0

Joined: 04 Jun 2006
Posts: 1597
Location: The Netherlands

PostPosted: Mon Jul 14, 2008 7:32 am    Post subject: Reply with quote

Hmm so you just push Eax's value onto the stack and then pop it into StorageX?

but what is this for then?

Code:
    StorageX:
      dd 00
Back to top
View user's profile Send private message
Jani
Grandmaster Cheater
Reputation: 2

Joined: 29 Dec 2006
Posts: 804

PostPosted: Mon Jul 14, 2008 7:47 am    Post subject: Reply with quote

Nuclear898 wrote:
but what is this for then?

Code:
    StorageX:
      dd 00
Define dword. Same as db 00 00 00 00
Back to top
View user's profile Send private message
Nuclear898
Grandmaster Cheater Supreme
Reputation: 0

Joined: 04 Jun 2006
Posts: 1597
Location: The Netherlands

PostPosted: Mon Jul 14, 2008 8:06 am    Post subject: Reply with quote

ah ok thanks for helping!
Back to top
View user's profile Send private message
samuri25404
Grandmaster Cheater
Reputation: 7

Joined: 04 May 2007
Posts: 955
Location: Why do you care?

PostPosted: Mon Jul 14, 2008 3:54 pm    Post subject: Reply with quote

I think you should be doing

Code:

  MOV EAX, [00860000]
  LEA EAX, [EAX+49C]


And as personal preference, I'd have simply done

Code:

  MOV EAX, [EAX]
  MOV [STORAGE],EAX


But you can do it your way; it works just the same.

Edit:

Btw, when CE allocates the memory, the default for 4 bytes is 00 00 00 00 (00 per byte), so you don't need to do

Code:

Storage:
  db 00 00 00 00

_________________
Wiccaan wrote:

Oh jeez, watchout I'm a bias person! Locked.


Auto Assembly Tuts:
In Depth Tutorial on AA
Extended
Back to top
View user's profile Send private message
DoomsDay
Grandmaster Cheater
Reputation: 0

Joined: 06 Jan 2007
Posts: 768
Location: %HomePath%

PostPosted: Tue Jul 15, 2008 3:30 am    Post subject: Reply with quote

Hmm, next time I should read the question instead of the script O.O

@x0r: nice warning count =)
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 programming 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