Ignore:
Timestamp:
Apr 23, 2010, 8:45:12 PM (15 years ago)
Author:
george
Message:
  • Přidáno: WowLua pro 3.3.3a.
  • Opraveno: Nástroj pro generování WowLua byl zobecněn a ověřen vůči 3.3.0a, 3.3.2 a 3.3.3a.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • tools/wow_patcher/wowpatcher.pas

    r406 r473  
    1818  TWoWPatcher = class(TCustomApplication)
    1919  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);
    2122    procedure WriteHexData(Data: array of Byte; From, Count: Integer);
    2223  protected
     
    7475end;
    7576
    76 function TWoWPatcher.FindSequence(Data, Sequence: array of Byte; Position: Integer = 0): Integer;
     77function TWoWPatcher.FindSequence(Data: array of Byte; Sequence: array of Integer; Position: Integer = 0): Integer;
    7778var
    7879  I: Integer;
     
    8788      Same := True;
    8889      for II := 0 to High(Sequence) do begin
    89         if Data[I + II] <> Sequence[II] then begin
     90        if (Sequence[II] <> -1) and (Data[I + II] <> Sequence[II]) then begin
    9091          Same := False;
    9192          Break;
     
    9899    end;
    99100  end;
     101end;
     102
     103procedure TWoWPatcher.WriteHexData(Data: array of Integer; From, Count: Integer);
     104var
     105  I: Integer;
     106begin
     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 ');
    100111end;
    101112
     
    116127  I: Integer;
    117128const
    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);
    120131begin
    121132  OriginalFile := TFileStream.Create(FileName, fmOpenRead);
Note: See TracChangeset for help on using the changeset viewer.