22 #ifndef SCI_ENGINE_SCRIPT_PATCHES_H 23 #define SCI_ENGINE_SCRIPT_PATCHES_H 30 #define SIG_END 0xFFFF 31 #define SIG_MISMATCH 0xFFFE 32 #define SIG_COMMANDMASK 0xF000 33 #define SIG_VALUEMASK 0x0FFF 34 #define SIG_BYTEMASK 0x00FF 35 #define SIG_MAGICDWORD 0xF000 36 #define SIG_CODE_ADDTOOFFSET 0xE000 37 #define SIG_ADDTOOFFSET(_offset_) SIG_CODE_ADDTOOFFSET | (_offset_) 38 #define SIG_CODE_SELECTOR16 0x9000 39 #define SIG_SELECTOR16(_selectorID_) SIG_CODE_SELECTOR16 | SELECTOR_##_selectorID_ 40 #define SIG_CODE_SELECTOR8 0x8000 41 #define SIG_SELECTOR8(_selectorID_) SIG_CODE_SELECTOR8 | SELECTOR_##_selectorID_ 42 #define SIG_CODE_UINT16 0x1000 43 #define SIG_UINT16(_value_) SIG_CODE_UINT16 | ((_value_) & 0xFF), ((_value_) >> 8) 44 #define SIG_CODE_BYTE 0x0000 46 #define PATCH_END SIG_END 47 #define PATCH_COMMANDMASK SIG_COMMANDMASK 48 #define PATCH_VALUEMASK SIG_VALUEMASK 49 #define PATCH_BYTEMASK SIG_BYTEMASK 50 #define PATCH_CODE_ADDTOOFFSET SIG_CODE_ADDTOOFFSET 51 #define PATCH_ADDTOOFFSET(_offset_) SIG_CODE_ADDTOOFFSET | (_offset_) 52 #define PATCH_CODE_GETORIGINALBYTES 0xB000 53 #define PATCH_GETORIGINALBYTES(_offset_, _length_) PATCH_CODE_GETORIGINALBYTES | (_offset_), (uint16)(_length_) 54 #define PATCH_CODE_GETORIGINALBYTE 0xC000 55 #define PATCH_GETORIGINALBYTE(_offset_) PATCH_CODE_GETORIGINALBYTE | (_offset_), 0 56 #define PATCH_GETORIGINALBYTEADJUST(_offset_, _adjustValue_) PATCH_CODE_GETORIGINALBYTE | (_offset_), (uint16)(_adjustValue_) 57 #define PATCH_CODE_GETORIGINALUINT16 0xD000 58 #define PATCH_GETORIGINALUINT16(_offset_) PATCH_CODE_GETORIGINALUINT16 | (_offset_), 0 59 #define PATCH_GETORIGINALUINT16ADJUST(_offset_, _adjustValue_) PATCH_CODE_GETORIGINALUINT16 | (_offset_), (uint16)(_adjustValue_) 60 #define PATCH_CODE_SELECTOR16 SIG_CODE_SELECTOR16 61 #define PATCH_SELECTOR16(_selectorID_) SIG_CODE_SELECTOR16 | SELECTOR_##_selectorID_ 62 #define PATCH_CODE_SELECTOR8 SIG_CODE_SELECTOR8 63 #define PATCH_SELECTOR8(_selectorID_) SIG_CODE_SELECTOR8 | SELECTOR_##_selectorID_ 64 #define PATCH_CODE_UINT16 SIG_CODE_UINT16 65 #define PATCH_UINT16(_value_) SIG_CODE_UINT16 | ((_value_) & 0xFF), ((_value_) >> 8) 66 #define PATCH_CODE_BYTE SIG_CODE_BYTE 69 #define PATCH_VALUELIMIT 4096 74 const char *description;
76 const uint16 *signatureData;
77 const uint16 *patchData;
80 #define SCI_SIGNATUREENTRY_TERMINATOR { false, 0, NULL, 0, NULL, NULL } 98 void calculateMagicDWordAndVerify(
const char *signatureDescription,
const uint16 *signatureData,
bool magicDWordIncluded, uint32 &calculatedMagicDWord,
int &calculatedMagicDWordOffset);
101 void processScript(uint16 scriptNr,
SciSpan<byte> scriptData);
104 bool verifySignature(uint32 byteOffset,
const uint16 *signatureData,
const char *signatureDescription,
const SciSpan<const byte> &scriptData);
108 int32 findSignature(uint32 magicDWord,
int magicOffset,
const uint16 *signatureData,
const char *patchDescription,
const SciSpan<const byte> &scriptData);
124 Selector *_selectorIdTable;
131 #endif // SCI_ENGINE_WORKAROUNDS_H Definition: script_patches.h:82
Definition: script_patches.h:91
Definition: script_patches.h:71