flat assembler
Message board for the users of flat assembler.
Index
> Windows > Export from executable |
Author |
|
Nikolay Petrov 09 Jan 2005, 13:56
Please help me
How i export a functions from exe file? thanks in advance |
|||
09 Jan 2005, 13:56 |
|
vid 11 Jan 2005, 08:27
just like in DLL, create export section/data like you would in DLL
|
|||
11 Jan 2005, 08:27 |
|
vid 12 Jan 2005, 00:06
hmm, i quess it has something to do with Dll init procedures (called each time app wants to use some DLL) it is pointed by entry point of file, so i quess that you are calling ExitProcess inside it, while as DLL entry proc it should return. But i am not sure, try it.
|
|||
12 Jan 2005, 00:06 |
|
Vortex 12 Jan 2005, 18:52
Nickolay,
Why your executable should export functions? Why not to use a DLL? _________________ Code it... That's all... |
|||
12 Jan 2005, 18:52 |
|
IronFelix 14 Jan 2005, 09:08
Nikolay, i have done something like this: i exported some function from EXE and imported it in DLL, used by this EXE. I think it is useful when you want to export some pointer to datablock into DLL without extra coding (initialization functions, etc.) - this will be done by OS. But it works only on WinXP, on Win98 it fails. If you still need the example, i shall try to find it in my progs.
Regards. |
|||
14 Jan 2005, 09:08 |
|
Nikolay Petrov 14 Jan 2005, 21:59
IronFelix it's will be an interesting. I tryed, but was retuned error: the application failed to initialize properly (0xc0000005)
|
|||
14 Jan 2005, 21:59 |
|
JohnFound 14 Jan 2005, 22:07
I am not very sure, but it is possible that Win98 doen't relocate the .exe files even if there is a reloc section... So, maybe it is possible to import functions dynamically using LoadLibrary or possibly LoadLibraryEx with GetProcAddress. Maybe if the .exe is loaded with LoadLibrary the loader will provide relocations???
Another atempt may be GetProcAddress with hInstance of the .exe (if this exe running in the moment)... Regards. |
|||
14 Jan 2005, 22:07 |
|
Nikolay Petrov 15 Jan 2005, 20:58
John, i think that it doesn't matter if we import a function with LoadLibrary - GetProcAddress, or as import data, but maybe you right about the way. I collect some executable with working export functions and interesting for me is a loading 'dll' address - 00410000h, but it's entry point my exe...
At this moment i exported a working function from executable without using winapi or other dll functions. If i include it - result is a 'stack is overflow' or 'Access violation reading location...'. Maybe i must read more about 'reloc' section... |
|||
15 Jan 2005, 20:58 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.