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 


autoassembler label help request

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine
View previous topic :: View next topic  
Author Message
PedraSimon
Master Cheater
Reputation: 0

Joined: 14 Feb 2006
Posts: 368

PostPosted: Thu Mar 02, 2006 9:01 am    Post subject: autoassembler label help request Reply with quote

hi..

I wonder if there is a way to define label to addr that are not dynamic? like a constant value/addr?

This is to make my autoscript more readable and maintainable. For example, instead of

Code:
mov eax,[12345678]
.....
inc [12345678]
.....


can i do something to the effect of ..
Code:
label (hpvalue=12345678)
mov eax,[hpvalue]
.....
inc [hpvalue]
.....


btw, is CE autoscripts based on some standard ASM instructions? I am new to assembly, but is able to deal with the standard instructions(mov, inc...etc). but things like label, I am not too sure..

Thanx in advance

_________________
Back to top
View user's profile Send private message MSN Messenger
Dark Byte
Site Admin
Reputation: 470

Joined: 09 May 2003
Posts: 25812
Location: The netherlands

PostPosted: Thu Mar 02, 2006 1:07 pm    Post subject: Reply with quote

yes you can label addresses, but it wasn't really designed for values (more for addresses) but it's possible to use it like that yes: (probably not what you expected)
Code:

alloc(mycode,512)
label(hpvalue)

12345678:
hpvalue:

mycode:
mov eax,hpvalue



Also a assembler hint: addresses go between a [ ] constant values not. So don't do mov eax,[hpvalue] because that would result in reading the address 12345678 into eax instead of placing the value 12345678 in eax

also," inc [hpvalue] " is not possible. inc can only work on registers and direct memory locations. Not constant values. (so inc eax or inc [addressofvalue] )

of course if you want a variable in your auto assemble script:
Code:

alloc(hpvalue,4)
alloc(mycode,512)

hpvalue:
dd 0 //initialize hpvalue to 0

mycode:
mov eax,[hpvalue]  //place the value hpvalue points to into eax
inc [hpvalue] //increase the value pointed to by hpvalue



closest standard is probably inline assembler code

_________________
Do not ask me about online cheats. I don't know any and wont help finding them.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
PedraSimon
Master Cheater
Reputation: 0

Joined: 14 Feb 2006
Posts: 368

PostPosted: Thu Mar 09, 2006 9:10 am    Post subject: Reply with quote

thx DarkByte, for the explanation. Qn. How can i put the addr of alloc label in a fixed mem location.

I tried this:
Code:
alloc(ListSize, 1024)
alloc(newCodes,1024)

004001dd:
db ListSize

newCodes:
[...blah blah...]

But the addr of ListSize is not inserted at 004001dd .. What is my mistake?

Thanx

_________________
Back to top
View user's profile Send private message MSN Messenger
Dark Byte
Site Admin
Reputation: 470

Joined: 09 May 2003
Posts: 25812
Location: The netherlands

PostPosted: Thu Mar 09, 2006 10:04 am    Post subject: Reply with quote

try "dd ListSize" db is 1 byte, dd is 4 byte
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
PedraSimon
Master Cheater
Reputation: 0

Joined: 14 Feb 2006
Posts: 368

PostPosted: Thu Mar 09, 2006 1:10 pm    Post subject: Reply with quote

Thank you very much. You have been very helpful.
_________________
Back to top
View user's profile Send private message MSN Messenger
PedraSimon
Master Cheater
Reputation: 0

Joined: 14 Feb 2006
Posts: 368

PostPosted: Mon May 01, 2006 11:55 pm    Post subject: Reply with quote

Hi DB,

I hv the following test codes, which works w/o error in 5.2 (not sure build number), but now the same code gives error "not all instructions could be injected" ( CE 5.2.78 )

Code:
alloc(dupeFlag,4)
alloc(dodupe,256)

00400418:
dd dupeFlag

dodupe:
ret


Essentially, I need to put the addr of a allocated memory into a specific addr (in this case, 00400418). If this is no longer allowed in latest CE, how can we workaround?
Pls help

_________________
Back to top
View user's profile Send private message MSN Messenger
Dark Byte
Site Admin
Reputation: 470

Joined: 09 May 2003
Posts: 25812
Location: The netherlands

PostPosted: Tue May 02, 2006 12:29 am    Post subject: Reply with quote

disable kernelmode read/writeprocessmemory
or edit the soucecode and add the check back that filters out usermode checks

_________________
Do not ask me about online cheats. I don't know any and wont help finding them.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
PedraSimon
Master Cheater
Reputation: 0

Joined: 14 Feb 2006
Posts: 368

PostPosted: Wed May 03, 2006 8:08 am    Post subject: Reply with quote

tx for the reply.. I also found an earlier thread that covers the same issue.. Kinda tied up with something now.. will try it soon..

Thanx

_________________
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 -> Cheat Engine 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