修复校验和-32校验和。 [英] Fixing a Checksum-32 checksum.

查看:101
本文介绍了修复校验和-32校验和。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个4428472字节长的文件。我希望我的程序能够从偏移量28开始计算所有字节的Sum32校验和。

我用来读取文件的代码是:

I have a 4428472 byte-long file. I want my program to be able to figure out the Sum32 checksum for all the bytes from offset 28 onwards.
The code I'm using to read the file is:

System.IO.File.ReadAllBytes(filename)



这是一个winforms应用程序。

谢谢。



编辑:这个程序基本上是用户输入的,根据那个输入,只是在指定的偏移处写一个0x01(其中一个偏移1276) ),因为这个文件已被编辑,校验和不再有效,所以,我需要弄清楚如何生成这个校验和,我坚持了。


This is a winforms application.
Thanks.

This program is basically going to take user input, and according to that input, is simply going to write an 0x01 at specified offset(one of them is offset 1276), because this file has been edited, the checksum is no longer valid, so, I need to figure out how to generate this checksum, which I'm stuck on.

推荐答案

基本上你有两个选择。

  • (幸运者)如果你能获得用于校验和的确切算法的相关信息,那么找到它的源代码或实现它
  • (不那么幸运的人)尝试(即获取或编码自己)不同的'校验和32'算法(例如Fletcher-3) 2)并将结果与​​你的结果进行比较。
Basically you have two options.
  • (the lucky one) if you can get relevant info on the exact algorithm used for the checksum then find its source code or implement it yourself.
  • (the not-so-lucky-one) Try (that is obtain or code yourself) different 'checksum 32' algorithms (e.g. the Fletcher-32) and compare their results with the one you have.


这篇关于修复校验和-32校验和。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆