flat assembler
Message board for the users of flat assembler.
Index
> Windows > PE Format - SizeOfImage |
Author |
|
revolution 15 Dec 2011, 02:15
I presume NS == NA? Assuming that is so, then you add one (+1) because the initial section (the first section, the header) is not included in the NA (NS) value.
|
|||
15 Dec 2011, 02:15 |
|
DOS386 15 Dec 2011, 05:48
> I presume NS == NA?
SS === SA ??? > Hi, im trying to understand how to calculae the SizeOfImage value. Sum of all section sizes (every section padded up to multiple of 4 KiB) + 4 KiB. > "SizeOfImage = SectionAlignment * NumberOfSections" Consider a section > 4 KiB Note: section alignment is always 4 KiB in EXE and DLL (Ring0 SYS at your own risk). _________________ Bug Nr.: 12345 Title: Hello World program compiles to 100 KB !!! Status: Closed: NOT a Bug |
|||
15 Dec 2011, 05:48 |
|
revolution 15 Dec 2011, 05:57
DOS386 wrote: SS === SA ??? |
|||
15 Dec 2011, 05:57 |
|
wyvern 15 Dec 2011, 11:48
DOS386 wrote:
Please, can you show me an example of that? |
|||
15 Dec 2011, 11:48 |
|
DOS386 17 Dec 2011, 01:52
why don't you check my examples?
Code: org $0040'0000 ; RVA=0 | AVA=$0040'0000 ; bullshit (up to 4 KiB, some versions of Windaube do ; mmap the MZ stub and PE headers too for no valid reason) org $0040'1000 ; RVA=$1000 | AVA=$0040'1000 ; a section with $1001 useful Byte's ... call dword [GetVirusEx] int1 ... ; $0FFF Byte's wasted org $0040'3000 ; RVA=$3000 | AVA=$0040'3000 ; a section with $0800 useful Byte's ... . db "NTOSKRNL.EXE",0 . db "LSASS.EXE",0 ... ; $0800 Byte's wasted org $0040'4000 ; RVA=$4000 | AVA=$0040'4000 ; end of program ; we got 2 sections and SizeOfImage $4000 = 16 KiB |
|||
17 Dec 2011, 01:52 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.