nospaceships/raw-socket-sniffer

Exception calling "BlockCopy" with "5" argument(s)

GirkovArpa opened this issue · 1 comments

I'm running PowerShell as Admin on an Administrator Windows 10 account and get flooded with errors of this sort.

Exception calling "BlockCopy" with "5" argument(s): "Offset and length were out of bounds for the array or count is
greater than the number of elements from index to the end of the source collection."
At C:\github\raw-socket-sniffer\raw-socket-sniffer.ps1:102 char:5
+     [Buffer]::BlockCopy([BitConverter]::GetBytes($rc), 0, $buffer, 8, ...
+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : ArgumentException

Exception calling "BlockCopy" with "5" argument(s): "Offset and length were out of bounds for the array or count is
greater than the number of elements from index to the end of the source collection."
At C:\github\raw-socket-sniffer\raw-socket-sniffer.ps1:103 char:5
+     [Buffer]::BlockCopy([BitConverter]::GetBytes($rc), 0, $buffer, 12 ...
+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : ArgumentException

Compiled the C program and it works.