Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrates Stream functions into the .NET Listener #1428

Merged
merged 1 commit into from
Oct 23, 2024
Merged

Conversation

Badgerati
Copy link
Owner

Description of the Change

Migrates PowerShell streaming functions into the compiled .NET DLL, to prevent VirusTotal from flagging the Private/Streams.ps1 file as "malicious" just because it reading and compresses streams!

Related Issue

Resolves #1426

Additional Context

Scan results after changes
image

@Badgerati Badgerati added this to the 2.11.1 milestone Oct 22, 2024
@Badgerati Badgerati self-assigned this Oct 22, 2024
@mdaneri
Copy link
Contributor

mdaneri commented Oct 22, 2024

it's not part of your pull request but in PodeHelper line 143

if (count > 0)
{
       await stream.WriteAsync(array, startIndex, count, cancellationToken).ConfigureAwait(false);
}

can be improved performance-wise using

if (count > 0)
{
      await stream.WriteAsync(array.AsMemory(startIndex, count), cancellationToken).ConfigureAwait(false);
}

https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1835

@Badgerati
Copy link
Owner Author

This one I'm aware of, but as Spans/Memory were .NET8 only I didn't include them originally. I have thought about wrapping the code in #if NET8_0_OR_GREATER for the various places that would benefit from it though

@Badgerati Badgerati merged commit 0b08d67 into develop Oct 23, 2024
24 checks passed
@Badgerati Badgerati deleted the Issue-1426 branch October 23, 2024 08:03
@Badgerati Badgerati mentioned this pull request Nov 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rewrite Steams.ps1 into .NET, to prevent VirusTotal erroneously flagging the file
2 participants