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 


Regarding calling Windows API functions with ASM

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

Joined: 08 Oct 2015
Posts: 486

PostPosted: Thu Oct 06, 2016 2:30 am    Post subject: Regarding calling Windows API functions with ASM Reply with quote

1. How do we know which registers are used to passed which variables to Windows API functions? Other than to analyze the function in disassembly view and try to reverse it, the other way is to glance at Windows' API functions and try to guess the variables passed in order from eax-edx and then the stack right? But I recalled reading somewhere too that sometimes variables are passed directly through the stack instead of registers?

2. I presume if some .dll library is not bundled and loaded with a program, we won't be able to call the functions that are in that library right?
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 470

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

PostPosted: Thu Oct 06, 2016 2:53 am    Post subject: Reply with quote

1:
Windows API uses the stdcall calling method

In 32 bit windows that means 0 registers, and just on the stack only.

In 64 bit rcx, rdx, r8 and r9, and stack (https://msdn.microsoft.com/en-us/library/ms235286.aspx)

2:
The function LoadLibrary is available in the kernel, which any running program loads.
Together with getProcAddress you can get a function from that dll

_________________
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
predprey
Master Cheater
Reputation: 24

Joined: 08 Oct 2015
Posts: 486

PostPosted: Thu Oct 06, 2016 4:17 am    Post subject: Reply with quote

ah......ok. thanks.
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