flat assembler
Message board for the users of flat assembler.
Index
> Windows > Simple DLL template? |
Author |
|
kohlrak 20 Dec 2007, 01:19
Erm, you want a DLL that calls procedures from an EXE?
|
|||
20 Dec 2007, 01:19 |
|
AlexP 20 Dec 2007, 01:22
no, I just want a simple dll - I have a lot of asm code that I do not want in the program, so I want to know how to create a dll in assembly, call that dll from a program in assembly (just how to import it) and that is it. Sry for unclear-ness
|
|||
20 Dec 2007, 01:22 |
|
LocoDelAssembly 20 Dec 2007, 01:41
Have you checked the examples on the package? (EXAMPLES\DLL)
|
|||
20 Dec 2007, 01:41 |
|
AlexP 20 Dec 2007, 01:46
Yes, they are for gui things, I'll look over -it- again but I got a little lost when they started calling proc. Do you need to have your dll functions declared as proc for them to be exported? or can you just export a label? All I have is raw assembly, no structures, proc, or anything like that. Just a simple, few-line template of how to make the library and anything special that is needed.
PS: do I need to declare .reloc like the example does? Just wonderin. Is this it? Code: format PE DLL ;Don't know if console or gui entry MyLabel include '%fasminc%\win32ax.inc' section '.code' code readable executable MyLabel: ;?? why does a dll need an entry?? ;Couldn't I just place all my functions ;In here and declare no entry?? ;Or is it just for show? OneOfMyFunctions: ;LALALALA section '.idata' import data readable writeable ;Nothing to import!!! all my code i have ;But I think windows always needs an import.. section '.edata' export data readable export 'MYLIB.DLL',\ ;All my labels here that represent functions MyFunction,'OneOfMyFunctions' section '.reloc' fixups data discardable ;Do I really need to include this section? |
|||
20 Dec 2007, 01:46 |
|
kohlrak 20 Dec 2007, 05:00
Proc is just a fancy lable and local variable set. You don't have to use proc, but it does make it easier. As for the reloc, i heard you do, but i never tested to find out what happens if you don't have it.
|
|||
20 Dec 2007, 05:00 |
|
revolution 20 Dec 2007, 05:13
kohlrak wrote: As for the reloc, i heard you do, but i never tested to find out what happens if you don't have it. In many cases the DLL will still load and work without the relocations but it is not possible to guarantee it will work in all cases. |
|||
20 Dec 2007, 05:13 |
|
AlexP 20 Dec 2007, 22:16
Yes, I have known that the reloc in DLL's are needed, but I didn't think that in Windows a program with one dll would need it. I will include it anyway, justfor good practice
NEW QUESTION: Does the entry point in a DLL get executed whenever a function in the dll is called? How does that work? Would this work? Code: format PE GUI 4.0 DLL entry Init ;Later Init: push ebp mov ebp,esp pusha ret ;All my functions already have above code done for them? |
|||
20 Dec 2007, 22:16 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.