For Windows 10, I can offer a powershell solution to read RtlComputeCrc32 API on Ntdll.dll.
param (
[Parameter(Mandatory=$true)]
[string]$InputFile
)
Add-Type -TypeDefinition @"
using System;
using System.Runtime.InteropServices;
public class Win32Api {
[DllImport("ntdll.dll")]
public static extern uint RtlComputeCrc32(uint dwInitial, byte[] pData, int iLen);
}
"@
Read the file as bytes
$fileBytes = [System.IO.File]::ReadAllBytes($InputFile)
Calculate the CRC32 checksum using the Win32 API
$crc32 = [Win32Api]::RtlComputeCrc32(0, $fileBytes, $fileBytes.Length)
Convert the CRC32 value to hexadecimal string
$crc32String = $crc32.ToString("X8")
Display the CRC32 checksum
Write-Output "CRC32: 0x$crc32String"
#Just to keep Powershell window open. Remove this line for non-interactive usage.
pause
Save this script as a file like crc32.ps1
You can run on windows console as
Powershell -ExecutionPolicy Bypass -File crc32.ps1 -InputFile SomeFile.bin