Changeset 490 for tools/wow_patcher
- Timestamp:
- Sep 10, 2010, 6:50:32 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tools/wow_patcher/wowpatcher.pas
r489 r490 39 39 40 40 procedure TWoWPatcher.DoRun; 41 var42 ErrorMsg: String;43 41 begin 44 42 WriteLn('wowpatcher ' + Version + ' ' + ReleaseDate); … … 134 132 NotValid: Boolean; 135 133 const 134 // -1 means any byte value 136 135 StartSequence: array[0..15] of Integer = ($8D, $4D, $E8, $E8, -1, -1, -1, -1, $5B, $8B, $E5, $5D, $C3, $8D, $49, $00); 137 136 StartSequence2: array[0..15] of Integer = ($88, $1D, -1, -1, -1, -1, $E8, -1, -1, -1, -1, $5B, $8B, $E5, $5D, $C3); 138 137 begin 139 try 140 NewFile := TFileStream.Create(NewFileName, fmCreate); 138 if not FileExists(FileName) then begin 139 WriteLn(Format('File %s not found', [FileName])); 140 Exit; 141 end; 141 142 try 142 143 OriginalFile := TFileStream.Create(FileName, fmOpenRead); … … 180 181 end; 181 182 WriteLn; 182 end else WriteLn('not found'); 183 end else begin 184 WriteLn('not found'); 185 Exit; 186 end; 183 187 184 188 WriteLn; … … 215 219 end; 216 220 WriteLn; 217 end else WriteLn('not found'); 218 219 NewFile.WriteBuffer(Buffer[0], Length(Buffer)); 221 end else begin 222 WriteLn('not found'); 223 Exit; 224 end; 225 226 try 227 WriteLn(Format('Patched file %s created', [NewFileName])); 228 NewFile := TFileStream.Create(NewFileName, fmCreate); 229 if Length(Buffer) > 0 then 230 NewFile.WriteBuffer(Buffer[0], Length(Buffer)); 220 231 finally 221 232 NewFile.Free;
Note:
See TracChangeset
for help on using the changeset viewer.