News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Exports

Started by ecube, December 10, 2006, 08:31:55 AM

Previous topic - Next topic

Vortex

E^Cube,

\MASM32\BIN\link  /DEF:exportexe.def  /base:0x47290000 /MAP /MAPINFO:FIXUPS /SUBSYSTEM:WINDOWS exportexe.obj

The address 0x47290000, has it a special meaning? How did you calculate this value?

ecube

Thanks Vortex,
to answer your question as far as I can tell that number doesn't have any signifigance other than its a multiple of 64k and it changes the entry point. I could be entirely wrong ofcourse I have to test more. The problem as I said before was a reloc issue, so I adjusted the base address to see what would happen and it appears to have fixed it. Before for instance I tried a simple string copy operation in the exported procedure and have the calling exe then messagebox the buffer with the new string only it didn't copy the new string, it messagbox'd the string that was in itself instead of the exported function because they had the same address, so by adjusting the base address it gave it a higher address and resolved the conflicts. That's my understanding at this point.

hutch--

cube,

Its worth keeping in mind that there are other methods of cross executable communication as well. Sending a private message with the HWND_BROADCAST value is one way of activating an event in an external exe file and where you need to transfer data in any quantity, you can use a memory mapped file that is accesible to both exe files that open it.

Where I can see you getting into trouble with the technique you are using is that Microsoft are closing methods of this type that don't run in the same memory space so you may end up with a broken app in a later OS version. It is viable with a DLL as it runs in the same memory space as the exe that calls it and you can directly address a procedure in either direction.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php