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 


What the no push word, immediate in auto assemble?

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

Joined: 22 Mar 2010
Posts: 37
Location: Australia

PostPosted: Fri Sep 24, 2010 4:49 am    Post subject: What the no push word, immediate in auto assemble? Reply with quote

How do you decide how many bytes to push in CE if you are using an immediate value?

Push dword 12345 won't work, neither will push word 12345. some functions take words you know, and its annoying to load the value into registers.
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 474

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

PostPosted: Fri Sep 24, 2010 6:01 am    Post subject: Reply with quote

sub esp,paramcountinbytes (0xc in this case)
mov [esp],firstparameter
mov [esp+4],second parameter (word)
mov [esp+6],third parameter (word)
mov [esp+8],fourth parameter
call function

and which function takes a word?

_________________
Tools give you results. Knowledge gives you control.

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

Joined: 22 Mar 2010
Posts: 37
Location: Australia

PostPosted: Fri Sep 24, 2010 10:04 am    Post subject: Reply with quote

of course you could do it that way, but I regard that method as hacky. Can you still please make pushing words supported?
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 474

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

PostPosted: Fri Sep 24, 2010 10:19 am    Post subject: Reply with quote

another method would be:
Code:

db 66
push wordvalue


also, the first method I wrote isn't really that hackerish. That's the default method of stack parameter passing in 64-bit (and perhaps even faster because esp is only modified 2 times instead of 5 times)

_________________
Tools give you results. Knowledge gives you control.

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

Joined: 29 Jun 2010
Posts: 893

PostPosted: Sat Sep 25, 2010 11:11 am    Post subject: Reply with quote

TehBix,

Late to the party, but thought I'd suggest that you try it in C/C++ and ask your compiler to generate an assembly listing. I think you'll find that it either passes a DWORD despite you asking for a short or that it makes something even more hackerish than what you are calling hackerish.

Cheers
Back to top
View user's profile Send private message
Teh1337Bix
Cheater
Reputation: 3

Joined: 22 Mar 2010
Posts: 37
Location: Australia

PostPosted: Sun Sep 26, 2010 10:37 pm    Post subject: Reply with quote

I haven't written C++ in years, all I do now is assembly.

EDIT: Still I just think it would be a nice feature to having pushing words supported.
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