C program that, after compiling and linking, results in an EXE file that contains an edata section?2019 Community Moderator ElectionWhat is the smallest possible Windows (PE) executable?When is assembly faster than C?What REALLY happens when you don't free after malloc?Improve INSERT-per-second performance of SQLite?Names of source shared libraries for imported symbols in ELF formatDifference between shared objects (.so), static libraries (.a), and DLL's (.so)?How binary file can be portable in C programming?Unresolved Reference when linking compiled code with NASM and MSVCExecutable Section Headers - Meaning and use?Role of the Dll name specified in the .edata section of a Dll
Russian cases: A few examples, I'm really confused
In-house repeater?
What is the greatest age difference between a married couple in Tanach?
How to write cleanly even if my character uses expletive language?
Be in awe of my brilliance!
Have researchers managed to "reverse time"? If so, what does that mean for physics?
Replacing Windows 7 security updates with anti-virus?
Humanity loses the vast majority of its technology, information, and population in the year 2122. How long does it take to rebuild itself?
Does splitting a potentially monolithic application into several smaller ones help prevent bugs?
How is the Swiss post e-voting system supposed to work, and how was it wrong?
Calculus II Professor will not accept my correct integral evaluation that uses a different method, should I bring this up further?
Am I not good enough for you?
Why did it take so long to abandon sail after steamships were demonstrated?
Life insurance that covers only simultaneous/dual deaths
It's a yearly task, alright
Using "wallow" verb with object
Brexit - No Deal Rejection
Validating user input
Professor being mistaken for a grad student
Why do Australian milk farmers need to protest supermarkets' milk price?
Old race car problem/puzzle
PlotLabels with equations not expressions
How to answer questions about my characters?
Why is "das Weib" grammatically neuter?
C program that, after compiling and linking, results in an EXE file that contains an edata section?
2019 Community Moderator ElectionWhat is the smallest possible Windows (PE) executable?When is assembly faster than C?What REALLY happens when you don't free after malloc?Improve INSERT-per-second performance of SQLite?Names of source shared libraries for imported symbols in ELF formatDifference between shared objects (.so), static libraries (.a), and DLL's (.so)?How binary file can be portable in C programming?Unresolved Reference when linking compiled code with NASM and MSVCExecutable Section Headers - Meaning and use?Role of the Dll name specified in the .edata section of a Dll
I am reviewing the Microsoft specification on Portable Executable files (EXE files). In particular, I am reviewing the .edata (export data) section. Here's what the specification says about the edata section:
The export data section, named .edata, contains information about
symbols that other images can access through dynamic linking. Exported
symbols are generally found in DLLs, but DLLs can also import symbols.
Can a non-DLL file have an edata section? Specifically, can a C program, after compiling and linking, result in an EXE file that contains an edata section? If yes, would you show a simple C program that, after compiling and linking, results in an EXE file that contains an edata section, please?
c compilation executable portable-executable
add a comment |
I am reviewing the Microsoft specification on Portable Executable files (EXE files). In particular, I am reviewing the .edata (export data) section. Here's what the specification says about the edata section:
The export data section, named .edata, contains information about
symbols that other images can access through dynamic linking. Exported
symbols are generally found in DLLs, but DLLs can also import symbols.
Can a non-DLL file have an edata section? Specifically, can a C program, after compiling and linking, result in an EXE file that contains an edata section? If yes, would you show a simple C program that, after compiling and linking, results in an EXE file that contains an edata section, please?
c compilation executable portable-executable
at first section name not play any role at all. and any PE can have export table, in what is problem ?
– RbMm
Mar 7 at 17:34
The export data section, named .edata - this is wrong.IMAGE_EXPORT_DIRECTORY
data directory not a section, can belong to any section with any name
– RbMm
Mar 7 at 17:36
add a comment |
I am reviewing the Microsoft specification on Portable Executable files (EXE files). In particular, I am reviewing the .edata (export data) section. Here's what the specification says about the edata section:
The export data section, named .edata, contains information about
symbols that other images can access through dynamic linking. Exported
symbols are generally found in DLLs, but DLLs can also import symbols.
Can a non-DLL file have an edata section? Specifically, can a C program, after compiling and linking, result in an EXE file that contains an edata section? If yes, would you show a simple C program that, after compiling and linking, results in an EXE file that contains an edata section, please?
c compilation executable portable-executable
I am reviewing the Microsoft specification on Portable Executable files (EXE files). In particular, I am reviewing the .edata (export data) section. Here's what the specification says about the edata section:
The export data section, named .edata, contains information about
symbols that other images can access through dynamic linking. Exported
symbols are generally found in DLLs, but DLLs can also import symbols.
Can a non-DLL file have an edata section? Specifically, can a C program, after compiling and linking, result in an EXE file that contains an edata section? If yes, would you show a simple C program that, after compiling and linking, results in an EXE file that contains an edata section, please?
c compilation executable portable-executable
c compilation executable portable-executable
asked Mar 7 at 12:10
Roger CostelloRoger Costello
1,27111225
1,27111225
at first section name not play any role at all. and any PE can have export table, in what is problem ?
– RbMm
Mar 7 at 17:34
The export data section, named .edata - this is wrong.IMAGE_EXPORT_DIRECTORY
data directory not a section, can belong to any section with any name
– RbMm
Mar 7 at 17:36
add a comment |
at first section name not play any role at all. and any PE can have export table, in what is problem ?
– RbMm
Mar 7 at 17:34
The export data section, named .edata - this is wrong.IMAGE_EXPORT_DIRECTORY
data directory not a section, can belong to any section with any name
– RbMm
Mar 7 at 17:36
at first section name not play any role at all. and any PE can have export table, in what is problem ?
– RbMm
Mar 7 at 17:34
at first section name not play any role at all. and any PE can have export table, in what is problem ?
– RbMm
Mar 7 at 17:34
The export data section, named .edata - this is wrong.
IMAGE_EXPORT_DIRECTORY
data directory not a section, can belong to any section with any name– RbMm
Mar 7 at 17:36
The export data section, named .edata - this is wrong.
IMAGE_EXPORT_DIRECTORY
data directory not a section, can belong to any section with any name– RbMm
Mar 7 at 17:36
add a comment |
1 Answer
1
active
oldest
votes
Any PE Image file may contain an export table, regardless of whether it is an EXE or DLL. However, the export tables are not necessarily contained within an .edata
section. It is, for example, common to see export tables in the .rdata
section instead.
To locate the export table, you should use the Export Table data directory, and not rely on the Section Table at all.
The following is an example C program that, when compiled, will produce an EXE with an export table. However, it might not be placed inside an .edata
section (and the EXE might not have an .edata
section at all).
#include <stdio.h>
__declspec(dllexport) void some_func(void)
printf("Hellon");
return;
int main()
return 0;
When I compile this program using Visual Studio 2017 on my system, and run dumpbin /HEADERS /EXPORTS
on the resulting EXE, I see the following:
...
SECTION HEADER #3
.rdata name
2A94 virtual size
19000 virtual address (0000000140019000 to 000000014001BA93)
2C00 size of raw data
7E00 file pointer to raw data (00007E00 to 0000A9FF)
0 file pointer to relocation table
0 file pointer to line numbers
0 number of relocations
0 number of line numbers
40000040 flags
Initialized Data
Read Only
...
Section contains the following exports for SampleApp.exe
00000000 characteristics
FFFFFFFF time date stamp
0.00 version
1 ordinal base
1 number of functions
1 number of names
ordinal hint RVA name
1 0 0001108C some_func = @ILT+135(some_func)
which confirms that the Export Table was put in the .rdata
section in this case.
Thank you @Erlend Graff - awesome!
– Roger Costello
Mar 7 at 22:30
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55043473%2fc-program-that-after-compiling-and-linking-results-in-an-exe-file-that-contain%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Any PE Image file may contain an export table, regardless of whether it is an EXE or DLL. However, the export tables are not necessarily contained within an .edata
section. It is, for example, common to see export tables in the .rdata
section instead.
To locate the export table, you should use the Export Table data directory, and not rely on the Section Table at all.
The following is an example C program that, when compiled, will produce an EXE with an export table. However, it might not be placed inside an .edata
section (and the EXE might not have an .edata
section at all).
#include <stdio.h>
__declspec(dllexport) void some_func(void)
printf("Hellon");
return;
int main()
return 0;
When I compile this program using Visual Studio 2017 on my system, and run dumpbin /HEADERS /EXPORTS
on the resulting EXE, I see the following:
...
SECTION HEADER #3
.rdata name
2A94 virtual size
19000 virtual address (0000000140019000 to 000000014001BA93)
2C00 size of raw data
7E00 file pointer to raw data (00007E00 to 0000A9FF)
0 file pointer to relocation table
0 file pointer to line numbers
0 number of relocations
0 number of line numbers
40000040 flags
Initialized Data
Read Only
...
Section contains the following exports for SampleApp.exe
00000000 characteristics
FFFFFFFF time date stamp
0.00 version
1 ordinal base
1 number of functions
1 number of names
ordinal hint RVA name
1 0 0001108C some_func = @ILT+135(some_func)
which confirms that the Export Table was put in the .rdata
section in this case.
Thank you @Erlend Graff - awesome!
– Roger Costello
Mar 7 at 22:30
add a comment |
Any PE Image file may contain an export table, regardless of whether it is an EXE or DLL. However, the export tables are not necessarily contained within an .edata
section. It is, for example, common to see export tables in the .rdata
section instead.
To locate the export table, you should use the Export Table data directory, and not rely on the Section Table at all.
The following is an example C program that, when compiled, will produce an EXE with an export table. However, it might not be placed inside an .edata
section (and the EXE might not have an .edata
section at all).
#include <stdio.h>
__declspec(dllexport) void some_func(void)
printf("Hellon");
return;
int main()
return 0;
When I compile this program using Visual Studio 2017 on my system, and run dumpbin /HEADERS /EXPORTS
on the resulting EXE, I see the following:
...
SECTION HEADER #3
.rdata name
2A94 virtual size
19000 virtual address (0000000140019000 to 000000014001BA93)
2C00 size of raw data
7E00 file pointer to raw data (00007E00 to 0000A9FF)
0 file pointer to relocation table
0 file pointer to line numbers
0 number of relocations
0 number of line numbers
40000040 flags
Initialized Data
Read Only
...
Section contains the following exports for SampleApp.exe
00000000 characteristics
FFFFFFFF time date stamp
0.00 version
1 ordinal base
1 number of functions
1 number of names
ordinal hint RVA name
1 0 0001108C some_func = @ILT+135(some_func)
which confirms that the Export Table was put in the .rdata
section in this case.
Thank you @Erlend Graff - awesome!
– Roger Costello
Mar 7 at 22:30
add a comment |
Any PE Image file may contain an export table, regardless of whether it is an EXE or DLL. However, the export tables are not necessarily contained within an .edata
section. It is, for example, common to see export tables in the .rdata
section instead.
To locate the export table, you should use the Export Table data directory, and not rely on the Section Table at all.
The following is an example C program that, when compiled, will produce an EXE with an export table. However, it might not be placed inside an .edata
section (and the EXE might not have an .edata
section at all).
#include <stdio.h>
__declspec(dllexport) void some_func(void)
printf("Hellon");
return;
int main()
return 0;
When I compile this program using Visual Studio 2017 on my system, and run dumpbin /HEADERS /EXPORTS
on the resulting EXE, I see the following:
...
SECTION HEADER #3
.rdata name
2A94 virtual size
19000 virtual address (0000000140019000 to 000000014001BA93)
2C00 size of raw data
7E00 file pointer to raw data (00007E00 to 0000A9FF)
0 file pointer to relocation table
0 file pointer to line numbers
0 number of relocations
0 number of line numbers
40000040 flags
Initialized Data
Read Only
...
Section contains the following exports for SampleApp.exe
00000000 characteristics
FFFFFFFF time date stamp
0.00 version
1 ordinal base
1 number of functions
1 number of names
ordinal hint RVA name
1 0 0001108C some_func = @ILT+135(some_func)
which confirms that the Export Table was put in the .rdata
section in this case.
Any PE Image file may contain an export table, regardless of whether it is an EXE or DLL. However, the export tables are not necessarily contained within an .edata
section. It is, for example, common to see export tables in the .rdata
section instead.
To locate the export table, you should use the Export Table data directory, and not rely on the Section Table at all.
The following is an example C program that, when compiled, will produce an EXE with an export table. However, it might not be placed inside an .edata
section (and the EXE might not have an .edata
section at all).
#include <stdio.h>
__declspec(dllexport) void some_func(void)
printf("Hellon");
return;
int main()
return 0;
When I compile this program using Visual Studio 2017 on my system, and run dumpbin /HEADERS /EXPORTS
on the resulting EXE, I see the following:
...
SECTION HEADER #3
.rdata name
2A94 virtual size
19000 virtual address (0000000140019000 to 000000014001BA93)
2C00 size of raw data
7E00 file pointer to raw data (00007E00 to 0000A9FF)
0 file pointer to relocation table
0 file pointer to line numbers
0 number of relocations
0 number of line numbers
40000040 flags
Initialized Data
Read Only
...
Section contains the following exports for SampleApp.exe
00000000 characteristics
FFFFFFFF time date stamp
0.00 version
1 ordinal base
1 number of functions
1 number of names
ordinal hint RVA name
1 0 0001108C some_func = @ILT+135(some_func)
which confirms that the Export Table was put in the .rdata
section in this case.
edited Mar 7 at 21:27
answered Mar 7 at 21:15
Erlend GraffErlend Graff
6231117
6231117
Thank you @Erlend Graff - awesome!
– Roger Costello
Mar 7 at 22:30
add a comment |
Thank you @Erlend Graff - awesome!
– Roger Costello
Mar 7 at 22:30
Thank you @Erlend Graff - awesome!
– Roger Costello
Mar 7 at 22:30
Thank you @Erlend Graff - awesome!
– Roger Costello
Mar 7 at 22:30
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55043473%2fc-program-that-after-compiling-and-linking-results-in-an-exe-file-that-contain%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
at first section name not play any role at all. and any PE can have export table, in what is problem ?
– RbMm
Mar 7 at 17:34
The export data section, named .edata - this is wrong.
IMAGE_EXPORT_DIRECTORY
data directory not a section, can belong to any section with any name– RbMm
Mar 7 at 17:36