2009-05-15 Rodrigo Kumpera <rkumpera@novell.com>
[mono.git] / mono / tests / metadata-verifier / section-table-tests.md
1 pe-section-headers {
2         #Simple assembly has 2 sections since it doesn't have any resources
3         assembly simple-assembly.exe
4
5         #truncate the section themselves
6         invalid offset section-table + 0 truncate
7         invalid offset section-table + 39 truncate
8         invalid offset section-table + 41 truncate
9         invalid offset section-table + 78 truncate
10
11
12         #A section RVA maps [VirtAddress,VirtAddress + RawSize] starting at PointerToRawData
13         #truncate before PointerToRawData
14         invalid offset read.uint ( section-table + 20 ) - 1 truncate
15         invalid offset read.uint ( section-table + 60 ) - 1 truncate
16
17         #make it point to after EOF
18         invalid offset section-table + 20 set-uint 90000
19         invalid offset section-table + 60 set-uint 90000
20
21         #make VirtualSize be huge
22         valid offset section-table + 8 set-uint read.uint ( section-table + 8 )
23         #invalid offset section-table + 8 + 0 set-uint 90000
24
25         #VirtualSize = file size + PointerToRawData + 32
26         invalid offset section-table + 16 set-uint file-size - read.uint ( section-table + 20 ) + 32
27         invalid offset section-table + 56 set-uint file-size - read.uint ( section-table + 60 ) + 32
28         
29         invalid offset section-table + 60 set-uint 90000
30
31         #FIXME add section relocation tests
32 }
33
34 pe-section-header-flags {
35         #Simple assembly has 2 sections since it doesn't have any resources
36         assembly simple-assembly.exe
37
38         #first section is always text 
39         valid offset section-table + 36 set-uint 0x60000020
40
41         valid offset section-table + 76 set-uint 0x42000040
42         
43         invalid offset section-table + 36 set-uint 0
44
45         invalid offset section-table + 36 set-uint 0xFFFFFFFF
46 }