Page 1 of 1
dll - do not export function?
Posted: Sun Oct 02, 2011 9:43 pm
by jassing
When creating a dll, is there a way to suppress the export of a function's name?
Re: dll - do not export function?
Posted: Sun Oct 02, 2011 11:03 pm
by luis
Not declaring it with ProcedureDLL but with Procedure instead ?
Unless I misunderstood you.
Re: dll - do not export function?
Posted: Sun Oct 02, 2011 11:11 pm
by jassing
I wasn't specific enough...
I want it usable to other programs, just not visible in the dll.
Re: dll - do not export function?
Posted: Sun Oct 02, 2011 11:18 pm
by luis
In that case I've no idea, since the export table is needed to known its address, unless you have a way to know the proc offset inside the dll by some other means.
Re: dll - do not export function?
Posted: Sun Oct 02, 2011 11:47 pm
by jassing
luis wrote:In that case I've no idea, since the export table is needed to known its address, unless you have a way to know the proc offset inside the dll by some other means.
Yes, it's possible.. It's a common way to not let end users know about a function.
For instance, if you have two sales tiers.. "Basic" and "Advanced"
You can send the same dll and just change your documentation -- basic users are not told about the advanced functions.
Then you cannot just "look" at the dll to uncover function names, you must
know them ahead of time.
Exports really mean the function is visible. In C it's done with an additional file (def) that is sent to the linker.
Re: dll - do not export function?
Posted: Mon Oct 03, 2011 9:37 pm
by Thorium
jassing wrote:luis wrote:In that case I've no idea, since the export table is needed to known its address, unless you have a way to know the proc offset inside the dll by some other means.
Yes, it's possible.. It's a common way to not let end users know about a function.
For instance, if you have two sales tiers.. "Basic" and "Advanced"
You can send the same dll and just change your documentation -- basic users are not told about the advanced functions.
Then you cannot just "look" at the dll to uncover function names, you must
know them ahead of time.
Exports really mean the function is visible. In C it's done with an additional file (def) that is sent to the linker.
Exported functions need to be in the export table. What is common is that functions get numbers as names. Like #1, #2 #3. You just ship 2 different header files to your costumers one without the imports and one that imports the functions with alias names.
Exported doesnt mean it's visible it means the PE loader will get the address of the function and store it in the export table to make it accessable by the main program. That is needed because the DLL can be loaded to any address, so addresses of the functions are changing and cant be staticly stored.
Re: dll - do not export function?
Posted: Wed Oct 05, 2011 2:15 am
by idle
use oo methods in your dll so you only need to export the init function