//***************************************************************************** //* prefix S equals search data, R equals replace data * //* Two bytes per character: * //* 0x00xx means match or replace * //* 0xFFFF means we don't care what the byte is * //* 0xFFFE means end of search string * //* The first byte is the current byte offset to compare within the string * //* The second byte contains the status of the search * //***************************************************************************** #define PATCH_TOTAL 3 uChar sd1[] = {0x02, \ 0x00, 0x83, 0x00, 0x78, \ 0x00, 0xf8, 0x00, 0x00, \ 0x00, 0x0f, 0x00, 0x85, \ 0x00, 0xe9, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, \ 0x00, 0xc7, 0x00, 0x45, 0xFF, 0xFE}; uChar rd1[] = {0x02, \ 0xff, 0xff, 0xff, 0xff, \ 0xff, 0xff, 0xff, 0xff, \ 0x00, 0xe9, 0x00, 0xea, \ 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0xff, 0xff, \ 0xff, 0xff, 0xff, 0xff, 0xFF, 0xFE}; uChar sd2[] = {0x02, \ 0x00, 0x8b, 0x00, 0x54, \ 0x00, 0x24, 0x00, 0x04, \ 0x00, 0x57, 0x00, 0x85, \ 0x00, 0xd2, 0x00, 0x74, \ 0x00, 0x2d, 0x00, 0x80, \ 0x00, 0x3a, 0x00, 0x00, 0xFF, 0xFE}; uChar rd2[] = {0x02, \ 0x00, 0xb8, 0x00, 0x01, \ 0x00, 0x00, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0xc3, \ 0xff, 0xff, 0xff, 0xff, \ 0xff, 0xff, 0xff, 0xff, \ 0xff, 0xff, 0xff, 0xff, 0xFF, 0xFE}; uChar sd3[] = {0x02, \ 0x00, 0x83, 0x00, 0x7c, \ 0x00, 0x24, 0x00, 0x14, \ 0x00, 0x07, 0x00, 0x74, \ 0x00, 0x1a, 0x00, 0x33, \ 0x00, 0xc0, 0x00, 0x5d, \ 0x00, 0x5f, 0x00, 0x5e, \ 0x00, 0x5b, 0x00, 0x81, \ 0x00, 0xc4, 0x00, 0x18, \ 0x00, 0x12, 0xFF, 0xFE}; uChar rd3[] = {0x02, \ 0x00, 0xc7, 0x00, 0x44, \ 0xff, 0xff, 0xff, 0xff, \ 0xff, 0xff, 0x00, 0x00, \ 0x00, 0x00, 0x00, 0x00, \ 0x00, 0xeb, 0x00, 0x17, \ 0xff, 0xff, 0xff, 0xff, \ 0xff, 0xff, 0xff, 0xff, \ 0xff, 0xff, 0xff, 0xff, \ 0xff, 0xff, 0xFF, 0xFE}; //***************************************************************************** //* The list of pointers to the search and replace data * //***************************************************************************** const uChar *Patch1[] = {(uChar *)sd1, (uChar *)rd1, \ (uChar *)sd2, (uChar *)rd2, \ (uChar *)sd3, (uChar *)rd3, 0}; //***************************************************************************** //* A list of files to search and replace data in * //* Note: PatchData is compared in every file (so make unique). * //***************************************************************************** struct _patch_info_ { char *FileName; uChar **pArray; } PatchData[] = { {"hl.exe", Patch1}, {0, 0} };