Changeset 473 for tools/wow_patcher/wowpatcher.pas
- Timestamp:
- Apr 23, 2010, 8:45:12 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tools/wow_patcher/wowpatcher.pas
r406 r473 18 18 TWoWPatcher = class(TCustomApplication) 19 19 private 20 function FindSequence(Data, Sequence: array of Byte; Position: Integer = 0): Integer; 20 function FindSequence(Data: array of Byte; Sequence: array of Integer; Position: Integer = 0): Integer; 21 procedure WriteHexData(Data: array of Integer; From, Count: Integer); 21 22 procedure WriteHexData(Data: array of Byte; From, Count: Integer); 22 23 protected … … 74 75 end; 75 76 76 function TWoWPatcher.FindSequence(Data , Sequence: array of Byte; Position: Integer = 0): Integer;77 function TWoWPatcher.FindSequence(Data: array of Byte; Sequence: array of Integer; Position: Integer = 0): Integer; 77 78 var 78 79 I: Integer; … … 87 88 Same := True; 88 89 for II := 0 to High(Sequence) do begin 89 if Data[I + II] <> Sequence[II]then begin90 if (Sequence[II] <> -1) and (Data[I + II] <> Sequence[II]) then begin 90 91 Same := False; 91 92 Break; … … 98 99 end; 99 100 end; 101 end; 102 103 procedure TWoWPatcher.WriteHexData(Data: array of Integer; From, Count: Integer); 104 var 105 I: Integer; 106 begin 107 for I := From to From + Count - 1 do 108 if Data[I] <> -1 then 109 Write(IntToHex(Data[I], 2) + ' ') 110 else Write('XX '); 100 111 end; 101 112 … … 116 127 I: Integer; 117 128 const 118 StartSequence: array[0.. 9] of Byte = ($FF, $FF, $5B, $8B, $E5, $5D, $C3, $8D, $49, $00);119 StartSequence2: array[0.. 9] of Byte = ($E8, $71, $09, $FB, $FF, $5B, $8B, $E5, $5D, $C3);129 StartSequence: array[0..15] of Integer = ($8D, $4D, $E8, $E8, -1, -1, -1, -1, $5B, $8B, $E5, $5D, $C3, $8D, $49, $00); 130 StartSequence2: array[0..15] of Integer = ($88, $1D, -1, -1, -1, -1, $E8, -1, -1, -1, -1, $5B, $8B, $E5, $5D, $C3); 120 131 begin 121 132 OriginalFile := TFileStream.Create(FileName, fmOpenRead);
Note:
See TracChangeset
for help on using the changeset viewer.