dll - do not export function?

Windows specific forum
jassing
Addict
Addict
Posts: 1885
Joined: Wed Feb 17, 2010 12:00 am

dll - do not export function?

Post by jassing »

When creating a dll, is there a way to suppress the export of a function's name?
User avatar
luis
Addict
Addict
Posts: 3895
Joined: Wed Aug 31, 2005 11:09 pm
Location: Italy

Re: dll - do not export function?

Post by luis »

Not declaring it with ProcedureDLL but with Procedure instead ?

Unless I misunderstood you.
"Have you tried turning it off and on again ?"
jassing
Addict
Addict
Posts: 1885
Joined: Wed Feb 17, 2010 12:00 am

Re: dll - do not export function?

Post by jassing »

I wasn't specific enough...
I want it usable to other programs, just not visible in the dll.
User avatar
luis
Addict
Addict
Posts: 3895
Joined: Wed Aug 31, 2005 11:09 pm
Location: Italy

Re: dll - do not export function?

Post 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.
"Have you tried turning it off and on again ?"
jassing
Addict
Addict
Posts: 1885
Joined: Wed Feb 17, 2010 12:00 am

Re: dll - do not export function?

Post 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.
Thorium
Addict
Addict
Posts: 1308
Joined: Sat Aug 15, 2009 6:59 pm

Re: dll - do not export function?

Post 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.
User avatar
idle
Always Here
Always Here
Posts: 6048
Joined: Fri Sep 21, 2007 5:52 am
Location: New Zealand

Re: dll - do not export function?

Post by idle »

use oo methods in your dll so you only need to export the init function
Windows 11, Manjaro, Raspberry Pi OS
Image
Post Reply