Original link: https://hsiaofeng.com/archives/247.html
Now there is a very large file, but one byte of data is missing at the end and it cannot be used normally.
It was originally repaired with WinHex, but the working logic of WinHex is to create a copy and then overwrite the original file, which will take a long time.
Finally, I learned that PowerShell can be written quickly, and the final arrangement is as follows:
Assuming that the file to be added is yourfile
, and the hexadecimal data is 0A
, use the following command.
Add-Content -Path "yourfile" -Value ([byte]0x0A) -Encoding Byte
This command is obtained using ChatGPT.
This article is transferred from: https://hsiaofeng.com/archives/247.html
This site is only for collection, and the copyright belongs to the original author.