- $srcDir = 'E:\Test'; #源文件夹路径
- $arr = @();
- forEach( $file In (dir ($srcDir + '\*.bin')) ){
- $byte = [Array]::CreateInstance('byte', 8);
- $stream = [IO.File]::Open($file.FullName, [IO.FileMode]::Open, [IO.FileAccess]::Read);
- $null = $stream.Seek(0x2C1C, [IO.SeekOrigin]::Begin);
- $null = $stream.Read($byte, 0, 8);
- $arr += [BitConverter]::ToString($byte) -replace '-';
- $stream.Dispose();
- }
- sc bbb.txt $arr;
- echo 'Done';
- [Console]::ReadLine()
复制代码
|