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 


Calling Functions in assembly

 
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: Tue Mar 23, 2010 6:52 am    Post subject: Calling Functions in assembly Reply with quote

in /keypresstut.php on the official cheat engine site (stupid forum won't let me post URL)

In that tutorial the author talks about calling the GetAsyncKeystate function in User32.dll. I am a C# programmer and use that method in heaps of my programs. From what I gather you need to push the value you want to pass in to the function, and then to get the value out of the function, you use eax.

Is this the case for all functions?
How do I use functions not in User32.dll?
How do I pass in more than one value for functions that take more than one?
Where are the values stored if I get an array back?

So basically I am asking for a guide on this whole calling functions in assembly thing.
Back to top
View user's profile Send private message
Slugsnack
Grandmaster Cheater Supreme
Reputation: 71

Joined: 24 Jan 2007
Posts: 1857

PostPosted: Tue Mar 23, 2010 8:05 am    Post subject: Reply with quote

it all depends on how you are coding. if you are using pure assembly without high level constructs such as macros then all parameters must be pushed onto the stack in reverse order. eax, ecx and edx are designated to be trash registers. eax holds the return value. this call convention is known as stdcall and is used by x86 windows.

what are you writing your code in ? auto-assembler ?
Back to top
View user's profile Send private message
Teh1337Bix
Cheater
Reputation: 3

Joined: 22 Mar 2010
Posts: 37
Location: Australia

PostPosted: Tue Mar 23, 2010 11:29 pm    Post subject: Reply with quote

Yeah I'm coding in AA. How would I get the system time by calling this function?

msdn(dot)microsoft(dot)com/en-us/library/ms724390%28VS.85%29.aspx
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