checksum

Methods to nail down 16 bit CRC/Checksum algorithm used by Windows CE executable?

泄露秘密 提交于 2019-11-28 10:23:22
I need to reverse engineer CRC/Checksum algorithm implemented by windows CE executable. Being propritory protocol, it does not say anything about CRC/checksum algorithm. However, There is console interface that reports correct/calculated checksum and I can construct my own messages with random bits if message protocol is correct: I have observed that, Changing single bit in message changes checksum bytes completely. Algorithm seems to be position dependent as I fed some single 1 bit messages in various message data positions with rest of the bits zero and all the time console reported

checksum udp calculation python

﹥>﹥吖頭↗ 提交于 2019-11-28 09:30:19
I'd like to calculate the checksum of an UDP header packet I want to send: packetosend = """60 00 00 00 00 24 3a 40 20 02 c0 a8 01 50 00 01 00 00 00 00 00 00 09 38 20 02 c0 a8 01 50 00 01 00 00 00 00 00 00 09 6f""" so I need to join this utf-16 (not a problem) and calculate the checksum of this specific packet. How can I do that? Thanks! EDIT: Yes it's an IPv6 header for an ICMPv6 packet, anyways what I would like to know is the formula, and how it works. I'll give another example with an ICMP ping echo (v4) packet: packet = """ 08 00 d1 15 76 0c 00 07 bf d3 55 4a ad b5 03 00 // "d1 15" is the

Bit shifting in internet checksums

风流意气都作罢 提交于 2019-11-28 08:41:38
问题 This is almost certainly a very silly question, but for some reason I'm having trouble with internet checksum calculations. All of the algorithms basically look something like this: WORD chksm(WORD *startpos, WORD checklen){ ulong sum = 0; WORD answer = 0; while (checklen > 1) { sum += *startpos++; checklen -= 2; } if (checklen == 1) { *(BYTE *)(&answer) = *(BYTE *)startpos; sum += answer; } sum = (sum >> 16) + (sum & 0xffff); sum += (sum >> 16); answer = ~sum; return answer;} I'm clear on

Maven checksum pom setting?

偶尔善良 提交于 2019-11-28 08:40:06
问题 Google has failed me and I can't find an answer even here on SO - relegating me to actually posting my first question here. I'm trying to get the command "mvn install" to automatically generate the checksums for the artifacts and place the checksums in the repository right along with the artifacts. Everything I've read seems to indicate it should be happening without my intervention, but all I'm getting is the artifact, a source zip, a pom, and the local metadata xml. The pom for the project

OpenCV 3.0 Trouble with Installation

时光怂恿深爱的人放手 提交于 2019-11-28 06:58:18
I need OpenCV3.0 since it supports some new functions which I need. I used the following code for installation (I had successfully installed OpenCV 2.4.9 using this code. But for OpenCV 3.0, while doing the cmake section, some error pops up due to mismatch of MD5 checksum) mkdir OpenCV cd OpenCV echo "Removing any pre-installed ffmpeg and x264" sudo apt-get -qq remove ffmpeg x264 libx264-dev echo "Installing Dependenices" sudo apt-get -qq install libopencv-dev build-essential checkinstall cmake pkg-config yasm libjpeg-dev libjasper-dev libavcodec-dev libavformat-dev libswscale-dev libdc1394-22

CRC-4 implementation in C#

大城市里の小女人 提交于 2019-11-28 05:29:32
问题 I've been searching the net for a C# implementation of the 4-bit cyclic redundancy check (CRC-4-ITU) but so far I've been unsuccessful. Is there anyone who's able to give me a reference implementation of CRC-4-ITU? Preferrably with the standard polynomial if there is a standard polynomial (I've read the spec pointed to by wikipedia as the CRC4 spec without finding a definition of the polynomial). I'd also really appreciate some sort of test suite or test data to verify a CRC4 implementation.

How do I validate a UPC or EAN code?

混江龙づ霸主 提交于 2019-11-28 05:01:53
I need a C# .NET function to evaluate whether a typed or scanned barcode is a valid Global Trade Item Number (UPC or EAN). The last digit of a bar code number is a computer Check Digit which makes sure the bar code is correctly composed. GTIN Check Digit Calculator public static bool IsValidGtin(string code) { if (code != (new Regex("[^0-9]")).Replace(code, "")) { // is not numeric return false; } // pad with zeros to lengthen to 14 digits switch (code.Length) { case 8: code = "000000" + code; break; case 12: code = "00" + code; break; case 13: code = "0" + code; break; case 14: break; default

Can a TCP checksum fail to detect an error? If yes, how is this dealt with?

孤街醉人 提交于 2019-11-28 04:39:19
If a TCP payload gets corrupted in transit the recomputed checksum won't match the transmitted checksum. Great, all fine so far. If a TCP checksum gets corrupted in transit the recomputed checksum won't match the now corrupted checksum. Great, all fine so far. What happens when both the payload and checksum get corrupted and the recomputed checksum, whilst different to what it should be, just happens to match the now corrupted checksum? I can see with a good checksum algorithm (and additional checksums at lower levels) this might be very, very unlikely but isn't TCP meant to be 100% reliable?

Hash Code and Checksum - what's the difference?

大城市里の小女人 提交于 2019-11-28 02:54:35
My understanding is that a hash code and checksum are similar things - a numeric value, computed for a block of data, that is relatively unique. i.e. The probability of two blocks of data yielding the same numeric hash/checksum value is low enough that it can be ignored for the purposes of the application. So do we have two words for the same thing, or are there important differences between hash codes and checksums? I would say that a checksum is necessarily a hashcode . However, not all hashcodes make good checksums. A checksum has a special purpose --- it verifies or checks the integrity of

CHECKSUM and CHECKSUM_AGG: What's the algorithm?

余生长醉 提交于 2019-11-28 02:04:24
We perform checksums of some data in sql server as follows: declare @cs int; select @cs = CHECKSUM_AGG(CHECKSUM(someid, position)) from SomeTable where userid = @userId group by userid; This data is then shared with clients. We'd like to be able to repeat the checksum at the client end... however there doesn't seem to be any info about how the checksums in the functions above are calculated. Can anyone enlighten me? Dan On SQL Server Forum, at this page , it's stated: The built-in CHECKSUM function in SQL Server is built on a series of 4 bit left rotational xor operations. See this post for