TypeLoadException when strong named

R

Robert Simpson

I have a custom-built binary that recently starting throwing fits on the
Compact Framework. The same binary built the same way for the desktop runs
fine, but when I built it for CF it fails to load. If I remove the strong
name from the CF binary, it loads just fine.

This binary is non-standard in that it wasn't entirely created by Visual
Studio. The .NET assembly manifest and IL code is not in the same place
inside the DLL as would normally appear in a pure CSC-created assembly, but
all the PE headers, COR20 headers and metadata are correct for the binary.

After building the binary, SN -v verifies the signature, and PEVerify /MD
/IL indicates the assembly is valid. If built for the desktop, the desktop
DLL works perfectly.

The capper is that previous versions of the CF binary ran just fine, built
using the same methods and strong named. It's only been recently when more
code was added that the binary suddenly stopped loading on the CF. The
binary is approximately 400kb

Here's are two netcf_loader logs, the first with the strong name (fails to
load) and the second log without the strong name (successfully loaded)

========================================
Process [\Program Files\testce\testce.exe]
ProcessID [0x3771a0fe]
Date [2006/10/10] (yyyy/mm/dd)
Time [19:27:31] (hh:mm:ss)
NETCF [2.0.5238.00]
Platform [Windows CE v4.21.1088 (PocketPC) WinCE4ARMV4 release V2 ARMV4
IJITv2]
========================================
GAC: Updating GAC [0x0]
GAC: Checking .gac files inside [\Windows\]
GAC: Found [System.SR.2.0.ENU.gac] .gac file.
GAC: Found [Microsoft .NET CF 2.0.GAC] .gac file.
GAC: Done with the file system check. Checking the registry.
GAC: Found [System.SR.2.0.ENU.gac] registry entry.
GAC: Found [Microsoft .NET CF 2.0.GAC] registry entry.
GAC: Done with the registry check. Let's compare.
GAC: Entry [Microsoft .NET CF 2.0.GAC] is up to date.
GAC: Entry [System.SR.2.0.ENU.gac] is up to date.
GAC: GAC is up to date.
Compatibility mode [2.0.0.0]
Loading module [\Windows\GAC_mscorlib_v2_0_0_0_cneutral_1.dll]
Loaded [mscorlib, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=969DB8053D3322AC] from
[\Windows\GAC_mscorlib_v2_0_0_0_cneutral_1.dll]
Loading module [\Program Files\testce\testce.exe]
Policy file not present. [\Program Files\testce\testce.exe.config]
Loading module [\Windows\GAC_System.Data_v2_0_0_0_cneutral_1.dll]
Loaded [System.Data, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=969DB8053D3322AC] from
[\Windows\GAC_System.Data_v2_0_0_0_cneutral_1.dll]
Loading module [\Windows\GAC_System_v2_0_0_0_cneutral_1.dll]
Loaded [System, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=969DB8053D3322AC] from
[\Windows\GAC_System_v2_0_0_0_cneutral_1.dll]
Loading module [\Windows\GAC_System.Windows.Forms_v2_0_0_0_cneutral_1.dll]
Loaded [System.Windows.Forms, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=969DB8053D3322AC] from
[\Windows\GAC_System.Windows.Forms_v2_0_0_0_cneutral_1.dll]
Loading module [\Windows\GAC_System.Drawing_v2_0_0_0_cneutral_1.dll]
Loaded [System.Drawing, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=969DB8053D3322AC] from
[\Windows\GAC_System.Drawing_v2_0_0_0_cneutral_1.dll]
Loading module [\Program Files\testce\System.Data.SQLite.dll]
Missing Assembly [System.Data.SQLite, Version=1.0.36.0, Culture=neutral,
PublicKeyToken=1FDB50B1B62B4C84].
Failed to load [System.Data.SQLite, Version=1.0.36.0, Culture=neutral,
PublicKeyToken=1FDB50B1B62B4C84]
==================(end)=================


And without a strong name:

========================================
Process [\Program Files\testce\testce.exe]
ProcessID [0x576e0002]
Date [2006/10/10] (yyyy/mm/dd)
Time [19:29:10] (hh:mm:ss)
NETCF [2.0.5238.00]
Platform [Windows CE v4.21.1088 (PocketPC) WinCE4ARMV4 release V2 ARMV4
IJITv2]
========================================
GAC: Updating GAC [0x0]
GAC: Checking .gac files inside [\Windows\]
GAC: Found [System.SR.2.0.ENU.gac] .gac file.
GAC: Found [Microsoft .NET CF 2.0.GAC] .gac file.
GAC: Done with the file system check. Checking the registry.
GAC: Found [System.SR.2.0.ENU.gac] registry entry.
GAC: Found [Microsoft .NET CF 2.0.GAC] registry entry.
GAC: Done with the registry check. Let's compare.
GAC: Entry [Microsoft .NET CF 2.0.GAC] is up to date.
GAC: Entry [System.SR.2.0.ENU.gac] is up to date.
GAC: GAC is up to date.
Compatibility mode [2.0.0.0]
Loading module [\Windows\GAC_mscorlib_v2_0_0_0_cneutral_1.dll]
Loaded [mscorlib, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=969DB8053D3322AC] from
[\Windows\GAC_mscorlib_v2_0_0_0_cneutral_1.dll]
Loading module [\Program Files\testce\testce.exe]
Policy file not present. [\Program Files\testce\testce.exe.config]
Loading module [\Windows\GAC_System.Data_v2_0_0_0_cneutral_1.dll]
Loaded [System.Data, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=969DB8053D3322AC] from
[\Windows\GAC_System.Data_v2_0_0_0_cneutral_1.dll]
Loading module [\Windows\GAC_System_v2_0_0_0_cneutral_1.dll]
Loaded [System, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=969DB8053D3322AC] from
[\Windows\GAC_System_v2_0_0_0_cneutral_1.dll]
Loading module [\Windows\GAC_System.Windows.Forms_v2_0_0_0_cneutral_1.dll]
Loaded [System.Windows.Forms, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=969DB8053D3322AC] from
[\Windows\GAC_System.Windows.Forms_v2_0_0_0_cneutral_1.dll]
Loading module [\Windows\GAC_System.Drawing_v2_0_0_0_cneutral_1.dll]
Loaded [System.Drawing, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=969DB8053D3322AC] from
[\Windows\GAC_System.Drawing_v2_0_0_0_cneutral_1.dll]
Loading module [\Program Files\testce\System.Data.SQLite.dll]
Failed to load [System.Data.SQLite, Version=1.0.36.0, Culture=neutral,
PublicKeyToken=null] from GAC
Loaded [System.Data.SQLite, Version=1.0.36.0, Culture=neutral,
PublicKeyToken=null] from [\Program Files\testce\System.Data.SQLite.dll]
Loading module [\Windows\GAC_System.Xml_v2_0_0_0_cneutral_1.dll]
Loaded [System.Xml, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=969DB8053D3322AC] from
[\Windows\GAC_System.Xml_v2_0_0_0_cneutral_1.dll]
==================(end)=================


Finally, here's a DUMPBIN /HEADERS /CLRHEADER for the CF binary:

Microsoft (R) COFF/PE Dumper Version 8.00.50727.42
Copyright (C) Microsoft Corporation. All rights reserved.


Dump of file system.data.sqlite.dll

PE signature found

File Type: DLL

FILE HEADER VALUES
14C machine (x86)
7 number of sections
452C1878 time date stamp Tue Oct 10 15:02:32 2006
0 file pointer to symbol table
0 number of symbols
E0 size of optional header
2102 characteristics
Executable
32 bit word machine
DLL

OPTIONAL HEADER VALUES
10B magic # (PE32)
8.00 linker version
3B200 size of code
28E00 size of initialized data
0 size of uninitialized data
3B034 entry point (1003B034)
1000 base of code
3D000 base of data
10000000 image base (10000000 to 10068FFF)
1000 section alignment
200 file alignment
4.00 operating system version
0.00 image version
4.10 subsystem version
0 Win32 version
69000 size of image
400 size of headers
72A8A checksum
3 subsystem (Windows CUI)
0 DLL characteristics
100000 size of stack reserve
1000 size of stack commit
100000 size of heap reserve
1000 size of heap commit
0 loader flags
10 number of directories
437C0 [ 19FC] RVA [size] of Export Directory
43620 [ 28] RVA [size] of Import Directory
66000 [ 39C] RVA [size] of Resource Directory
47000 [ 1CD0] RVA [size] of Exception Directory
0 [ 0] RVA [size] of Certificates Directory
67000 [ 1374] RVA [size] of Base Relocation Directory
0 [ 0] RVA [size] of Debug Directory
0 [ 0] RVA [size] of Architecture Directory
0 [ 0] RVA [size] of Global Pointer Directory
0 [ 0] RVA [size] of Thread Storage Directory
0 [ 0] RVA [size] of Load Configuration Directory
0 [ 0] RVA [size] of Bound Import Directory
46000 [ 168] RVA [size] of Import Address Table Directory
0 [ 0] RVA [size] of Delay Import Directory
49004 [ 48] RVA [size] of COM Descriptor Directory
0 [ 0] RVA [size] of Reserved Directory


SECTION HEADER #1
.text name
3B09C virtual size
1000 virtual address (10001000 to 1003C09B)
3B200 size of raw data
400 file pointer to raw data (00000400 to 0003B5FF)
0 file pointer to relocation table
0 file pointer to line numbers
0 number of relocations
0 number of line numbers
60000020 flags
Code
Execute Read

SECTION HEADER #2
.rdata name
81BC virtual size
3D000 virtual address (1003D000 to 100451BB)
8200 size of raw data
3B600 file pointer to raw data (0003B600 to 000437FF)
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 HEADER #3
.data name
324 virtual size
46000 virtual address (10046000 to 10046323)
200 size of raw data
43800 file pointer to raw data (00043800 to 000439FF)
0 file pointer to relocation table
0 file pointer to line numbers
0 number of relocations
0 number of line numbers
C0000040 flags
Initialized Data
Read Write

SECTION HEADER #4
.pdata name
1CD0 virtual size
47000 virtual address (10047000 to 10048CCF)
1E00 size of raw data
43A00 file pointer to raw data (00043A00 to 000457FF)
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 HEADER #5
.clr name
1CC6C virtual size
49000 virtual address (10049000 to 10065C6B)
1CE00 size of raw data
45800 file pointer to raw data (00045800 to 000625FF)
0 file pointer to relocation table
0 file pointer to line numbers
0 number of relocations
0 number of line numbers
60000020 flags
Code
Execute Read

clr Header:

48 cb
2.05 runtime version
58F70 [ CCFC] RVA [size] of MetaData Directory
18 flags
3BE98 entry point (1003BE98)
514FC [ 7A72] RVA [size] of Resources Directory
4904C [ 80] RVA [size] of StrongNameSignature Directory
0 [ 0] RVA [size] of CodeManagerTable Directory
0 [ 0] RVA [size] of VTableFixups Directory
0 [ 0] RVA [size] of ExportAddressTableJumps Directory
0 [ 0] RVA [size] of ManagedNativeHeader Directory


SECTION HEADER #6
.rsrc name
39C virtual size
66000 virtual address (10066000 to 1006639B)
400 size of raw data
62600 file pointer to raw data (00062600 to 000629FF)
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 HEADER #7
.reloc name
1696 virtual size
67000 virtual address (10067000 to 10068695)
1800 size of raw data
62A00 file pointer to raw data (00062A00 to 000641FF)
0 file pointer to relocation table
0 file pointer to line numbers
0 number of relocations
0 number of line numbers
42000040 flags
Initialized Data
Discardable
Read Only

Summary

1D000 .clr
1000 .data
2000 .pdata
9000 .rdata
2000 .reloc
1000 .rsrc
3C000 .text

Robert Simpson
Programmer at Large
 
R

Robert Simpson

Well I'm sure nobody else will encounter this error since I appear to be the
only one on the planet making mixed-mode DLL's on the Compact Framework ...
but in case anyone's interested in the solution for academic purposes:

It appears that Strong Name validation on the Compact Framework may be
slightly flawed. In the case of my particular binary, the .data segment of
the PE file looked like this:

SECTION HEADER #3
.data name
340 virtual size
4C000 virtual address (1004C000 to 1004C33F)
200 size of raw data
4A400 file pointer to raw data (0004A400 to 0004A5FF)
0 file pointer to relocation table
0 file pointer to line numbers
0 number of relocations
0 number of line numbers
C0000040 flags
Initialized Data
Read Write

Notice that the SizeofRawData field is less than the VirtualSize. This can
happen, and its not unusual in a native EXE/DLL. However for managed
assemblies, there never occurs an instance where the VirtualSize of any
segment is larger than the RawData size -- just a side-effect of the way
managed assemblies are built.

When a strong name is assigned to the DLL, all the sections of the PE file
are iterated and the strong name hash is computed based on the VirtualSize
of each section in the PE file. Now on the desktop, strong name validation
works using the same principle. This is why I never had any issues on the
Desktop.

However, on the CompactFramework, it appears that the strong name validation
routine is probably using a formula somewhat akin to min(VirtualSize,
RawDataSize) to determine the length of the section for hashing it. The
result is that the strong name computation function on the Compact Framework
is not computing the entire section and is throwing off the final hash
value.

To prove the theory, I added this code to the native source to artificially
increase the .data segment to force the RawData size to increase by the
specified FileAlignment:

DWORD _ph[] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};

Re-compiling this code triggers expansion of the .data segment's RawData
size such that it is now larger than the VirtualSize.

When I re-deployed the modified binary in the Pocket PC 2003 SE emulator, it
worked flawlessly.

Robert Simpson
Programmer at Large




Robert Simpson said:
I have a custom-built binary that recently starting throwing fits on the
Compact Framework. The same binary built the same way for the desktop runs
fine, but when I built it for CF it fails to load. If I remove the strong
name from the CF binary, it loads just fine.

This binary is non-standard in that it wasn't entirely created by Visual
Studio. The .NET assembly manifest and IL code is not in the same place
inside the DLL as would normally appear in a pure CSC-created assembly,
but all the PE headers, COR20 headers and metadata are correct for the
binary.

After building the binary, SN -v verifies the signature, and PEVerify /MD
/IL indicates the assembly is valid. If built for the desktop, the
desktop DLL works perfectly.

The capper is that previous versions of the CF binary ran just fine, built
using the same methods and strong named. It's only been recently when
more code was added that the binary suddenly stopped loading on the CF.
The binary is approximately 400kb

Here's are two netcf_loader logs, the first with the strong name (fails to
load) and the second log without the strong name (successfully loaded)

========================================
Process [\Program Files\testce\testce.exe]
ProcessID [0x3771a0fe]
Date [2006/10/10] (yyyy/mm/dd)
Time [19:27:31] (hh:mm:ss)
NETCF [2.0.5238.00]
Platform [Windows CE v4.21.1088 (PocketPC) WinCE4ARMV4 release V2 ARMV4
IJITv2]
========================================
GAC: Updating GAC [0x0]
GAC: Checking .gac files inside [\Windows\]
GAC: Found [System.SR.2.0.ENU.gac] .gac file.
GAC: Found [Microsoft .NET CF 2.0.GAC] .gac file.
GAC: Done with the file system check. Checking the registry.
GAC: Found [System.SR.2.0.ENU.gac] registry entry.
GAC: Found [Microsoft .NET CF 2.0.GAC] registry entry.
GAC: Done with the registry check. Let's compare.
GAC: Entry [Microsoft .NET CF 2.0.GAC] is up to date.
GAC: Entry [System.SR.2.0.ENU.gac] is up to date.
GAC: GAC is up to date.
Compatibility mode [2.0.0.0]
Loading module [\Windows\GAC_mscorlib_v2_0_0_0_cneutral_1.dll]
Loaded [mscorlib, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=969DB8053D3322AC] from
[\Windows\GAC_mscorlib_v2_0_0_0_cneutral_1.dll]
Loading module [\Program Files\testce\testce.exe]
Policy file not present. [\Program Files\testce\testce.exe.config]
Loading module [\Windows\GAC_System.Data_v2_0_0_0_cneutral_1.dll]
Loaded [System.Data, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=969DB8053D3322AC] from
[\Windows\GAC_System.Data_v2_0_0_0_cneutral_1.dll]
Loading module [\Windows\GAC_System_v2_0_0_0_cneutral_1.dll]
Loaded [System, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=969DB8053D3322AC] from
[\Windows\GAC_System_v2_0_0_0_cneutral_1.dll]
Loading module [\Windows\GAC_System.Windows.Forms_v2_0_0_0_cneutral_1.dll]
Loaded [System.Windows.Forms, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=969DB8053D3322AC] from
[\Windows\GAC_System.Windows.Forms_v2_0_0_0_cneutral_1.dll]
Loading module [\Windows\GAC_System.Drawing_v2_0_0_0_cneutral_1.dll]
Loaded [System.Drawing, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=969DB8053D3322AC] from
[\Windows\GAC_System.Drawing_v2_0_0_0_cneutral_1.dll]
Loading module [\Program Files\testce\System.Data.SQLite.dll]
Missing Assembly [System.Data.SQLite, Version=1.0.36.0, Culture=neutral,
PublicKeyToken=1FDB50B1B62B4C84].
Failed to load [System.Data.SQLite, Version=1.0.36.0, Culture=neutral,
PublicKeyToken=1FDB50B1B62B4C84]
==================(end)=================


And without a strong name:

========================================
Process [\Program Files\testce\testce.exe]
ProcessID [0x576e0002]
Date [2006/10/10] (yyyy/mm/dd)
Time [19:29:10] (hh:mm:ss)
NETCF [2.0.5238.00]
Platform [Windows CE v4.21.1088 (PocketPC) WinCE4ARMV4 release V2 ARMV4
IJITv2]
========================================
GAC: Updating GAC [0x0]
GAC: Checking .gac files inside [\Windows\]
GAC: Found [System.SR.2.0.ENU.gac] .gac file.
GAC: Found [Microsoft .NET CF 2.0.GAC] .gac file.
GAC: Done with the file system check. Checking the registry.
GAC: Found [System.SR.2.0.ENU.gac] registry entry.
GAC: Found [Microsoft .NET CF 2.0.GAC] registry entry.
GAC: Done with the registry check. Let's compare.
GAC: Entry [Microsoft .NET CF 2.0.GAC] is up to date.
GAC: Entry [System.SR.2.0.ENU.gac] is up to date.
GAC: GAC is up to date.
Compatibility mode [2.0.0.0]
Loading module [\Windows\GAC_mscorlib_v2_0_0_0_cneutral_1.dll]
Loaded [mscorlib, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=969DB8053D3322AC] from
[\Windows\GAC_mscorlib_v2_0_0_0_cneutral_1.dll]
Loading module [\Program Files\testce\testce.exe]
Policy file not present. [\Program Files\testce\testce.exe.config]
Loading module [\Windows\GAC_System.Data_v2_0_0_0_cneutral_1.dll]
Loaded [System.Data, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=969DB8053D3322AC] from
[\Windows\GAC_System.Data_v2_0_0_0_cneutral_1.dll]
Loading module [\Windows\GAC_System_v2_0_0_0_cneutral_1.dll]
Loaded [System, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=969DB8053D3322AC] from
[\Windows\GAC_System_v2_0_0_0_cneutral_1.dll]
Loading module [\Windows\GAC_System.Windows.Forms_v2_0_0_0_cneutral_1.dll]
Loaded [System.Windows.Forms, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=969DB8053D3322AC] from
[\Windows\GAC_System.Windows.Forms_v2_0_0_0_cneutral_1.dll]
Loading module [\Windows\GAC_System.Drawing_v2_0_0_0_cneutral_1.dll]
Loaded [System.Drawing, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=969DB8053D3322AC] from
[\Windows\GAC_System.Drawing_v2_0_0_0_cneutral_1.dll]
Loading module [\Program Files\testce\System.Data.SQLite.dll]
Failed to load [System.Data.SQLite, Version=1.0.36.0, Culture=neutral,
PublicKeyToken=null] from GAC
Loaded [System.Data.SQLite, Version=1.0.36.0, Culture=neutral,
PublicKeyToken=null] from [\Program Files\testce\System.Data.SQLite.dll]
Loading module [\Windows\GAC_System.Xml_v2_0_0_0_cneutral_1.dll]
Loaded [System.Xml, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=969DB8053D3322AC] from
[\Windows\GAC_System.Xml_v2_0_0_0_cneutral_1.dll]
==================(end)=================


Finally, here's a DUMPBIN /HEADERS /CLRHEADER for the CF binary:

Microsoft (R) COFF/PE Dumper Version 8.00.50727.42
Copyright (C) Microsoft Corporation. All rights reserved.


Dump of file system.data.sqlite.dll

PE signature found

File Type: DLL

FILE HEADER VALUES
14C machine (x86)
7 number of sections
452C1878 time date stamp Tue Oct 10 15:02:32 2006
0 file pointer to symbol table
0 number of symbols
E0 size of optional header
2102 characteristics
Executable
32 bit word machine
DLL

OPTIONAL HEADER VALUES
10B magic # (PE32)
8.00 linker version
3B200 size of code
28E00 size of initialized data
0 size of uninitialized data
3B034 entry point (1003B034)
1000 base of code
3D000 base of data
10000000 image base (10000000 to 10068FFF)
1000 section alignment
200 file alignment
4.00 operating system version
0.00 image version
4.10 subsystem version
0 Win32 version
69000 size of image
400 size of headers
72A8A checksum
3 subsystem (Windows CUI)
0 DLL characteristics
100000 size of stack reserve
1000 size of stack commit
100000 size of heap reserve
1000 size of heap commit
0 loader flags
10 number of directories
437C0 [ 19FC] RVA [size] of Export Directory
43620 [ 28] RVA [size] of Import Directory
66000 [ 39C] RVA [size] of Resource Directory
47000 [ 1CD0] RVA [size] of Exception Directory
0 [ 0] RVA [size] of Certificates Directory
67000 [ 1374] RVA [size] of Base Relocation Directory
0 [ 0] RVA [size] of Debug Directory
0 [ 0] RVA [size] of Architecture Directory
0 [ 0] RVA [size] of Global Pointer Directory
0 [ 0] RVA [size] of Thread Storage Directory
0 [ 0] RVA [size] of Load Configuration Directory
0 [ 0] RVA [size] of Bound Import Directory
46000 [ 168] RVA [size] of Import Address Table Directory
0 [ 0] RVA [size] of Delay Import Directory
49004 [ 48] RVA [size] of COM Descriptor Directory
0 [ 0] RVA [size] of Reserved Directory


SECTION HEADER #1
.text name
3B09C virtual size
1000 virtual address (10001000 to 1003C09B)
3B200 size of raw data
400 file pointer to raw data (00000400 to 0003B5FF)
0 file pointer to relocation table
0 file pointer to line numbers
0 number of relocations
0 number of line numbers
60000020 flags
Code
Execute Read

SECTION HEADER #2
.rdata name
81BC virtual size
3D000 virtual address (1003D000 to 100451BB)
8200 size of raw data
3B600 file pointer to raw data (0003B600 to 000437FF)
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 HEADER #3
.data name
324 virtual size
46000 virtual address (10046000 to 10046323)
200 size of raw data
43800 file pointer to raw data (00043800 to 000439FF)
0 file pointer to relocation table
0 file pointer to line numbers
0 number of relocations
0 number of line numbers
C0000040 flags
Initialized Data
Read Write

SECTION HEADER #4
.pdata name
1CD0 virtual size
47000 virtual address (10047000 to 10048CCF)
1E00 size of raw data
43A00 file pointer to raw data (00043A00 to 000457FF)
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 HEADER #5
.clr name
1CC6C virtual size
49000 virtual address (10049000 to 10065C6B)
1CE00 size of raw data
45800 file pointer to raw data (00045800 to 000625FF)
0 file pointer to relocation table
0 file pointer to line numbers
0 number of relocations
0 number of line numbers
60000020 flags
Code
Execute Read

clr Header:

48 cb
2.05 runtime version
58F70 [ CCFC] RVA [size] of MetaData Directory
18 flags
3BE98 entry point (1003BE98)
514FC [ 7A72] RVA [size] of Resources Directory
4904C [ 80] RVA [size] of StrongNameSignature Directory
0 [ 0] RVA [size] of CodeManagerTable Directory
0 [ 0] RVA [size] of VTableFixups Directory
0 [ 0] RVA [size] of ExportAddressTableJumps Directory
0 [ 0] RVA [size] of ManagedNativeHeader Directory


SECTION HEADER #6
.rsrc name
39C virtual size
66000 virtual address (10066000 to 1006639B)
400 size of raw data
62600 file pointer to raw data (00062600 to 000629FF)
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 HEADER #7
.reloc name
1696 virtual size
67000 virtual address (10067000 to 10068695)
1800 size of raw data
62A00 file pointer to raw data (00062A00 to 000641FF)
0 file pointer to relocation table
0 file pointer to line numbers
0 number of relocations
0 number of line numbers
42000040 flags
Initialized Data
Discardable
Read Only

Summary

1D000 .clr
1000 .data
2000 .pdata
9000 .rdata
2000 .reloc
1000 .rsrc
3C000 .text

Robert Simpson
Programmer at Large
 
B

Bryan Phillips

I noticed that the non-strong-named assembly looked in the GAC first and
then the program files directory. It does not specifically mention
looking in the GAC for your strong-named assembly, but I bet that it
wants to find the strong-named file there. Try adding the strong-named
assembly to the GAC and see if the error still occurs.

Bryan Phillips
MCSD, MCDBA, MCSE
Blog: http://bphillips76.spaces.live.com




I have a custom-built binary that recently starting throwing fits on the
Compact Framework. The same binary built the same way for the desktop runs
fine, but when I built it for CF it fails to load. If I remove the strong
name from the CF binary, it loads just fine.

This binary is non-standard in that it wasn't entirely created by Visual
Studio. The .NET assembly manifest and IL code is not in the same place
inside the DLL as would normally appear in a pure CSC-created assembly, but
all the PE headers, COR20 headers and metadata are correct for the binary.

After building the binary, SN -v verifies the signature, and PEVerify /MD
/IL indicates the assembly is valid. If built for the desktop, the desktop
DLL works perfectly.

The capper is that previous versions of the CF binary ran just fine, built
using the same methods and strong named. It's only been recently when more
code was added that the binary suddenly stopped loading on the CF. The
binary is approximately 400kb

Here's are two netcf_loader logs, the first with the strong name (fails to
load) and the second log without the strong name (successfully loaded)

========================================
Process [\Program Files\testce\testce.exe]
ProcessID [0x3771a0fe]
Date [2006/10/10] (yyyy/mm/dd)
Time [19:27:31] (hh:mm:ss)
NETCF [2.0.5238.00]
Platform [Windows CE v4.21.1088 (PocketPC) WinCE4ARMV4 release V2 ARMV4
IJITv2]
========================================
GAC: Updating GAC [0x0]
GAC: Checking .gac files inside [\Windows\]
GAC: Found [System.SR.2.0.ENU.gac] .gac file.
GAC: Found [Microsoft .NET CF 2.0.GAC] .gac file.
GAC: Done with the file system check. Checking the registry.
GAC: Found [System.SR.2.0.ENU.gac] registry entry.
GAC: Found [Microsoft .NET CF 2.0.GAC] registry entry.
GAC: Done with the registry check. Let's compare.
GAC: Entry [Microsoft .NET CF 2.0.GAC] is up to date.
GAC: Entry [System.SR.2.0.ENU.gac] is up to date.
GAC: GAC is up to date.
Compatibility mode [2.0.0.0]
Loading module [\Windows\GAC_mscorlib_v2_0_0_0_cneutral_1.dll]
Loaded [mscorlib, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=969DB8053D3322AC] from
[\Windows\GAC_mscorlib_v2_0_0_0_cneutral_1.dll]
Loading module [\Program Files\testce\testce.exe]
Policy file not present. [\Program Files\testce\testce.exe.config]
Loading module [\Windows\GAC_System.Data_v2_0_0_0_cneutral_1.dll]
Loaded [System.Data, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=969DB8053D3322AC] from
[\Windows\GAC_System.Data_v2_0_0_0_cneutral_1.dll]
Loading module [\Windows\GAC_System_v2_0_0_0_cneutral_1.dll]
Loaded [System, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=969DB8053D3322AC] from
[\Windows\GAC_System_v2_0_0_0_cneutral_1.dll]
Loading module [\Windows\GAC_System.Windows.Forms_v2_0_0_0_cneutral_1.dll]
Loaded [System.Windows.Forms, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=969DB8053D3322AC] from
[\Windows\GAC_System.Windows.Forms_v2_0_0_0_cneutral_1.dll]
Loading module [\Windows\GAC_System.Drawing_v2_0_0_0_cneutral_1.dll]
Loaded [System.Drawing, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=969DB8053D3322AC] from
[\Windows\GAC_System.Drawing_v2_0_0_0_cneutral_1.dll]
Loading module [\Program Files\testce\System.Data.SQLite.dll]
Missing Assembly [System.Data.SQLite, Version=1.0.36.0, Culture=neutral,
PublicKeyToken=1FDB50B1B62B4C84].
Failed to load [System.Data.SQLite, Version=1.0.36.0, Culture=neutral,
PublicKeyToken=1FDB50B1B62B4C84]
==================(end)=================


And without a strong name:

========================================
Process [\Program Files\testce\testce.exe]
ProcessID [0x576e0002]
Date [2006/10/10] (yyyy/mm/dd)
Time [19:29:10] (hh:mm:ss)
NETCF [2.0.5238.00]
Platform [Windows CE v4.21.1088 (PocketPC) WinCE4ARMV4 release V2 ARMV4
IJITv2]
========================================
GAC: Updating GAC [0x0]
GAC: Checking .gac files inside [\Windows\]
GAC: Found [System.SR.2.0.ENU.gac] .gac file.
GAC: Found [Microsoft .NET CF 2.0.GAC] .gac file.
GAC: Done with the file system check. Checking the registry.
GAC: Found [System.SR.2.0.ENU.gac] registry entry.
GAC: Found [Microsoft .NET CF 2.0.GAC] registry entry.
GAC: Done with the registry check. Let's compare.
GAC: Entry [Microsoft .NET CF 2.0.GAC] is up to date.
GAC: Entry [System.SR.2.0.ENU.gac] is up to date.
GAC: GAC is up to date.
Compatibility mode [2.0.0.0]
Loading module [\Windows\GAC_mscorlib_v2_0_0_0_cneutral_1.dll]
Loaded [mscorlib, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=969DB8053D3322AC] from
[\Windows\GAC_mscorlib_v2_0_0_0_cneutral_1.dll]
Loading module [\Program Files\testce\testce.exe]
Policy file not present. [\Program Files\testce\testce.exe.config]
Loading module [\Windows\GAC_System.Data_v2_0_0_0_cneutral_1.dll]
Loaded [System.Data, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=969DB8053D3322AC] from
[\Windows\GAC_System.Data_v2_0_0_0_cneutral_1.dll]
Loading module [\Windows\GAC_System_v2_0_0_0_cneutral_1.dll]
Loaded [System, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=969DB8053D3322AC] from
[\Windows\GAC_System_v2_0_0_0_cneutral_1.dll]
Loading module [\Windows\GAC_System.Windows.Forms_v2_0_0_0_cneutral_1.dll]
Loaded [System.Windows.Forms, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=969DB8053D3322AC] from
[\Windows\GAC_System.Windows.Forms_v2_0_0_0_cneutral_1.dll]
Loading module [\Windows\GAC_System.Drawing_v2_0_0_0_cneutral_1.dll]
Loaded [System.Drawing, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=969DB8053D3322AC] from
[\Windows\GAC_System.Drawing_v2_0_0_0_cneutral_1.dll]
Loading module [\Program Files\testce\System.Data.SQLite.dll]
Failed to load [System.Data.SQLite, Version=1.0.36.0, Culture=neutral,
PublicKeyToken=null] from GAC
Loaded [System.Data.SQLite, Version=1.0.36.0, Culture=neutral,
PublicKeyToken=null] from [\Program Files\testce\System.Data.SQLite.dll]
Loading module [\Windows\GAC_System.Xml_v2_0_0_0_cneutral_1.dll]
Loaded [System.Xml, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=969DB8053D3322AC] from
[\Windows\GAC_System.Xml_v2_0_0_0_cneutral_1.dll]
==================(end)=================


Finally, here's a DUMPBIN /HEADERS /CLRHEADER for the CF binary:

Microsoft (R) COFF/PE Dumper Version 8.00.50727.42
Copyright (C) Microsoft Corporation. All rights reserved.


Dump of file system.data.sqlite.dll

PE signature found

File Type: DLL

FILE HEADER VALUES
14C machine (x86)
7 number of sections
452C1878 time date stamp Tue Oct 10 15:02:32 2006
0 file pointer to symbol table
0 number of symbols
E0 size of optional header
2102 characteristics
Executable
32 bit word machine
DLL

OPTIONAL HEADER VALUES
10B magic # (PE32)
8.00 linker version
3B200 size of code
28E00 size of initialized data
0 size of uninitialized data
3B034 entry point (1003B034)
1000 base of code
3D000 base of data
10000000 image base (10000000 to 10068FFF)
1000 section alignment
200 file alignment
4.00 operating system version
0.00 image version
4.10 subsystem version
0 Win32 version
69000 size of image
400 size of headers
72A8A checksum
3 subsystem (Windows CUI)
0 DLL characteristics
100000 size of stack reserve
1000 size of stack commit
100000 size of heap reserve
1000 size of heap commit
0 loader flags
10 number of directories
437C0 [ 19FC] RVA [size] of Export Directory
43620 [ 28] RVA [size] of Import Directory
66000 [ 39C] RVA [size] of Resource Directory
47000 [ 1CD0] RVA [size] of Exception Directory
0 [ 0] RVA [size] of Certificates Directory
67000 [ 1374] RVA [size] of Base Relocation Directory
0 [ 0] RVA [size] of Debug Directory
0 [ 0] RVA [size] of Architecture Directory
0 [ 0] RVA [size] of Global Pointer Directory
0 [ 0] RVA [size] of Thread Storage Directory
0 [ 0] RVA [size] of Load Configuration Directory
0 [ 0] RVA [size] of Bound Import Directory
46000 [ 168] RVA [size] of Import Address Table Directory
0 [ 0] RVA [size] of Delay Import Directory
49004 [ 48] RVA [size] of COM Descriptor Directory
0 [ 0] RVA [size] of Reserved Directory


SECTION HEADER #1
.text name
3B09C virtual size
1000 virtual address (10001000 to 1003C09B)
3B200 size of raw data
400 file pointer to raw data (00000400 to 0003B5FF)
0 file pointer to relocation table
0 file pointer to line numbers
0 number of relocations
0 number of line numbers
60000020 flags
Code
Execute Read

SECTION HEADER #2
.rdata name
81BC virtual size
3D000 virtual address (1003D000 to 100451BB)
8200 size of raw data
3B600 file pointer to raw data (0003B600 to 000437FF)
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 HEADER #3
.data name
324 virtual size
46000 virtual address (10046000 to 10046323)
200 size of raw data
43800 file pointer to raw data (00043800 to 000439FF)
0 file pointer to relocation table
0 file pointer to line numbers
0 number of relocations
0 number of line numbers
C0000040 flags
Initialized Data
Read Write

SECTION HEADER #4
.pdata name
1CD0 virtual size
47000 virtual address (10047000 to 10048CCF)
1E00 size of raw data
43A00 file pointer to raw data (00043A00 to 000457FF)
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 HEADER #5
.clr name
1CC6C virtual size
49000 virtual address (10049000 to 10065C6B)
1CE00 size of raw data
45800 file pointer to raw data (00045800 to 000625FF)
0 file pointer to relocation table
0 file pointer to line numbers
0 number of relocations
0 number of line numbers
60000020 flags
Code
Execute Read

clr Header:

48 cb
2.05 runtime version
58F70 [ CCFC] RVA [size] of MetaData Directory
18 flags
3BE98 entry point (1003BE98)
514FC [ 7A72] RVA [size] of Resources Directory
4904C [ 80] RVA [size] of StrongNameSignature Directory
0 [ 0] RVA [size] of CodeManagerTable Directory
0 [ 0] RVA [size] of VTableFixups Directory
0 [ 0] RVA [size] of ExportAddressTableJumps Directory
0 [ 0] RVA [size] of ManagedNativeHeader Directory


SECTION HEADER #6
.rsrc name
39C virtual size
66000 virtual address (10066000 to 1006639B)
400 size of raw data
62600 file pointer to raw data (00062600 to 000629FF)
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 HEADER #7
.reloc name
1696 virtual size
67000 virtual address (10067000 to 10068695)
1800 size of raw data
62A00 file pointer to raw data (00062A00 to 000641FF)
0 file pointer to relocation table
0 file pointer to line numbers
0 number of relocations
0 number of line numbers
42000040 flags
Initialized Data
Discardable
Read Only

Summary

1D000 .clr
1000 .data
2000 .pdata
9000 .rdata
2000 .reloc
1000 .rsrc
3C000 .text

Robert Simpson
Programmer at Large
 
R

Robert Simpson

Thanks, but I was able to come up with a workaround (posted as a reply to my
own post). The problem was strong name validation was failing due to an
inconsistency in the way the strong name was computed on the desktop and
verified on the Compact Framework. I doubt seriously the assembly could've
made it into the GAC to begin with since GAC registration requires the
assembly be loaded and its hash verified -- which was exactly the step that
was failing.

Robert


Bryan Phillips said:
I noticed that the non-strong-named assembly looked in the GAC first and
then the program files directory. It does not specifically mention looking
in the GAC for your strong-named assembly, but I bet that it wants to find
the strong-named file there. Try adding the strong-named assembly to the
GAC and see if the error still occurs.

Bryan Phillips
MCSD, MCDBA, MCSE
Blog: http://bphillips76.spaces.live.com




I have a custom-built binary that recently starting throwing fits on the
Compact Framework. The same binary built the same way for the desktop
runs
fine, but when I built it for CF it fails to load. If I remove the
strong
name from the CF binary, it loads just fine.

This binary is non-standard in that it wasn't entirely created by Visual
Studio. The .NET assembly manifest and IL code is not in the same place
inside the DLL as would normally appear in a pure CSC-created assembly,
but
all the PE headers, COR20 headers and metadata are correct for the
binary.

After building the binary, SN -v verifies the signature, and PEVerify /MD
/IL indicates the assembly is valid. If built for the desktop, the
desktop
DLL works perfectly.

The capper is that previous versions of the CF binary ran just fine,
built
using the same methods and strong named. It's only been recently when
more
code was added that the binary suddenly stopped loading on the CF. The
binary is approximately 400kb

Here's are two netcf_loader logs, the first with the strong name (fails
to
load) and the second log without the strong name (successfully loaded)

========================================
Process [\Program Files\testce\testce.exe]
ProcessID [0x3771a0fe]
Date [2006/10/10] (yyyy/mm/dd)
Time [19:27:31] (hh:mm:ss)
NETCF [2.0.5238.00]
Platform [Windows CE v4.21.1088 (PocketPC) WinCE4ARMV4 release V2 ARMV4
IJITv2]
========================================
GAC: Updating GAC [0x0]
GAC: Checking .gac files inside [\Windows\]
GAC: Found [System.SR.2.0.ENU.gac] .gac file.
GAC: Found [Microsoft .NET CF 2.0.GAC] .gac file.
GAC: Done with the file system check. Checking the registry.
GAC: Found [System.SR.2.0.ENU.gac] registry entry.
GAC: Found [Microsoft .NET CF 2.0.GAC] registry entry.
GAC: Done with the registry check. Let's compare.
GAC: Entry [Microsoft .NET CF 2.0.GAC] is up to date.
GAC: Entry [System.SR.2.0.ENU.gac] is up to date.
GAC: GAC is up to date.
Compatibility mode [2.0.0.0]
Loading module [\Windows\GAC_mscorlib_v2_0_0_0_cneutral_1.dll]
Loaded [mscorlib, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=969DB8053D3322AC] from
[\Windows\GAC_mscorlib_v2_0_0_0_cneutral_1.dll]
Loading module [\Program Files\testce\testce.exe]
Policy file not present. [\Program Files\testce\testce.exe.config]
Loading module [\Windows\GAC_System.Data_v2_0_0_0_cneutral_1.dll]
Loaded [System.Data, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=969DB8053D3322AC] from
[\Windows\GAC_System.Data_v2_0_0_0_cneutral_1.dll]
Loading module [\Windows\GAC_System_v2_0_0_0_cneutral_1.dll]
Loaded [System, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=969DB8053D3322AC] from
[\Windows\GAC_System_v2_0_0_0_cneutral_1.dll]
Loading module
[\Windows\GAC_System.Windows.Forms_v2_0_0_0_cneutral_1.dll]
Loaded [System.Windows.Forms, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=969DB8053D3322AC] from
[\Windows\GAC_System.Windows.Forms_v2_0_0_0_cneutral_1.dll]
Loading module [\Windows\GAC_System.Drawing_v2_0_0_0_cneutral_1.dll]
Loaded [System.Drawing, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=969DB8053D3322AC] from
[\Windows\GAC_System.Drawing_v2_0_0_0_cneutral_1.dll]
Loading module [\Program Files\testce\System.Data.SQLite.dll]
Missing Assembly [System.Data.SQLite, Version=1.0.36.0, Culture=neutral,
PublicKeyToken=1FDB50B1B62B4C84].
Failed to load [System.Data.SQLite, Version=1.0.36.0, Culture=neutral,
PublicKeyToken=1FDB50B1B62B4C84]
==================(end)=================


And without a strong name:

========================================
Process [\Program Files\testce\testce.exe]
ProcessID [0x576e0002]
Date [2006/10/10] (yyyy/mm/dd)
Time [19:29:10] (hh:mm:ss)
NETCF [2.0.5238.00]
Platform [Windows CE v4.21.1088 (PocketPC) WinCE4ARMV4 release V2 ARMV4
IJITv2]
========================================
GAC: Updating GAC [0x0]
GAC: Checking .gac files inside [\Windows\]
GAC: Found [System.SR.2.0.ENU.gac] .gac file.
GAC: Found [Microsoft .NET CF 2.0.GAC] .gac file.
GAC: Done with the file system check. Checking the registry.
GAC: Found [System.SR.2.0.ENU.gac] registry entry.
GAC: Found [Microsoft .NET CF 2.0.GAC] registry entry.
GAC: Done with the registry check. Let's compare.
GAC: Entry [Microsoft .NET CF 2.0.GAC] is up to date.
GAC: Entry [System.SR.2.0.ENU.gac] is up to date.
GAC: GAC is up to date.
Compatibility mode [2.0.0.0]
Loading module [\Windows\GAC_mscorlib_v2_0_0_0_cneutral_1.dll]
Loaded [mscorlib, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=969DB8053D3322AC] from
[\Windows\GAC_mscorlib_v2_0_0_0_cneutral_1.dll]
Loading module [\Program Files\testce\testce.exe]
Policy file not present. [\Program Files\testce\testce.exe.config]
Loading module [\Windows\GAC_System.Data_v2_0_0_0_cneutral_1.dll]
Loaded [System.Data, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=969DB8053D3322AC] from
[\Windows\GAC_System.Data_v2_0_0_0_cneutral_1.dll]
Loading module [\Windows\GAC_System_v2_0_0_0_cneutral_1.dll]
Loaded [System, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=969DB8053D3322AC] from
[\Windows\GAC_System_v2_0_0_0_cneutral_1.dll]
Loading module
[\Windows\GAC_System.Windows.Forms_v2_0_0_0_cneutral_1.dll]
Loaded [System.Windows.Forms, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=969DB8053D3322AC] from
[\Windows\GAC_System.Windows.Forms_v2_0_0_0_cneutral_1.dll]
Loading module [\Windows\GAC_System.Drawing_v2_0_0_0_cneutral_1.dll]
Loaded [System.Drawing, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=969DB8053D3322AC] from
[\Windows\GAC_System.Drawing_v2_0_0_0_cneutral_1.dll]
Loading module [\Program Files\testce\System.Data.SQLite.dll]
Failed to load [System.Data.SQLite, Version=1.0.36.0, Culture=neutral,
PublicKeyToken=null] from GAC
Loaded [System.Data.SQLite, Version=1.0.36.0, Culture=neutral,
PublicKeyToken=null] from [\Program Files\testce\System.Data.SQLite.dll]
Loading module [\Windows\GAC_System.Xml_v2_0_0_0_cneutral_1.dll]
Loaded [System.Xml, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=969DB8053D3322AC] from
[\Windows\GAC_System.Xml_v2_0_0_0_cneutral_1.dll]
==================(end)=================


Finally, here's a DUMPBIN /HEADERS /CLRHEADER for the CF binary:

Microsoft (R) COFF/PE Dumper Version 8.00.50727.42
Copyright (C) Microsoft Corporation. All rights reserved.


Dump of file system.data.sqlite.dll

PE signature found

File Type: DLL

FILE HEADER VALUES
14C machine (x86)
7 number of sections
452C1878 time date stamp Tue Oct 10 15:02:32 2006
0 file pointer to symbol table
0 number of symbols
E0 size of optional header
2102 characteristics
Executable
32 bit word machine
DLL

OPTIONAL HEADER VALUES
10B magic # (PE32)
8.00 linker version
3B200 size of code
28E00 size of initialized data
0 size of uninitialized data
3B034 entry point (1003B034)
1000 base of code
3D000 base of data
10000000 image base (10000000 to 10068FFF)
1000 section alignment
200 file alignment
4.00 operating system version
0.00 image version
4.10 subsystem version
0 Win32 version
69000 size of image
400 size of headers
72A8A checksum
3 subsystem (Windows CUI)
0 DLL characteristics
100000 size of stack reserve
1000 size of stack commit
100000 size of heap reserve
1000 size of heap commit
0 loader flags
10 number of directories
437C0 [ 19FC] RVA [size] of Export Directory
43620 [ 28] RVA [size] of Import Directory
66000 [ 39C] RVA [size] of Resource Directory
47000 [ 1CD0] RVA [size] of Exception Directory
0 [ 0] RVA [size] of Certificates Directory
67000 [ 1374] RVA [size] of Base Relocation Directory
0 [ 0] RVA [size] of Debug Directory
0 [ 0] RVA [size] of Architecture Directory
0 [ 0] RVA [size] of Global Pointer Directory
0 [ 0] RVA [size] of Thread Storage Directory
0 [ 0] RVA [size] of Load Configuration Directory
0 [ 0] RVA [size] of Bound Import Directory
46000 [ 168] RVA [size] of Import Address Table Directory
0 [ 0] RVA [size] of Delay Import Directory
49004 [ 48] RVA [size] of COM Descriptor Directory
0 [ 0] RVA [size] of Reserved Directory


SECTION HEADER #1
.text name
3B09C virtual size
1000 virtual address (10001000 to 1003C09B)
3B200 size of raw data
400 file pointer to raw data (00000400 to 0003B5FF)
0 file pointer to relocation table
0 file pointer to line numbers
0 number of relocations
0 number of line numbers
60000020 flags
Code
Execute Read

SECTION HEADER #2
.rdata name
81BC virtual size
3D000 virtual address (1003D000 to 100451BB)
8200 size of raw data
3B600 file pointer to raw data (0003B600 to 000437FF)
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 HEADER #3
.data name
324 virtual size
46000 virtual address (10046000 to 10046323)
200 size of raw data
43800 file pointer to raw data (00043800 to 000439FF)
0 file pointer to relocation table
0 file pointer to line numbers
0 number of relocations
0 number of line numbers
C0000040 flags
Initialized Data
Read Write

SECTION HEADER #4
.pdata name
1CD0 virtual size
47000 virtual address (10047000 to 10048CCF)
1E00 size of raw data
43A00 file pointer to raw data (00043A00 to 000457FF)
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 HEADER #5
.clr name
1CC6C virtual size
49000 virtual address (10049000 to 10065C6B)
1CE00 size of raw data
45800 file pointer to raw data (00045800 to 000625FF)
0 file pointer to relocation table
0 file pointer to line numbers
0 number of relocations
0 number of line numbers
60000020 flags
Code
Execute Read

clr Header:

48 cb
2.05 runtime version
58F70 [ CCFC] RVA [size] of MetaData Directory
18 flags
3BE98 entry point (1003BE98)
514FC [ 7A72] RVA [size] of Resources Directory
4904C [ 80] RVA [size] of StrongNameSignature Directory
0 [ 0] RVA [size] of CodeManagerTable Directory
0 [ 0] RVA [size] of VTableFixups Directory
0 [ 0] RVA [size] of ExportAddressTableJumps
Directory
0 [ 0] RVA [size] of ManagedNativeHeader Directory


SECTION HEADER #6
.rsrc name
39C virtual size
66000 virtual address (10066000 to 1006639B)
400 size of raw data
62600 file pointer to raw data (00062600 to 000629FF)
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 HEADER #7
.reloc name
1696 virtual size
67000 virtual address (10067000 to 10068695)
1800 size of raw data
62A00 file pointer to raw data (00062A00 to 000641FF)
0 file pointer to relocation table
0 file pointer to line numbers
0 number of relocations
0 number of line numbers
42000040 flags
Initialized Data
Discardable
Read Only

Summary

1D000 .clr
1000 .data
2000 .pdata
9000 .rdata
2000 .reloc
1000 .rsrc
3C000 .text

Robert Simpson
Programmer at Large
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top