ReactOS 0.4.15-dev-6662-g1b3eed5
mspatcha.c File Reference
#include <windows.h>
#include "wine/test.h"
#include <patchapi.h>
Include dependency graph for mspatcha.c:

Go to the source code of this file.

Classes

struct  _bin_file
 
struct  _patch_data
 

Macros

#define WIN32_NO_STATUS
 
#define MAKE_BIN(data_)   { data_, sizeof(data_) }
 
#define compare_file(filename, data, len, test_name)   compare_file_(filename, data, len, test_name, __LINE__)
 

Typedefs

typedef struct _bin_file bin_file
 
typedef struct _patch_data patch_data
 

Functions

BOOL extract2 (char *filename, const unsigned char *data, size_t len)
 
BOOL extract (char *filename, const bin_file *bin)
 
HANDLE open_file (char *filename, BOOL bWrite)
 
void compare_file_ (char *filename, const unsigned char *data, size_t len, const char *test_name, int line)
 
static void validate_signature (const char *casename, const char *fieldname, const bin_file *bin, const char *expected)
 
unsigned int crc32 (unsigned int seed, unsigned char *msg, unsigned int msglen)
 
static void validate_patch (patch_data *current)
 
static void apply_patch (patch_data *current)
 
void test_one (patch_data *current)
 
 START_TEST (mspatcha)
 

Variables

unsigned char in1_bin [8]
 
unsigned char out1_bin [26]
 
unsigned char patch1_bin [75]
 
unsigned char patch1_header_bin [31]
 
unsigned char in2_bin [25]
 
unsigned char out2_bin [25]
 
unsigned char patch2_bin [75]
 
unsigned char patch2_header_bin [31]
 
unsigned char in3_bin [138]
 
unsigned char out3_bin [152]
 
unsigned char patch3_bin [88]
 
unsigned char patch3_header_bin [32]
 
char temp_path [MAX_PATH]
 
static const unsigned int crc_32_tab []
 
static patch_data data []
 

Macro Definition Documentation

◆ compare_file

#define compare_file (   filename,
  data,
  len,
  test_name 
)    compare_file_(filename, data, len, test_name, __LINE__)

Definition at line 209 of file mspatcha.c.

◆ MAKE_BIN

#define MAKE_BIN (   data_)    { data_, sizeof(data_) }

Definition at line 121 of file mspatcha.c.

◆ WIN32_NO_STATUS

#define WIN32_NO_STATUS

Definition at line 8 of file mspatcha.c.

Typedef Documentation

◆ bin_file

◆ patch_data

Function Documentation

◆ apply_patch()

static void apply_patch ( patch_data current)
static

Definition at line 343 of file mspatcha.c.

344{
345 char patchname[MAX_PATH], targetname[MAX_PATH], outputname[MAX_PATH];
346 BOOL bResult;
347 DWORD dwErr;
348 HANDLE hPatch, hTarget, hFind;
349 WIN32_FIND_DATAA wfd = { sizeof(wfd) };
350
351 if (!GetTempFileNameA(temp_path, "MPO", 0, outputname))
352 {
353 ok(0, "GetTempFileNameA failed %lu, %s\n", GetLastError(), current->name);
354 return;
355 }
356 DeleteFileA(outputname);
357
358 if (!extract(patchname, &current->patch))
359 return;
360 if (!extract(targetname, &current->input))
361 {
362 DeleteFileA(patchname);
363 return;
364 }
365 // There is a bug in 2k3, where calling 'TestApplyPatchToFileA' gives an AV...
366#if 0
367 bResult = TestApplyPatchToFileA(patchname, targetname, 0);
368#else
369 hPatch = open_file(patchname, FALSE);
370 hTarget = open_file(targetname, FALSE);
371 bResult = TestApplyPatchToFileByHandles(hPatch, hTarget, 0);
372 CloseHandle(hPatch);
373 CloseHandle(hTarget);
374#endif
375 ok(bResult, "TestApplyPatchToFileA failed %lu, %s\n", GetLastError(), current->name);
376 // Files are not touched
377 compare_file(patchname, current->patch.data, current->patch.len, current->name);
378 compare_file(targetname, current->input.data, current->input.len, current->name);
379 DeleteFileA(patchname);
380 DeleteFileA(targetname);
381
382
383 if (!extract2(patchname, current->patch.data, current->patch.len -1))
384 return;
385 if (!extract(targetname, &current->input))
386 {
387 DeleteFileA(patchname);
388 return;
389 }
390 hPatch = open_file(patchname, FALSE);
391 hTarget = open_file(targetname, FALSE);
392 bResult = TestApplyPatchToFileByHandles(hPatch, hTarget, 0);
394 CloseHandle(hPatch);
395 CloseHandle(hTarget);
396 ok(!bResult, "TestApplyPatchToFileA succeeded, %s\n", current->name);
397 ok(dwErr == ERROR_PATCH_CORRUPT, "TestApplyPatchToFileA GetLastError %lx, %s\n", dwErr, current->name);
398 // Files are not touched
399 compare_file(patchname, current->patch.data, current->patch.len - 1, current->name);
400 compare_file(targetname, current->input.data, current->input.len, current->name);
401 DeleteFileA(patchname);
402 DeleteFileA(targetname);
403
404 if (!extract(patchname, &current->patch))
405 return;
406 if (!extract2(targetname, current->input.data, current->input.len -1))
407 {
408 DeleteFileA(patchname);
409 return;
410 }
411 hPatch = open_file(patchname, FALSE);
412 hTarget = open_file(targetname, FALSE);
413 bResult = TestApplyPatchToFileByHandles(hPatch, hTarget, 0);
415 CloseHandle(hPatch);
416 CloseHandle(hTarget);
417 ok(!bResult, "TestApplyPatchToFileA succeeded, %s\n", current->name);
418 ok(dwErr == ERROR_PATCH_WRONG_FILE, "TestApplyPatchToFileA GetLastError %lx, %s\n", dwErr, current->name);
419 // Files are not touched
420 compare_file(patchname, current->patch.data, current->patch.len, current->name);
421 compare_file(targetname, current->input.data, current->input.len -1, current->name);
422 DeleteFileA(patchname);
423 DeleteFileA(targetname);
424
425 if (!extract(patchname, &current->patch))
426 return;
427 if (!extract(targetname, &current->input))
428 {
429 DeleteFileA(patchname);
430 return;
431 }
432 bResult = ApplyPatchToFileA(patchname, targetname, outputname, APPLY_OPTION_TEST_ONLY);
433
434 ok(bResult, "ApplyPatchToFileA failed %lu, %s\n", GetLastError(), current->name);
435 // Files are not touched
436 compare_file(patchname, current->patch.data, current->patch.len, current->name);
437 compare_file(targetname, current->input.data, current->input.len, current->name);
438 // W2k3 creates an empty file, W10 does not create a file
439 hFind = FindFirstFileA(outputname, &wfd);
440 ok(hFind == INVALID_HANDLE_VALUE || wfd.nFileSizeLow == 0, "Got a (non-empty) file, %s\n", current->name);
441 if (hFind != INVALID_HANDLE_VALUE)
442 FindClose(hFind);
443 DeleteFileA(patchname);
444 DeleteFileA(targetname);
445 DeleteFileA(outputname);
446
447 if (!extract(patchname, &current->patch))
448 return;
449 if (!extract(targetname, &current->input))
450 {
451 DeleteFileA(patchname);
452 return;
453 }
454 bResult = ApplyPatchToFileA(patchname, targetname, outputname, 0);
455 ok(bResult, "ApplyPatchToFileA failed %lu, %s\n", GetLastError(), current->name);
456 // Files are not touched
457 compare_file(patchname, current->patch.data, current->patch.len, current->name);
458 compare_file(targetname, current->input.data, current->input.len, current->name);
459 // One output file
460 compare_file(outputname, current->output.data, current->output.len, current->name);
461 DeleteFileA(patchname);
462 DeleteFileA(targetname);
463 DeleteFileA(outputname);
464}
#define ok(value,...)
Definition: atltest.h:57
DWORD dwErr
Definition: service.c:36
#define FALSE
Definition: types.h:117
#define CloseHandle
Definition: compat.h:739
#define INVALID_HANDLE_VALUE
Definition: compat.h:731
#define MAX_PATH
Definition: compat.h:34
BOOL WINAPI DeleteFileA(IN LPCSTR lpFileName)
Definition: delete.c:24
HANDLE WINAPI FindFirstFileA(IN LPCSTR lpFileName, OUT LPWIN32_FIND_DATAA lpFindFileData)
Definition: find.c:263
BOOL WINAPI FindClose(HANDLE hFindFile)
Definition: find.c:502
UINT WINAPI GetTempFileNameA(IN LPCSTR lpPathName, IN LPCSTR lpPrefixString, IN UINT uUnique, OUT LPSTR lpTempFileName)
Definition: filename.c:26
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
struct task_struct * current
Definition: linux.c:32
char temp_path[MAX_PATH]
Definition: mspatcha.c:123
#define compare_file(filename, data, len, test_name)
Definition: mspatcha.c:209
BOOL extract2(char *filename, const unsigned char *data, size_t len)
Definition: mspatcha.c:125
BOOL extract(char *filename, const bin_file *bin)
Definition: mspatcha.c:158
HANDLE open_file(char *filename, BOOL bWrite)
Definition: mspatcha.c:163
BOOL WINAPI ApplyPatchToFileA(LPCSTR patch_file, LPCSTR old_file, LPCSTR new_file, ULONG apply_flags)
BOOL WINAPI TestApplyPatchToFileByHandles(HANDLE patch_file, HANDLE old_file, ULONG apply_flags)
BOOL WINAPI TestApplyPatchToFileA(LPCSTR patch_file, LPCSTR old_file, ULONG apply_flags)
#define ERROR_PATCH_WRONG_FILE
Definition: patchapi.h:38
#define ERROR_PATCH_CORRUPT
Definition: patchapi.h:36
#define APPLY_OPTION_TEST_ONLY
Definition: patchapi.h:28
DWORD WINAPI GetLastError(void)
Definition: except.c:1042

Referenced by test_one().

◆ compare_file_()

void compare_file_ ( char filename,
const unsigned char data,
size_t  len,
const char test_name,
int  line 
)

Definition at line 171 of file mspatcha.c.

172{
173 char* buf;
174 size_t size;
177
179 {
180 ok_(__FILE__, line)(0, "Unable to open file %s(%lu), %s\n", filename, GetLastError(), test_name);
181 return;
182 }
184 ok(size == len, "Filesize is %u instead of %u, %s\n", size, len, test_name);
185
186 buf = malloc(size);
187 if (buf)
188 {
189 DWORD dwRead;
190 if (ReadFile(hFile, buf, (DWORD)size, &dwRead, NULL) && dwRead == size)
191 {
192 ok(!memcmp(buf, data, min(size,len)), "Data mismatch, %s\n", test_name);
193 }
194 else
195 {
196 ok_(__FILE__, line)(0, "Unable to read %s(%lu), %s\n", filename, GetLastError(), test_name);
197 }
198
199 free(buf);
200 }
201 else
202 {
203 ok_(__FILE__, line)(0, "Unable to allocate %u, %s\n", size, test_name);
204 }
205
207}
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
Definition: utclib.c:112
#define ok_(x1, x2)
Definition: atltest.h:61
#define free
Definition: debug_ros.c:5
#define malloc
Definition: debug_ros.c:4
#define NULL
Definition: types.h:112
#define OPEN_EXISTING
Definition: compat.h:775
#define ReadFile(a, b, c, d, e)
Definition: compat.h:742
#define CreateFileA(a, b, c, d, e, f, g)
Definition: compat.h:740
#define GENERIC_READ
Definition: compat.h:135
#define FILE_SHARE_READ
Definition: compat.h:136
DWORD WINAPI GetFileSize(HANDLE hFile, LPDWORD lpFileSizeHigh)
Definition: fileinfo.c:331
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLsizeiptr size
Definition: glext.h:5919
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
GLenum GLsizei len
Definition: glext.h:6722
const char * filename
Definition: ioapi.h:137
static const char * test_name
Definition: run.c:177
#define min(a, b)
Definition: monoChain.cc:55
_In_ HANDLE hFile
Definition: mswsock.h:90
#define FILE_ATTRIBUTE_READONLY
Definition: nt_native.h:702
Definition: parser.c:49

◆ crc32()

unsigned int crc32 ( unsigned int  seed,
unsigned char msg,
unsigned int  msglen 
)

Definition at line 319 of file mspatcha.c.

320{
321 unsigned int rem = seed;
322 unsigned int i;
323
324 for (i = 0; i < msglen; i++)
325 {
326 rem = crc_32_tab[(rem ^ msg[i]) & 0xff] ^ (rem >> 8);
327 }
328
329 return rem;
330}
#define msg(x)
Definition: auth_time.c:54
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
static const unsigned int crc_32_tab[]
Definition: mspatcha.c:272

◆ extract()

BOOL extract ( char filename,
const bin_file bin 
)

Definition at line 158 of file mspatcha.c.

159{
160 return extract2(filename, bin->data, bin->len);
161}
static struct _PeImage bin

Referenced by apply_patch(), and validate_signature().

◆ extract2()

BOOL extract2 ( char filename,
const unsigned char data,
size_t  len 
)

Definition at line 125 of file mspatcha.c.

126{
128 BOOL bRet;
129 DWORD dwWritten;
130
131 if (!GetTempFileNameA(temp_path, "mpa", 0, filename))
132 {
133 ok(0, "GetTempFileNameA failed %lu\n", GetLastError());
134 return FALSE;
135 }
136
139 {
140 ok(0, "CreateFileA failed %lu\n", GetLastError());
142 return FALSE;
143 }
144
145 bRet = WriteFile(hFile, data, (DWORD)len, &dwWritten, NULL);
147 bRet = bRet && (dwWritten == len);
148
149 if (!bRet)
150 {
151 ok(0, "WriteFile failed %lu\n", GetLastError());
153 }
154
155 return bRet;
156}
#define FILE_ATTRIBUTE_NORMAL
Definition: compat.h:137
BOOL WINAPI WriteFile(IN HANDLE hFile, IN LPCVOID lpBuffer, IN DWORD nNumberOfBytesToWrite OPTIONAL, OUT LPDWORD lpNumberOfBytesWritten, IN LPOVERLAPPED lpOverlapped OPTIONAL)
Definition: rw.c:24
#define CREATE_ALWAYS
Definition: disk.h:72
#define GENERIC_WRITE
Definition: nt_native.h:90

Referenced by apply_patch(), and extract().

◆ open_file()

HANDLE open_file ( char filename,
BOOL  bWrite 
)

Definition at line 163 of file mspatcha.c.

164{
165 DWORD dwAccess = GENERIC_READ | (bWrite ? GENERIC_WRITE : 0);
168 dwAttr, NULL);
169}

Referenced by apply_patch().

◆ START_TEST()

START_TEST ( mspatcha  )

Definition at line 509 of file mspatcha.c.

510{
511 size_t n;
512
514
515 for (n = 0; n < _countof(data); ++n)
516 {
517 test_one(data + n);
518 }
519}
DWORD WINAPI GetTempPathA(IN DWORD nBufferLength, OUT LPSTR lpBuffer)
Definition: path.c:2054
GLdouble n
Definition: glext.h:7729
void test_one(patch_data *current)
Definition: mspatcha.c:467
#define _countof(array)
Definition: sndvol32.h:68

◆ test_one()

void test_one ( patch_data current)

Definition at line 467 of file mspatcha.c.

468{
469 validate_signature(current->name, "input", &current->input, current->input_signature);
470 validate_signature(current->name, "output", &current->output, current->output_signature);
473}
static void apply_patch(patch_data *current)
Definition: mspatcha.c:343
static void validate_patch(patch_data *current)
Definition: mspatcha.c:332
static void validate_signature(const char *casename, const char *fieldname, const bin_file *bin, const char *expected)
Definition: mspatcha.c:211

Referenced by START_TEST().

◆ validate_patch()

static void validate_patch ( patch_data current)
static

Definition at line 332 of file mspatcha.c.

333{
334 UINT crc;
335
336 crc = crc32(~0, current->patch.data, (UINT)current->patch.len);
337 ok(crc == 0, "Invalid patch crc 0x%x for %s\n", crc, current->name);
338
339 crc = crc32(~0, current->patch_header.data, (UINT)current->patch_header.len);
340 ok(crc == 0, "Invalid patch_header crc 0x%x for %s\n", crc, current->name);
341}
#define crc32(crc, buf, len)
Definition: inflate.c:1081
unsigned int UINT
Definition: ndis.h:50

Referenced by test_one().

◆ validate_signature()

static void validate_signature ( const char casename,
const char fieldname,
const bin_file bin,
const char expected 
)
static

Definition at line 211 of file mspatcha.c.

212{
213 char filename[MAX_PATH];
216 unsigned char data[0x100];
217 char signature[0x20] = {0};
218 WCHAR signatureW[0x20] = {0};
219 BOOL bResult;
220
221 memset(signature, 0xaa, sizeof(signature));
222 memcpy(data, bin->data, bin->len);
223
224 if (!extract(filename, bin))
225 return;
226
227 memset(signature, 0xaa, sizeof(signature)-1);
228 bResult = GetFilePatchSignatureA(filename, 0, NULL, 0, NULL, 0, NULL, sizeof(signature), signature);
229 ok(bResult, "GetFilePatchSignatureA failed %lu, %s.%s\n", GetLastError(), casename, fieldname);
230 if (bResult)
231 {
232 // Signature is crc32 of data
233 ok(!_stricmp(expected, signature), "Got %s for %s.%s\n", signature, casename, fieldname);
234 }
235
236 memset(signature, 0xaa, sizeof(signature)-1);
237 memset(signatureW, 0xaa, sizeof(signatureW)-sizeof(WCHAR));
238 // Widechar version has a widechar signature
240 bResult = GetFilePatchSignatureW(filenameW, 0, NULL, 0, NULL, 0, NULL, sizeof(signatureW), signatureW);
241 ok(bResult, "GetFilePatchSignatureW failed %lu, %s.%s\n", GetLastError(), casename, fieldname);
242 if (bResult)
243 {
244 WideCharToMultiByte(CP_ACP, 0, signatureW, -1, signature, _countof(signature), NULL, NULL);
245 // Signature is crc32 of data
246 ok(!_stricmp(expected, signature), "Got %s for %s.%s\n", signature, casename, fieldname);
247 }
248
249 memset(signature, 0xaa, sizeof(signature)-1);
250 // 'Handle' version has ansi signature
252 ok(hFile != INVALID_HANDLE_VALUE, "Unable to open file %lu\n", GetLastError());
254 {
255 bResult = GetFilePatchSignatureByHandle(hFile, 0, NULL, 0, NULL, 0, NULL, sizeof(signature), signature);
256 ok(bResult, "GetFilePatchSignatureByHandle failed %lu, %s.%s\n", GetLastError(), casename, fieldname);
257 if (bResult)
258 {
259 // Signature is crc32 of data
260 ok(!_stricmp(expected, signature), "Got %s for %s.%s\n", signature, casename, fieldname);
261 }
262
264 }
265
267}
#define _stricmp
Definition: cat.c:22
#define CP_ACP
Definition: compat.h:109
#define WideCharToMultiByte
Definition: compat.h:111
#define MultiByteToWideChar
Definition: compat.h:110
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
static const WCHAR filenameW[]
Definition: amstream.c:41
BOOL expected
Definition: store.c:2063
BOOL WINAPI GetFilePatchSignatureW(LPCWSTR filename, ULONG flags, PVOID data, ULONG ignore_range_count, PPATCH_IGNORE_RANGE ignore_range, ULONG retain_range_count, PPATCH_RETAIN_RANGE retain_range, ULONG bufsize, PVOID buffer)
BOOL WINAPI GetFilePatchSignatureByHandle(HANDLE hFile, ULONG flags, PVOID data, ULONG ignore_range_count, PPATCH_IGNORE_RANGE ignore_range, ULONG retain_range_count, PPATCH_RETAIN_RANGE retain_range, ULONG bufsize, PVOID buffer)
BOOL WINAPI GetFilePatchSignatureA(LPCSTR filename, ULONG flags, PVOID data, ULONG ignore_range_count, PPATCH_IGNORE_RANGE ignore_range, ULONG retain_range_count, PPATCH_RETAIN_RANGE retain_range, ULONG bufsize, PVOID buffer)
#define FILE_SHARE_WRITE
Definition: nt_native.h:681
#define memset(x, y, z)
Definition: compat.h:39
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by test_one().

Variable Documentation

◆ crc_32_tab

const unsigned int crc_32_tab[]
static

Definition at line 272 of file mspatcha.c.

Referenced by crc32().

◆ data

patch_data data[]
static
Initial value:
=
{
{
"in1_text",
"99e5365e",
"f651d108",
},
{
"in2_binary",
"fc54c21d",
"028aa0fa",
},
{
"in3_compression",
"f10a52d9",
"411dd8f9",
},
}
#define MAKE_BIN(data_)
Definition: mspatcha.c:121
unsigned char out2_bin[25]
Definition: mspatcha.c:44
unsigned char in1_bin[8]
Definition: mspatcha.c:16
unsigned char patch1_bin[75]
Definition: mspatcha.c:25
unsigned char out3_bin[152]
Definition: mspatcha.c:76
unsigned char patch2_bin[75]
Definition: mspatcha.c:49
unsigned char patch3_bin[88]
Definition: mspatcha.c:89
unsigned char patch2_header_bin[31]
Definition: mspatcha.c:57
unsigned char in2_bin[25]
Definition: mspatcha.c:39
unsigned char patch3_header_bin[32]
Definition: mspatcha.c:98
unsigned char out1_bin[26]
Definition: mspatcha.c:20
unsigned char patch1_header_bin[31]
Definition: mspatcha.c:33
unsigned char in3_bin[138]
Definition: mspatcha.c:64

Definition at line 477 of file mspatcha.c.

◆ in1_bin

unsigned char in1_bin[8]
Initial value:
=
{
0x74, 0x65, 0x73, 0x74, 0x64, 0x61, 0x74, 0x61,
}

Definition at line 16 of file mspatcha.c.

◆ in2_bin

unsigned char in2_bin[25]
Initial value:
=
{
0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff, 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0xaa,
0x00, 0xaa, 0x00, 0xaa, 0x00, 0xaa, 0x00, 0xaa, 0x00,
}

Definition at line 39 of file mspatcha.c.

◆ in3_bin

unsigned char in3_bin[138]
Initial value:
=
{
0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
}

Definition at line 64 of file mspatcha.c.

◆ out1_bin

unsigned char out1_bin[26]
Initial value:
=
{
0x74, 0x65, 0x73, 0x74, 0x20, 0x44, 0x61, 0x74, 0x61, 0x0d, 0x0a, 0x57, 0x69, 0x74, 0x68, 0x20,
0x73, 0x6f, 0x6d, 0x65, 0x20, 0x65, 0x78, 0x74, 0x72, 0x61,
}

Definition at line 20 of file mspatcha.c.

◆ out2_bin

unsigned char out2_bin[25]
Initial value:
=
{
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0xbb,
0x00, 0xbb, 0x00, 0xbb, 0x00, 0xbb, 0x00, 0xbb, 0x00,
}

Definition at line 44 of file mspatcha.c.

◆ out3_bin

unsigned char out3_bin[152]
Initial value:
=
{
0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb,
0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb,
0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb,
0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb,
0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb,
0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb,
0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb,
0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb,
}

Definition at line 76 of file mspatcha.c.

◆ patch1_bin

unsigned char patch1_bin[75]
Initial value:
=
{
0x50, 0x41, 0x31, 0x39, 0x01, 0x00, 0xc4, 0x00, 0x4e, 0x28, 0xb3, 0x5b, 0x9a, 0x08, 0xd1, 0x51,
0xf6, 0x01, 0xd2, 0x5e, 0x36, 0xe5, 0x99, 0x00, 0x00, 0x80, 0xac, 0x2a, 0x00, 0x00, 0x30, 0xa0,
0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x74, 0x65, 0x73,
0x74, 0x20, 0x44, 0x61, 0x74, 0x61, 0x0d, 0x0a, 0x57, 0x69, 0x74, 0x68, 0x20, 0x73, 0x6f, 0x6d,
0x65, 0x20, 0x65, 0x78, 0x74, 0x72, 0x61, 0xa7, 0x19, 0x4a, 0x68,
}

Definition at line 25 of file mspatcha.c.

◆ patch1_header_bin

unsigned char patch1_header_bin[31]
Initial value:
=
{
0x50, 0x41, 0x31, 0x39, 0x01, 0x00, 0xc4, 0x00, 0x4e, 0x28, 0xb3, 0x5b, 0x9a, 0x08, 0xd1, 0x51,
0xf6, 0x01, 0xd2, 0x5e, 0x36, 0xe5, 0x99, 0x00, 0x00, 0x80, 0xac, 0xe9, 0xf0, 0x53, 0xf7,
}

Definition at line 33 of file mspatcha.c.

◆ patch2_bin

unsigned char patch2_bin[75]
Initial value:
=
{
0x50, 0x41, 0x31, 0x39, 0x01, 0x00, 0xc4, 0x00, 0x62, 0x35, 0xb3, 0x5b, 0x99, 0xfa, 0xa0, 0x8a,
0x02, 0x01, 0x80, 0x1d, 0xc2, 0x54, 0xfc, 0x00, 0x00, 0x80, 0xac, 0x2a, 0x00, 0x00, 0x30, 0x90,
0x01, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0xbb, 0x00, 0xbb, 0x00,
0xbb, 0x00, 0xbb, 0x00, 0xbb, 0x00, 0x00, 0x14, 0x06, 0xeb, 0x61,
}

Definition at line 49 of file mspatcha.c.

◆ patch2_header_bin

unsigned char patch2_header_bin[31]
Initial value:
=
{
0x50, 0x41, 0x31, 0x39, 0x01, 0x00, 0xc4, 0x00, 0x62, 0x35, 0xb3, 0x5b, 0x99, 0xfa, 0xa0, 0x8a,
0x02, 0x01, 0x80, 0x1d, 0xc2, 0x54, 0xfc, 0x00, 0x00, 0x80, 0xac, 0xce, 0x5d, 0x8c, 0xed,
}

Definition at line 57 of file mspatcha.c.

◆ patch3_bin

unsigned char patch3_bin[88]
Initial value:
=
{
0x50, 0x41, 0x31, 0x39, 0x01, 0x00, 0xc4, 0x00, 0xb1, 0x57, 0xb3, 0x5b, 0x18, 0x81, 0xf9, 0xd8,
0x1d, 0x41, 0x01, 0xce, 0xd9, 0x52, 0x0a, 0xf1, 0x00, 0x00, 0x80, 0xb8, 0x36, 0x00, 0x00, 0x10,
0x82, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x0f, 0x22, 0xff, 0xff, 0x35, 0xd8,
0xfb, 0x8f, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x21, 0x03, 0xb7, 0x08, 0xf7, 0x7d,
0x7e, 0xdf, 0x40, 0x4c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x0d, 0x20, 0x7d, 0xbe,
0xf9, 0xbe, 0x68, 0xf4, 0x1f, 0x45, 0x3e, 0x35,
}

Definition at line 89 of file mspatcha.c.

◆ patch3_header_bin

unsigned char patch3_header_bin[32]
Initial value:
=
{
0x50, 0x41, 0x31, 0x39, 0x01, 0x00, 0xc4, 0x00, 0xb1, 0x57, 0xb3, 0x5b, 0x18, 0x81, 0xf9, 0xd8,
0x1d, 0x41, 0x01, 0xce, 0xd9, 0x52, 0x0a, 0xf1, 0x00, 0x00, 0x80, 0xb8, 0xbd, 0xeb, 0x70, 0xdd,
}

Definition at line 98 of file mspatcha.c.

◆ temp_path