ReactOS  0.4.14-dev-55-g2da92ac
integrity.c File Reference
#include "wine/test.h"
#include "windef.h"
#include "winbase.h"
#include "winuser.h"
#include "winerror.h"
#include "winnt.h"
#include "imagehlp.h"
#include "psapi.h"
Include dependency graph for integrity.c:

Go to the source code of this file.

Macros

#define COBJMACROS
 

Functions

static BOOL (WINAPI *pImageAddCertificate)(HANDLE
 
static PIMAGE_NT_HEADERS (WINAPI *pCheckSumMappedFile)(PVOID
 
static BOOL copy_dll_file (void)
 
static DWORD get_file_size (void)
 
static DWORD test_add_certificate (const char *cert_data, int len)
 
static void test_get_certificate (const char *cert_data, int index)
 
static void test_remove_certificate (int index)
 
static DWORD _get_checksum_offset (PVOID base, PIMAGE_NT_HEADERS *nt_header, DWORD *checksum)
 
static void test_pe_checksum (void)
 
 START_TEST (integrity)
 

Variables

static HMODULE hImageHlp
 
static HMODULE hPsapi
 
static char test_dll_path [MAX_PATH]
 
static LPWIN_CERTIFICATE
 
static PDWORD
 
static WORD
 
static DWORD
 
static HMODULE
 
static LPMODULEINFO
 
static DWORD cb
 
static const char test_cert_data []
 
static const char test_cert_data_2 [] = {0xDE,0xAD,0xBE,0xEF,0x01,0x02,0x03}
 
static char test_pe_executable []
 

Macro Definition Documentation

◆ COBJMACROS

#define COBJMACROS

Definition at line 21 of file integrity.c.

Function Documentation

◆ _get_checksum_offset()

static DWORD _get_checksum_offset ( PVOID  base,
PIMAGE_NT_HEADERS nt_header,
DWORD checksum 
)
static

Definition at line 267 of file integrity.c.

268 {
270  PIMAGE_NT_HEADERS32 Header32;
271  PIMAGE_NT_HEADERS64 Header64;
272 
274  return 0;
275 
276  Header32 = (IMAGE_NT_HEADERS32 *)((char *)dos + dos->e_lfanew);
277  if (Header32->Signature != IMAGE_NT_SIGNATURE)
278  return 0;
279 
280  *nt_header = (PIMAGE_NT_HEADERS)Header32;
281 
283  {
284  *checksum = Header32->OptionalHeader.CheckSum;
285  return (char *)&Header32->OptionalHeader.CheckSum - (char *)base;
286  }
287  else if (Header32->OptionalHeader.Magic == IMAGE_NT_OPTIONAL_HDR64_MAGIC)
288  {
289  Header64 = (IMAGE_NT_HEADERS64 *)Header32;
290  *checksum = Header64->OptionalHeader.CheckSum;
291  return (char *)&Header64->OptionalHeader.CheckSum - (char *)base;
292  }
293 
294  return 0;
295 }
static PIMAGE_NT_HEADERS(WINAPI *pCheckSumMappedFile)(PVOID
#define IMAGE_NT_OPTIONAL_HDR32_MAGIC
Definition: ntimage.h:376
IMAGE_OPTIONAL_HEADER32 OptionalHeader
Definition: ntddk_ex.h:184
#define IMAGE_DOS_SIGNATURE
Definition: pedump.c:89
PIMAGE_NT_HEADERS nt_header
Definition: pefixup.c:166
IMAGE_OPTIONAL_HEADER64 OptionalHeader
Definition: ntimage.h:396
#define IMAGE_NT_SIGNATURE
Definition: pedump.c:93
#define IMAGE_NT_OPTIONAL_HDR64_MAGIC
Definition: ntimage.h:377
IMAGE_DOS_HEADER dos
Definition: module.c:49
static cab_ULONG checksum(const cab_UBYTE *data, cab_UWORD bytes, cab_ULONG csum)
Definition: fdi.c:353

Referenced by test_pe_checksum().

◆ BOOL()

static BOOL ( WINAPI pImageAddCertificate)
static

◆ copy_dll_file()

static BOOL copy_dll_file ( void  )
static

Definition at line 118 of file integrity.c.

119 {
120  char sys_dir[MAX_PATH+15];
121  char temp_path[MAX_PATH];
122 
123  if (GetSystemDirectoryA(sys_dir, MAX_PATH) == 0)
124  {
125  skip("Failed to get system directory. Skipping certificate/PE image tests.\n");
126  return FALSE;
127  }
128 
129  if (sys_dir[lstrlenA(sys_dir) - 1] != '\\')
130  lstrcatA(sys_dir, "\\");
131 
132  lstrcatA(sys_dir, "imagehlp.dll");
133 
134  /* Copy DLL to a temp file */
137 
138  if (CopyFileA(sys_dir, test_dll_path, FALSE) == 0)
139  {
140  skip("Unable to create copy of imagehlp.dll for tests.\n");
141  return FALSE;
142  }
143 
144  return TRUE;
145 }
#define TRUE
Definition: types.h:120
UINT WINAPI GetSystemDirectoryA(OUT LPSTR lpBuffer, IN UINT uSize)
Definition: path.c:2282
BOOL WINAPI CopyFileA(IN LPCSTR lpExistingFileName, IN LPCSTR lpNewFileName, IN BOOL bFailIfExists)
Definition: copy.c:404
static char test_dll_path[MAX_PATH]
Definition: integrity.c:32
LPSTR WINAPI lstrcatA(LPSTR lpString1, LPCSTR lpString2)
Definition: lstring.c:123
#define MAX_PATH
Definition: compat.h:26
int WINAPI lstrlenA(LPCSTR lpString)
Definition: lstring.c:145
DWORD WINAPI GetTempPathA(IN DWORD nBufferLength, OUT LPSTR lpBuffer)
Definition: path.c:2053
#define skip(...)
Definition: atltest.h:64
UINT WINAPI GetTempFileNameA(IN LPCSTR lpPathName, IN LPCSTR lpPrefixString, IN UINT uUnique, OUT LPSTR lpTempFileName)
Definition: filename.c:26
char temp_path[MAX_PATH]
Definition: mspatcha.c:123

Referenced by START_TEST().

◆ get_file_size()

static DWORD get_file_size ( void  )
static

Definition at line 147 of file integrity.c.

148 {
149  HANDLE file;
150  DWORD filesize = 0;
151 
154  if (file == INVALID_HANDLE_VALUE)
155  return 0;
156 
157  filesize = GetFileSize(file, NULL);
158  CloseHandle(file);
159 
160  return filesize;
161 }
#define CloseHandle
Definition: compat.h:398
#define INVALID_HANDLE_VALUE
Definition: compat.h:391
#define FILE_SHARE_READ
Definition: compat.h:125
static char test_dll_path[MAX_PATH]
Definition: integrity.c:32
smooth NULL
Definition: ftsmooth.c:416
#define OPEN_EXISTING
Definition: compat.h:426
const char file[]
Definition: icontest.c:11
unsigned long DWORD
Definition: ntddk_ex.h:95
DWORD WINAPI GetFileSize(HANDLE hFile, LPDWORD lpFileSizeHigh)
Definition: fileinfo.c:481
#define FILE_ATTRIBUTE_NORMAL
Definition: compat.h:126
#define GENERIC_READ
Definition: compat.h:124
#define CreateFileA(a, b, c, d, e, f, g)
Definition: compat.h:399
Definition: fci.c:126

Referenced by START_TEST().

◆ PIMAGE_NT_HEADERS()

static PIMAGE_NT_HEADERS ( WINAPI pCheckSumMappedFile)
static

Referenced by _get_checksum_offset().

◆ START_TEST()

START_TEST ( integrity  )

Definition at line 484 of file integrity.c.

485 {
486  DWORD file_size, file_size_orig, first, second;
487 
488  hImageHlp = LoadLibraryA("imagehlp.dll");
489 
490  if (!hImageHlp)
491  {
492  win_skip("ImageHlp unavailable\n");
493  return;
494  }
495 
496  if (!copy_dll_file())
497  {
499  return;
500  }
501 
502  file_size_orig = get_file_size();
503  /*
504  * Align file_size_orig to an 8-byte boundary. This avoids tests failures where
505  * the original dll is not correctly aligned (but when written to it will be).
506  */
507  if (file_size_orig % 8 != 0)
508  {
509  skip("We need to align to an 8-byte boundary\n");
510  file_size_orig = (file_size_orig + 7) & ~7;
511  }
512 
513  pImageAddCertificate = (void *) GetProcAddress(hImageHlp, "ImageAddCertificate");
514  pImageEnumerateCertificates = (void *) GetProcAddress(hImageHlp, "ImageEnumerateCertificates");
515  pImageGetCertificateData = (void *) GetProcAddress(hImageHlp, "ImageGetCertificateData");
516  pImageGetCertificateHeader = (void *) GetProcAddress(hImageHlp, "ImageGetCertificateHeader");
517  pImageRemoveCertificate = (void *) GetProcAddress(hImageHlp, "ImageRemoveCertificate");
518  pCheckSumMappedFile = (void *) GetProcAddress(hImageHlp, "CheckSumMappedFile");
519 
520  hPsapi = LoadLibraryA("psapi.dll");
521  if (hPsapi)
522  pGetModuleInformation = (void *) GetProcAddress(hPsapi, "GetModuleInformation");
523 
527 
529  ok(file_size == file_size_orig, "File size different after add and remove (old: %d; new: %d)\n", file_size_orig, file_size);
530 
531  /* Try adding multiple certificates */
534  ok(second == first + 1, "got %d %d\n", first, second);
535 
538 
539  /* Remove the first one and verify the second certificate is intact */
541  second--;
543 
544  test_remove_certificate(second);
545 
547  ok(file_size == file_size_orig, "File size different after add and remove (old: %d; new: %d)\n", file_size_orig, file_size);
548 
550 
551  if (hPsapi) FreeLibrary(hPsapi);
554 }
const GLint * first
Definition: glext.h:5794
static HMODULE hImageHlp
Definition: integrity.c:31
static DWORD get_file_size(void)
Definition: integrity.c:147
static char test_dll_path[MAX_PATH]
Definition: integrity.c:32
static BOOL copy_dll_file(void)
Definition: integrity.c:118
HINSTANCE WINAPI DECLSPEC_HOTPATCH LoadLibraryA(LPCSTR lpLibFileName)
Definition: loader.c:111
BOOL WINAPI DeleteFileA(IN LPCSTR lpFileName)
Definition: delete.c:24
static DWORD test_add_certificate(const char *cert_data, int len)
Definition: integrity.c:163
#define FreeLibrary(x)
Definition: compat.h:405
static HMODULE hPsapi
Definition: integrity.c:31
unsigned long DWORD
Definition: ntddk_ex.h:95
static void test_remove_certificate(int index)
Definition: integrity.c:241
static void test_get_certificate(const char *cert_data, int index)
Definition: integrity.c:203
static const char test_cert_data[]
Definition: integrity.c:43
static void test_pe_checksum(void)
Definition: integrity.c:297
#define ok(value,...)
Definition: atltest.h:57
#define skip(...)
Definition: atltest.h:64
#define GetProcAddress(x, y)
Definition: compat.h:410
static const char test_cert_data_2[]
Definition: integrity.c:95
#define win_skip
Definition: test.h:141
#define file_size(inode)
Definition: reiserfs_fs.h:1869

◆ test_add_certificate()

static DWORD test_add_certificate ( const char cert_data,
int  len 
)
static

Definition at line 163 of file integrity.c.

164 {
165  HANDLE hFile;
167  DWORD cert_len;
168  DWORD index;
169  BOOL ret;
170 
172 
174  {
175  skip("Unable to open %s, skipping test\n", test_dll_path);
176  return ~0;
177  }
178 
179  cert_len = sizeof(WIN_CERTIFICATE) + len;
181 
182  if (!cert)
183  {
184  skip("Unable to allocate memory, skipping test\n");
186  return ~0;
187  }
188 
189  cert->dwLength = cert_len;
190  cert->wRevision = WIN_CERT_REVISION_1_0;
191  cert->wCertificateType = WIN_CERT_TYPE_PKCS_SIGNED_DATA;
192  CopyMemory(cert->bCertificate, cert_data, len);
193 
194  ret = pImageAddCertificate(hFile, cert, &index);
195  ok(ret, "Unable to add certificate to image, error %x\n", GetLastError());
196  trace("added cert index %d\n", index);
197 
200  return index;
201 }
#define CloseHandle
Definition: compat.h:398
#define INVALID_HANDLE_VALUE
Definition: compat.h:391
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
struct _WIN_CERTIFICATE WIN_CERTIFICATE
#define WIN_CERT_REVISION_1_0
Definition: wintrust.h:623
#define FILE_SHARE_READ
Definition: compat.h:125
static char test_dll_path[MAX_PATH]
Definition: integrity.c:32
unsigned int BOOL
Definition: ntddk_ex.h:94
#define GENERIC_WRITE
Definition: nt_native.h:90
smooth NULL
Definition: ftsmooth.c:416
static BYTE cert[]
Definition: msg.c:1437
GLuint index
Definition: glext.h:6031
#define OPEN_EXISTING
Definition: compat.h:426
#define GetProcessHeap()
Definition: compat.h:395
#define trace
Definition: atltest.h:70
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
#define CopyMemory
Definition: winbase.h:1633
unsigned long DWORD
Definition: ntddk_ex.h:95
int ret
#define FILE_ATTRIBUTE_NORMAL
Definition: compat.h:126
#define index(s, c)
Definition: various.h:29
GLenum GLsizei len
Definition: glext.h:6722
#define GENERIC_READ
Definition: compat.h:124
_In_ HANDLE hFile
Definition: mswsock.h:90
#define ok(value,...)
Definition: atltest.h:57
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
#define skip(...)
Definition: atltest.h:64
#define WIN_CERT_TYPE_PKCS_SIGNED_DATA
#define CreateFileA(a, b, c, d, e, f, g)
Definition: compat.h:399
#define HeapFree(x, y, z)
Definition: compat.h:394

Referenced by START_TEST().

◆ test_get_certificate()

static void test_get_certificate ( const char cert_data,
int  index 
)
static

Definition at line 203 of file integrity.c.

204 {
205  HANDLE hFile;
207  DWORD cert_len = 0;
208  DWORD err;
209  BOOL ret;
210 
212 
214  {
215  skip("Unable to open %s, skipping test\n", test_dll_path);
216  return;
217  }
218 
219  ret = pImageGetCertificateData(hFile, index, NULL, &cert_len);
220  err = GetLastError();
221 
222  ok ((ret == FALSE) && (err == ERROR_INSUFFICIENT_BUFFER), "ImageGetCertificateData gave unexpected result; ret=%d / err=%x\n", ret, err);
223 
225 
226  if (!cert)
227  {
228  skip("Unable to allocate memory, skipping test\n");
230  return;
231  }
232 
233  ret = pImageGetCertificateData(hFile, index, cert, &cert_len);
234  ok(ret, "Unable to retrieve certificate; err=%x\n", GetLastError());
235  ok(memcmp(cert->bCertificate, cert_data, cert_len - sizeof(WIN_CERTIFICATE)) == 0, "Certificate retrieved did not match original\n");
236 
239 }
#define CloseHandle
Definition: compat.h:398
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
Definition: utclib.c:112
#define INVALID_HANDLE_VALUE
Definition: compat.h:391
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
#define FILE_SHARE_READ
Definition: compat.h:125
static char test_dll_path[MAX_PATH]
Definition: integrity.c:32
unsigned int BOOL
Definition: ntddk_ex.h:94
smooth NULL
Definition: ftsmooth.c:416
static BYTE cert[]
Definition: msg.c:1437
GLuint index
Definition: glext.h:6031
#define OPEN_EXISTING
Definition: compat.h:426
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
unsigned long DWORD
Definition: ntddk_ex.h:95
int ret
#define FILE_ATTRIBUTE_NORMAL
Definition: compat.h:126
#define GENERIC_READ
Definition: compat.h:124
#define err(...)
_In_ HANDLE hFile
Definition: mswsock.h:90
#define ok(value,...)
Definition: atltest.h:57
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
#define skip(...)
Definition: atltest.h:64
#define CreateFileA(a, b, c, d, e, f, g)
Definition: compat.h:399
#define HeapFree(x, y, z)
Definition: compat.h:394
#define ERROR_INSUFFICIENT_BUFFER
Definition: dderror.h:10

Referenced by START_TEST().

◆ test_pe_checksum()

static void test_pe_checksum ( void  )
static

Definition at line 297 of file integrity.c.

298 {
299  DWORD checksum_orig, checksum_new, checksum_off, checksum_correct;
302  HMODULE quartz_data;
303  char* quartz_base;
305  char buffer[20];
306  BOOL ret_bool;
307 
308  if (!pCheckSumMappedFile)
309  {
310  win_skip("CheckSumMappedFile not supported, skipping tests\n");
311  return;
312  }
313 
314  SetLastError(0xdeadbeef);
315  checksum_orig = checksum_new = 0xdeadbeef;
316  ret = pCheckSumMappedFile(NULL, 0, &checksum_orig, &checksum_new);
317  ok(!ret, "Expected CheckSumMappedFile to fail, got %p\n", ret);
318  ok(GetLastError() == 0xdeadbeef, "Expected err=0xdeadbeef, got %x\n", GetLastError());
319  ok(checksum_orig == 0, "Expected 0, got %x\n", checksum_orig);
320  ok(checksum_new == 0, "Expected 0, got %x\n", checksum_new);
321 
322  SetLastError(0xdeadbeef);
323  checksum_orig = checksum_new = 0xdeadbeef;
324  ret = pCheckSumMappedFile((void *)0xdeadbeef, 0, &checksum_orig, &checksum_new);
325  ok(!ret, "Expected CheckSumMappedFile to fail, got %p\n", ret);
326  ok(GetLastError() == 0xdeadbeef, "Expected err=0xdeadbeef, got %x\n", GetLastError());
327  ok(checksum_orig == 0, "Expected 0, got %x\n", checksum_orig);
328  ok(checksum_new == 0, "Expected 0, got %x\n", checksum_new);
329 
330  if (0)
331  {
332  /* crashes on Windows */
333  checksum_orig = checksum_new = 0xdeadbeef;
334  pCheckSumMappedFile(0, 0x1000, &checksum_orig, &checksum_new);
335  pCheckSumMappedFile((void *)0xdeadbeef, 0x1000, NULL, NULL);
336  }
337 
338  /* basic checksum tests */
339  memset(buffer, 0x11, sizeof(buffer));
340  checksum_orig = checksum_new = 0xdeadbeef;
341  ret = pCheckSumMappedFile(buffer, sizeof(buffer), &checksum_orig, &checksum_new);
342  ok(ret == NULL, "Expected NULL, got %p\n", ret);
343  ok(checksum_orig == 0, "Expected 0, got %x\n", checksum_orig);
344  ok(checksum_new == 0xaabe, "Expected 0xaabe, got %x\n", checksum_new);
345 
346  memset(buffer, 0x22, sizeof(buffer));
347  checksum_orig = checksum_new = 0xdeadbeef;
348  ret = pCheckSumMappedFile(buffer, sizeof(buffer), &checksum_orig, &checksum_new);
349  ok(ret == NULL, "Expected NULL, got %p\n", ret);
350  ok(checksum_orig == 0, "Expected 0, got %x\n", checksum_orig);
351  ok(checksum_new == 0x5569, "Expected 0x5569, got %x\n", checksum_new);
352 
353  memset(buffer, 0x22, sizeof(buffer));
354  checksum_orig = checksum_new = 0xdeadbeef;
355  ret = pCheckSumMappedFile(buffer, 10, &checksum_orig, &checksum_new);
356  ok(ret == NULL, "Expected NULL, got %p\n", ret);
357  ok(checksum_orig == 0, "Expected 0, got %x\n", checksum_orig);
358  ok(checksum_new == 0xaab4, "Expected 0xaab4, got %x\n", checksum_new);
359 
360  memset(buffer, 0x22, sizeof(buffer));
361  checksum_orig = checksum_new = 0xdeadbeef;
362  ret = pCheckSumMappedFile(buffer, 11, &checksum_orig, &checksum_new);
363  ok(ret == NULL, "Expected NULL, got %p\n", ret);
364  ok(checksum_orig == 0, "Expected 0, got %x\n", checksum_orig);
365  ok(checksum_new == 0xaad7, "Expected 0xaad7, got %x\n", checksum_new);
366 
367  /* test checksum of PE module */
368  memset(buffer, 0x22, sizeof(buffer));
369  checksum_orig = checksum_new = 0xdeadbeef;
370  ret = pCheckSumMappedFile(test_pe_executable, sizeof(test_pe_executable),
371  &checksum_orig, &checksum_new);
372  ok((char *)ret == test_pe_executable + 0x80, "Expected %p, got %p\n", test_pe_executable + 0x80, ret);
373  ok(checksum_orig == 0xabcdef11, "Expected 0xabcdef11, got %x\n", checksum_orig);
374  ok(checksum_new == 0xaa4, "Expected 0xaa4, got %x\n", checksum_new);
375 
376  if (!pGetModuleInformation)
377  {
378  win_skip("GetModuleInformation not supported, skipping tests\n");
379  return;
380  }
381 
382  ret_bool = pGetModuleInformation(GetCurrentProcess(), GetModuleHandleA(NULL),
383  &modinfo, sizeof(modinfo));
384  ok(ret_bool, "GetModuleInformation failed, error: %x\n", GetLastError());
385 
386  if (0)
387  {
388  /* crashes on Windows */
389  pCheckSumMappedFile(modinfo.lpBaseOfDll, modinfo.SizeOfImage, NULL, NULL);
390  }
391 
392  SetLastError(0xdeadbeef);
393  checksum_orig = checksum_new = 0xdeadbeef;
394  ret = pCheckSumMappedFile(modinfo.lpBaseOfDll, modinfo.SizeOfImage, &checksum_orig, &checksum_new);
395  ok(ret != NULL, "Expected CheckSumMappedFile to succeed\n");
396  ok(GetLastError() == 0xdeadbeef, "Expected err=0xdeadbeef, got %x\n", GetLastError());
397  ok(checksum_orig != 0xdeadbeef, "Expected orig checksum != 0xdeadbeef\n");
398  ok(checksum_new != 0xdeadbeef, "Expected new checksum != 0xdeadbeef\n");
399 
400  SetLastError(0xdeadbeef);
401  checksum_orig = checksum_new = 0xdeadbeef;
402  ret = pCheckSumMappedFile((char *)modinfo.lpBaseOfDll + 100, modinfo.SizeOfImage - 100,
403  &checksum_orig, &checksum_new);
404  ok(!ret, "Expected CheckSumMappedFile to fail, got %p\n", ret);
405  ok(GetLastError() == 0xdeadbeef, "Expected err=0xdeadbeef, got %x\n", GetLastError());
406  ok(checksum_orig == 0, "Expected 0xdeadbeef, got %x\n", checksum_orig);
407  ok(checksum_new != 0 && checksum_new != 0xdeadbeef, "Got unexpected value %x\n", checksum_new);
408 
409  checksum_off = _get_checksum_offset(modinfo.lpBaseOfDll, &nt_header, &checksum_correct);
410  ok(checksum_off != 0, "Failed to get checksum offset\n");
411 
412  checksum_orig = checksum_new = 0xdeadbeef;
413  ret = pCheckSumMappedFile(modinfo.lpBaseOfDll, checksum_off, &checksum_orig, &checksum_new);
414  ok(ret == nt_header, "Expected %p, got %p\n", nt_header, ret);
415  ok(checksum_orig == checksum_correct, "Expected %x, got %x\n", checksum_correct, checksum_orig);
416  ok(checksum_new != 0 && checksum_new != 0xdeadbeef, "Got unexpected value %x\n", checksum_new);
417 
418  checksum_orig = checksum_new = 0xdeadbeef;
419  ret = pCheckSumMappedFile(modinfo.lpBaseOfDll, (char *)nt_header - (char *)modinfo.lpBaseOfDll,
420  &checksum_orig, &checksum_new);
421  ok(ret == nt_header, "Expected %p, got %p\n", nt_header, ret);
422  ok(checksum_orig == checksum_correct, "Expected %x, got %x\n", checksum_correct, checksum_orig);
423  ok(checksum_new != 0 && checksum_new != 0xdeadbeef, "Got unexpected value %x\n", checksum_new);
424 
425  checksum_orig = checksum_new = 0xdeadbeef;
426  ret = pCheckSumMappedFile(modinfo.lpBaseOfDll, sizeof(IMAGE_DOS_HEADER),
427  &checksum_orig, &checksum_new);
428  ok(ret == nt_header, "Expected %p, got %p\n", nt_header, ret);
429  ok(checksum_orig == checksum_correct, "Expected %x, got %x\n", checksum_correct, checksum_orig);
430  ok(checksum_new != 0 && checksum_new != 0xdeadbeef, "Got unexpected value %x\n", checksum_new);
431 
432  checksum_orig = checksum_new = 0xdeadbeef;
433  ret = pCheckSumMappedFile(modinfo.lpBaseOfDll, 0, &checksum_orig, &checksum_new);
434  ok(ret == nt_header, "Expected %p, got %p\n", nt_header, ret);
435  ok(checksum_orig == checksum_correct, "Expected %x, got %x\n", checksum_correct, checksum_orig);
436  todo_wine ok(checksum_new != 0 && checksum_new != 0xdeadbeef, "Got unexpected value %x\n", checksum_new);
437 
438  checksum_orig = checksum_new = 0xdeadbeef;
439  ret = pCheckSumMappedFile((char *)modinfo.lpBaseOfDll + 1, 0,
440  &checksum_orig, &checksum_new);
441  ok(ret == NULL, "Expected NULL, got %p\n", ret);
442  ok(checksum_orig == 0, "Expected 0, got %x\n", checksum_orig);
443  ok(checksum_new == 0, "Expected 0, got %x\n", checksum_new);
444 
445  quartz_data = LoadLibraryExA("quartz.dll", NULL, LOAD_LIBRARY_AS_DATAFILE);
446  if (!quartz_data)
447  {
448  skip("Failed to load quartz as datafile, skipping tests\n");
449  return;
450  }
451 
452  quartz_base = (char *)((DWORD_PTR)quartz_data & ~1);
453  checksum_off = _get_checksum_offset(quartz_base, &nt_header, &checksum_correct);
454  ok(checksum_off != 0, "Failed to get checksum offset\n");
455 
456  checksum_orig = checksum_new = 0xdeadbeef;
457  ret = pCheckSumMappedFile(quartz_base, checksum_off, &checksum_orig, &checksum_new);
458  ok(ret == nt_header, "Expected %p, got %p\n", nt_header, ret);
459  ok(checksum_orig == checksum_correct, "Expected %x, got %x\n", checksum_correct, checksum_orig);
460  ok(checksum_new != 0 && checksum_new != 0xdeadbeef, "Got unexpected value %x\n", checksum_new);
461 
462  checksum_orig = checksum_new = 0xdeadbeef;
463  ret = pCheckSumMappedFile(quartz_base, (char *)nt_header - quartz_base,
464  &checksum_orig, &checksum_new);
465  ok(ret == nt_header, "Expected %p, got %p\n", nt_header, ret);
466  ok(checksum_orig == checksum_correct, "Expected %x, got %x\n", checksum_correct, checksum_orig);
467  ok(checksum_new != 0 && checksum_new != 0xdeadbeef, "Got unexpected value %x\n", checksum_new);
468 
469  checksum_orig = checksum_new = 0xdeadbeef;
470  ret = pCheckSumMappedFile(quartz_base, sizeof(IMAGE_DOS_HEADER), &checksum_orig, &checksum_new);
471  ok(ret == nt_header, "Expected %p, got %p\n", nt_header, ret);
472  ok(checksum_orig == checksum_correct, "Expected %x, got %x\n", checksum_correct, checksum_orig);
473  ok(checksum_new != 0 && checksum_new != 0xdeadbeef, "Got unexpected value %x\n", checksum_new);
474 
475  checksum_orig = checksum_new = 0xdeadbeef;
476  ret = pCheckSumMappedFile(quartz_base, 0, &checksum_orig, &checksum_new);
477  ok(ret == nt_header, "Expected %p, got %p\n", nt_header, ret);
478  ok(checksum_orig == checksum_correct, "Expected %x, got %x\n", checksum_correct, checksum_orig);
479  todo_wine ok(checksum_new != 0 && checksum_new != 0xdeadbeef, "Got unexpected value %x\n", checksum_new);
480 
481  FreeLibrary(quartz_data);
482 }
static char test_pe_executable[]
Definition: integrity.c:97
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
GLuint buffer
Definition: glext.h:5915
PIMAGE_NT_HEADERS nt_header
Definition: pefixup.c:166
unsigned int BOOL
Definition: ntddk_ex.h:94
smooth NULL
Definition: ftsmooth.c:416
static DWORD _get_checksum_offset(PVOID base, PIMAGE_NT_HEADERS *nt_header, DWORD *checksum)
Definition: integrity.c:267
#define FreeLibrary(x)
Definition: compat.h:405
HANDLE WINAPI GetCurrentProcess(VOID)
Definition: proc.c:1138
unsigned long DWORD
Definition: ntddk_ex.h:95
#define SetLastError(x)
Definition: compat.h:409
static HMODULE MODULEINFO * modinfo
Definition: module.c:32
int ret
#define todo_wine
Definition: test.h:154
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
Definition: loader.c:821
uint32_t DWORD_PTR
Definition: typedefs.h:63
#define LOAD_LIBRARY_AS_DATAFILE
Definition: winbase.h:338
#define ok(value,...)
Definition: atltest.h:57
#define skip(...)
Definition: atltest.h:64
HINSTANCE WINAPI DECLSPEC_HOTPATCH LoadLibraryExA(LPCSTR lpLibFileName, HANDLE hFile, DWORD dwFlags)
Definition: loader.c:159
#define memset(x, y, z)
Definition: compat.h:39
#define win_skip
Definition: test.h:141

Referenced by START_TEST().

◆ test_remove_certificate()

static void test_remove_certificate ( int  index)
static

Definition at line 241 of file integrity.c.

242 {
243  DWORD orig_count = 0, count = 0;
244  HANDLE hFile;
245  BOOL ret;
246 
248 
250  {
251  skip("Unable to open %s, skipping test\n", test_dll_path);
252  return;
253  }
254 
255  ret = pImageEnumerateCertificates(hFile, CERT_SECTION_TYPE_ANY, &orig_count, NULL, 0);
256  ok (ret, "Unable to enumerate certificates in file; err=%x\n", GetLastError());
257  ret = pImageRemoveCertificate(hFile, index);
258  ok (ret, "Unable to remove certificate from file; err=%x\n", GetLastError());
259 
260  /* Test to see if the certificate has actually been removed */
261  pImageEnumerateCertificates(hFile, CERT_SECTION_TYPE_ANY, &count, NULL, 0);
262  ok (count == orig_count - 1, "Certificate count mismatch; orig=%d new=%d\n", orig_count, count);
263 
265 }
#define CloseHandle
Definition: compat.h:398
GLuint GLuint GLsizei count
Definition: gl.h:1545
#define CERT_SECTION_TYPE_ANY
Definition: imagehlp.h:47
#define INVALID_HANDLE_VALUE
Definition: compat.h:391
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
#define FILE_SHARE_READ
Definition: compat.h:125
static char test_dll_path[MAX_PATH]
Definition: integrity.c:32
unsigned int BOOL
Definition: ntddk_ex.h:94
#define GENERIC_WRITE
Definition: nt_native.h:90
smooth NULL
Definition: ftsmooth.c:416
GLuint index
Definition: glext.h:6031
#define OPEN_EXISTING
Definition: compat.h:426
unsigned long DWORD
Definition: ntddk_ex.h:95
int ret
#define FILE_ATTRIBUTE_NORMAL
Definition: compat.h:126
#define GENERIC_READ
Definition: compat.h:124
_In_ HANDLE hFile
Definition: mswsock.h:90
#define ok(value,...)
Definition: atltest.h:57
#define skip(...)
Definition: atltest.h:64
#define CreateFileA(a, b, c, d, e, f, g)
Definition: compat.h:399

Referenced by START_TEST().

Variable Documentation

◆ cb

DWORD cb

Definition at line 41 of file integrity.c.

Referenced by _bdf_readstream(), AboutProtocol_Read(), accumulating_stream_output(), add_ms_root_certs(), add_properties(), AllocADsMem(), AMFilterData_ParseFilterData(), AVISplitter_ProcessIndex(), AVISplitter_ProcessODML(), AVISplitter_ProcessStreamList(), BindProtocol_Read(), cabinet_alloc(), cabinet_read(), cabinet_read_stream(), cabinet_write(), cert_mgr_dlg_proc(), CertContext_CopyParam(), check_convertible(), check_wellknown_name(), compareStore(), _com_util::ConvertBSTRToString(), create_show_list(), CardWindow::CreateButton(), CRYPT_findPropID(), CRYPT_ReadContextProp(), cvid_v1_15(), cvid_v1_16(), cvid_v1_24(), cvid_v1_32(), cvid_v4_15(), cvid_v4_16(), cvid_v4_24(), cvid_v4_32(), d3dcompiler_parse_rdef(), d3dcompiler_parse_variables(), d3dcompiler_shader_reflection_GetVariableByName(), d3drm1_CreateUserVisual(), d3drm1_EnumerateObjects(), d3drm2_CreateUserVisual(), d3drm2_EnumerateObjects(), d3drm3_CreateUserVisual(), d3drm3_EnumerateObjects(), d3drm_animation1_AddDestroyCallback(), d3drm_animation1_DeleteDestroyCallback(), d3drm_animation2_AddDestroyCallback(), d3drm_animation2_DeleteDestroyCallback(), d3drm_device1_AddDestroyCallback(), d3drm_device1_AddUpdateCallback(), d3drm_device1_DeleteDestroyCallback(), d3drm_device1_DeleteUpdateCallback(), d3drm_device2_AddDestroyCallback(), d3drm_device2_AddUpdateCallback(), d3drm_device2_DeleteDestroyCallback(), d3drm_device2_DeleteUpdateCallback(), d3drm_device3_AddDestroyCallback(), d3drm_device3_AddUpdateCallback(), d3drm_device3_DeleteDestroyCallback(), d3drm_device3_DeleteUpdateCallback(), d3drm_device_win_AddDestroyCallback(), d3drm_device_win_DeleteDestroyCallback(), d3drm_face1_AddDestroyCallback(), d3drm_face1_DeleteDestroyCallback(), d3drm_face2_AddDestroyCallback(), d3drm_face2_DeleteDestroyCallback(), d3drm_frame1_AddDestroyCallback(), d3drm_frame1_AddMoveCallback(), d3drm_frame1_DeleteDestroyCallback(), d3drm_frame1_DeleteMoveCallback(), d3drm_frame1_Load(), d3drm_frame2_AddDestroyCallback(), d3drm_frame2_AddMoveCallback(), d3drm_frame2_AddMoveCallback2(), d3drm_frame2_DeleteDestroyCallback(), d3drm_frame2_DeleteMoveCallback(), d3drm_frame2_Load(), d3drm_frame3_AddDestroyCallback(), d3drm_frame3_AddMoveCallback(), d3drm_frame3_DeleteDestroyCallback(), d3drm_frame3_DeleteMoveCallback(), d3drm_frame3_Load(), d3drm_light_AddDestroyCallback(), d3drm_light_DeleteDestroyCallback(), d3drm_material_AddDestroyCallback(), d3drm_material_DeleteDestroyCallback(), d3drm_mesh_AddDestroyCallback(), d3drm_mesh_builder2_AddDestroyCallback(), d3drm_mesh_builder2_DeleteDestroyCallback(), d3drm_mesh_builder2_Load(), d3drm_mesh_builder3_AddDestroyCallback(), d3drm_mesh_builder3_DeleteDestroyCallback(), d3drm_mesh_builder3_Load(), d3drm_mesh_DeleteDestroyCallback(), d3drm_object_add_destroy_callback(), d3drm_object_delete_destroy_callback(), d3drm_texture1_AddDestroyCallback(), d3drm_texture1_DeleteDestroyCallback(), d3drm_texture2_AddDestroyCallback(), d3drm_texture2_DeleteDestroyCallback(), d3drm_texture3_AddDestroyCallback(), d3drm_texture3_DeleteDestroyCallback(), d3drm_texture3_SetDownsampleCallback(), d3drm_texture3_SetValidationCallback(), d3drm_viewport1_AddDestroyCallback(), d3drm_viewport1_DeleteDestroyCallback(), d3drm_viewport2_AddDestroyCallback(), d3drm_viewport2_DeleteDestroyCallback(), d3drm_wrap_AddDestroyCallback(), d3drm_wrap_DeleteDestroyCallback(), DdeAddData(), DdeCreateDataHandle(), ddraw7_EnumDisplayModes(), ddraw_surface7_EnumAttachedSurfaces(), ddraw_surface7_EnumOverlayZOrders(), DECLARE_INTERFACE_(), CardWindow::DeleteButton(), detail_dlg_proc(), dispex_traverse(), DlgMainProc(), do_searchW(), do_test_about_protocol(), downloadcb_create(), DuplicateString(), DuplicationString(), EditStreamCallback(), EnumDeviceDrivers(), EnumDirTree(), EnumDirTreeW(), EnumProcesses(), EnumProcessModules(), fci_get_checksum(), fci_read(), fci_write(), fdi_alloc(), fdi_mem_read(), fdi_mem_write(), fdi_read(), fdi_read_static(), fdi_write(), FileLockBytesImpl_LockRegion(), FileLockBytesImpl_ReadAt(), FileLockBytesImpl_UnlockRegion(), FileLockBytesImpl_WriteAt(), FileProtocol_Read(), fill_filter_data_information(), findPropID(), FNALLOC(), FNREAD(), FNWRITE(), format_enhanced_key_usage_value(), format_hex_string(), format_string_callback(), free_constant_buffer(), FtpProtocol_Read(), GdipGetImageThumbnail(), get_cert_property_as_string(), CExtractIcon::GetIconLocation(), GetModuleInformation(), GetPerformanceInfo(), GetProcessMemoryInfo(), GetWsChanges(), GopherProtocol_Read(), HEXEDIT_Copy(), HEXEDIT_Paste(), HGLOBALLockBytesImpl_ReadAt(), HGLOBALLockBytesImpl_WriteAt(), HGLOBALStreamImpl_CopyTo(), HGLOBALStreamImpl_Read(), HGLOBALStreamImpl_Write(), HLPFILE_BPTreeEnum(), horAcc8(), HTMLAnchorElement_traverse(), HTMLBodyElement_traverse(), HTMLButtonElement_traverse(), HTMLDocumentNode_traverse(), HTMLDOMNode_traverse(), HTMLFormElement_traverse(), HTMLFrameElement_traverse(), HTMLIFrame_traverse(), HTMLImgElement_traverse(), HTMLInputElement_traverse(), HTMLLinkElement_traverse(), HTMLObjectElement_traverse(), HTMLOptionElement_traverse(), HTMLScriptElement_traverse(), HTMLSelectElement_traverse(), HTMLStyleElement_traverse(), HTMLTable_traverse(), HTMLTableCell_traverse(), HTMLTableRow_traverse(), HTMLTextAreaElement_traverse(), ICGetInfo(), IFillLockBytes_FillAppend_Proxy(), IFillLockBytes_FillAppend_Stub(), IFillLockBytes_FillAt_Proxy(), IFillLockBytes_FillAt_Stub(), III_dequantize_sample(), ILockBytes_ReadAt_Proxy(), ILockBytes_ReadAt_Stub(), ILockBytes_WriteAt_Proxy(), ILockBytes_WriteAt_Stub(), IMalloc_fnAlloc(), IMalloc_fnGetSize(), IMalloc_fnRealloc(), IMAPIMalloc_fnAlloc(), IMAPIMalloc_fnRealloc(), init_layer3(), initFileFromData(), initialize_purpose_selection(), InitPropVariantFromBuffer(), InitVariantFromBuffer(), ISequentialStream_Read_Proxy(), ISequentialStream_Read_Stub(), ISequentialStream_Write_Proxy(), ISequentialStream_Write_Stub(), IStream_CopyTo_Proxy(), IStream_CopyTo_Stub(), IStream_fnCopyTo(), IStream_fnLockUnlockRegion(), IStream_fnRead(), IStream_fnWrite(), ITSProtocol_Read(), ITSS_IStream_Read(), IWICStreamImpl_CopyTo(), IWICStreamImpl_LockRegion(), IWICStreamImpl_Read(), IWICStreamImpl_UnlockRegion(), IWICStreamImpl_Write(), JoyConfig8Impl_EnumTypes(), MD_ComboBox_OnInitStorage(), MD_ListBox_OnInitStorage(), ME_AppendToHGLOBAL(), ME_ReadFromHGLOBALRTF(), ME_ReadFromHGLOBALUnicode(), ME_ReadFromRTFString(), mem_alloc(), MimeAlloc_Alloc(), MimeAlloc_Realloc(), MimeFilterProtocol_Read(), MimeHtmlProtocol_Read(), MimeProtocol_Read(), MkProtocol_Read(), mmTaskCreate(), MmuSetTrapHandler(), mp_prime_random_ex(), mxstream_Write(), NetBIOSEnumAdapters(), nfs41_handle_callback(), NoStatStreamImpl_CopyTo(), NoStatStreamImpl_Read(), NoStatStreamImpl_Write(), pdb_load_stream_name_table(), pdlgex_hook_proc(), printBytes(), Protocol_Read(), ProtocolEmul_Read(), ProtocolHandler_Read(), ProtocolSink_ReportData(), ProtocolStream_CopyTo(), ProtocolStream_LockRegion(), ProtocolStream_Read(), ProtocolStream_UnlockRegion(), ProtocolStream_Write(), QueryWorkingSet(), QueryWorkingSetEx(), read_key(), read_text_callback(), ReadChunkIntoExtra(), ReadExtraChunk(), refresh_details_view(), RegFindRecurse(), ResProtocol_Read(), RpcStream_Read(), RpcStream_Write(), rpn_exec_int(), SampleGrabber_ISampleGrabber_SetCallback(), save_base64(), save_der(), sc_cb_alloc(), sc_cb_read(), sc_cb_write(), show_store_certs(), START_TEST(), StgStreamImpl_CopyTo(), StgStreamImpl_Read(), StgStreamImpl_Write(), StorageImpl_CheckLockRange(), StorageImpl_Destroy(), StorageImpl_GrabLocks(), StorageImpl_LockOne(), StorageImpl_LockRegion(), StorageImpl_LockRegionSync(), StorageImpl_LockTransaction(), StorageImpl_UnlockRegion(), StorageImpl_UnlockTransaction(), stream_in(), stream_out(), Stream_Read(), StreamOnFileHandle_CopyTo(), StreamOnFileHandle_LockRegion(), StreamOnFileHandle_Read(), StreamOnFileHandle_UnlockRegion(), StreamOnFileHandle_Write(), StreamOnMemory_CopyTo(), StreamOnMemory_LockRegion(), StreamOnMemory_Read(), StreamOnMemory_UnlockRegion(), StreamOnMemory_Write(), StreamOnStreamRange_CopyTo(), StreamOnStreamRange_LockRegion(), StreamOnStreamRange_Read(), StreamOnStreamRange_UnlockRegion(), StreamOnStreamRange_Write(), sub_stream_CopyTo(), sub_stream_Read(), sym_register_cb(), SymEnumLines(), SymFindFileInPath(), SymFindFileInPathW(), SymRegisterFunctionEntryCallback(), SymRegisterFunctionEntryCallback64(), template_hook(), test_CoInternetQueryInfo(), test_copyto(), test_CreateWellKnownSid(), test_EM_GETMODIFY_esCallback(), test_EM_STREAMIN_esCallback(), test_EM_STREAMIN_esCallback2(), test_esCallback_written_1(), test_file_protocol_url(), test_ftp_protocol(), test_http_protocol_url(), test_pack_DISPLAY_DEVICEA(), test_pack_DISPLAY_DEVICEW(), test_pack_SHChangeDWORDAsIDList(), test_pack_SHChangeProductKeyAsIDList(), test_pack_SHITEMID(), test_pack_STARTUPINFOA(), test_pack_STARTUPINFOW(), test_pack_TTPOLYGONHEADER(), test_protocol_terminate(), test_protocol_url(), test_rasenum(), test_res_protocol(), test_status_callbacks(), Test_Stream_Read(), Test_Stream_Write(), test_WM_SETTEXT_esCallback(), TestLockBytes_ReadAt(), TestLockBytes_SetSize(), TestLockBytes_WriteAt(), teststream_Write(), Thunk_DDrawSurface3_EnumAttachedSurfaces(), Thunk_DDrawSurface3_EnumOverlayZOrders(), ThunkDirectDraw2_EnumDisplayModes(), ThunkDirectDraw2_EnumSurfaces(), ThunkDirectDraw4_EnumDisplayModes(), ThunkDirectDraw4_EnumSurfaces(), ThunkDirectDraw_EnumDisplayModes(), ThunkDirectDraw_EnumSurfaces(), WINHELP_RtfStreamIn(), WINTRUST_Alloc(), WINTRUST_ReAlloc(), ycc_rgb_convert(), and ycck_cmyk_convert().

◆ DWORD

Definition at line 35 of file integrity.c.

◆ hImageHlp

HMODULE hImageHlp
static

Definition at line 31 of file integrity.c.

Referenced by START_TEST().

◆ HMODULE

Definition at line 41 of file integrity.c.

◆ hPsapi

HMODULE hPsapi
static

Definition at line 31 of file integrity.c.

Referenced by init_pointers(), and START_TEST().

◆ LPMODULEINFO

Definition at line 41 of file integrity.c.

◆ LPWIN_CERTIFICATE

Definition at line 34 of file integrity.c.

◆ PDWORD

Definition at line 34 of file integrity.c.

◆ test_cert_data

const char test_cert_data[]
static

Definition at line 43 of file integrity.c.

Referenced by START_TEST().

◆ test_cert_data_2

const char test_cert_data_2[] = {0xDE,0xAD,0xBE,0xEF,0x01,0x02,0x03}
static

Definition at line 95 of file integrity.c.

Referenced by START_TEST().

◆ test_dll_path

◆ test_pe_executable

char test_pe_executable[]
static
Initial value:
=
{
0x4d,0x5a,0x90,0x00,0x03,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0xff,0xff,0x00,
0x00,0xb8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x80,0x00,0x00,0x00,0x0e,0x1f,0xba,0x0e,0x00,0xb4,0x09,0xcd,0x21,0xb8,0x01,
0x4c,0xcd,0x21,0x54,0x68,0x69,0x73,0x20,0x70,0x72,0x6f,0x67,0x72,0x61,0x6d,
0x20,0x63,0x61,0x6e,0x6e,0x6f,0x74,0x20,0x62,0x65,0x20,0x72,0x75,0x6e,0x20,
0x69,0x6e,0x20,0x44,0x4f,0x53,0x20,0x6d,0x6f,0x64,0x65,0x2e,0x0d,0x0d,0x0a,
0x24,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x50,0x45,0x00,0x00,0x4c,0x01,0x0f,
0x00,0xfd,0x38,0xc9,0x55,0x00,0x24,0x01,0x00,0xea,0x04,0x00,0x00,0xe0,0x00,
0x07,0x01,0x0b,0x01,0x02,0x18,0x00,0x1a,0x00,0x00,0x00,0x2c,0x00,0x00,0x00,
0x06,0x00,0x00,0xe0,0x14,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x30,0x00,0x00,
0x00,0x00,0x40,0x00,0x00,0x10,0x00,0x00,0x00,0x02,0x00,0x00,0x04,0x00,0x00,
0x00,0x01,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,
0x01,0x00,0x00,0x04,0x00,0x00, 0x11,0xEF,0xCD,0xAB,0x03,0x00,
0x00,0x00,0x00,0x00,0x20,0x00,0x00,0x10,0x00,0x00,0x00,0x00,0x10,0x00,0x00,
0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x00,0x00,0x00
}

Definition at line 97 of file integrity.c.

Referenced by test_pe_checksum().

◆ WORD

Definition at line 35 of file integrity.c.