System.Data.SQLite

Check-in [06a28e89b4]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Remove old setup and obsolete mergebin tool.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 06a28e89b4951675855e495adacd2c15774612c2
User & Date: mistachkin 2011-08-09 07:25:27.844
Context
2011-08-09
07:32
Make sure the output directory exists prior to creating the source and binary release packages. check-in: c00b53012c user: mistachkin tags: trunk
07:25
Remove old setup and obsolete mergebin tool. check-in: 06a28e89b4 user: mistachkin tags: trunk
06:51
Initial implementation of new VS designer installer. check-in: 2f59622e3c user: mistachkin tags: trunk
Changes
Unified Diff Ignore Whitespace Patch
Changes to exclude_src.txt.
19
20
21
22
23
24
25
26
27
28
SQLite.Designer/VSDesign/*
System.Data.SQLite.Linq/obj/*
System.Data.SQLite/obj/*
System.Data.SQLite/Properties/*
test/obj/*
testce/obj/*
testlinq/obj/*
Tests/*
tools/*
www/*







<
|

19
20
21
22
23
24
25

26
27
SQLite.Designer/VSDesign/*
System.Data.SQLite.Linq/obj/*
System.Data.SQLite/obj/*
System.Data.SQLite/Properties/*
test/obj/*
testce/obj/*
testlinq/obj/*

tools/install/obj/*
www/*
Deleted tools/mergebin/MetaData.cpp.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
/********************************************************
 * mergebin
 * Written by Robert Simpson (robert@blackcastlesoft.com)
 * 
 * Released to the public domain, use at your own risk!
 ********************************************************/

#include "StdAfx.h"
#include "MetaData.h"

CMetadata::CStream::operator LPBYTE() const
{
  return m_pbData;
}

CMetadata::CMetadata(CPEFile& peFile) : m_peFile(peFile)
{
  PIMAGE_COR20_HEADER pCor = m_peFile;
  if (!pCor) throw;

  LPBYTE pb = (LPBYTE)m_peFile.GetPtrFromRVA(pCor->MetaData.VirtualAddress);
  LPBYTE pbRoot = pb;
  size_t x;
  if (!pb) throw;

  m_pdwSignature     = (LPDWORD)pb;
  m_pwMajorVersion   = (LPWORD)(m_pdwSignature + 1);
  m_pwMinorVersion   = m_pwMajorVersion + 1;
  m_pdwVersionLength = (LPDWORD)(m_pwMinorVersion + 3);
  m_pszVersion       = (LPSTR)(m_pdwVersionLength + 1);

  pb = (LPBYTE)m_pszVersion;
  x = *m_pdwVersionLength;
  if (x % 4) x += 4 - (x % 4);
  pb += x;
  pb += 2;
  
  m_pwStreams        = (LPWORD)pb;
  m_pStreams = new CStream[*m_pwStreams];
  pb = (LPBYTE)(m_pwStreams + 1);

  for (WORD n = 0; n < *m_pwStreams; n++)
  {
    m_pStreams[n].m_pdwOffset  = (LPDWORD)pb;
    m_pStreams[n].m_pdwSize    = m_pStreams[n].m_pdwOffset + 1;
    m_pStreams[n].m_pszName    = (LPSTR)(m_pStreams[n].m_pdwSize + 1);
    m_pStreams[n].m_pbData     = pbRoot + (*m_pStreams[n].m_pdwOffset);

    x = strlen(m_pStreams[n].m_pszName) + 1;
    if (x % 4) x += 4 - (x % 4);

    pb = (LPBYTE)m_pStreams[n].m_pszName + x;
  }
}

CMetadata::~CMetadata(void)
{
  delete[] m_pStreams;
}

CMetadata::operator CPEFile&() const
{
  return m_peFile;
}

CMetadata::CStream * CMetadata::GetStream(UINT uiStream)
{
  if (uiStream >= *m_pwStreams) return NULL;
  return &m_pStreams[uiStream];
}

CMetadata::CStream * CMetadata::GetStream(LPCSTR pszStreamName)
{
  for (WORD n = 0; n < *m_pwStreams; n++)
  {
    if (_stricmp(pszStreamName, m_pStreams[n].m_pszName) == 0)
      return &m_pStreams[n];
  }
  return NULL;
}

WORD * CMetadata::StreamCount() const
{
  return m_pwStreams;
}

<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<












































































































































































Deleted tools/mergebin/MetaData.h.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/********************************************************
 * mergebin
 * Written by Robert Simpson (robert@blackcastlesoft.com)
 * 
 * Released to the public domain, use at your own risk!
 ********************************************************/

#pragma once

#include "pefile.h"

class CMetadata
{
public:
  class CStream
  {
    friend CMetadata;
  public:
    operator LPBYTE() const;

  protected:
    DWORD *m_pdwOffset;
    DWORD *m_pdwSize;
    LPSTR  m_pszName;
    LPBYTE m_pbData;
  };
public:
  CMetadata(CPEFile& peFile);
  virtual ~CMetadata(void);

protected:
  CPEFile& m_peFile;

  DWORD   *m_pdwSignature;
  WORD    *m_pwMajorVersion;
  WORD    *m_pwMinorVersion;
  DWORD   *m_pdwVersionLength;
  LPSTR    m_pszVersion;
  WORD    *m_pwStreams;
  CStream *m_pStreams;

public:
  operator CPEFile&() const;

  WORD *               StreamCount () const;
  CMetadata::CStream * GetStream   (UINT uiStream);
  CMetadata::CStream * GetStream   (LPCSTR pszStreamName);
};
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
































































































Deleted tools/mergebin/MetaDataTables.cpp.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
/********************************************************
 * mergebin
 * Written by Robert Simpson (robert@blackcastlesoft.com)
 * 
 * Released to the public domain, use at your own risk!
 ********************************************************/

#include "StdAfx.h"
#include "MetaDataTables.h"
#include "TableData.h"

CMetadataTables::CMetadataTables(CMetadata& metaData) : m_meta(metaData)
{
  CMetadata::CStream *ps = m_meta.GetStream("#~");
  if (!ps) throw;

  *static_cast<CMetadata::CStream *>(this) = *ps;

  LPBYTE pb = m_pbData + sizeof(DWORD);
  m_pbMajorVersion = pb;
  m_pbMinorVersion = m_pbMajorVersion + 1;
  m_pbHeapOffsetSizes = m_pbMinorVersion + 1;
  // Skip a byte
  m_pullMaskValid = (UINT64 *)(m_pbHeapOffsetSizes + 2);
  m_pullMaskSorted = m_pullMaskValid + 1;

  m_pdwTableLengths = (LPDWORD)(m_pullMaskSorted + 1);

  m_dwTables = 0;
  for (int n = 0; n < 64; n++)
  {
    if ((((*m_pullMaskValid) >> n) & 1) == 1)
    {
      m_pdwTableLengthIndex[n] = &m_pdwTableLengths[m_dwTables ++];
    }
    else
    {
      m_pdwTableLengthIndex[n] = NULL;
    }
  }
  m_pbData = (LPBYTE)(m_pdwTableLengths + m_dwTables);

  for (int n = 0; n < 64; n++)
  {
    if (m_pdwTableLengthIndex[n] && g_arTableTypes[n])
    {
      m_pTables[n] = g_arTableTypes[n](this);
    }
    else
      m_pTables[n] = 0;
  }
}

CMetadataTables::~CMetadataTables(void)
{
  for (int n = 0; n < 64; n++)
  {
    if (m_pTables[n])
      delete m_pTables[n];
  }
}

UINT CMetadataTables::GetStringIndexSize(void)
{
  return ((*m_pbHeapOffsetSizes) & 0x01) == 0 ? sizeof(WORD) : sizeof(DWORD);
}

UINT CMetadataTables::GetGuidIndexSize(void)
{
  return ((*m_pbHeapOffsetSizes) & 0x02) == 0 ? sizeof(WORD) : sizeof(DWORD);
}

UINT CMetadataTables::GetBlobIndexSize(void)
{
  return ((*m_pbHeapOffsetSizes) & 0x04) == 0 ? sizeof(WORD) : sizeof(DWORD);
}

DWORD *CMetadataTables::TableRowCount(UINT uType)
{
  return m_pdwTableLengthIndex[uType];
}

DWORD CMetadataTables::GetMaxIndexSizeOf(UINT * puiTables)
{
  DWORD dwMaxRows = 0;
  DWORD *pdwLength;
  UINT uCount = 0;

  while (*puiTables)
  {
    uCount ++;
    pdwLength = m_pdwTableLengthIndex[*puiTables];
    if (pdwLength)
      dwMaxRows = max(dwMaxRows, pdwLength[0]);

    puiTables ++;
  }

  return (dwMaxRows > 0xFFFF) ? 4 : 2;
  //return (dwMaxRows > (ULONG)(2 << (16 - uCount))) ? 4 : 2;
}

CTableData *CMetadataTables::GetTable(UINT uId)
{
  return m_pTables[uId];
}
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<




















































































































































































































Deleted tools/mergebin/MetaDataTables.h.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/********************************************************
 * mergebin
 * Written by Robert Simpson (robert@blackcastlesoft.com)
 * 
 * Released to the public domain, use at your own risk!
 ********************************************************/

#pragma once
#include "metadata.h"

class CTableData;

class CMetadataTables :
  public CMetadata::CStream
{
  friend CTableData;

public:
  CMetadataTables(CMetadata& metaData);
  virtual ~CMetadataTables(void);

protected:
  CMetadata&  m_meta;
  BYTE       *m_pbMajorVersion;
  BYTE       *m_pbMinorVersion;
  BYTE       *m_pbHeapOffsetSizes;
  UINT64     *m_pullMaskValid;
  UINT64     *m_pullMaskSorted;
  DWORD      *m_pdwTableLengths;

  DWORD      *m_pdwTableLengthIndex[64];
  DWORD       m_dwTables;

  CTableData *m_pTables[64];

public:
  UINT        GetStringIndexSize ();
  UINT        GetGuidIndexSize   ();
  UINT        GetBlobIndexSize   ();
  DWORD       GetMaxIndexSizeOf  (UINT *);

  DWORD *     TableRowCount      (UINT uType);

  CTableData *GetTable           (UINT uId);
};
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<


























































































Deleted tools/mergebin/PEFile.cpp.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
/********************************************************
 * mergebin
 * Written by Robert Simpson (robert@blackcastlesoft.com)
 * 
 * Released to the public domain, use at your own risk!
 ********************************************************/

#include "StdAfx.h"
#include "PEFile.h"

#define MakePtr( cast, ptr, addValue ) (cast)( (DWORD_PTR)(ptr) + (DWORD_PTR)(addValue))

CPEFile::CPEFile(void)
{
  m_hMap = NULL;
  m_hFile = INVALID_HANDLE_VALUE;
  m_pBase = NULL;
}

CPEFile::~CPEFile(void)
{
  Close();
}

HRESULT CPEFile::Open(LPCTSTR pszFile, BOOL bReadOnly)
{
  HRESULT hr = S_OK;
  Close();

  m_hFile = CreateFile(pszFile, GENERIC_READ | ((bReadOnly == FALSE) ? GENERIC_WRITE: 0), FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
  if (m_hFile == INVALID_HANDLE_VALUE)
  {
    hr = HRESULT_FROM_WIN32(GetLastError());
  }
  else
  {
    m_hMap = CreateFileMapping(m_hFile, NULL, (bReadOnly == TRUE) ? PAGE_READONLY:PAGE_READWRITE, 0, 0, NULL);
    if (!m_hMap)
    {
      hr = HRESULT_FROM_WIN32(GetLastError());
    }
    else
    {
      m_pBase = (PIMAGE_DOS_HEADER)MapViewOfFile(m_hMap, FILE_MAP_READ | ((bReadOnly == FALSE) ? FILE_MAP_WRITE:0), 0, 0, 0);
      if (!m_pBase)
      {
        hr = HRESULT_FROM_WIN32(GetLastError());
      }
    }
  }

  if (SUCCEEDED(hr))
  {
    PIMAGE_FILE_HEADER pImageHeader = (PIMAGE_FILE_HEADER)m_pBase;
    if (m_pBase->e_magic != IMAGE_DOS_SIGNATURE)
    {
      hr = HRESULT_FROM_WIN32(ERROR_BAD_FORMAT);
    }

    m_pNTHeader = MakePtr(PIMAGE_NT_HEADERS, m_pBase, m_pBase->e_lfanew);
    if (IsBadReadPtr(m_pNTHeader, sizeof(m_pNTHeader->Signature)))
    {
      hr = HRESULT_FROM_WIN32(ERROR_BAD_FORMAT);
    }
    else
    {
      if (m_pNTHeader->Signature != IMAGE_NT_SIGNATURE)
      {
        hr = HRESULT_FROM_WIN32(ERROR_BAD_FORMAT);
      }
    }
    m_bIs64Bit = (m_pNTHeader->OptionalHeader.Magic == IMAGE_NT_OPTIONAL_HDR64_MAGIC);
  }

  if (FAILED(hr)) Close();

  return hr;
}

void CPEFile::Close(void)
{
  if (m_pBase)
  {
    UnmapViewOfFile(m_pBase);
  }

  if (m_hMap)
    CloseHandle(m_hMap);

  if (m_hFile != INVALID_HANDLE_VALUE)
    CloseHandle(m_hFile);

  m_hMap = NULL;
  m_hFile = INVALID_HANDLE_VALUE;
  m_pBase = NULL;
}

PIMAGE_SECTION_HEADER CPEFile::GetEnclosingSectionHeader(DWORD rva) const
{
  PIMAGE_SECTION_HEADER section;
  
  if (m_bIs64Bit)
    section = IMAGE_FIRST_SECTION((PIMAGE_NT_HEADERS64)m_pNTHeader);
  else
    section = IMAGE_FIRST_SECTION(m_pNTHeader);

  for (UINT i=0; i < m_pNTHeader->FileHeader.NumberOfSections; i++, section++ )
  {
    DWORD size = section->Misc.VirtualSize;
    if (!size)
      size = section->SizeOfRawData;

    if ( (rva >= section->VirtualAddress) && 
      (rva < (section->VirtualAddress + size)))
      return section;
  }
  return NULL;
}

LPVOID CPEFile::GetPtrFromRVA(DWORD rva) const
{
  PIMAGE_SECTION_HEADER pSectionHdr;
  INT delta;

  pSectionHdr = GetEnclosingSectionHeader(rva);
  if ( !pSectionHdr )
    return 0;

  delta = (INT)(pSectionHdr->VirtualAddress-pSectionHdr->PointerToRawData);
  return (PVOID) (((LPBYTE)m_pBase) + rva - delta);
}

PIMAGE_SECTION_HEADER CPEFile::GetSectionHeader(LPCSTR name) const
{
  PIMAGE_SECTION_HEADER section;
  
  if (m_bIs64Bit)
    section = IMAGE_FIRST_SECTION((PIMAGE_NT_HEADERS64)m_pNTHeader);
  else
    section = IMAGE_FIRST_SECTION(m_pNTHeader);

  for (UINT i=0; i < m_pNTHeader->FileHeader.NumberOfSections; i++, section++)
  {
    if (_strnicmp((char *)section->Name,name,IMAGE_SIZEOF_SHORT_NAME) == 0)
      return section;
  }

  return NULL;
}

CPEFile::operator PIMAGE_NT_HEADERS32() const
{
  if (!m_pBase || m_bIs64Bit) return NULL;
  return m_pNTHeader;
}

CPEFile::operator PIMAGE_NT_HEADERS64() const
{
  if (!m_pBase || !m_bIs64Bit) return NULL;
  return (PIMAGE_NT_HEADERS64)m_pNTHeader;
}

CPEFile::operator PIMAGE_DOS_HEADER() const
{
  return m_pBase;
}

CPEFile::operator PIMAGE_COR20_HEADER() const
{
  if (!m_pBase) return NULL;

  DWORD dwRVA;

  if (m_bIs64Bit)
    dwRVA = ((PIMAGE_NT_HEADERS64)m_pNTHeader)->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_COM_DESCRIPTOR].VirtualAddress;
  else
    dwRVA = m_pNTHeader->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_COM_DESCRIPTOR].VirtualAddress;
  if (!dwRVA)
  {
    return NULL;
  }

  return ((PIMAGE_COR20_HEADER)GetPtrFromRVA(dwRVA));
}
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
















































































































































































































































































































































































Deleted tools/mergebin/PEFile.h.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/********************************************************
 * mergebin
 * Written by Robert Simpson (robert@blackcastlesoft.com)
 * 
 * Released to the public domain, use at your own risk!
 ********************************************************/

#pragma once

class CPEFile
{
public:
  CPEFile();
  virtual ~CPEFile(void);

protected:
  HANDLE              m_hMap;
  HANDLE              m_hFile;
  PIMAGE_DOS_HEADER   m_pBase;
  PIMAGE_NT_HEADERS32 m_pNTHeader;
  BOOL                m_bIs64Bit;

public:
  HRESULT Open  (LPCTSTR pszFile, BOOL bReadOnly = TRUE);
  void    Close (void);

  PIMAGE_SECTION_HEADER GetEnclosingSectionHeader (DWORD rva) const;
  LPVOID                GetPtrFromRVA             (DWORD rva) const;
  PIMAGE_SECTION_HEADER GetSectionHeader          (LPCSTR name) const;
  
  operator PIMAGE_DOS_HEADER   () const;
  operator PIMAGE_NT_HEADERS32 () const;
  operator PIMAGE_NT_HEADERS64 () const;
  operator PIMAGE_COR20_HEADER () const;
};
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<






































































Deleted tools/mergebin/StreamTable.cpp.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#include "StdAfx.h"
#include "StreamTable.h"

CREATEINSTANCE g_arTableTypes[64] = {
  CStreamTable::CreateInstance<CModuleTable>,
  CStreamTable::CreateInstance<CTypeRefTable>,
  CStreamTable::CreateInstance<CTypeDefTable>,
  NULL,
};

CStreamTable::CStreamTable(CMetadataTables& tables) : m_tables(tables)
{
}

CStreamTable::~CStreamTable(void)
{
}

template<class C>
static CStreamTable * CALLBACK CStreamTable::CreateInstance(CMetadataTables *ptables)
{
  CStreamTable *p = new C(*ptables);
  p->Init();

  return p;
}

void CStreamTable::Init()
{
  m_pbData = m_tables.m_pbData;
  CStreamTable *p;

  for (UINT n = 0; n < GetType(); n++)
  {
    p = m_tables.GetTable(n);
    if (p)
    {
      m_pbData += (p->GetRowSize() * p->GetRowCount());
    }
  }
}

DWORD CStreamTable::GetRowCount()
{
  return *m_tables.TableRowCount(GetType());
}

UINT CStreamTable::GetRowSize()
{
  TABLE_COLUMN *pc = GetColumns();
  UINT ulen = 0;

  while (pc->uSize)
  {
    ulen += pc->uSize;
    pc ++;
  }

  return ulen;
}

UINT CStreamTable::GetColumnCount()
{
  TABLE_COLUMN *pc = GetColumns();
  UINT ucount = 0;

  while (pc->uSize)
  {
    ucount ++;
    pc ++;
  }
  return ucount;
}

LPBYTE CStreamTable::operator[](UINT uRow)
{
  return m_pbData + (uRow * GetRowSize());
}
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<




























































































































































Deleted tools/mergebin/StreamTable.h.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
#pragma once
#include "MetaDataTables.h"

typedef enum TableTypes
{
  ttModule = 0,
  ttTypeRef = 1,
  ttTypeDef = 2,
  ttFieldPtr = 3, 
  ttField = 4,
  ttMethodPtr = 5,
  ttMethodDef = 6,
  ttParamPtr = 7, 
  ttParam = 8,
  ttInterfaceImpl = 9,
  ttMemberRef = 10,
  ttConstant = 11, 
  ttCustomAttribute = 12,
  ttFieldMarshal = 13,
  ttPermission = 14,
  ttClassLayout = 15, 
  ttFieldLayout = 16,
  ttStandAloneSig = 17,
  ttEventMap = 18,
  ttEventPtr = 19, 
  ttEvent = 20,
  ttPropertyMap = 21,
  ttPropertyPtr = 22,
  ttProperty = 23, 
  ttMethodSemantics = 24,
  ttMethodImpl = 25,
  ttModuleRef = 26,
  ttTypeSpec = 27, 
  ttImplMap = 28, //lidin book is wrong again here?  It has enclog at 28
  ttFieldRVA = 29,
  ttENCLog = 30,
  ttENCMap = 31, 
  ttAssembly = 32,
  ttAssemblyProcessor= 33,
  ttAssemblyOS = 34,
  ttAssemblyRef = 35, 
  ttAssemblyRefProcessor = 36,
  ttAssemblyRefOS = 37,
  ttFile = 38,
  ttExportedType = 39, 
  ttManifestResource = 40,
  ttNestedClass = 41,
  ttTypeTyPar = 42,
  ttMethodTyPar = 43,
} TableTypes;

#define STRING_INDEXSIZE (m_tables.GetStringIndexSize())
#define GUID_INDEXSIZE (m_tables.GetGuidIndexSize())
#define BLOB_INDEXSIZE (m_tables.GetBlobIndexSize())
#define TABLE_ROWCOUNT(x) (m_tables.TableRowCount(x)[0])
#define TABLE_INDEXSIZE(x) (TABLE_ROWCOUNT(x) > 65535 ? 4 : 2)
#define MAX_INDEXSIZE(x) (m_tables.GetMaxIndexSizeOf(x))

class CStreamTable;

typedef CStreamTable* (CALLBACK* CREATEINSTANCE)(CMetadataTables *);

#define DECLARE_TABLE(classname, typ, nam) \
  public: \
  classname##(CMetadataTables& tables) : CStreamTable(tables) {} \
  UINT GetType() { return typ; } \
  LPCTSTR GetName() { return _T(nam); }

typedef struct TABLE_COLUMN
{
  UINT uSize;
  LPCTSTR pszName;
} TABLE_COLUMNS;

#define BEGIN_COLUMN_MAP() \
  protected: \
  TABLE_COLUMN *GetColumns() \
  { \
    static TABLE_COLUMN map[] = {

#define END_COLUMN_MAP() \
      { 0, NULL } \
    }; \
    return map; \
  }

#define COLUMN_ENTRY(name, size) { size, _T(name) },

class CStreamTable
{
public:
  CStreamTable(CMetadataTables& tables);
  virtual ~CStreamTable(void);

  DWORD GetRowCount();
  LPBYTE operator[](UINT uRow);

  virtual UINT GetType() = 0;
  virtual LPCTSTR GetName() = 0;

  template<class C> static CStreamTable * CALLBACK CreateInstance(CMetadataTables *ptables);

protected:
  CMetadataTables& m_tables;
  LPBYTE m_pbData;

  virtual UINT GetRowSize();
  virtual UINT GetColumnCount();

  virtual TABLE_COLUMN *GetColumns() = 0;

private:
  void Init();
};

class CModuleTable : public CStreamTable
{
  DECLARE_TABLE(CModuleTable, ttModule, "Module")
  
  BEGIN_COLUMN_MAP()
    COLUMN_ENTRY("Generation", sizeof(WORD))
    COLUMN_ENTRY("Name",       STRING_INDEXSIZE)
    COLUMN_ENTRY("Mvid",       GUID_INDEXSIZE)
    COLUMN_ENTRY("EncId",      GUID_INDEXSIZE)
    COLUMN_ENTRY("EncBaseId",  GUID_INDEXSIZE)
  END_COLUMN_MAP()
};

static UINT ResolutionScopeIndex[] = {ttModule, ttModuleRef, ttAssemblyRef, ttTypeRef, 0};

class CTypeRefTable : public CStreamTable
{
  DECLARE_TABLE(CTypeRefTable, ttTypeRef, "TypeRef")

  BEGIN_COLUMN_MAP()
    COLUMN_ENTRY("ResolutionScope", MAX_INDEXSIZE(ResolutionScopeIndex))
    COLUMN_ENTRY("TypeName", STRING_INDEXSIZE)
    COLUMN_ENTRY("TypeNamespace", STRING_INDEXSIZE)
  END_COLUMN_MAP()
};

static UINT TypeDefOrRefIndex[] = {ttTypeDef, ttTypeRef, ttTypeSpec, 0};

class CTypeDefTable : public CStreamTable
{
  DECLARE_TABLE(CTypeDefTable, ttTypeDef, "TypeDef")

  BEGIN_COLUMN_MAP()
    COLUMN_ENTRY("Flags", sizeof(DWORD))
    COLUMN_ENTRY("TypeName", STRING_INDEXSIZE)
    COLUMN_ENTRY("TypeNamespace", STRING_INDEXSIZE)
    COLUMN_ENTRY("Extends", MAX_INDEXSIZE(TypeDefOrRefIndex))
    COLUMN_ENTRY("FieldList", TABLE_INDEXSIZE(ttField))
    COLUMN_ENTRY("MethodList", TABLE_INDEXSIZE(ttMethodDef))
  END_COLUMN_MAP()
};

extern CREATEINSTANCE g_arTableTypes[64];
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<




























































































































































































































































































































Deleted tools/mergebin/TableData.cpp.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
/********************************************************
 * mergebin
 * Written by Robert Simpson (robert@blackcastlesoft.com)
 * 
 * Released to the public domain, use at your own risk!
 ********************************************************/

#include "StdAfx.h"
#include "TableData.h"

CREATEINSTANCE g_arTableTypes[64] = {
  CTableData::CreateInstance<CModuleTable>,
  CTableData::CreateInstance<CTypeRefTable>,
  CTableData::CreateInstance<CTypeDefTable>,
  CTableData::CreateInstance<CFieldPtrTable>,
  CTableData::CreateInstance<CFieldTable>,
  CTableData::CreateInstance<CMethodPtrTable>,
  CTableData::CreateInstance<CMethodTable>,
  CTableData::CreateInstance<CParamPtrTable>,
  CTableData::CreateInstance<CParamTable>,
  CTableData::CreateInstance<CInterfaceImplTable>,
  CTableData::CreateInstance<CMemberRefTable>,
  CTableData::CreateInstance<CConstantTable>,
  CTableData::CreateInstance<CCustomAttributeTable>,
  CTableData::CreateInstance<CFieldMarshalTable>,
  CTableData::CreateInstance<CDeclSecurityTable>,
  CTableData::CreateInstance<CClassLayoutTable>,
  CTableData::CreateInstance<CFieldLayoutTable>,
  CTableData::CreateInstance<CStandAloneSigTable>,
  CTableData::CreateInstance<CEventMapTable>,
  CTableData::CreateInstance<CEventPtrTable>,
  CTableData::CreateInstance<CEventTable>,
  CTableData::CreateInstance<CPropertyMapTable>,
  CTableData::CreateInstance<CPropertyPtrTable>,
  CTableData::CreateInstance<CPropertyTable>,
  CTableData::CreateInstance<CMethodSemanticsTable>,
  CTableData::CreateInstance<CMethodImplTable>,
  CTableData::CreateInstance<CModuleRefTable>,
  CTableData::CreateInstance<CTypeSpecTable>,
  CTableData::CreateInstance<CImplMapTable>,
  CTableData::CreateInstance<CFieldRVATable>,
  NULL,
};

CTableData::CTableData(CMetadataTables& tables) : m_tables(tables)
{
  m_uiRowSize = 0;
}

CTableData::~CTableData(void)
{
  if (m_pColumns) 
    delete[] m_pColumns;
}

template<class C>
static CTableData * CALLBACK CTableData::CreateInstance(CMetadataTables *ptables)
{
  CTableData *p = new C(*ptables);
  p->Init();

  return p;
}

void CTableData::Init()
{
  m_pbData = m_tables.m_pbData;
  CTableData *p;
  UINT n = GetType();
  
  while(n--)
  {
    p = m_tables.GetTable(n);
    if (p)
    {
      m_pbData = p->m_pbData + (p->GetRowSize() * p->GetRowCount());
      break;
    }
  }

  m_pColumns = _CreateColumns();
  TABLE_COLUMNS *tc = m_pColumns + 1;

  while (tc->pszName && !tc->dwOffset)
  {
    tc->dwOffset = tc[-1].dwOffset + tc[-1].uSize;
    tc ++;
  }
}

TABLE_COLUMN * CTableData::GetColumns()
{
  return m_pColumns;
}

DWORD CTableData::GetRowCount()
{
  return *m_tables.TableRowCount(GetType());
}

UINT CTableData::GetRowSize()
{
  if (m_uiRowSize == 0)
  {
    TABLE_COLUMN *pc = m_pColumns;

    while (pc->uSize)
    {
      m_uiRowSize += pc->uSize;
      pc ++;
    }
  }

  return m_uiRowSize;
}

UINT CTableData::GetColumnCount()
{
  TABLE_COLUMN *pc = m_pColumns;
  UINT ucount = 0;

  while (pc->uSize)
  {
    ucount ++;
    pc ++;
  }
  return ucount;
}

int CTableData::GetColumnIndex(LPCTSTR pszName)
{
  TABLE_COLUMN *pc = m_pColumns;
  for (int n = 0; pc[n].pszName; n++)
  {
    if (lstrcmpi(pszName, pc[n].pszName) == 0) return n;
  }
  return -1;
}

UINT CTableData::GetColumnSize(UINT uIndex)
{
  return m_pColumns[uIndex].uSize;
}

UINT CTableData::GetColumnSize(LPCTSTR pszName)
{
  int n = GetColumnIndex(pszName);
  if (n < 0) return 0;

  return GetColumnSize(n);
}

LPBYTE CTableData::Column(UINT uRow, UINT uIndex)
{
  TABLE_COLUMN *pc = m_pColumns;
  LPBYTE pb = m_pbData + (uRow * GetRowSize()) + pc[uIndex].dwOffset;

  return pb;
}

LPBYTE CTableData::Column(UINT uRow, LPCTSTR pszName)
{
  int n = GetColumnIndex(pszName);
  if (n < 0) return NULL;
  return Column(uRow, n);
}
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<












































































































































































































































































































































Deleted tools/mergebin/TableData.h.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
/********************************************************
 * mergebin
 * Written by Robert Simpson (robert@blackcastlesoft.com)
 * 
 * Released to the public domain, use at your own risk!
 ********************************************************/

#pragma once
#include "MetaDataTables.h"

typedef enum TableTypes
{
  ttModule = 0,
  ttTypeRef = 1,
  ttTypeDef = 2,
  ttFieldPtr = 3, 
  ttField = 4,
  ttMethodPtr = 5,
  ttMethodDef = 6,
  ttParamPtr = 7, 
  ttParam = 8,
  ttInterfaceImpl = 9,
  ttMemberRef = 10,
  ttConstant = 11, 
  ttCustomAttribute = 12,
  ttFieldMarshal = 13,
  ttDeclSecurity = 14,
  ttClassLayout = 15, 
  ttFieldLayout = 16,
  ttStandAloneSig = 17,
  ttEventMap = 18,
  ttEventPtr = 19, 
  ttEvent = 20,
  ttPropertyMap = 21,
  ttPropertyPtr = 22,
  ttProperty = 23, 
  ttMethodSemantics = 24,
  ttMethodImpl = 25,
  ttModuleRef = 26,
  ttTypeSpec = 27, 
  ttImplMap = 28,
  ttFieldRVA = 29,
  ttENCLog = 30,
  ttENCMap = 31, 
  ttAssembly = 32,
  ttAssemblyProcessor= 33,
  ttAssemblyOS = 34,
  ttAssemblyRef = 35, 
  ttAssemblyRefProcessor = 36,
  ttAssemblyRefOS = 37,
  ttFile = 38,
  ttExportedType = 39, 
  ttManifestResource = 40,
  ttNestedClass = 41,
  ttGenericParam = 42,
  ttMethodSpec = 43,
  ttGenericParamConstraint = 44,
} TableTypes;

typedef struct TABLE_COLUMN
{
  UINT uSize;
  LPCTSTR pszName;
  DWORD dwOffset;
} TABLE_COLUMNS;

class CTableData;

/*
** Helpers
*/
#define STRING_INDEXSIZE (m_tables.GetStringIndexSize())
#define GUID_INDEXSIZE (m_tables.GetGuidIndexSize())
#define BLOB_INDEXSIZE (m_tables.GetBlobIndexSize())
#define TABLE_ROWCOUNT(x) (m_tables.TableRowCount(x)[0])
#define TABLE_INDEXSIZE(x) (TABLE_ROWCOUNT(x) > 65535 ? 4 : 2)
#define MAX_INDEXSIZE(x) (m_tables.GetMaxIndexSizeOf(x))

#define DECLARE_TABLE(classname, typ, nam) \
  public: \
  classname##(CMetadataTables& tables) : CTableData(tables) {} \
  UINT GetType() { return typ; } \
  LPCTSTR GetName() { return _T(nam); }

#define BEGIN_COLUMN_MAP() \
  protected: \
  TABLE_COLUMN *_CreateColumns() \
  { \
    TABLE_COLUMN map[] = {

#define END_COLUMN_MAP() \
      { 0, NULL } \
    }; \
    TABLE_COLUMN *p = new TABLE_COLUMN[sizeof(map) / sizeof(TABLE_COLUMN)]; \
    CopyMemory(p, map, sizeof(map)); \
    return p; \
  }

#define COLUMN_ENTRY(name, size) { size, _T(name), 0 },
/*
** End Of Helpers
*/

class CTableData
{
public:
  CTableData(CMetadataTables& tables);
  virtual ~CTableData(void);

  virtual UINT          GetType        () = 0;
  virtual LPCTSTR       GetName        () = 0;
  virtual TABLE_COLUMN *_CreateColumns () = 0;

  template<class C> static CTableData * CALLBACK CreateInstance(CMetadataTables *ptables);

  virtual DWORD         GetRowCount ();
  virtual UINT          GetRowSize  ();

  int           GetColumnIndex (LPCTSTR pszName);
  UINT          GetColumnSize  (UINT uIndex);
  UINT          GetColumnSize  (LPCTSTR pszName);
  UINT          GetColumnCount ();
  LPBYTE        Column         (UINT uRow, UINT uIndex);
  LPBYTE        Column         (UINT uRow, LPCTSTR pszName);
  TABLE_COLUMN *GetColumns     ();

protected:
  CMetadataTables& m_tables;
  LPBYTE           m_pbData;
  UINT             m_uiRowSize;
  TABLE_COLUMN    *m_pColumns;

private:
  void Init ();
};

class CModuleTable : public CTableData
{
  DECLARE_TABLE(CModuleTable, ttModule, "Module")
  
  BEGIN_COLUMN_MAP()
    COLUMN_ENTRY("Generation", sizeof(WORD))
    COLUMN_ENTRY("Name",       STRING_INDEXSIZE)
    COLUMN_ENTRY("Mvid",       GUID_INDEXSIZE)
    COLUMN_ENTRY("EncId",      GUID_INDEXSIZE)
    COLUMN_ENTRY("EncBaseId",  GUID_INDEXSIZE)
  END_COLUMN_MAP()
};

static UINT TypeDefOrRefIndex[]        = { ttTypeDef,   ttTypeRef,     ttTypeSpec,     0 };
static UINT HasConstantIndex[]         = { ttField,     ttParam,       ttProperty,     0 };
static UINT HasCustomAttributeIndex[]  = { ttMethodDef, ttField,       ttTypeRef,      ttTypeDef,   ttParam,    ttInterfaceImpl, ttMemberRef, ttModule, ttDeclSecurity, ttProperty, ttEvent, ttStandAloneSig, ttModuleRef, ttTypeSpec, ttAssembly, ttAssemblyRef, ttFile, ttExportedType, ttManifestResource, 0 };
static UINT HasFieldMarshalIndex[]     = { ttField,     ttParam,       0 };
static UINT HasDeclSecurityIndex[]     = { ttTypeDef,   ttMethodDef,   ttAssembly,     0 };
static UINT MemberRefParentIndex[]     = { ttTypeDef,   ttTypeRef,     ttModuleRef,    ttMethodDef, ttTypeSpec, 0 };
static UINT HasSemanticsIndex[]        = { ttEvent,     ttProperty,    0 };
static UINT MethodDefOrRefIndex[]      = { ttMethodDef, ttMemberRef,   0 };
static UINT MemberForwardedIndex[]     = { ttField,     ttMethodDef,   0 };
static UINT ImplementationIndex[]      = { ttFile,      ttAssemblyRef, ttExportedType, 0 };
static UINT CustomAttributeTypeIndex[] = { 63,          63,            ttMethodDef,    ttMemberRef, 63,         0 };
static UINT ResolutionScopeIndex[]     = { ttModule,    ttModuleRef,   ttAssemblyRef,  ttTypeRef,   0 };
static UINT TypeOrMethodDefIndex[]     = { ttTypeDef,   ttMethodDef,   0 };

class CTypeRefTable : public CTableData
{
  DECLARE_TABLE(CTypeRefTable, ttTypeRef, "TypeRef")

  BEGIN_COLUMN_MAP()
    COLUMN_ENTRY("ResolutionScope", MAX_INDEXSIZE(ResolutionScopeIndex))
    COLUMN_ENTRY("TypeName",        STRING_INDEXSIZE)
    COLUMN_ENTRY("TypeNamespace",   STRING_INDEXSIZE)
  END_COLUMN_MAP()
};

class CTypeDefTable : public CTableData
{
  DECLARE_TABLE(CTypeDefTable, ttTypeDef, "TypeDef")

  BEGIN_COLUMN_MAP()
    COLUMN_ENTRY("Flags",         sizeof(DWORD))
    COLUMN_ENTRY("TypeName",      STRING_INDEXSIZE)
    COLUMN_ENTRY("TypeNamespace", STRING_INDEXSIZE)
    COLUMN_ENTRY("Extends",       MAX_INDEXSIZE(TypeDefOrRefIndex))
    COLUMN_ENTRY("FieldList",     TABLE_INDEXSIZE(ttField))
    COLUMN_ENTRY("MethodList",    TABLE_INDEXSIZE(ttMethodDef))
  END_COLUMN_MAP()
};

class CFieldPtrTable : public CTableData
{
  DECLARE_TABLE(CFieldPtrTable, ttFieldPtr, "FieldPtr")

  BEGIN_COLUMN_MAP()
    COLUMN_ENTRY("Field", TABLE_INDEXSIZE(ttField))
  END_COLUMN_MAP()
};

class CFieldTable : public CTableData
{
  DECLARE_TABLE(CFieldTable, ttField, "Field")

  BEGIN_COLUMN_MAP()
    COLUMN_ENTRY("Flags",     sizeof(WORD))
    COLUMN_ENTRY("Name",      STRING_INDEXSIZE)
    COLUMN_ENTRY("Signature", BLOB_INDEXSIZE)
  END_COLUMN_MAP()
};

class CMethodPtrTable : public CTableData
{
  DECLARE_TABLE(CMethodPtrTable, ttMethodPtr, "MethodPtr")

  BEGIN_COLUMN_MAP()
    COLUMN_ENTRY("Method", TABLE_INDEXSIZE(ttMethodDef))
  END_COLUMN_MAP()
};

class CMethodTable : public CTableData
{
  DECLARE_TABLE(CMethodTable, ttMethodDef, "Method")

  BEGIN_COLUMN_MAP()
    COLUMN_ENTRY("RVA",        sizeof(DWORD))
    COLUMN_ENTRY("ImplFlags",  sizeof(WORD))
    COLUMN_ENTRY("Flags",      sizeof(WORD))
    COLUMN_ENTRY("Name",       STRING_INDEXSIZE)
    COLUMN_ENTRY("Signature",  BLOB_INDEXSIZE)
    COLUMN_ENTRY("Parameters", TABLE_INDEXSIZE(ttParam))
  END_COLUMN_MAP()
};

class CParamPtrTable : public CTableData
{
  DECLARE_TABLE(CParamPtrTable, ttParamPtr, "ParamPtr")

  BEGIN_COLUMN_MAP()
    COLUMN_ENTRY("Param", TABLE_INDEXSIZE(ttParam))
  END_COLUMN_MAP()
};

class CParamTable : public CTableData
{
  DECLARE_TABLE(CParamTable, ttParam, "Param")

  BEGIN_COLUMN_MAP()
    COLUMN_ENTRY("Flags",    sizeof(WORD))
    COLUMN_ENTRY("Sequence", sizeof(WORD))
    COLUMN_ENTRY("Name",     STRING_INDEXSIZE)
  END_COLUMN_MAP()
};

class CInterfaceImplTable : public CTableData
{
  DECLARE_TABLE(CInterfaceImplTable, ttInterfaceImpl, "Interface")

  BEGIN_COLUMN_MAP()
    COLUMN_ENTRY("Class",     TABLE_INDEXSIZE(ttTypeDef))
    COLUMN_ENTRY("Interface", MAX_INDEXSIZE(TypeDefOrRefIndex))
  END_COLUMN_MAP()
};

class CMemberRefTable : public CTableData
{
  DECLARE_TABLE(CMemberRefTable, ttMemberRef, "Member")

  BEGIN_COLUMN_MAP()
    COLUMN_ENTRY("Class",     MAX_INDEXSIZE(MemberRefParentIndex))
    COLUMN_ENTRY("Name",      STRING_INDEXSIZE)
    COLUMN_ENTRY("Signature", BLOB_INDEXSIZE)
  END_COLUMN_MAP()
};

class CConstantTable : public CTableData
{
  DECLARE_TABLE(CConstantTable, ttConstant, "Constant")

  BEGIN_COLUMN_MAP()
    COLUMN_ENTRY("Type",   sizeof(WORD))
    COLUMN_ENTRY("Parent", MAX_INDEXSIZE(HasConstantIndex))
    COLUMN_ENTRY("Value",  BLOB_INDEXSIZE)
  END_COLUMN_MAP()
};

class CCustomAttributeTable : public CTableData
{
  DECLARE_TABLE(CCustomAttributeTable, ttCustomAttribute, "CustomAttribute")

  BEGIN_COLUMN_MAP()
    COLUMN_ENTRY("Parent", MAX_INDEXSIZE(HasCustomAttributeIndex))
    COLUMN_ENTRY("Type",   MAX_INDEXSIZE(CustomAttributeTypeIndex))
    COLUMN_ENTRY("Value",  BLOB_INDEXSIZE)
  END_COLUMN_MAP()
};

class CFieldMarshalTable : public CTableData
{
  DECLARE_TABLE(CFieldMarshalTable, ttFieldMarshal, "FieldMarshal")

  BEGIN_COLUMN_MAP()
    COLUMN_ENTRY("Parent",     MAX_INDEXSIZE(HasFieldMarshalIndex))
    COLUMN_ENTRY("NativeType", BLOB_INDEXSIZE)
  END_COLUMN_MAP()
};

class CDeclSecurityTable : public CTableData
{
  DECLARE_TABLE(CDeclSecurityTable, ttDeclSecurity, "DeclSecurity")

  BEGIN_COLUMN_MAP()
    COLUMN_ENTRY("Action",        sizeof(WORD))
    COLUMN_ENTRY("Parent",        MAX_INDEXSIZE(HasDeclSecurityIndex))
    COLUMN_ENTRY("PermissionSet", BLOB_INDEXSIZE)
  END_COLUMN_MAP()
};

class CClassLayoutTable : public CTableData
{
  DECLARE_TABLE(CClassLayoutTable, ttClassLayout, "ClassLayout")
  
  BEGIN_COLUMN_MAP()
    COLUMN_ENTRY("PackingSize", sizeof(WORD))
    COLUMN_ENTRY("ClassSize",   sizeof(DWORD))
    COLUMN_ENTRY("Parent",      TABLE_INDEXSIZE(ttTypeDef))
  END_COLUMN_MAP()
};

class CFieldLayoutTable : public CTableData
{
  DECLARE_TABLE(CFieldLayoutTable, ttFieldLayout, "FieldLayout")

  BEGIN_COLUMN_MAP()
    COLUMN_ENTRY("Offset", sizeof(DWORD))
    COLUMN_ENTRY("Field",  TABLE_INDEXSIZE(ttField))
  END_COLUMN_MAP()
};

class CStandAloneSigTable : public CTableData
{
  DECLARE_TABLE(CStandAloneSigTable, ttStandAloneSig, "StandAloneSig")

  BEGIN_COLUMN_MAP()
    COLUMN_ENTRY("Signature", BLOB_INDEXSIZE)
  END_COLUMN_MAP()
};

class CEventMapTable : public CTableData
{
  DECLARE_TABLE(CEventMapTable, ttEventMap, "EventMap")

  BEGIN_COLUMN_MAP()
    COLUMN_ENTRY("Parent",    TABLE_INDEXSIZE(ttTypeDef))
    COLUMN_ENTRY("EventList", TABLE_INDEXSIZE(ttEvent))
  END_COLUMN_MAP()
};

class CEventTable : public CTableData
{
  DECLARE_TABLE(CEventTable, ttEvent, "Event")

  BEGIN_COLUMN_MAP()
    COLUMN_ENTRY("EventFlags", sizeof(WORD))
    COLUMN_ENTRY("Name",       STRING_INDEXSIZE)
    COLUMN_ENTRY("EventType",  MAX_INDEXSIZE(TypeDefOrRefIndex))
  END_COLUMN_MAP()
};

class CEventPtrTable : public CTableData
{
  DECLARE_TABLE(CEventPtrTable, ttEventPtr, "EventPtr")

  BEGIN_COLUMN_MAP()
    COLUMN_ENTRY("Event", TABLE_INDEXSIZE(ttEvent))
  END_COLUMN_MAP()
};

class CPropertyMapTable : public CTableData
{
  DECLARE_TABLE(CPropertyMapTable, ttPropertyMap, "PropertyMap")

  BEGIN_COLUMN_MAP()
    COLUMN_ENTRY("Parent",       TABLE_INDEXSIZE(ttTypeDef))
    COLUMN_ENTRY("PropertyList", TABLE_INDEXSIZE(ttProperty))
  END_COLUMN_MAP()
};

class CPropertyPtrTable : public CTableData
{
  DECLARE_TABLE(CPropertyPtrTable, ttEventPtr, "PropertyPtr")

  BEGIN_COLUMN_MAP()
    COLUMN_ENTRY("Property", TABLE_INDEXSIZE(ttProperty))
  END_COLUMN_MAP()
};

class CPropertyTable : public CTableData
{
  DECLARE_TABLE(CPropertyTable, ttProperty, "Property")

  BEGIN_COLUMN_MAP()
    COLUMN_ENTRY("Flags", sizeof(WORD))
    COLUMN_ENTRY("Name",  STRING_INDEXSIZE)
    COLUMN_ENTRY("Type",  BLOB_INDEXSIZE)
  END_COLUMN_MAP()
};

class CMethodSemanticsTable : public CTableData
{
  DECLARE_TABLE(CMethodSemanticsTable, ttMethodSemantics, "MethodSemantics")

  BEGIN_COLUMN_MAP()
    COLUMN_ENTRY("Semantics",   sizeof(WORD))
    COLUMN_ENTRY("Method",      TABLE_INDEXSIZE(ttMethodDef))
    COLUMN_ENTRY("Association", MAX_INDEXSIZE(HasSemanticsIndex))
  END_COLUMN_MAP()
};

class CMethodImplTable : public CTableData
{
  DECLARE_TABLE(CMethodImplTable, ttMethodImpl, "MethodImpl")

  BEGIN_COLUMN_MAP()
    COLUMN_ENTRY("Class",             TABLE_INDEXSIZE(ttTypeDef))
    COLUMN_ENTRY("MethodBody",        MAX_INDEXSIZE(MethodDefOrRefIndex))
    COLUMN_ENTRY("MethodDeclaration", MAX_INDEXSIZE(MethodDefOrRefIndex))
  END_COLUMN_MAP()
};

class CModuleRefTable : public CTableData
{
  DECLARE_TABLE(CModuleRefTable, ttModuleRef, "ModuleRef")

  BEGIN_COLUMN_MAP()
    COLUMN_ENTRY("Name", STRING_INDEXSIZE)
  END_COLUMN_MAP()
};

class CTypeSpecTable : public CTableData
{
  DECLARE_TABLE(CTypeSpecTable, ttTypeSpec, "TypeSpec")

  BEGIN_COLUMN_MAP()
    COLUMN_ENTRY("Signature", BLOB_INDEXSIZE)
  END_COLUMN_MAP()
};

class CImplMapTable : public CTableData
{
  DECLARE_TABLE(CImplMapTable, ttImplMap, "ImplMap")

  BEGIN_COLUMN_MAP()
    COLUMN_ENTRY("MappingFlags",    sizeof(WORD))
    COLUMN_ENTRY("MemberForwarded", MAX_INDEXSIZE(MemberForwardedIndex))
    COLUMN_ENTRY("ImportName",      STRING_INDEXSIZE)
    COLUMN_ENTRY("ImportScope",     TABLE_INDEXSIZE(ttModuleRef))
  END_COLUMN_MAP()
};

class CFieldRVATable : public CTableData
{
  DECLARE_TABLE(CFieldRVATable, ttFieldRVA, "FieldRVA")

  BEGIN_COLUMN_MAP()
    COLUMN_ENTRY("RVA",   sizeof(DWORD))
    COLUMN_ENTRY("Field", TABLE_INDEXSIZE(ttField))
  END_COLUMN_MAP()
};

// Only tables up to ttFieldRVA are mapped, because they're all I needed.  If you need the tables beyond that, map them yourself!

typedef CTableData* (CALLBACK* CREATEINSTANCE)(CMetadataTables *);
extern CREATEINSTANCE g_arTableTypes[64];
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<














































































































































































































































































































































































































































































































































































































































































































































































































































































































































































Deleted tools/mergebin/mergebin.cpp.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
/********************************************************
 * mergebin
 * Written by Robert Simpson (robert@blackcastlesoft.com)
 * 
 * Released to the public domain, use at your own risk!
 ********************************************************/

#include "stdafx.h"
#include "MetaData.h"
#include "MetaDataTables.h"
#include "TableData.h"

void DumpCLRInfo(LPCTSTR pszFile);
void MergeModules(LPCTSTR pszAssembly, LPCTSTR pszNative, LPCTSTR pszSection, DWORD dwAdjust);
void DumpCLRPragma(LPCTSTR pszAssembly, LPCTSTR pszSection);
void FixObjFile(LPCTSTR pszFile);

typedef struct EXTRA_STUFF
{
  DWORD dwNativeEntryPoint;
} EXTRA_STUFF, *LPEXTRA_STUFF;

int _tmain(int argc, _TCHAR* argv[])
{
  if (argc == 1)
  {
    _tprintf(_T(
"MERGEBIN - Merges a pure .NET assembly with a native DLL\n \
Syntax: MERGEBIN [/I:assembly] [/S:sectionname assembly nativedll]\n \
/I:assembly            Returns the number of bytes required\n \
                       to consume the assembly\n \
/S:sectionname         The name of the section in the nativedll\n \
                       to insert the CLR data\n \
/P:assembly            Outputs the C++ pragma code that can be used\n \
                       as additional input to a C++ app to reserve\n \
                       a section block large enough for the managed code.\n \
/B:objectfile          Windows CE workaround, changes the attributes of\n \
                       the .BSS section of an object file to generate a\n \
                       DLL that doesn't have a .bss section whos \n \
                       virtualsize is larger than the rawdata size.\n \
The native DLL must have an unused section in it, into which the\n \
.NET assembly will be inserted.  You can do this with the following code:\n \
  #pragma data_seg(\".clr\")\n \
  #pragma comment(linker, \"/SECTION:.clr,ER\")\n \
   char __ph[92316] = {0}; // 92316 is the number of bytes to reserve\n \
  #pragma data_seg()\n \
You would then specify /SECTION:.CLR in the command-line for the location to\n \
insert the .NET assembly.  The number of bytes reserved in the section needs\n \
to be equal to or more than the number of bytes returned by the /I parameter.\n \
\n \
The native DLL must also export a function that calls _CorDllMain in \n \
MSCOREE.DLL.  This function must have the same parameters and calling\n \
conventions as DllMain, and its name must have the word \"CORDLLMAIN\"\n \
in it.\n \
"));
    return 0;
  }

  LPTSTR pszAssembly = NULL;
  LPTSTR pszNative = NULL;
  LPTSTR pszSection = NULL;
  BOOL bDoPragma = FALSE;
  BOOL bDoObj = FALSE;
  DWORD dwAdjust = 0;

  for (int n = 1; n < argc; n++)
  {
    if (argv[n][0] != '-' && argv[n][0] != '/')
    {
      if (pszAssembly == NULL)
        pszAssembly = argv[n];
      else if (pszNative == NULL)
        pszNative = argv[n];
      else
      {
        _tprintf(_T("Too many files specified\n"));
        return 0;
      }
      continue;
    }

    switch(argv[n][1])
    {
    case 'I':
    case 'i':
      pszAssembly = &argv[n][3];
      if (argv[n][2] != ':' || lstrlen(pszAssembly) == 0)
      {
        _tprintf(_T("/I requires an assembly name\n"));
        return 0;
      }
      DumpCLRInfo(pszAssembly);
      return 0;
      break;
    case 'P':
    case 'p':
      pszAssembly = &argv[n][3];
      if (argv[n][2] != ':' || lstrlen(pszAssembly) == 0)
      {
        _tprintf(_T("/P requires an assembly name\n"));
        return 0;
      }
      bDoPragma = TRUE;
      break;
    case 'S':
    case 's':
      pszSection = &argv[n][3];
      if (argv[n][2] != ':' || lstrlen(pszSection) == 0)
      {
        _tprintf(_T("/S requires a section name\n"));
        return 0;
      }
      break;
    //case 'A':
    //case 'a':
    //  if (argv[n][2] != ':')
    //  {
    //    _tprintf(_T("A parameter requires a numeric value\n"));
    //    return 0;
    //  }
    //  dwAdjust = _ttol(&argv[n][3]);
    //  break;
    case 'B':
    case 'b':
      pszAssembly = &argv[n][3];
      if (argv[n][2] != ':' || lstrlen(pszAssembly) == 0)
      {
        _tprintf(_T("/B requires an object file name\n"));
        return 0;
      }
      bDoObj = TRUE;
      break;
    }
  }

  if (pszAssembly && bDoObj)
    FixObjFile(pszAssembly);
  else if (pszAssembly && pszNative && pszSection && !bDoPragma)
    MergeModules(pszAssembly, pszNative, pszSection, dwAdjust);
  else if (pszAssembly && bDoPragma)
    DumpCLRPragma(pszAssembly, pszSection);

  return 0;
}

LPBYTE memstr(LPBYTE buffer, LPCSTR find, DWORD size)
{
	LPBYTE p;
	DWORD findsize = lstrlenA(find);

	for (p = buffer; p <= (buffer-findsize+size); p++)
	{
		if (memcmp(p, find, findsize) == 0)
			return p; /* found */
	}
	return NULL;
}

void FixObjFile(LPCTSTR pszFile)
{
  HANDLE hMap = INVALID_HANDLE_VALUE;
  HANDLE hFile = CreateFile(pszFile, GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL);
  LPBYTE p;
  DWORD dwSize;

  if (hFile == INVALID_HANDLE_VALUE) return;

  dwSize = GetFileSize(hFile, NULL);
  hMap = CreateFileMapping(hFile, NULL, PAGE_READWRITE, 0, 0, NULL);
  if (hMap)
  {
    p = (LPBYTE)MapViewOfFile(hMap, FILE_MAP_READ | FILE_MAP_WRITE, 0, 0, 0);
    if (p)
    {
      PIMAGE_SECTION_HEADER section = (PIMAGE_SECTION_HEADER)memstr(p, ".bss", dwSize);

      if (section)
      {
        section->Characteristics &= ~IMAGE_SCN_CNT_UNINITIALIZED_DATA;
        section->Characteristics |= IMAGE_SCN_CNT_INITIALIZED_DATA;
      }
      UnmapViewOfFile(p);
    }
    CloseHandle(hMap);
  }
  CloseHandle(hFile);
}


BOOL GetMinMaxCOR20RVA(CPEFile& file, DWORD& dwMin, DWORD& dwMax)
{
  PIMAGE_COR20_HEADER pCor = file;
  dwMin = MAXDWORD;
  dwMax = 0;

  if (!pCor) return FALSE;

  if (pCor->MetaData.Size) dwMin = min(dwMin, pCor->MetaData.VirtualAddress);
  if (pCor->Resources.Size) dwMin = min(dwMin, pCor->Resources.VirtualAddress);
  if (pCor->StrongNameSignature.Size) dwMin = min(dwMin, pCor->StrongNameSignature.VirtualAddress);
  if (pCor->CodeManagerTable.Size) dwMin = min(dwMin, pCor->CodeManagerTable.VirtualAddress);
  if (pCor->VTableFixups.Size) dwMin = min(dwMin, pCor->VTableFixups.VirtualAddress);
  if (pCor->ExportAddressTableJumps.Size) dwMin = min(dwMin, pCor->ExportAddressTableJumps.VirtualAddress);
  if (pCor->ManagedNativeHeader.Size) dwMin = min(dwMin, pCor->ManagedNativeHeader.VirtualAddress);

  dwMax = max(dwMax, (pCor->MetaData.VirtualAddress + pCor->MetaData.Size));
  dwMax = max(dwMax, (pCor->Resources.VirtualAddress + pCor->Resources.Size));
  dwMax = max(dwMax, (pCor->StrongNameSignature.VirtualAddress + pCor->StrongNameSignature.Size));
  dwMax = max(dwMax, (pCor->CodeManagerTable.VirtualAddress + pCor->CodeManagerTable.Size));
  dwMax = max(dwMax, (pCor->VTableFixups.VirtualAddress + pCor->VTableFixups.Size));
  dwMax = max(dwMax, (pCor->ExportAddressTableJumps.VirtualAddress + pCor->ExportAddressTableJumps.Size));
  dwMax = max(dwMax, (pCor->ManagedNativeHeader.VirtualAddress + pCor->ManagedNativeHeader.Size));

  CMetadata meta(file);
  CMetadataTables tables(meta);
  CTableData *p;
  DWORD *pdwRVA;
  DWORD dwRows;

  for (int n = 0; n < 2; n++)
  {
    p = tables.GetTable((n == 0) ? ttMethodDef : ttFieldRVA);
    if (p)
    {
      dwRows = p->GetRowCount();
      for (UINT uRow = 0; uRow < dwRows; uRow ++)
      {
        pdwRVA = (DWORD *)p->Column(uRow, (UINT)0);
        if (*pdwRVA)
          dwMin = min(dwMin, (*pdwRVA));
      }
    }
  }
  return TRUE;
}

void DumpCLRInfo(LPCTSTR pszFile)
{
  CPEFile peFile;
  HRESULT hr;
  hr = peFile.Open(pszFile);
  if (FAILED(hr)) return;

  DWORD dwMinRVA;
  DWORD dwMaxRVA;

  if (!GetMinMaxCOR20RVA(peFile, dwMinRVA, dwMaxRVA))
  {
    _tprintf(_T("Unable to retrieve .NET assembly information for file %s\n"), pszFile);
    return;
  }

  _tprintf(_T("%d Bytes required to merge %s\n"), (dwMaxRVA - dwMinRVA) + ((PIMAGE_COR20_HEADER)peFile)->cb + sizeof(EXTRA_STUFF), pszFile);
}

void DumpCLRPragma(LPCTSTR pszAssembly, LPCTSTR pszSection)
{
  CPEFile peFile;
  HRESULT hr;
  DWORD dwMinRVA;
  DWORD dwMaxRVA;

  hr = peFile.Open(pszAssembly);
  if (FAILED(hr)) return;
  
  if (pszSection == NULL) pszSection = _T(".clr");

  if (!GetMinMaxCOR20RVA(peFile, dwMinRVA, dwMaxRVA))
  {
    _tprintf(_T("// Unable to retrieve .NET assembly information for file %s\n"), pszAssembly);
    return;
  }

  _tprintf(_T("// This code was automatically generated from assembly\n\
// %s\n\n\
#include <windef.h>\n\n\
#pragma data_seg(push,clrseg,\"%s\")\n\
#pragma comment(linker, \"/SECTION:%s,ER\")\n\
  char __ph[%d] = {0}; // The number of bytes to reserve\n\
#pragma data_seg(pop,clrseg)\n\n\
typedef BOOL (WINAPI *DLLMAIN)(HANDLE, DWORD, LPVOID);\n\
typedef struct EXTRA_STUFF\n\
{\n\
  DWORD dwNativeEntryPoint;\n\
} EXTRA_STUFF, *LPEXTRA_STUFF;\n\n\
__declspec(dllexport) BOOL WINAPI _CorDllMainStub(HANDLE hModule, DWORD dwReason, LPVOID pvReserved)\n\
{\n\
  HANDLE hMod;\n\
  DLLMAIN proc;\n\
  LPEXTRA_STUFF pExtra;\n\n\
  hMod = GetModuleHandle(_T(\"mscoree\"));\n\
  if (hMod)\n\
    proc = (DLLMAIN)GetProcAddress(hMod, _T(\"_CorDllMain\"));\n\
  else\n\
  {\n\
    MEMORY_BASIC_INFORMATION mbi;\n\n\
    VirtualQuery(_CorDllMainStub, &mbi, sizeof(mbi));\n\
    pExtra = (LPEXTRA_STUFF)__ph;\n\
    proc = (DLLMAIN)(pExtra->dwNativeEntryPoint + (DWORD)mbi.AllocationBase);\n\
  }\n\
  return proc(hModule, dwReason, pvReserved);\n\
}\n\
"), pszAssembly, pszSection, pszSection, (dwMaxRVA - dwMinRVA) + ((PIMAGE_COR20_HEADER)peFile)->cb + sizeof(EXTRA_STUFF));
}

/*   When merged, the native DLL's entrypoint must go to _CorDllMain in MSCOREE.DLL.
  ** In order to do this, we need to change the DLL's entrypoint to "something" that will
  ** call CorDllMain.  Since its too much hassle to add imports to the DLL and make drastic
  ** changes to it, we rely on the native DLL to export a function that we can call which will
  ** forward to CorDllMain.  Exported functions are easy to identify and get an RVA for.
  ** The exported function must have the same calling conventions and parameters as DllMain,
  ** and must contain the letters "CORDLLMAIN" in the name.  The search is case-insensitive. */
DWORD GetExportedCorDllMainRVA(CPEFile& file)
{
  PIMAGE_EXPORT_DIRECTORY pExportDir;
  PIMAGE_SECTION_HEADER header;
  INT delta; 
  DWORD i;
  DWORD *pdwFunctions;
  PWORD pwOrdinals;
  DWORD *pszFuncNames;
  DWORD exportsStartRVA;
  DWORD exportsEndRVA;
  CHAR szName[MAX_PATH + 1];
  PIMAGE_NT_HEADERS32 pNT = file;
  PIMAGE_NT_HEADERS64 pNT64 = file;

  if (pNT)
  {
    exportsStartRVA = pNT->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_EXPORT].VirtualAddress;
    exportsEndRVA = exportsStartRVA + pNT->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_EXPORT].Size;
  }
  else
  {
    exportsStartRVA = pNT64->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_EXPORT].VirtualAddress;
    exportsEndRVA = exportsStartRVA + pNT64->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_EXPORT].Size;
  }

  header = file.GetEnclosingSectionHeader(exportsStartRVA);
  if (!header)
    return 0;

  delta = (INT)(header->VirtualAddress - header->PointerToRawData);

  pExportDir   =  (PIMAGE_EXPORT_DIRECTORY)file.GetPtrFromRVA(exportsStartRVA);
  pdwFunctions =	(PDWORD)file.GetPtrFromRVA(pExportDir->AddressOfFunctions);
  pwOrdinals   =	(PWORD)file.GetPtrFromRVA(pExportDir->AddressOfNameOrdinals);
  pszFuncNames =	(DWORD *)file.GetPtrFromRVA(pExportDir->AddressOfNames);

  for (i = 0; i < pExportDir->NumberOfFunctions; i++, pdwFunctions++)
  {
    DWORD entryPointRVA = *pdwFunctions;

    if ( entryPointRVA == 0 )
      continue;

    for (UINT j = 0; j < pExportDir->NumberOfNames; j++)
    {
      if (pwOrdinals[j] == i)
      {
        lstrcpynA(szName, (LPSTR)file.GetPtrFromRVA(pszFuncNames[j]), MAX_PATH);
        szName[MAX_PATH] = 0;
        CharUpper(szName);
        if (strstr(szName, "CORDLLMAIN") != 0) return entryPointRVA;
      }
    }
  }
  return 0;
}

// Merges a pure .NET assembly with a native DLL, inserting it into the specified section
void MergeModules(LPCTSTR pszAssembly, LPCTSTR pszNative, LPCTSTR pszSection, DWORD dwAdjust)
{
  CPEFile peFile;
  CPEFile peDest;
  HRESULT hr;
  DWORD dwMinRVA;
  DWORD dwMaxRVA;
  DWORD dwDestRVA;
  PIMAGE_SECTION_HEADER pSection;
  LPBYTE pSrc;
  LPBYTE pDest;
  DWORD dwSize;
  DWORD dwNewEntrypoint;
  PIMAGE_COR20_HEADER pCor;
  PIMAGE_NT_HEADERS32 pNT;
  PIMAGE_NT_HEADERS64 pNT64;
  int diffRVA;
  CTableData *p;
  DWORD *pdwRVA;
  DWORD dwRows;
  LPEXTRA_STUFF pExtra;

  // Open the .NET assembly
  hr = peFile.Open(pszAssembly);
  if (FAILED(hr)) return;

  // Scan the .NET assembly and find the block of .NET code specified in the .NET metadata
  if (!GetMinMaxCOR20RVA(peFile, dwMinRVA, dwMaxRVA))
  {
    _tprintf(_T("Unable to retrieve .NET assembly information for file %s\n"), pszAssembly);
    return;
  }
  // Total number of bytes of the block of .NET code we're going to merge
  dwSize = (dwMaxRVA - dwMinRVA) + ((PIMAGE_COR20_HEADER)peFile)->cb;

  // Open the destination file for readwrite access
  hr = peDest.Open(pszNative, FALSE);
  if (FAILED(hr)) return;

  // Make sure it has the section specified in the command-line
  pSection = peDest.GetSectionHeader(pszSection);
  if (!pSection)
  {
    _tprintf(_T("Unable to find section %s in file\n"), pszSection);
    return;
  }

  // If the section isn't large enough, tell the user how large it needs to be
  if (pSection->Misc.VirtualSize < (dwSize + sizeof(EXTRA_STUFF)))
  {
    _tprintf(_T("Not enough room in section for data.  Need %d bytes\n"), dwSize + sizeof(EXTRA_STUFF));
    return;
  }

  /*
  ** Find a new entrypoint to use for the DLL.  The old entrypoint is written into the .NET header
  */
  dwNewEntrypoint = GetExportedCorDllMainRVA(peDest);
  if (!dwNewEntrypoint)
  {
    _tprintf(_T("Native DLL must export a function that calls _CorDllMain, and its name must contain the word \"CorDllMain\".\n"));
    return;
  }

  // Change this section's flags
  pSection->Characteristics = IMAGE_SCN_CNT_CODE | IMAGE_SCN_MEM_EXECUTE | IMAGE_SCN_MEM_READ;
  dwDestRVA = pSection->VirtualAddress;

  pExtra = (LPEXTRA_STUFF)peDest.GetPtrFromRVA(dwDestRVA);
  dwDestRVA += sizeof(EXTRA_STUFF);

  // If the native DLL has been merged with an assembly beforehand, we need to strip the .NET stuff and restore the entrypoint
  pCor = peDest;
  if (pCor)
  {
    if (pCor->Flags & 0x10)
    {
      pNT = peDest;
      pNT64 = peDest;

      if (pNT)
        pNT->OptionalHeader.AddressOfEntryPoint = pCor->EntryPointToken;
      else
        pNT64->OptionalHeader.AddressOfEntryPoint = pCor->EntryPointToken;
    }
  }

  // Copy the assembly's .NET header into the section
  dwSize = ((PIMAGE_COR20_HEADER)peFile)->cb;
  pSrc = (LPBYTE)(PIMAGE_COR20_HEADER)peFile;
  pDest = (LPBYTE)peDest.GetPtrFromRVA(dwDestRVA);
  CopyMemory(pDest, pSrc, dwSize);

  pNT = peDest;
  pNT64 = peDest;

  // Fixup the NT header on the native DLL to include the new .NET header
  if (pNT)
  {
    pExtra->dwNativeEntryPoint = pNT->OptionalHeader.AddressOfEntryPoint;
    pNT->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_COM_DESCRIPTOR].VirtualAddress = dwDestRVA;
    pNT->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_COM_DESCRIPTOR].Size = dwSize;
  }
  else
  {
    pExtra->dwNativeEntryPoint = pNT64->OptionalHeader.AddressOfEntryPoint;
    pNT64->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_COM_DESCRIPTOR].VirtualAddress = dwDestRVA;
    pNT64->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_COM_DESCRIPTOR].Size = dwSize;
  }
  dwDestRVA += dwSize;
  if (dwDestRVA % 4) dwDestRVA += (4 - (dwDestRVA % 4));

  // Copy the .NET block of code and metadata into the section, after the header
  dwSize = dwMaxRVA - dwMinRVA;
  pSrc = (LPBYTE)peFile.GetPtrFromRVA(dwMinRVA);
  pDest = (LPBYTE)peDest.GetPtrFromRVA(dwDestRVA);
  CopyMemory(pDest, pSrc, dwSize);

  // Figure out by how much we need to change the RVA's to compensate for the relocation
  diffRVA = dwDestRVA - dwMinRVA;
  pCor = peDest;

  // Fixup the DLL entrypoints
  if (pNT)
  {
    pNT->OptionalHeader.MajorOperatingSystemVersion = 4;
    pNT->OptionalHeader.MajorSubsystemVersion = 4;
    if (pNT->OptionalHeader.AddressOfEntryPoint != dwNewEntrypoint)
    {
      pCor->EntryPointToken = pNT->OptionalHeader.AddressOfEntryPoint;
      pNT->OptionalHeader.AddressOfEntryPoint = dwNewEntrypoint;
    }
  }
  else
  {
    if (pNT64->OptionalHeader.AddressOfEntryPoint != dwNewEntrypoint)
    {
      pCor->EntryPointToken = pNT64->OptionalHeader.AddressOfEntryPoint;
      pNT64->OptionalHeader.AddressOfEntryPoint = dwNewEntrypoint;
    }
  }
  // Adjust the .NET headers to indicate we're a mixed DLL
  pCor->Flags = (pCor->Flags & 0xFFFE) | 0x10;

  // Fixup the metadata header RVA's
  if (pCor->MetaData.VirtualAddress) pCor->MetaData.VirtualAddress += diffRVA;
  if (pCor->Resources.VirtualAddress) pCor->Resources.VirtualAddress += diffRVA;
  if (pCor->StrongNameSignature.VirtualAddress) pCor->StrongNameSignature.VirtualAddress += diffRVA;
  if (pCor->CodeManagerTable.VirtualAddress) pCor->CodeManagerTable.VirtualAddress += diffRVA;
  if (pCor->VTableFixups.VirtualAddress) pCor->VTableFixups.VirtualAddress += diffRVA;
  if (pCor->ExportAddressTableJumps.VirtualAddress) pCor->ExportAddressTableJumps.VirtualAddress += diffRVA;
  if (pCor->ManagedNativeHeader.VirtualAddress) pCor->ManagedNativeHeader.VirtualAddress += diffRVA;

  CMetadata meta(peDest);
  CMetadataTables tables(meta);

  // Fixup all the RVA's for methods and fields that have them in the .NET code
  for (int n = 0; n < 2; n++)
  {
    p = tables.GetTable((n == 0) ? ttMethodDef : ttFieldRVA);
    if (p)
    {
      dwRows = p->GetRowCount();
      for (UINT uRow = 0; uRow < dwRows; uRow ++)
      {
        pdwRVA = (DWORD *)p->Column(uRow, (UINT)0);
        if (*pdwRVA)
          *pdwRVA = (*pdwRVA) + diffRVA;
      }
    }
  }

  // If this is a CE file, then change the processor to x86
  if (pNT)
  {
    if (pNT->OptionalHeader.Subsystem == IMAGE_SUBSYSTEM_WINDOWS_CE_GUI 
      || pNT->FileHeader.Machine == IMAGE_FILE_MACHINE_ARM)
    {
      pNT->FileHeader.Machine = IMAGE_FILE_MACHINE_I386;
      pNT->OptionalHeader.Subsystem = IMAGE_SUBSYSTEM_WINDOWS_CUI;
    }

    if (pNT->OptionalHeader.Subsystem == IMAGE_SUBSYSTEM_WINDOWS_CUI && (pCor->Flags & 0x08))
    {
      PIMAGE_SECTION_HEADER section = IMAGE_FIRST_SECTION(pNT);
      for (UINT i=0; i < pNT->FileHeader.NumberOfSections; i++, section++)
      {
        if (_tcscmp((LPCSTR)section->Name, _T(".bss")) == 0)
        {
          _tcscpy((LPSTR)section->Name, _T(".idata"));
          //section->Characteristics &= ~IMAGE_SCN_CNT_INITIALIZED_DATA;
          //section->Characteristics |= IMAGE_SCN_CNT_UNINITIALIZED_DATA;
          DWORD dwBSSRVA = section->VirtualAddress;
          LPBYTE pBSS = (LPBYTE)peDest.GetPtrFromRVA(dwBSSRVA);
          for (DWORD u = 0; u < section->SizeOfRawData; u++)
          {
            pBSS[u] = 0;
          }
        }
        if (section->SizeOfRawData < section->Misc.VirtualSize)
        {
          if (_tcscmp((LPCSTR)section->Name, _T(".data")) == 0 && dwAdjust > 0)
          {
            _tprintf(_T("\nWARNING: %s section has a RawData size of %d, less than its VirtualSize of %d, adjusting VirtualSize to %d\n"), section->Name, section->SizeOfRawData, section->Misc.VirtualSize, dwAdjust);
            section->Misc.VirtualSize = dwAdjust;
          }
          else
          {
            _tprintf(_T("\nWARNING: %s section has a RawData size of %d and a VirtualSize of %d, strong named image may not run on Windows CE\n"), section->Name, section->SizeOfRawData, section->Misc.VirtualSize);
          }
        }
      }
    }
  }

  if (pCor->Flags & 0x08)
    _tprintf(_T("\nWARNING: %s must be re-signed before it can be used!\n"), pszNative);

  _tprintf(_T("Success!\n"));
}
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<






























































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































Deleted tools/mergebin/stdafx.cpp.
1
2
3
4
5
6
7
8
// stdafx.cpp : source file that includes just the standard includes
// mergebin.pch will be the pre-compiled header
// stdafx.obj will contain the pre-compiled type information

#include "stdafx.h"

// TODO: reference any additional headers you need in STDAFX.H
// and not in this file
<
<
<
<
<
<
<
<
















Deleted tools/mergebin/stdafx.h.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently, but
// are changed infrequently
//

#pragma once


#define WIN32_LEAN_AND_MEAN		// Exclude rarely-used stuff from Windows headers
#define _WIN32_WINNT 0x0400

#include <windows.h>
#include <stdio.h>
#include <stdlib.h>
#include <tchar.h>
// TODO: reference additional headers your program requires here
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
































Deleted tools/setup/exe/setup/admin.manifest.
1
2
3
4
5
6
7
8
9
10
<?xml version='1.0' encoding='UTF-8' standalone='yes'?>
<assembly xmlns='urn:schemas-microsoft-com:asm.v1' manifestVersion='1.0'>
  <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
    <security>
      <requestedPrivileges>
        <requestedExecutionLevel level="requireAdministrator"/>
      </requestedPrivileges>
    </security>
  </trustInfo>
</assembly>
<
<
<
<
<
<
<
<
<
<




















Deleted tools/setup/exe/setup/install.ico.

cannot compute difference between binary files

Deleted tools/setup/exe/setup/resource.h.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
//{{NO_DEPENDENCIES}}
// Microsoft Visual C++ generated include file.
// Used by setup.rc
//
#define IDI_SETUP                       5
#define IDD_SETUP_DIALOG                102
#define IDR_MAINFRAME                   128
#define IDR_MSI1                        130
#define IDC_STATIC                      -1

// Next default values for new objects
// 
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NO_MFC                     1
#define _APS_NEXT_RESOURCE_VALUE        131
#define _APS_NEXT_COMMAND_VALUE         32771
#define _APS_NEXT_CONTROL_VALUE         1000
#define _APS_NEXT_SYMED_VALUE           110
#endif
#endif
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<










































Deleted tools/setup/exe/setup/setup.cpp.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
// setup.cpp : Defines the entry point for the application.
//

#include "stdafx.h"
#include "setup.h"

int APIENTRY _tWinMain(HINSTANCE hInstance,
                     HINSTANCE /*hPrevInstance*/,
                     LPTSTR    /*lpCmdLine*/,
                     int       /*nCmdShow*/)
{
  HRSRC hRes = FindResource(hInstance, MAKEINTRESOURCE(1), _T("MSI"));
  HGLOBAL hGlob = LoadResource(hInstance, hRes);
  DWORD dwSize = SizeofResource(hInstance, hRes);
  LPVOID pv  = LockResource(hGlob);
  TCHAR szDir[MAX_PATH];
  TCHAR szPath[MAX_PATH];

  GetTempPath(MAX_PATH, szDir);
  GetTempFileName(szDir, _T("tmp"), 0, szPath);
  DeleteFile(szPath);
  lstrcat(szPath, _T(".msi"));

  HANDLE hFile = CreateFile(szPath, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, NULL);
  WriteFile(hFile, pv, dwSize, &dwSize, NULL);
  CloseHandle(hFile);

  SHELLEXECUTEINFO shex;

  ZeroMemory(&shex, sizeof(shex));

  shex.cbSize = sizeof(shex);
  shex.fMask = SEE_MASK_NOCLOSEPROCESS;

  shex.lpFile = szPath;

  if (ShellExecuteEx(&shex))
  {
    if (shex.hProcess)
    {
      WaitForSingleObject(shex.hProcess, INFINITE);
    }
  }
  while (!DeleteFile(szPath))
    Sleep(250);

  return 0;
}
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
































































































Deleted tools/setup/exe/setup/setup.h.
1
2
3
#pragma once

#include "resource.h"
<
<
<






Deleted tools/setup/exe/setup/setup.rc.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
// Microsoft Visual C++ generated resource script.
//
#include "resource.h"

#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#define APSTUDIO_HIDDEN_SYMBOLS
#include "windows.h"
#undef APSTUDIO_HIDDEN_SYMBOLS

/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS

/////////////////////////////////////////////////////////////////////////////
// English (U.S.) resources

#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
#ifdef _WIN32
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
#pragma code_page(1252)
#endif //_WIN32

#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//

1 TEXTINCLUDE 
BEGIN
    "resource.h\0"
END

2 TEXTINCLUDE 
BEGIN
    "#define APSTUDIO_HIDDEN_SYMBOLS\r\n"
    "#include ""windows.h""\r\n"
    "#undef APSTUDIO_HIDDEN_SYMBOLS\r\n"
    "\0"
END

3 TEXTINCLUDE 
BEGIN
    "\r\n"
    "\0"
END

#endif    // APSTUDIO_INVOKED


/////////////////////////////////////////////////////////////////////////////
//
// Version
//

VS_VERSION_INFO VERSIONINFO
 FILEVERSION 1,0,67,0
 PRODUCTVERSION 1,0,0,0
 FILEFLAGSMASK 0x17L
#ifdef _DEBUG
 FILEFLAGS 0x1L
#else
 FILEFLAGS 0x0L
#endif
 FILEOS 0x4L
 FILETYPE 0x1L
 FILESUBTYPE 0x0L
BEGIN
    BLOCK "StringFileInfo"
    BEGIN
        BLOCK "040904b0"
        BEGIN
            VALUE "Comments", "http://sqlite.phxsoftware.com"
            VALUE "FileDescription", "SQLite ADO.NET Setup"
            VALUE "FileVersion", "1.0.67.0"
            VALUE "InternalName", "setup"
            VALUE "LegalCopyright", "Released to the public domain"
            VALUE "OriginalFilename", "setup.exe"
            VALUE "ProductName", "System.Data.SQLite"
            VALUE "ProductVersion", "1.0"
        END
    END
    BLOCK "VarFileInfo"
    BEGIN
        VALUE "Translation", 0x409, 1200
    END
END


/////////////////////////////////////////////////////////////////////////////
//
// Icon
//

// Icon with lowest ID value placed first to ensure application icon
// remains consistent on all systems.
IDI_SETUP               ICON                    ".\\install.ico"

/////////////////////////////////////////////////////////////////////////////
//
// MSI
//

1                       MSI                     "..\\..\\sqlite_setup.msi"
#endif    // English (U.S.) resources
/////////////////////////////////////////////////////////////////////////////



#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//


/////////////////////////////////////////////////////////////////////////////
#endif    // not APSTUDIO_INVOKED

<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<




















































































































































































































































Deleted tools/setup/exe/setup/stdafx.cpp.
1
2
3
4
5
6
7
8
// stdafx.cpp : source file that includes just the standard includes
// setup.pch will be the pre-compiled header
// stdafx.obj will contain the pre-compiled type information

#include "stdafx.h"

// TODO: reference any additional headers you need in STDAFX.H
// and not in this file
<
<
<
<
<
<
<
<
















Deleted tools/setup/exe/setup/stdafx.h.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently, but
// are changed infrequently
//

#pragma once

// Modify the following defines if you have to target a platform prior to the ones specified below.
// Refer to MSDN for the latest info on corresponding values for different platforms.
#ifndef WINVER				// Allow use of features specific to Windows XP or later.
#define WINVER 0x0500		// Change this to the appropriate value to target other versions of Windows.
#endif

#ifndef _WIN32_WINNT		// Allow use of features specific to Windows XP or later.                   
#define _WIN32_WINNT 0x0500	// Change this to the appropriate value to target other versions of Windows.
#endif						

#ifndef _WIN32_WINDOWS		// Allow use of features specific to Windows 98 or later.
#define _WIN32_WINDOWS 0x0410 // Change this to the appropriate value to target Windows Me or later.
#endif

#ifndef _WIN32_IE			// Allow use of features specific to IE 6.0 or later.
#define _WIN32_IE 0x0500	// Change this to the appropriate value to target other versions of IE.
#endif

#define WIN32_LEAN_AND_MEAN		// Exclude rarely-used stuff from Windows headers
// Windows Header Files:
#include <windows.h>

// C RunTime Header Files
#include <stdlib.h>
#include <malloc.h>
#include <memory.h>
#include <tchar.h>
#include <shellapi.h>

// TODO: reference additional headers your program requires here
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<










































































Deleted tools/setup/install.ico.

cannot compute difference between binary files

Deleted tools/setup/sqlite_setup.vdproj.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
"DeployProject"
{
"VSVersion" = "3:800"
"ProjectType" = "8:{978C614F-708E-4E1A-B201-565925725DBA}"
"IsWebType" = "8:FALSE"
"ProjectName" = "8:sqlite_msi"
"LanguageId" = "3:1033"
"CodePage" = "3:1252"
"UILanguageId" = "3:1033"
"SccProjectName" = "8:"
"SccLocalPath" = "8:"
"SccAuxPath" = "8:"
"SccProvider" = "8:"
    "Hierarchy"
    {
        "Entry"
        {
        "MsmKey" = "8:_055B2BCD025C40A08F3B155843F41702"
        "OwnerKey" = "8:_UNDEFINED"
        "MsmSig" = "8:_UNDEFINED"
        }
        "Entry"
        {
        "MsmKey" = "8:_26E74AC417994018832F9B82462AA3AF"
        "OwnerKey" = "8:_UNDEFINED"
        "MsmSig" = "8:_UNDEFINED"
        }
        "Entry"
        {
        "MsmKey" = "8:_2C7EDFF06B61482393D94E3A63D90113"
        "OwnerKey" = "8:_UNDEFINED"
        "MsmSig" = "8:_UNDEFINED"
        }
        "Entry"
        {
        "MsmKey" = "8:_33349D46CCFB4E16A3F7C6CE1FE6F6C9"
        "OwnerKey" = "8:_UNDEFINED"
        "MsmSig" = "8:_UNDEFINED"
        }
        "Entry"
        {
        "MsmKey" = "8:_3ED55D8CC0EF87B27C01F6698F3EE7B2"
        "OwnerKey" = "8:_2C7EDFF06B61482393D94E3A63D90113"
        "MsmSig" = "8:_UNDEFINED"
        }
        "Entry"
        {
        "MsmKey" = "8:_3ED55D8CC0EF87B27C01F6698F3EE7B2"
        "OwnerKey" = "8:_CE9E3EF0722342DB8DE0860C0DDCD39E"
        "MsmSig" = "8:_UNDEFINED"
        }
        "Entry"
        {
        "MsmKey" = "8:_58B331DC63A74A74B1C85278A998798F"
        "OwnerKey" = "8:_UNDEFINED"
        "MsmSig" = "8:_UNDEFINED"
        }
        "Entry"
        {
        "MsmKey" = "8:_60E2C442F77C48DE8150EBFC86663225"
        "OwnerKey" = "8:_UNDEFINED"
        "MsmSig" = "8:_UNDEFINED"
        }
        "Entry"
        {
        "MsmKey" = "8:_B29C75F5F4D24817846DCEF9951068E1"
        "OwnerKey" = "8:_UNDEFINED"
        "MsmSig" = "8:_UNDEFINED"
        }
        "Entry"
        {
        "MsmKey" = "8:_B6156897CBBB4E929D9C1F7358CE9E90"
        "OwnerKey" = "8:_UNDEFINED"
        "MsmSig" = "8:_UNDEFINED"
        }
        "Entry"
        {
        "MsmKey" = "8:_C8E329AC56AD4C88A986481E639F72A5"
        "OwnerKey" = "8:_UNDEFINED"
        "MsmSig" = "8:_UNDEFINED"
        }
        "Entry"
        {
        "MsmKey" = "8:_CE9E3EF0722342DB8DE0860C0DDCD39E"
        "OwnerKey" = "8:_UNDEFINED"
        "MsmSig" = "8:_UNDEFINED"
        }
        "Entry"
        {
        "MsmKey" = "8:_D7FECFD3C8164DA7B3712AF54D0CDDAD"
        "OwnerKey" = "8:_UNDEFINED"
        "MsmSig" = "8:_UNDEFINED"
        }
        "Entry"
        {
        "MsmKey" = "8:_UNDEFINED"
        "OwnerKey" = "8:_B29C75F5F4D24817846DCEF9951068E1"
        "MsmSig" = "8:_UNDEFINED"
        }
        "Entry"
        {
        "MsmKey" = "8:_UNDEFINED"
        "OwnerKey" = "8:_CE9E3EF0722342DB8DE0860C0DDCD39E"
        "MsmSig" = "8:_UNDEFINED"
        }
        "Entry"
        {
        "MsmKey" = "8:_UNDEFINED"
        "OwnerKey" = "8:_58B331DC63A74A74B1C85278A998798F"
        "MsmSig" = "8:_UNDEFINED"
        }
        "Entry"
        {
        "MsmKey" = "8:_UNDEFINED"
        "OwnerKey" = "8:_2C7EDFF06B61482393D94E3A63D90113"
        "MsmSig" = "8:_UNDEFINED"
        }
        "Entry"
        {
        "MsmKey" = "8:_UNDEFINED"
        "OwnerKey" = "8:_3ED55D8CC0EF87B27C01F6698F3EE7B2"
        "MsmSig" = "8:_UNDEFINED"
        }
    }
    "Configurations"
    {
        "Debug"
        {
        "DisplayName" = "8:Debug"
        "IsDebugOnly" = "11:TRUE"
        "IsReleaseOnly" = "11:FALSE"
        "OutputFilename" = "8:Debug\\sqlite_setup.msi"
        "PackageFilesAs" = "3:4"
        "PackageFileSize" = "3:-2147483648"
        "CabType" = "3:1"
        "Compression" = "3:3"
        "SignOutput" = "11:FALSE"
        "CertificateFile" = "8:"
        "PrivateKeyFile" = "8:"
        "TimeStampServer" = "8:"
        "InstallerBootstrapper" = "3:2"
            "BootstrapperCfg:{63ACBE69-63AA-4F98-B2B6-99F9E24495F2}"
            {
            "Enabled" = "11:TRUE"
            "PromptEnabled" = "11:TRUE"
            "PrerequisitesLocation" = "2:1"
            "Url" = "8:"
            "ComponentsUrl" = "8:"
                "Items"
                {
                }
            }
        }
        "Release"
        {
        "DisplayName" = "8:Release"
        "IsDebugOnly" = "11:FALSE"
        "IsReleaseOnly" = "11:TRUE"
        "OutputFilename" = "8:sqlite_setup.msi"
        "PackageFilesAs" = "3:2"
        "PackageFileSize" = "3:-2147483648"
        "CabType" = "3:1"
        "Compression" = "3:3"
        "SignOutput" = "11:FALSE"
        "CertificateFile" = "8:"
        "PrivateKeyFile" = "8:"
        "TimeStampServer" = "8:"
        "InstallerBootstrapper" = "3:2"
            "BootstrapperCfg:{63ACBE69-63AA-4F98-B2B6-99F9E24495F2}"
            {
            "Enabled" = "11:FALSE"
            "PromptEnabled" = "11:TRUE"
            "PrerequisitesLocation" = "2:1"
            "Url" = "8:"
            "ComponentsUrl" = "8:"
                "Items"
                {
                    "{EDC2488A-8267-493A-A98E-7D9C3B36CDF3}:Microsoft.Net.Framework.2.0"
                    {
                    "Name" = "8:.NET Framework 2.0"
                    "ProductCode" = "8:Microsoft.Net.Framework.2.0"
                    }
                }
            }
        }
    }
    "Deployable"
    {
        "CustomAction"
        {
        }
        "DefaultFeature"
        {
        "Name" = "8:DefaultFeature"
        "Title" = "8:"
        "Description" = "8:"
        }
        "ExternalPersistence"
        {
            "LaunchCondition"
            {
                "{A06ECF26-33A3-4562-8140-9B0E340D4F24}:_2A5202AB8FA440F9AA45DF7B9C7CEAD5"
                {
                "Name" = "8:.NET Framework"
                "Message" = "8:[VSDNETMSG]"
                "FrameworkVersion" = "8:2.0.50727     "
                "AllowLaterVersions" = "11:TRUE"
                "InstallUrl" = "8:http://go.microsoft.com/fwlink/?LinkId=9832"
                }
            }
        }
        "File"
        {
            "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_055B2BCD025C40A08F3B155843F41702"
            {
            "SourcePath" = "8:..\\..\\bin\\test.exe.config"
            "TargetName" = "8:test.exe.config"
            "Tag" = "8:"
            "Folder" = "8:_30C77BF2E6E84D01ADE5FB8BA2F81504"
            "Condition" = "8:"
            "Transitive" = "11:FALSE"
            "Vital" = "11:TRUE"
            "ReadOnly" = "11:FALSE"
            "Hidden" = "11:FALSE"
            "System" = "11:FALSE"
            "Permanent" = "11:FALSE"
            "SharedLegacy" = "11:FALSE"
            "PackageAs" = "3:1"
            "Register" = "3:1"
            "Exclude" = "11:FALSE"
            "IsDependency" = "11:FALSE"
            "IsolateTo" = "8:"
            }
            "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_26E74AC417994018832F9B82462AA3AF"
            {
            "SourcePath" = "8:..\\..\\bin\\x64\\System.Data.SQLite.lib"
            "TargetName" = "8:System.Data.SQLite.lib"
            "Tag" = "8:"
            "Folder" = "8:_66DBD0998AA8499691D4F5E42417697D"
            "Condition" = "8:"
            "Transitive" = "11:FALSE"
            "Vital" = "11:TRUE"
            "ReadOnly" = "11:FALSE"
            "Hidden" = "11:FALSE"
            "System" = "11:FALSE"
            "Permanent" = "11:FALSE"
            "SharedLegacy" = "11:FALSE"
            "PackageAs" = "3:1"
            "Register" = "3:1"
            "Exclude" = "11:FALSE"
            "IsDependency" = "11:FALSE"
            "IsolateTo" = "8:"
            }
            "{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_2C7EDFF06B61482393D94E3A63D90113"
            {
            "AssemblyRegister" = "3:1"
            "AssemblyIsInGAC" = "11:FALSE"
            "AssemblyAsmDisplayName" = "8:test, Version=1.0.0.40629, Culture=neutral, processorArchitecture=x86"
                "ScatterAssemblies"
                {
                    "_2C7EDFF06B61482393D94E3A63D90113"
                    {
                    "Name" = "8:test.exe"
                    "Attributes" = "3:512"
                    }
                }
            "SourcePath" = "8:..\\..\\bin\\test.exe"
            "TargetName" = "8:"
            "Tag" = "8:"
            "Folder" = "8:_30C77BF2E6E84D01ADE5FB8BA2F81504"
            "Condition" = "8:"
            "Transitive" = "11:FALSE"
            "Vital" = "11:TRUE"
            "ReadOnly" = "11:FALSE"
            "Hidden" = "11:FALSE"
            "System" = "11:FALSE"
            "Permanent" = "11:FALSE"
            "SharedLegacy" = "11:FALSE"
            "PackageAs" = "3:1"
            "Register" = "3:1"
            "Exclude" = "11:FALSE"
            "IsDependency" = "11:FALSE"
            "IsolateTo" = "8:"
            }
            "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_33349D46CCFB4E16A3F7C6CE1FE6F6C9"
            {
            "SourcePath" = "8:..\\..\\bin\\System.Data.SQLite.XML"
            "TargetName" = "8:System.Data.SQLite.XML"
            "Tag" = "8:"
            "Folder" = "8:_30C77BF2E6E84D01ADE5FB8BA2F81504"
            "Condition" = "8:"
            "Transitive" = "11:FALSE"
            "Vital" = "11:TRUE"
            "ReadOnly" = "11:FALSE"
            "Hidden" = "11:FALSE"
            "System" = "11:FALSE"
            "Permanent" = "11:FALSE"
            "SharedLegacy" = "11:FALSE"
            "PackageAs" = "3:1"
            "Register" = "3:1"
            "Exclude" = "11:FALSE"
            "IsDependency" = "11:FALSE"
            "IsolateTo" = "8:"
            }
            "{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_3ED55D8CC0EF87B27C01F6698F3EE7B2"
            {
            "AssemblyRegister" = "3:1"
            "AssemblyIsInGAC" = "11:FALSE"
            "AssemblyAsmDisplayName" = "8:System.Data.SQLite, Version=1.0.67.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=x86"
                "ScatterAssemblies"
                {
                    "_3ED55D8CC0EF87B27C01F6698F3EE7B2"
                    {
                    "Name" = "8:System.Data.SQLite.DLL"
                    "Attributes" = "3:512"
                    }
                }
            "SourcePath" = "8:System.Data.SQLite.DLL"
            "TargetName" = "8:"
            "Tag" = "8:"
            "Folder" = "8:_30C77BF2E6E84D01ADE5FB8BA2F81504"
            "Condition" = "8:"
            "Transitive" = "11:FALSE"
            "Vital" = "11:TRUE"
            "ReadOnly" = "11:FALSE"
            "Hidden" = "11:FALSE"
            "System" = "11:FALSE"
            "Permanent" = "11:FALSE"
            "SharedLegacy" = "11:FALSE"
            "PackageAs" = "3:1"
            "Register" = "3:1"
            "Exclude" = "11:FALSE"
            "IsDependency" = "11:TRUE"
            "IsolateTo" = "8:"
            }
            "{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_58B331DC63A74A74B1C85278A998798F"
            {
            "AssemblyRegister" = "3:1"
            "AssemblyIsInGAC" = "11:FALSE"
            "AssemblyAsmDisplayName" = "8:System.Data.SQLite, Version=1.0.67.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=x86"
                "ScatterAssemblies"
                {
                    "_58B331DC63A74A74B1C85278A998798F"
                    {
                    "Name" = "8:System.Data.SQLite.DLL"
                    "Attributes" = "3:512"
                    }
                }
            "SourcePath" = "8:..\\..\\bin\\System.Data.SQLite.DLL"
            "TargetName" = "8:"
            "Tag" = "8:"
            "Folder" = "8:_A0841E79B7874F7288672343934C7657"
            "Condition" = "8:"
            "Transitive" = "11:FALSE"
            "Vital" = "11:TRUE"
            "ReadOnly" = "11:FALSE"
            "Hidden" = "11:FALSE"
            "System" = "11:FALSE"
            "Permanent" = "11:FALSE"
            "SharedLegacy" = "11:FALSE"
            "PackageAs" = "3:1"
            "Register" = "3:1"
            "Exclude" = "11:FALSE"
            "IsDependency" = "11:FALSE"
            "IsolateTo" = "8:"
            }
            "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_60E2C442F77C48DE8150EBFC86663225"
            {
            "SourcePath" = "8:..\\..\\Doc\\SQLite.NET.chm"
            "TargetName" = "8:SQLite.NET.chm"
            "Tag" = "8:"
            "Folder" = "8:_CA5E61837F5B452B8169C698979CF05C"
            "Condition" = "8:"
            "Transitive" = "11:FALSE"
            "Vital" = "11:TRUE"
            "ReadOnly" = "11:FALSE"
            "Hidden" = "11:FALSE"
            "System" = "11:FALSE"
            "Permanent" = "11:FALSE"
            "SharedLegacy" = "11:FALSE"
            "PackageAs" = "3:1"
            "Register" = "3:1"
            "Exclude" = "11:FALSE"
            "IsDependency" = "11:FALSE"
            "IsolateTo" = "8:"
            }
            "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_B29C75F5F4D24817846DCEF9951068E1"
            {
            "SourcePath" = "8:..\\..\\bin\\x64\\System.Data.SQLite.DLL"
            "TargetName" = "8:System.Data.SQLite.DLL"
            "Tag" = "8:"
            "Folder" = "8:_66DBD0998AA8499691D4F5E42417697D"
            "Condition" = "8:"
            "Transitive" = "11:FALSE"
            "Vital" = "11:TRUE"
            "ReadOnly" = "11:FALSE"
            "Hidden" = "11:FALSE"
            "System" = "11:FALSE"
            "Permanent" = "11:FALSE"
            "SharedLegacy" = "11:FALSE"
            "PackageAs" = "3:1"
            "Register" = "3:1"
            "Exclude" = "11:FALSE"
            "IsDependency" = "11:FALSE"
            "IsolateTo" = "8:"
            "AssemblyAsmDisplayName" = "8:System.Data.SQLite, Version=1.0.27.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=AMD64"
            "AssemblyIsInGAC" = "11:FALSE"
            "AssemblyRegister" = "3:1"
                "ScatterAssemblies"
                {
                    "_B29C75F5F4D24817846DCEF9951068E1"
                    {
                    "Attributes" = "3:512"
                    "Name" = "8:System.Data.SQLite.DLL"
                    }
                }
            }
            "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_B6156897CBBB4E929D9C1F7358CE9E90"
            {
            "SourcePath" = "8:topband.jpg"
            "TargetName" = "8:topband.jpg"
            "Tag" = "8:"
            "Folder" = "8:_A0841E79B7874F7288672343934C7657"
            "Condition" = "8:"
            "Transitive" = "11:FALSE"
            "Vital" = "11:TRUE"
            "ReadOnly" = "11:FALSE"
            "Hidden" = "11:FALSE"
            "System" = "11:FALSE"
            "Permanent" = "11:FALSE"
            "SharedLegacy" = "11:FALSE"
            "PackageAs" = "3:1"
            "Register" = "3:1"
            "Exclude" = "11:TRUE"
            "IsDependency" = "11:FALSE"
            "IsolateTo" = "8:"
            }
            "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_C8E329AC56AD4C88A986481E639F72A5"
            {
            "SourcePath" = "8:..\\..\\readme.htm"
            "TargetName" = "8:readme.htm"
            "Tag" = "8:"
            "Folder" = "8:_A0841E79B7874F7288672343934C7657"
            "Condition" = "8:"
            "Transitive" = "11:FALSE"
            "Vital" = "11:TRUE"
            "ReadOnly" = "11:FALSE"
            "Hidden" = "11:FALSE"
            "System" = "11:FALSE"
            "Permanent" = "11:FALSE"
            "SharedLegacy" = "11:FALSE"
            "PackageAs" = "3:1"
            "Register" = "3:1"
            "Exclude" = "11:FALSE"
            "IsDependency" = "11:FALSE"
            "IsolateTo" = "8:"
            }
            "{9F6F8455-1EF1-4B85-886A-4223BCC8E7F7}:_CE9E3EF0722342DB8DE0860C0DDCD39E"
            {
            "AssemblyRegister" = "3:1"
            "AssemblyIsInGAC" = "11:FALSE"
            "AssemblyAsmDisplayName" = "8:System.Data.SQLite.Linq, Version=1.0.38.1, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=MSIL"
                "ScatterAssemblies"
                {
                    "_CE9E3EF0722342DB8DE0860C0DDCD39E"
                    {
                    "Name" = "8:System.Data.SQLite.Linq.dll"
                    "Attributes" = "3:512"
                    }
                }
            "SourcePath" = "8:..\\..\\bin\\System.Data.SQLite.Linq.dll"
            "TargetName" = "8:"
            "Tag" = "8:"
            "Folder" = "8:_30C77BF2E6E84D01ADE5FB8BA2F81504"
            "Condition" = "8:"
            "Transitive" = "11:FALSE"
            "Vital" = "11:TRUE"
            "ReadOnly" = "11:FALSE"
            "Hidden" = "11:FALSE"
            "System" = "11:FALSE"
            "Permanent" = "11:FALSE"
            "SharedLegacy" = "11:FALSE"
            "PackageAs" = "3:1"
            "Register" = "3:1"
            "Exclude" = "11:FALSE"
            "IsDependency" = "11:FALSE"
            "IsolateTo" = "8:"
            }
            "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_D7FECFD3C8164DA7B3712AF54D0CDDAD"
            {
            "SourcePath" = "8:..\\..\\bin\\System.Data.SQLite.lib"
            "TargetName" = "8:System.Data.SQLite.lib"
            "Tag" = "8:"
            "Folder" = "8:_30C77BF2E6E84D01ADE5FB8BA2F81504"
            "Condition" = "8:"
            "Transitive" = "11:FALSE"
            "Vital" = "11:TRUE"
            "ReadOnly" = "11:FALSE"
            "Hidden" = "11:FALSE"
            "System" = "11:FALSE"
            "Permanent" = "11:FALSE"
            "SharedLegacy" = "11:FALSE"
            "PackageAs" = "3:1"
            "Register" = "3:1"
            "Exclude" = "11:FALSE"
            "IsDependency" = "11:FALSE"
            "IsolateTo" = "8:"
            }
        }
        "FileType"
        {
        }
        "Folder"
        {
            "{3C67513D-01DD-4637-8A68-80971EB9504F}:_A0841E79B7874F7288672343934C7657"
            {
            "DefaultLocation" = "8:[ProgramFilesFolder]SQLite.NET4"
            "Name" = "8:#1925"
            "AlwaysCreate" = "11:FALSE"
            "Condition" = "8:"
            "Transitive" = "11:FALSE"
            "Property" = "8:TARGETDIR"
                "Folders"
                {
                    "{9EF0B969-E518-4E46-987F-47570745A589}:_30C77BF2E6E84D01ADE5FB8BA2F81504"
                    {
                    "Name" = "8:bin"
                    "AlwaysCreate" = "11:FALSE"
                    "Condition" = "8:"
                    "Transitive" = "11:FALSE"
                    "Property" = "8:_BD4105DB73B04559A56BB70C4E151056"
                        "Folders"
                        {
                            "{9EF0B969-E518-4E46-987F-47570745A589}:_66DBD0998AA8499691D4F5E42417697D"
                            {
                            "Name" = "8:x64"
                            "AlwaysCreate" = "11:FALSE"
                            "Condition" = "8:"
                            "Transitive" = "11:FALSE"
                            "Property" = "8:_7C07DE0299AB478C8BC7AFB40E220305"
                                "Folders"
                                {
                                }
                            }
                            "{9EF0B969-E518-4E46-987F-47570745A589}:_F11D54EE0EEA4BF59B52E621630B6A2E"
                            {
                            "Name" = "8:Designer"
                            "AlwaysCreate" = "11:FALSE"
                            "Condition" = "8:"
                            "Transitive" = "11:FALSE"
                            "Property" = "8:_CA865020181A40EEB518ACF5F89BD66A"
                                "Folders"
                                {
                                }
                            }
                        }
                    }
                    "{9EF0B969-E518-4E46-987F-47570745A589}:_CA5E61837F5B452B8169C698979CF05C"
                    {
                    "Name" = "8:Doc"
                    "AlwaysCreate" = "11:FALSE"
                    "Condition" = "8:"
                    "Transitive" = "11:FALSE"
                    "Property" = "8:_B787482AA405492D998CAAD43761AF61"
                        "Folders"
                        {
                        }
                    }
                }
            }
            "{1525181F-901A-416C-8A58-119130FE478E}:_AB7F365F78A44DE79C7007FB08F7343E"
            {
            "Name" = "8:#1916"
            "AlwaysCreate" = "11:FALSE"
            "Condition" = "8:"
            "Transitive" = "11:FALSE"
            "Property" = "8:DesktopFolder"
                "Folders"
                {
                }
            }
            "{1525181F-901A-416C-8A58-119130FE478E}:_E420345AA61B4AF780EEA7BC8AFAF268"
            {
            "Name" = "8:#1919"
            "AlwaysCreate" = "11:FALSE"
            "Condition" = "8:"
            "Transitive" = "11:FALSE"
            "Property" = "8:ProgramMenuFolder"
                "Folders"
                {
                    "{9EF0B969-E518-4E46-987F-47570745A589}:_1B562A9F876E47058AB813C418E24FBF"
                    {
                    "Name" = "8:SQLite.NET4"
                    "AlwaysCreate" = "11:FALSE"
                    "Condition" = "8:"
                    "Transitive" = "11:FALSE"
                    "Property" = "8:_85ED61DA38214E1C9AB39E119A89D75B"
                        "Folders"
                        {
                        }
                    }
                }
            }
        }
        "LaunchCondition"
        {
        }
        "Locator"
        {
        }
        "MsiBootstrapper"
        {
        "LangId" = "3:1033"
        "RequiresElevation" = "11:FALSE"
        }
        "Product"
        {
        "Name" = "8:Microsoft Visual Studio"
        "ProductName" = "8:SQLite ADO.NET Provider"
        "ProductCode" = "8:{902C69AF-5B0C-4E21-89F2-064462C2BBC4}"
        "PackageCode" = "8:{73B9EABC-05DF-499D-B771-8FB6F1E5AF1B}"
        "UpgradeCode" = "8:{E779C0FF-CCE2-493A-B8C2-6DD04E26072C}"
        "AspNetVersion" = "8:4.0.30319.0"
        "RestartWWWService" = "11:FALSE"
        "RemovePreviousVersions" = "11:TRUE"
        "DetectNewerInstalledVersion" = "11:TRUE"
        "InstallAllUsers" = "11:TRUE"
        "ProductVersion" = "8:1.066.1"
        "Manufacturer" = "8:Phoenix Software Solutions, LLC"
        "ARPHELPTELEPHONE" = "8:"
        "ARPHELPLINK" = "8:http://sqlite.phxsoftware.com"
        "Title" = "8:SQLite ADO.NET Provider"
        "Subject" = "8:"
        "ARPCONTACT" = "8:Phoenix Software Solutions, LLC"
        "Keywords" = "8:"
        "ARPCOMMENTS" = "8:"
        "ARPURLINFOABOUT" = "8:"
        "ARPPRODUCTICON" = "8:"
        "ARPIconIndex" = "3:0"
        "SearchPath" = "8:"
        "UseSystemSearchPath" = "11:TRUE"
        "TargetPlatform" = "3:0"
        "PreBuildEvent" = "8:"
        "PostBuildEvent" = "8:"
        "RunPostBuildEvent" = "3:0"
        }
        "Registry"
        {
            "HKLM"
            {
                "Keys"
                {
                }
            }
            "HKCU"
            {
                "Keys"
                {
                }
            }
            "HKCR"
            {
                "Keys"
                {
                }
            }
            "HKU"
            {
                "Keys"
                {
                }
            }
            "HKPU"
            {
                "Keys"
                {
                }
            }
        }
        "Sequences"
        {
        }
        "Shortcut"
        {
            "{970C0BB2-C7D0-45D7-ABFA-7EC378858BC0}:_920202B002F9475288A945B0C8361A44"
            {
            "Name" = "8:SQLite Test Application"
            "Arguments" = "8:"
            "Description" = "8:"
            "ShowCmd" = "3:1"
            "IconIndex" = "3:0"
            "Transitive" = "11:FALSE"
            "Target" = "8:_2C7EDFF06B61482393D94E3A63D90113"
            "Folder" = "8:_1B562A9F876E47058AB813C418E24FBF"
            "WorkingFolder" = "8:_30C77BF2E6E84D01ADE5FB8BA2F81504"
            "Icon" = "8:"
            "Feature" = "8:"
            }
            "{970C0BB2-C7D0-45D7-ABFA-7EC378858BC0}:_CC64AEB6D8A643F7BC8EB95EBC803EB5"
            {
            "Name" = "8:Help"
            "Arguments" = "8:"
            "Description" = "8:"
            "ShowCmd" = "3:1"
            "IconIndex" = "3:0"
            "Transitive" = "11:FALSE"
            "Target" = "8:_60E2C442F77C48DE8150EBFC86663225"
            "Folder" = "8:_1B562A9F876E47058AB813C418E24FBF"
            "WorkingFolder" = "8:_CA5E61837F5B452B8169C698979CF05C"
            "Icon" = "8:"
            "Feature" = "8:"
            }
        }
        "UserInterface"
        {
            "{2479F3F5-0309-486D-8047-8187E2CE5BA0}:_027E806A39AD4FCD8E7A4EBE86AD3DF3"
            {
            "UseDynamicProperties" = "11:FALSE"
            "IsDependency" = "11:FALSE"
            "SourcePath" = "8:<VsdDialogDir>\\VsdUserInterface.wim"
            }
            "{DF760B10-853B-4699-99F2-AFF7185B4A62}:_349E960F62F043E79FD080CB87E24922"
            {
            "Name" = "8:#1902"
            "Sequence" = "3:2"
            "Attributes" = "3:3"
                "Dialogs"
                {
                    "{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_F1CAA16A464043FBB06804165AB31D0C"
                    {
                    "Sequence" = "3:100"
                    "DisplayName" = "8:Finished"
                    "UseDynamicProperties" = "11:TRUE"
                    "IsDependency" = "11:FALSE"
                    "SourcePath" = "8:<VsdDialogDir>\\VsdAdminFinishedDlg.wid"
                        "Properties"
                        {
                            "BannerBitmap"
                            {
                            "Name" = "8:BannerBitmap"
                            "DisplayName" = "8:#1001"
                            "Description" = "8:#1101"
                            "Type" = "3:8"
                            "ContextData" = "8:Bitmap"
                            "Attributes" = "3:4"
                            "Setting" = "3:2"
                            "Value" = "8:_B6156897CBBB4E929D9C1F7358CE9E90"
                            "UsePlugInResources" = "11:TRUE"
                            }
                        }
                    }
                }
            }
            "{DF760B10-853B-4699-99F2-AFF7185B4A62}:_3CB3696DF5D54FCA98E2BF3D4579451E"
            {
            "Name" = "8:#1901"
            "Sequence" = "3:1"
            "Attributes" = "3:2"
                "Dialogs"
                {
                    "{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_1DBE83588B574F75A6233D46A3234D69"
                    {
                    "Sequence" = "3:100"
                    "DisplayName" = "8:Progress"
                    "UseDynamicProperties" = "11:TRUE"
                    "IsDependency" = "11:FALSE"
                    "SourcePath" = "8:<VsdDialogDir>\\VsdProgressDlg.wid"
                        "Properties"
                        {
                            "BannerBitmap"
                            {
                            "Name" = "8:BannerBitmap"
                            "DisplayName" = "8:#1001"
                            "Description" = "8:#1101"
                            "Type" = "3:8"
                            "ContextData" = "8:Bitmap"
                            "Attributes" = "3:4"
                            "Setting" = "3:2"
                            "Value" = "8:_B6156897CBBB4E929D9C1F7358CE9E90"
                            "UsePlugInResources" = "11:TRUE"
                            }
                            "ShowProgress"
                            {
                            "Name" = "8:ShowProgress"
                            "DisplayName" = "8:#1009"
                            "Description" = "8:#1109"
                            "Type" = "3:5"
                            "ContextData" = "8:1;True=1;False=0"
                            "Attributes" = "3:0"
                            "Setting" = "3:0"
                            "Value" = "3:1"
                            "DefaultValue" = "3:1"
                            "UsePlugInResources" = "11:TRUE"
                            }
                        }
                    }
                }
            }
            "{DF760B10-853B-4699-99F2-AFF7185B4A62}:_573543E04AA54E9387CD1AAF21220444"
            {
            "Name" = "8:#1902"
            "Sequence" = "3:1"
            "Attributes" = "3:3"
                "Dialogs"
                {
                    "{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_991B7280E37E4C23A54CC7027F774891"
                    {
                    "Sequence" = "3:100"
                    "DisplayName" = "8:Finished"
                    "UseDynamicProperties" = "11:TRUE"
                    "IsDependency" = "11:FALSE"
                    "SourcePath" = "8:<VsdDialogDir>\\VsdFinishedDlg.wid"
                        "Properties"
                        {
                            "BannerBitmap"
                            {
                            "Name" = "8:BannerBitmap"
                            "DisplayName" = "8:#1001"
                            "Description" = "8:#1101"
                            "Type" = "3:8"
                            "ContextData" = "8:Bitmap"
                            "Attributes" = "3:4"
                            "Setting" = "3:2"
                            "Value" = "8:_B6156897CBBB4E929D9C1F7358CE9E90"
                            "UsePlugInResources" = "11:TRUE"
                            }
                            "UpdateText"
                            {
                            "Name" = "8:UpdateText"
                            "DisplayName" = "8:#1058"
                            "Description" = "8:#1158"
                            "Type" = "3:15"
                            "ContextData" = "8:"
                            "Attributes" = "3:0"
                            "Setting" = "3:1"
                            "Value" = "8:#1258"
                            "DefaultValue" = "8:#1258"
                            "UsePlugInResources" = "11:TRUE"
                            }
                        }
                    }
                }
            }
            "{DF760B10-853B-4699-99F2-AFF7185B4A62}:_5E0AF2B2658547308882EEE91399D911"
            {
            "Name" = "8:#1901"
            "Sequence" = "3:2"
            "Attributes" = "3:2"
                "Dialogs"
                {
                    "{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_82FCCA944F324BA18F0E3E01BCA1E60B"
                    {
                    "Sequence" = "3:100"
                    "DisplayName" = "8:Progress"
                    "UseDynamicProperties" = "11:TRUE"
                    "IsDependency" = "11:FALSE"
                    "SourcePath" = "8:<VsdDialogDir>\\VsdAdminProgressDlg.wid"
                        "Properties"
                        {
                            "BannerBitmap"
                            {
                            "Name" = "8:BannerBitmap"
                            "DisplayName" = "8:#1001"
                            "Description" = "8:#1101"
                            "Type" = "3:8"
                            "ContextData" = "8:Bitmap"
                            "Attributes" = "3:4"
                            "Setting" = "3:2"
                            "Value" = "8:_B6156897CBBB4E929D9C1F7358CE9E90"
                            "UsePlugInResources" = "11:TRUE"
                            }
                            "ShowProgress"
                            {
                            "Name" = "8:ShowProgress"
                            "DisplayName" = "8:#1009"
                            "Description" = "8:#1109"
                            "Type" = "3:5"
                            "ContextData" = "8:1;True=1;False=0"
                            "Attributes" = "3:0"
                            "Setting" = "3:0"
                            "Value" = "3:1"
                            "DefaultValue" = "3:1"
                            "UsePlugInResources" = "11:TRUE"
                            }
                        }
                    }
                }
            }
            "{DF760B10-853B-4699-99F2-AFF7185B4A62}:_7046F6E46106420BA50AA9A9ED86389A"
            {
            "Name" = "8:#1900"
            "Sequence" = "3:1"
            "Attributes" = "3:1"
                "Dialogs"
                {
                    "{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_03C4F0FAD7804F3DAE9A980E584F691E"
                    {
                    "Sequence" = "3:300"
                    "DisplayName" = "8:Confirm Installation"
                    "UseDynamicProperties" = "11:TRUE"
                    "IsDependency" = "11:FALSE"
                    "SourcePath" = "8:<VsdDialogDir>\\VsdConfirmDlg.wid"
                        "Properties"
                        {
                            "BannerBitmap"
                            {
                            "Name" = "8:BannerBitmap"
                            "DisplayName" = "8:#1001"
                            "Description" = "8:#1101"
                            "Type" = "3:8"
                            "ContextData" = "8:Bitmap"
                            "Attributes" = "3:4"
                            "Setting" = "3:2"
                            "Value" = "8:_B6156897CBBB4E929D9C1F7358CE9E90"
                            "UsePlugInResources" = "11:TRUE"
                            }
                        }
                    }
                    "{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_4B4F0FAA5A094FCC952CA8A93DEA0F04"
                    {
                    "Sequence" = "3:100"
                    "DisplayName" = "8:Welcome"
                    "UseDynamicProperties" = "11:TRUE"
                    "IsDependency" = "11:FALSE"
                    "SourcePath" = "8:<VsdDialogDir>\\VsdWelcomeDlg.wid"
                        "Properties"
                        {
                            "BannerBitmap"
                            {
                            "Name" = "8:BannerBitmap"
                            "DisplayName" = "8:#1001"
                            "Description" = "8:#1101"
                            "Type" = "3:8"
                            "ContextData" = "8:Bitmap"
                            "Attributes" = "3:4"
                            "Setting" = "3:2"
                            "Value" = "8:_B6156897CBBB4E929D9C1F7358CE9E90"
                            "UsePlugInResources" = "11:TRUE"
                            }
                            "CopyrightWarning"
                            {
                            "Name" = "8:CopyrightWarning"
                            "DisplayName" = "8:#1002"
                            "Description" = "8:#1102"
                            "Type" = "3:3"
                            "ContextData" = "8:"
                            "Attributes" = "3:0"
                            "Setting" = "3:2"
                            "Value" = "8:"
                            "DefaultValue" = "8:#1202"
                            "UsePlugInResources" = "11:TRUE"
                            }
                            "Welcome"
                            {
                            "Name" = "8:Welcome"
                            "DisplayName" = "8:#1003"
                            "Description" = "8:#1103"
                            "Type" = "3:3"
                            "ContextData" = "8:"
                            "Attributes" = "3:0"
                            "Setting" = "3:1"
                            "Value" = "8:#1203"
                            "DefaultValue" = "8:#1203"
                            "UsePlugInResources" = "11:TRUE"
                            }
                        }
                    }
                    "{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_CAD4CD70D47945E7A7FCD4428405F7FD"
                    {
                    "Sequence" = "3:200"
                    "DisplayName" = "8:Installation Folder"
                    "UseDynamicProperties" = "11:TRUE"
                    "IsDependency" = "11:FALSE"
                    "SourcePath" = "8:<VsdDialogDir>\\VsdFolderDlg.wid"
                        "Properties"
                        {
                            "BannerBitmap"
                            {
                            "Name" = "8:BannerBitmap"
                            "DisplayName" = "8:#1001"
                            "Description" = "8:#1101"
                            "Type" = "3:8"
                            "ContextData" = "8:Bitmap"
                            "Attributes" = "3:4"
                            "Setting" = "3:2"
                            "Value" = "8:_B6156897CBBB4E929D9C1F7358CE9E90"
                            "UsePlugInResources" = "11:TRUE"
                            }
                            "InstallAllUsersVisible"
                            {
                            "Name" = "8:InstallAllUsersVisible"
                            "DisplayName" = "8:#1059"
                            "Description" = "8:#1159"
                            "Type" = "3:5"
                            "ContextData" = "8:1;True=1;False=0"
                            "Attributes" = "3:0"
                            "Setting" = "3:0"
                            "Value" = "3:1"
                            "DefaultValue" = "3:1"
                            "UsePlugInResources" = "11:TRUE"
                            }
                        }
                    }
                }
            }
            "{DF760B10-853B-4699-99F2-AFF7185B4A62}:_A95B4EFD2C5249848F009D88CBA3739B"
            {
            "Name" = "8:#1900"
            "Sequence" = "3:2"
            "Attributes" = "3:1"
                "Dialogs"
                {
                    "{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_101B4B845E67488FB6A0AC097773DA38"
                    {
                    "Sequence" = "3:300"
                    "DisplayName" = "8:Confirm Installation"
                    "UseDynamicProperties" = "11:TRUE"
                    "IsDependency" = "11:FALSE"
                    "SourcePath" = "8:<VsdDialogDir>\\VsdAdminConfirmDlg.wid"
                        "Properties"
                        {
                            "BannerBitmap"
                            {
                            "Name" = "8:BannerBitmap"
                            "DisplayName" = "8:#1001"
                            "Description" = "8:#1101"
                            "Type" = "3:8"
                            "ContextData" = "8:Bitmap"
                            "Attributes" = "3:4"
                            "Setting" = "3:2"
                            "Value" = "8:_B6156897CBBB4E929D9C1F7358CE9E90"
                            "UsePlugInResources" = "11:TRUE"
                            }
                        }
                    }
                    "{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_1AD3D10EBB64435985C57A85063E6CDF"
                    {
                    "Sequence" = "3:100"
                    "DisplayName" = "8:Welcome"
                    "UseDynamicProperties" = "11:TRUE"
                    "IsDependency" = "11:FALSE"
                    "SourcePath" = "8:<VsdDialogDir>\\VsdAdminWelcomeDlg.wid"
                        "Properties"
                        {
                            "BannerBitmap"
                            {
                            "Name" = "8:BannerBitmap"
                            "DisplayName" = "8:#1001"
                            "Description" = "8:#1101"
                            "Type" = "3:8"
                            "ContextData" = "8:Bitmap"
                            "Attributes" = "3:4"
                            "Setting" = "3:2"
                            "Value" = "8:_B6156897CBBB4E929D9C1F7358CE9E90"
                            "UsePlugInResources" = "11:TRUE"
                            }
                            "CopyrightWarning"
                            {
                            "Name" = "8:CopyrightWarning"
                            "DisplayName" = "8:#1002"
                            "Description" = "8:#1102"
                            "Type" = "3:3"
                            "ContextData" = "8:"
                            "Attributes" = "3:0"
                            "Setting" = "3:2"
                            "Value" = "8:"
                            "DefaultValue" = "8:#1202"
                            "UsePlugInResources" = "11:TRUE"
                            }
                            "Welcome"
                            {
                            "Name" = "8:Welcome"
                            "DisplayName" = "8:#1003"
                            "Description" = "8:#1103"
                            "Type" = "3:3"
                            "ContextData" = "8:"
                            "Attributes" = "3:0"
                            "Setting" = "3:1"
                            "Value" = "8:#1203"
                            "DefaultValue" = "8:#1203"
                            "UsePlugInResources" = "11:TRUE"
                            }
                        }
                    }
                    "{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_F5C2368EB13F47EF8808B4E5855A647B"
                    {
                    "Sequence" = "3:200"
                    "DisplayName" = "8:Installation Folder"
                    "UseDynamicProperties" = "11:TRUE"
                    "IsDependency" = "11:FALSE"
                    "SourcePath" = "8:<VsdDialogDir>\\VsdAdminFolderDlg.wid"
                        "Properties"
                        {
                            "BannerBitmap"
                            {
                            "Name" = "8:BannerBitmap"
                            "DisplayName" = "8:#1001"
                            "Description" = "8:#1101"
                            "Type" = "3:8"
                            "ContextData" = "8:Bitmap"
                            "Attributes" = "3:4"
                            "Setting" = "3:2"
                            "Value" = "8:_B6156897CBBB4E929D9C1F7358CE9E90"
                            "UsePlugInResources" = "11:TRUE"
                            }
                        }
                    }
                }
            }
            "{2479F3F5-0309-486D-8047-8187E2CE5BA0}:_F02FDE6DA53449159DF6E6441E2314C9"
            {
            "UseDynamicProperties" = "11:FALSE"
            "IsDependency" = "11:FALSE"
            "SourcePath" = "8:<VsdDialogDir>\\VsdBasicDialogs.wim"
            }
        }
        "MergeModule"
        {
        }
        "ProjectOutput"
        {
        }
    }
}
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<








































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































Deleted tools/setup/topband.jpg.

cannot compute difference between binary files