|
Luigi Auriemmaaluigi.org (ARCHIVE-ONLY FORUM!) |
|
It is currently 19 Jul 2012 16:27
|
View unanswered posts | View active topics
|
Page 1 of 1
|
[ 4 posts ] |
|
Author |
Message |
JediPathetique
|
Post subject: Calling functions from a dll Posted: 15 Jan 2009 16:39 |
|
Joined: 18 Sep 2008 22:23 Posts: 32
|
Hello Here's my question: How can you call functions defined in the main exe file from a loaded DLL? I want to try creating a dll to add some code to an exe, but I need access to the exe's functions. Also, would you recommend writing a dll in asm or c?
|
|
Top |
|
|
aluigi
|
Post subject: Re: Calling functions from a dll Posted: 15 Jan 2009 18:00 |
|
Joined: 13 Aug 2007 21:44 Posts: 4068 Location: http://aluigi.org
|
when the dll is loaded you have access to anything to which the exe has access, so if this function is at offset 0x00401234 you can define it as the following example:
int (*function)(char *arg1, int arg2, int arg3) = 0x00401234;
and then you can use it normally:
ret = function("blahblah", 123, 456);
|
|
Top |
|
|
JediPathetique
|
Post subject: Re: Calling functions from a dll Posted: 16 Jan 2009 15:09 |
|
Joined: 18 Sep 2008 22:23 Posts: 32
|
Thanks! That looks easy... So how do you call a function in a dll from the main exe? (In asm)
|
|
Top |
|
|
aluigi
|
Post subject: Re: Calling functions from a dll Posted: 16 Jan 2009 15:22 |
|
Joined: 13 Aug 2007 21:44 Posts: 4068 Location: http://aluigi.org
|
|
Top |
|
|
|
Page 1 of 1
|
[ 4 posts ] |
|
|
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 post attachments in this forum
|
|