Показать сообщение отдельно
  #3  
Старый 12.09.2009, 09:20
dissident dissident вне форума
Прохожий
 
Регистрация: 25.07.2007
Сообщения: 8
Репутация: 10
По умолчанию

Самый простой способ - влоб решить проблему:
Код:
var
  f : file of byte;
  c : integer;
  b : byte;
  wrd : string[7];
begin
  assignfile(f,'myfile.exe');
  reset(f);
  for c := 1 to filesize(f)-6 do
  begin
    seek(f,c); read(f,b); wrd[1] := chr(b);
    seek(f,c+1); read(f,b); wrd[2] := chr(b);
    seek(f,c+2); read(f,b); wrd[3] := chr(b);
    seek(f,c+3); read(f,b); wrd[4] := chr(b);
    seek(f,c+4); read(f,b); wrd[5] := chr(b);
    seek(f,c+5); read(f,b); wrd[6] := chr(b);
    seek(f,c+6); read(f,b); wrd[7] := chr(b);
    if wrd = 'example' then
    begin
       wrd := '7654321';
       seek(f,c); write(f,ord(wrd[1]));
       seek(f,c+1); write(f,ord(wrd[2]));
       seek(f,c+2); write(f,ord(wrd[3]));
       seek(f,c+3); write(f,ord(wrd[4]));
       seek(f,c+4); write(f,ord(wrd[5]));
       seek(f,c+5); write(f,ord(wrd[6]));
       seek(f,c+6); write(f,ord(wrd[7]));
       break;
    end;
  end;
  closefile(F);
end;
Способ, конечно, маниакальный)) Но прост в эксплуатации.
Ответить с цитированием