update to 0.5.1
This commit is contained in:
@@ -1,7 +0,0 @@
|
||||
unit DbgLog;
|
||||
|
||||
interface
|
||||
|
||||
implementation
|
||||
|
||||
end.
|
@@ -34,7 +34,7 @@ type
|
||||
PScanInfo = ^TScanInfo;
|
||||
|
||||
TScanInfo = record
|
||||
Size: Integer;
|
||||
CRCSize, ActualSize: Integer;
|
||||
CRC1, CRC2: Cardinal;
|
||||
end;
|
||||
|
||||
@@ -63,7 +63,7 @@ begin
|
||||
WriteLn(ErrOutput, '');
|
||||
WriteLn(ErrOutput, 'Parameters:');
|
||||
WriteLn(ErrOutput, ' -m# - codec to use for precompression');
|
||||
WriteLn(ErrOutput, ' -c# - scanning range of generator [16mb]');
|
||||
WriteLn(ErrOutput, ' -c# - scanning range [16mb]');
|
||||
WriteLn(ErrOutput, ' -t# - number of working threads [50p]');
|
||||
WriteLn(ErrOutput, '');
|
||||
end;
|
||||
@@ -159,6 +159,7 @@ var
|
||||
LastStream: Int64;
|
||||
Found1, Found2: Boolean;
|
||||
CountPos: NativeInt;
|
||||
BaseDir: String;
|
||||
LList: TArray<String>;
|
||||
LSInfo: PScanInfo;
|
||||
LEntry: TEntryStruct;
|
||||
@@ -181,10 +182,16 @@ begin
|
||||
for J := Low(SearchCount[I]) to High(SearchCount[I]) do
|
||||
SearchCount[I, J] := 0;
|
||||
end;
|
||||
if FileExists(Input1) then
|
||||
BaseDir := ExtractFilePath(TPath.GetFullPath(Input1))
|
||||
else if DirectoryExists(Input1) then
|
||||
BaseDir := IncludeTrailingBackSlash(TPath.GetFullPath(Input1))
|
||||
else
|
||||
BaseDir := ExtractFilePath(TPath.GetFullPath(Input1));
|
||||
LList := GetFileList([Input1], True);
|
||||
for I := Low(LList) to High(LList) do
|
||||
begin
|
||||
if FileSize(LList[I]) >= MinSize1 then
|
||||
if InRange(FileSize(LList[I]), MinSize1, Integer.MaxValue) then
|
||||
begin
|
||||
FStream := TFileStream.Create(LList[I], fmShareDenyNone);
|
||||
with FStream do
|
||||
@@ -195,14 +202,15 @@ begin
|
||||
B := Buffer[MinSize1 - 1];
|
||||
J := MinSize1;
|
||||
New(LSInfo);
|
||||
LSInfo^.Size := J;
|
||||
LSInfo^.CRCSize := J;
|
||||
LSInfo^.ActualSize := FileSize(LList[I]);
|
||||
LSInfo^.CRC1 := Utils.Hash32(0, @Buffer[0], J);
|
||||
LSInfo^.CRC2 := LSInfo^.CRC1;
|
||||
while (J > 0) and (LSInfo^.Size < Options.ChunkSize) do
|
||||
while (J > 0) and (LSInfo^.CRCSize < Options.ChunkSize) do
|
||||
begin
|
||||
J := Read(Buffer[0], Min(Options.ChunkSize - LSInfo^.Size,
|
||||
J := Read(Buffer[0], Min(Options.ChunkSize - LSInfo^.CRCSize,
|
||||
BufferSize));
|
||||
Inc(LSInfo^.Size, J);
|
||||
Inc(LSInfo^.CRCSize, J);
|
||||
LSInfo^.CRC2 := Utils.Hash32(LSInfo^.CRC2, @Buffer[0], J);
|
||||
end;
|
||||
finally
|
||||
@@ -210,7 +218,13 @@ begin
|
||||
end;
|
||||
Insert(LSInfo^, SearchInfo[A, B], Length(SearchInfo[A, B]));
|
||||
Inc(SearchCount[A, B]);
|
||||
end;
|
||||
end
|
||||
else if FileSize(LList[I]) < MinSize1 then
|
||||
WriteLn(ErrOutput, Format('Skipped %s (Smaller than %d)',
|
||||
[ReplaceText(LList[I], BaseDir, ''), MinSize1]))
|
||||
else if FileSize(LList[I]) > Integer.MaxValue then
|
||||
WriteLn(ErrOutput, Format('Skipped %s (Larger than %d)',
|
||||
[ReplaceText(LList[I], BaseDir, ''), Integer.MaxValue]));
|
||||
end;
|
||||
DataStore := TDataStore1.Create(nil, True, Options.Threads,
|
||||
Options.ChunkSize);
|
||||
@@ -258,13 +272,13 @@ begin
|
||||
CRC := Utils.Hash32(0, Ptr + Pos, MinSize1);
|
||||
for Y := 0 to SearchCount[C, D] - 1 do
|
||||
begin
|
||||
if (SearchInfo[C, D, Y].Size <= (SizeEx - Pos)) then
|
||||
if (SearchInfo[C, D, Y].CRCSize <= (SizeEx - Pos)) then
|
||||
if (CRC = SearchInfo[C, D, Y].CRC1) and
|
||||
(Utils.Hash32(CRC, Ptr + Pos + MinSize1, SearchInfo[C, D,
|
||||
Y].Size - MinSize1) = SearchInfo[C, D, Y].CRC2) then
|
||||
Y].CRCSize - MinSize1) = SearchInfo[C, D, Y].CRC2) then
|
||||
begin
|
||||
E.Position := DataStore.Position(X) + Pos;
|
||||
E.OldSize := SearchInfo[C, D, Y].Size;
|
||||
E.OldSize := SearchInfo[C, D, Y].ActualSize;
|
||||
E.NewSize := 0;
|
||||
E.DepthSize := 0;
|
||||
InfoStore[X].Add(E);
|
||||
@@ -280,6 +294,12 @@ begin
|
||||
end;
|
||||
end);
|
||||
end;
|
||||
if FileExists(Input2) then
|
||||
BaseDir := ExtractFilePath(TPath.GetFullPath(Input2))
|
||||
else if DirectoryExists(Input2) then
|
||||
BaseDir := IncludeTrailingBackSlash(TPath.GetFullPath(Input2))
|
||||
else
|
||||
BaseDir := ExtractFilePath(TPath.GetFullPath(Input2));
|
||||
LList := GetFileList([Input2], True);
|
||||
for I := Low(LList) to High(LList) do
|
||||
begin
|
||||
@@ -350,7 +370,10 @@ begin
|
||||
finally
|
||||
FStream.Free;
|
||||
end;
|
||||
end;
|
||||
end
|
||||
else if FileSize(LList[I]) < MinSize2 then
|
||||
WriteLn(ErrOutput, Format('Skipped %s (Smaller than %d)',
|
||||
[ReplaceText(LList[I], BaseDir, ''), MinSize2]));
|
||||
end;
|
||||
if Found1 then
|
||||
OStream.SaveToFile(Output);
|
||||
|
@@ -1,7 +0,0 @@
|
||||
unit DbgSearch;
|
||||
|
||||
interface
|
||||
|
||||
implementation
|
||||
|
||||
end.
|
Reference in New Issue
Block a user