Re: 16 bit exe?
- From: "[jongware]" <jongware@xxxxxxxxxxxxxxxxx>
- Date: Mon, 27 Feb 2006 21:56:23 +0100
"Dave Turner" <not@dave> wrote in message
news:4402a24d$1@xxxxxxxxxxxxxxxxxxx
Does anyone here know the formula for calculating the size of a 16 bit exe
based on IMAGE_DOS_HEADER alone?
I thought it was something like this but it's not quite right ...
BytesOnLastPage = IMAGE_DOS_HEADER.e_cblp
Pages = IMAGE_DOS_HEADER.e_cp
Size = (Pages * 512) + BytesOnLastPage
Almost -- e_cblp *is* the number of bytes on the last page. Yep -- the one
mentioned in e_cp!
So the size = (Pages-1)*512+BytesOnLastPage.
Cor! I knew that but to confirm I hadda search my legacy code directory for
that! (dirtasm.c, oct 3 1997)
[Jongware]
.
- References:
- 16 bit exe?
- From: Dave Turner
- 16 bit exe?
- Prev by Date: Re: Ideal computer language from scratch?
- Next by Date: Re: Ideal computer language from scratch?
- Previous by thread: Re: 16 bit exe?
- Next by thread: Resource weirdness
- Index(es):
Relevant Pages
|