Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Sonstige Fragen zu Delphi (https://www.delphipraxis.net/19-sonstige-fragen-zu-delphi/)
-   -   Delphi Byte Seek & Patch (https://www.delphipraxis.net/94128-byte-seek-patch.html)

ReVenGer 16. Jun 2007 19:47


Byte Seek & Patch
 
Da mir hier schon super weitergeholfen wurde, hab ich nochmal eine Frage:

Ich suche ein Byte mit:
Delphi-Quellcode:
FStream.Seek(89,soFromBeginning);
Gibt es irgendwie die möglichkeit das Byte auch so direkt zu überschreiben?


Gruß

marabu 16. Jun 2007 20:02

Re: Byte Seek & Patch
 
Hallo,

versuche es mal so:

Delphi-Quellcode:
function PatchStream(s: TStream; offset, size: Cardinal; const buf): Boolean;
begin
  Result := (offset + size) <= s.Size;
  if Result then
  begin
    s.Position := offset;
    s.WriteBuffer(buf, size);
  end;
end;
Getippt und nicht getestet.

Grüße vom marabu

ReVenGer 16. Jun 2007 20:15

Re: Byte Seek & Patch
 
Abgetippt und getestet. Danke Dir!

Gruß


Alle Zeitangaben in WEZ +1. Es ist jetzt 14:44 Uhr.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz