Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.programming > #7980 > unrolled thread

question about exe (again)

Started byfir <profesor.fir@gmail.com>
First post2017-08-19 04:36 -0700
Last post2017-08-22 01:00 -0500
Articles 4 — 3 participants

Back to article view | Back to comp.programming


Contents

  question about exe (again) fir <profesor.fir@gmail.com> - 2017-08-19 04:36 -0700
    Re: question about exe (again) Richard Damon <Richard@Damon-Family.org> - 2017-08-19 13:57 -0400
      Re: question about exe (again) fir <profesor.fir@gmail.com> - 2017-08-19 11:06 -0700
      Re: question about exe (again) Robert Wessel <robertwessel2@yahoo.com> - 2017-08-22 01:00 -0500

#7980 — question about exe (again)

Fromfir <profesor.fir@gmail.com>
Date2017-08-19 04:36 -0700
Subjectquestion about exe (again)
Message-ID<ae5e1307-b87e-4a1b-a6bd-6123a54e411a@googlegroups.com>
some times ago it was discussed and i know thet here are probably not much many people knowing that things but maybe some 

if you load exe program into memory it is typically loaded under adress 0040_0000 (which is 4 MB skiping from begining) 

header is typically loaded under 0040_0000, 
code is typically loaded under 0040_1000, and data is loaded after that (in small hello worlds it will be 0040_2000), 
consts after that, static empty ram area is reserved after that, then imports and other sections also somewhere after that 

still i am not sure as to one thing.. in exe 
i think you dont necessary need relocations 
(or am i wrong?) So this would mean that in 
such exe adresses may be fixed (and they in fact would have some values like 004x_xxxx and so on (may be obviously bigger but in small exe this kind of values)) 

is this really the case? no relocations and this kind of fixed values there? 


<yet maybe second a bit more hard of this question -> if realocations are present are 
they only a list of adresses in ram where you need to add "base adress" of image (as i heard) or yet something other to that?> 

tnx 

[toc] | [next] | [standalone]


#7981

FromRichard Damon <Richard@Damon-Family.org>
Date2017-08-19 13:57 -0400
Message-ID<PZ_lB.1069$xN2.298@fx44.iad>
In reply to#7980
On 8/19/17 7:36 AM, fir wrote:
> some times ago it was discussed and i know thet here are probably not much many people knowing that things but maybe some
> 
> if you load exe program into memory it is typically loaded under adress 0040_0000 (which is 4 MB skiping from begining)
> 
> header is typically loaded under 0040_0000,
> code is typically loaded under 0040_1000, and data is loaded after that (in small hello worlds it will be 0040_2000),
> consts after that, static empty ram area is reserved after that, then imports and other sections also somewhere after that
> 
> still i am not sure as to one thing.. in exe
> i think you dont necessary need relocations
> (or am i wrong?) So this would mean that in
> such exe adresses may be fixed (and they in fact would have some values like 004x_xxxx and so on (may be obviously bigger but in small exe this kind of values))
> 
> is this really the case? no relocations and this kind of fixed values there?
> 
> 
> <yet maybe second a bit more hard of this question -> if realocations are present are
> they only a list of adresses in ram where you need to add "base adress" of image (as i heard) or yet something other to that?>
> 
> tnx
> 

My understanding is that the exe file (like DLLs) is relocatable, but 
specifies a preferred address. I believe that if loaded at the preferred 
address, than one advantage is that the loader doesn't need to do most 
of the relocation fixups. The system has the option to load the program 
at a different address if it wants (and there are some security benefits 
to randomizing the load address), unless the file is specifically marked 
as non-relocatable.

[toc] | [prev] | [next] | [standalone]


#7982

Fromfir <profesor.fir@gmail.com>
Date2017-08-19 11:06 -0700
Message-ID<fa3ecdcc-4139-4a27-aea0-be9c08e45933@googlegroups.com>
In reply to#7981
W dniu sobota, 19 sierpnia 2017 19:57:08 UTC+2 użytkownik Richard Damon napisał:
> On 8/19/17 7:36 AM, fir wrote:
> > some times ago it was discussed and i know thet here are probably not much many people knowing that things but maybe some
> > 
> > if you load exe program into memory it is typically loaded under adress 0040_0000 (which is 4 MB skiping from begining)
> > 
> > header is typically loaded under 0040_0000,
> > code is typically loaded under 0040_1000, and data is loaded after that (in small hello worlds it will be 0040_2000),
> > consts after that, static empty ram area is reserved after that, then imports and other sections also somewhere after that
> > 
> > still i am not sure as to one thing.. in exe
> > i think you dont necessary need relocations
> > (or am i wrong?) So this would mean that in
> > such exe adresses may be fixed (and they in fact would have some values like 004x_xxxx and so on (may be obviously bigger but in small exe this kind of values))
> > 
> > is this really the case? no relocations and this kind of fixed values there?
> > 
> > 
> > <yet maybe second a bit more hard of this question -> if realocations are present are
> > they only a list of adresses in ram where you need to add "base adress" of image (as i heard) or yet something other to that?>
> > 
> > tnx
> > 
> 
> My understanding is that the exe file (like DLLs) is relocatable, but 
> specifies a preferred address. I believe that if loaded at the preferred 
> address, than one advantage is that the loader doesn't need to do most 
> of the relocation fixups. The system has the option to load the program 
> at a different address if it wants (and there are some security benefits 
> to randomizing the load address), unless the file is specifically marked 
> as non-relocatable.

im  not sure if exes are relocable (if so it is rare) - each exe has its own virtual memory process space so it is not prone to ;placement' conflicts as dll (and is ALWAYS or nearly olways loaded under 0040_0000 )

- but i dont know to much in this field so if some has to add something i would like to discuss it

[toc] | [prev] | [next] | [standalone]


#7984

FromRobert Wessel <robertwessel2@yahoo.com>
Date2017-08-22 01:00 -0500
Message-ID<dthnpcdk09skrjs2mftof18vavtgvpj0cs@4ax.com>
In reply to#7981
On Sat, 19 Aug 2017 13:57:03 -0400, Richard Damon
<Richard@Damon-Family.org> wrote:

>On 8/19/17 7:36 AM, fir wrote:
>> some times ago it was discussed and i know thet here are probably not much many people knowing that things but maybe some
>> 
>> if you load exe program into memory it is typically loaded under adress 0040_0000 (which is 4 MB skiping from begining)
>> 
>> header is typically loaded under 0040_0000,
>> code is typically loaded under 0040_1000, and data is loaded after that (in small hello worlds it will be 0040_2000),
>> consts after that, static empty ram area is reserved after that, then imports and other sections also somewhere after that
>> 
>> still i am not sure as to one thing.. in exe
>> i think you dont necessary need relocations
>> (or am i wrong?) So this would mean that in
>> such exe adresses may be fixed (and they in fact would have some values like 004x_xxxx and so on (may be obviously bigger but in small exe this kind of values))
>> 
>> is this really the case? no relocations and this kind of fixed values there?
>> 
>> 
>> <yet maybe second a bit more hard of this question -> if realocations are present are
>> they only a list of adresses in ram where you need to add "base adress" of image (as i heard) or yet something other to that?>
>> 
>> tnx
>> 
>
>My understanding is that the exe file (like DLLs) is relocatable, but 
>specifies a preferred address. I believe that if loaded at the preferred 
>address, than one advantage is that the loader doesn't need to do most 
>of the relocation fixups. The system has the option to load the program 
>at a different address if it wants (and there are some security benefits 
>to randomizing the load address), unless the file is specifically marked 
>as non-relocatable.


The default for .exes used to be to strip the relocation information,
although that could be overridden with a linker option.  ALSR got
added a few generations of VS back, use of which (obviously) needed
relocation information to remain, although ALSR was not the default
compile option.  ALSR became the default compile option a while after
its introduction, and so leaving relocation in .exes is now the
default.

[toc] | [prev] | [standalone]


Back to top | Article view | comp.programming


csiph-web