Switch to full style
In-depth technology research: finding new ways to recover data, accessing firmware, writing programs, reading bits off the platter, recovering data from dust.

Forum rules

Please do not post questions about data recovery cases here (use this forum instead). This forum is for topics on finding new ways to recover data. Accessing firmware, writing programs, reading bits off the platter, recovering data from dust...
Post a reply

ST Checksum

October 14th, 2021, 16:42

Hello Lovely people of this forum, hope all is good...
kasakai bara aahe (only the local Marathi speaking people reading this post will understand kasa kai bara aahi, which means whats up ! hope all is nice!)

I wish to understand the math behind the checksum of ST Module.... I am planning to write my own tool to compute and correct the same.

Any leads will do. Time to write something again in C :)

Good Day

Simran

Re: ST Checksum

October 14th, 2021, 18:05

https://github.com/eurecom-s3/hdd_firmware_tools
http://www.users.on.net/~fzabkar/FreeBasic_W32/Seagate/ST_CRC16_2.bas

Re: ST Checksum

October 14th, 2021, 18:53

Hi there Fzabkar. Thanks for always being helpful and supportive of my tiny projects.

Are we looking at CRC16 even for the Rosewood drives?

thanks

Simran

Re: ST Checksum

October 14th, 2021, 19:08

It's still CRC16, AFAIK.

You could try the Python tool or my FB version:

http://www.users.on.net/~fzabkar/FreeBasic_W32/Seagate/ST_CRC16.exe

You could use F3RomExplorer to carve the ROM segments.

Re: ST Checksum

October 15th, 2021, 14:05

sin wrote:Hello Lovely people of this forum, hope all is good...
kasakai bara aahe (only the local Marathi speaking people reading this post will understand kasa kai bara aahi, which means whats up ! hope all is nice!)

I wish to understand the math behind the checksum of ST Module.... I am planning to write my own tool to compute and correct the same.

Any leads will do. Time to write something again in C :)

Good Day

Simran


Hello Simran ,
What C Compiler are you using for your programming ,After My Borland Turbo C sessions in school i am planning to migrate to -> https://www.embarcadero.com/products/cbuilder ,I hardly find decent books on c++ builder and i also see this compiler which i have not used -> https://www.embarcadero.com/free-tools/ccompiler and https://www.embarcadero.com/free-tools/dev-cpp

Re: ST Checksum

October 16th, 2021, 2:43

Hello.

I use Dev C++ with TDM GCC 4.9.2.
My syntax is that of C and no C++

Simran

Re: ST Checksum

October 17th, 2021, 13:02

@Fzabkar

following is the ip bitstream and corresponding checksum stream

0000 0000 0000 0001
1111 1111 1111 1111

0000 0000 0000 0010
1111 1111 1111 1110

0000 0000 0000 0011
1111 1111 1111 1101

0000 0000 0000 0100
1111 1111 1111 1100

0000 0000 0000 0101
1111 1111 1111 1011

hehe
--

Re: ST Checksum

October 18th, 2021, 19:22

Here is something more interesting
There is an algorithm so as to how the MSBs and LSBs are added
When the LSBs are added, and they overflow by 4bits, the 4MSB overflown bits are truncated

eg wr.t. LSBs
FF+FF = 1FE, however the 1 is disregarded as overflown and only FE is considered in computation

ie: 00 ff 00 ff

Similarly,
FF+FF+FF=2FD however the 2 is disregarded and it's just FD.
00 ff 00 ff 00 ff

in a bit field where just there are MSBS and no LSBs to be added in the module, the MSBs can be added to 0x101 times before things overflow.
....
So the way the whole module is added, its just truncated to 0x_ _ _ _ which is computed against a value that makes the whole checksum 0000
--


to add, this is not for the ROM modules....its for another module that resides on SA and is sensitive to checksums :D

--

Re: ST Checksum

October 18th, 2021, 22:56

In addition to CRC16, the following tool computes all the different checksum types that I've encountered in hard drives (and have managed to identify):

http://www.users.on.net/~fzabkar/FreeBasic_W32/Utils/checksum.bas
http://www.users.on.net/~fzabkar/FreeBasic_W32/Utils/checksum.exe

Re: ST Checksum

October 25th, 2021, 6:47

figured out the math behind the checksum bits
it's not CRC!
its 2s compliment :)

code writing begins :)
--
Post a reply