Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 34 additions & 16 deletions ProcessingClips.cs
Original file line number Diff line number Diff line change
Expand Up @@ -591,38 +591,56 @@ private List<AsciiString> ExtractAsciiStrings(byte[] data)

for (int i = 0; i < data.Length; i++)
{
if (data[i] >= 32 && data[i] <= 126) // Printable ASCII range
if (IsPrintableAscii(data[i]))
{
if (currentString.Length == 0)
startIndex = i;

currentString.Append((char)data[i]);
startIndex = ProcessPrintableCharacter(currentString, data[i], i, startIndex);
}
else
{
if (currentString.Length > 0)
{
strings.Add(new AsciiString
{
StartIndex = startIndex,
Text = currentString.ToString()
});
currentString.Clear();
}
FinalizeCurrentString(strings, currentString, startIndex);
}
}

// Handle string at end of file
FinalizeCurrentString(strings, currentString, startIndex);

return strings;
}

/// <summary>
/// Check if a byte represents a printable ASCII character
/// </summary>
private bool IsPrintableAscii(byte value)
{
return value >= 32 && value <= 126;
}

/// <summary>
/// Process a printable ASCII character and track string position
/// </summary>
private int ProcessPrintableCharacter(StringBuilder currentString, byte character, int currentIndex, int startIndex)
{
if (currentString.Length == 0)
startIndex = currentIndex;

currentString.Append((char)character);
return startIndex;
}

/// <summary>
/// Finalize the current string if it has content
/// </summary>
private void FinalizeCurrentString(List<AsciiString> strings, StringBuilder currentString, int startIndex)
{
if (currentString.Length > 0)
{
strings.Add(new AsciiString
{
StartIndex = startIndex,
Text = currentString.ToString()
});
currentString.Clear();
}

return strings;
}

/// <summary>
Expand Down

This file was deleted.

Binary file removed obj/Debug/net8.0-windows/apphost.exe
Binary file not shown.
25 changes: 0 additions & 25 deletions obj/Debug/net8.0-windows/clip2load.AssemblyInfo.cs

This file was deleted.

This file was deleted.

This file was deleted.

10 changes: 0 additions & 10 deletions obj/Debug/net8.0-windows/clip2load.GlobalUsings.g.cs

This file was deleted.

Binary file removed obj/Debug/net8.0-windows/clip2load.assets.cache
Binary file not shown.
Binary file removed obj/Debug/net8.0-windows/clip2load.clip2load.resources
Binary file not shown.
Empty file.

This file was deleted.

16 changes: 0 additions & 16 deletions obj/Debug/net8.0-windows/clip2load.csproj.FileListAbsolute.txt

This file was deleted.

Binary file not shown.
11 changes: 0 additions & 11 deletions obj/Debug/net8.0-windows/clip2load.designer.deps.json

This file was deleted.

25 changes: 0 additions & 25 deletions obj/Debug/net8.0-windows/clip2load.designer.runtimeconfig.json

This file was deleted.

Binary file removed obj/Debug/net8.0-windows/clip2load.dll
Binary file not shown.
1 change: 0 additions & 1 deletion obj/Debug/net8.0-windows/clip2load.genruntimeconfig.cache

This file was deleted.

Binary file removed obj/Debug/net8.0-windows/clip2load.pdb
Binary file not shown.
Binary file removed obj/Debug/net8.0-windows/ref/clip2load.dll
Binary file not shown.
Binary file removed obj/Debug/net8.0-windows/refint/clip2load.dll
Binary file not shown.

This file was deleted.

Binary file removed obj/Release/net8.0-windows/apphost.exe
Binary file not shown.
25 changes: 0 additions & 25 deletions obj/Release/net8.0-windows/clip2load.AssemblyInfo.cs

This file was deleted.

This file was deleted.

This file was deleted.

10 changes: 0 additions & 10 deletions obj/Release/net8.0-windows/clip2load.GlobalUsings.g.cs

This file was deleted.

Binary file removed obj/Release/net8.0-windows/clip2load.assets.cache
Binary file not shown.
Binary file not shown.
Empty file.

This file was deleted.

16 changes: 0 additions & 16 deletions obj/Release/net8.0-windows/clip2load.csproj.FileListAbsolute.txt

This file was deleted.

Binary file not shown.
11 changes: 0 additions & 11 deletions obj/Release/net8.0-windows/clip2load.designer.deps.json

This file was deleted.

26 changes: 0 additions & 26 deletions obj/Release/net8.0-windows/clip2load.designer.runtimeconfig.json

This file was deleted.

Binary file removed obj/Release/net8.0-windows/clip2load.dll
Binary file not shown.

This file was deleted.

Binary file removed obj/Release/net8.0-windows/clip2load.pdb
Binary file not shown.
Binary file removed obj/Release/net8.0-windows/ref/clip2load.dll
Binary file not shown.
Binary file removed obj/Release/net8.0-windows/refint/clip2load.dll
Binary file not shown.
Loading