Программы   Загрузка Партнерство   О компании Контакты  
 
                    
  Карта Сайта   
   

Пропатчить двоичный файл - заменить строку


// Replaces a string in a file with new string. 
// Ersetzt eine Zeichenkette in einer Datei mit einer anderen Zeichenkette. 

procedure TForm1.Button1Click(Sender: TObject); 
var 
  f: file; 
  l: Longint; 
  FileName, oldstring, newstring, s: string; 
begin 
  oldstring := 'old string'; 
  newstring := 'new string'; 
  FileName  := 'c:\YourFileName.xyz'; 
   
  s := oldstring; 
  AssignFile(f, FileName); 
  Reset(f, 1); 
  for l := 0 to FileSize(f) - Length(oldstring) - 1 do 
  begin 
    Application.ProcessMessages; 
    Seek(f, l); 
    BlockRead(f, oldstring[1], Length(oldstring)); 
    if oldstring = s then 
    begin 
      Seek(f, l); 
      BlockWrite(f, newstring[1], Length(newstring)); 
      ShowMessage('String successfully replaced!'); 
    end; 
    Application.ProcessMessages; 
  end; 
  CloseFile(f); 
end;

           


Автозагар в салоне отзывы . Фото Lada, автосалоны продажа Lada. Lada 4x4 5-дв. . Строительный инструмент: строительные инструменты интернет магазин. Бесцельно бродишь по интернету? . Интернет магазин одеяла: одеяло шелковое. .


Программы  |  Загрузка  |  Партнерство  |  О компании  |  Контакты

Copyright © LSD Software 2006 - 2011