AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

TLockbox , stream fehler

Ein Thema von bernhard_LA · begonnen am 10. Mai 2017 · letzter Beitrag vom 24. Mai 2017
 
bernhard_LA

Registriert seit: 8. Jun 2009
Ort: Bayern
1.138 Beiträge
 
Delphi 11 Alexandria
 
#1

TLockbox , stream fehler

  Alt 10. Mai 2017, 13:48
wir bekommen beim ver /entschlüsseln mit LOCKBOX unter DELPHI 10.1 einen "random" Zugriffsfehler RANGE CHECK ERROR , log des fehlers mit MADSHI siehe screen dump
CodeZeile : ThreeBytes[ByteIdx] := ThreeBytes[ByteIdx] + (Bits6 shl (8 - BitIdx));[/I


Delphi-Quellcode:
procedure CustomBase64_to_stream( const Base64: TBytes; Destin: TStream;
  const InverseTransform: TInverseBaseTransform);
var
  P, j, i: integer;
  Ch: Byte;
  Bits6: byte;
  ThreeBytes: packed array[ 0..2 ] of byte;
  ByteIdx, BitIdx: integer;
// ShrN: integer;
  Addend: byte;
begin
{$IFDEF DEBUG}
  {$RANGECHECKS OFF}
{$ENDIF}

// Assume Destin is already at the desired postion and size.
for P := 0 to (Length( Base64) div 4) - 1 do
  begin
  for i := 0 to 2 do ThreeBytes[i] := 0;
  ByteIdx := 0;
  BitIdx := 0;
  for j := 1 to 4 do
    begin
    Ch := Base64[ P * 4 + j - 1];
    if Ch = Ord('=') then break;
    Bits6 := InverseTransform[ Ch];
// ShrN := BitIdx - 2;
    if BitIdx > 2 then
        Addend := Bits6 shr (BitIdx - 2)
      else if BitIdx = 2 then
        Addend := Bits6
      else
        Addend := Bits6 shl (2 - BitIdx);
    ThreeBytes[ ByteIdx ] := ThreeBytes[ ByteIdx ] + Addend;
    Inc( BitIdx, 6);
    if BitIdx >= 8 then
      begin
      Dec( BitIdx, 8);
      Inc( ByteIdx);
      if BitIdx > 0 then
        ThreeBytes[ByteIdx] := ThreeBytes[ByteIdx] + (Bits6 shl (8 - BitIdx));
      end
    end;
  Destin.WriteBuffer( ThreeBytes, ByteIdx)
  end
  {$IFDEF DEBUG}
  {$RANGECHECKS ON}
{$ENDIF}

end;
Angehängte Grafiken
Dateityp: jpg lockbox_issues.JPG (26,6 KB, 24x aufgerufen)
Dateityp: jpg lockbox_issues_3.JPG (18,7 KB, 6x aufgerufen)

Geändert von bernhard_LA (10. Mai 2017 um 22:15 Uhr)
  Mit Zitat antworten Zitat
 


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 13:49 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