All times are UTC - 5 hours [ DST ]


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 new topic Reply to topic  [ 101 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6  Next
Author Message
 Post subject: Re: Head Map Parser
PostPosted: January 30th, 2021, 11:49 
Offline
User avatar

Joined: September 8th, 2009, 18:21
Posts: 15461
Location: Australia
The first While loop works as expected, otherwise the program would report the wrong max head count.

I'm using Version 5.11 (build time April 28 2015). Which version/fork are you using?

Code:
Compiling single file...
--------
- Filename: C:\Downloads\Software\Head_Map_for_DDI\To_Upload.cpp
- Compiler Name: TDM-GCC 4.9.2 32-bit Release

Processing C++ source file...
--------
- C++ Compiler: C:\Program Files\Dev-Cpp\MinGW64\bin\g++.exe
- Command: g++.exe "C:\Downloads\Software\Head_Map_for_DDI\To_Upload.cpp" -o "C:\Downloads\Software\Head_Map_for_DDI\To_Upload.exe" -m32 -I"C:\Program Files\Dev-Cpp\MinGW64\include" -I"C:\Program Files\Dev-Cpp\MinGW64\x86_64-w64-mingw32\include" -I"C:\Program Files\Dev-Cpp\MinGW64\lib\gcc\x86_64-w64-mingw32\4.9.2\include" -I"C:\Program Files\Dev-Cpp\MinGW64\lib\gcc\x86_64-w64-mingw32\4.9.2\include\c++" -L"C:\Program Files\Dev-Cpp\MinGW64\x86_64-w64-mingw32\lib32" -static-libgcc -m32

Compilation results...
--------
- Errors: 0
- Warnings: 0
- Output Filename: C:\Downloads\Software\Head_Map_for_DDI\To_Upload.exe
- Output Size: 1.37166690826416 MiB
- Compilation Time: 6.33s

_________________
A backup a day keeps DR away.


Top
 Profile  
 
 Post subject: Re: Head Map Parser
PostPosted: January 30th, 2021, 13:13 
Offline

Joined: September 17th, 2016, 16:06
Posts: 430
Location: India
all is same.. 27april 2015 64 bit though.

Can you try a linux compiler ?

Its strange, if you are experiencing this, likely some others would have also experienced it?
people should post..its 75 downloads already.
--


Top
 Profile  
 
 Post subject: Re: Head Map Parser
PostPosted: January 30th, 2021, 13:27 
Offline

Joined: November 7th, 2020, 5:31
Posts: 1084
Location: The_UK
sin wrote:
all is same.. 27april 2015 64 bit though.
Its strange, if you are experiencing this, likely some others would have also experienced it?
--


Like fzabkar I used your code to reconstruct something in freebasic so I could mess with other things. :wink:

_________________
Data Recovery Services in the UK.
https://www.usbrecovery.co.uk/


Top
 Profile  
 
 Post subject: Re: Head Map Parser
PostPosted: January 30th, 2021, 14:52 
Offline

Joined: September 17th, 2016, 16:06
Posts: 430
Location: India
I tried another charger today. Parses till 1.7TB instead of 1.8TB.
The HM created in 3k creates chains/serpentines (whatever you call them) till 1.7TB only with 512 size.

--


Top
 Profile  
 
 Post subject: Re: Head Map Parser
PostPosted: January 30th, 2021, 14:53 
Offline

Joined: September 17th, 2016, 16:06
Posts: 430
Location: India
Fzabkar, how did you convert 512 /4096 (Multiplier of 8 ) ?
--


Top
 Profile  
 
 Post subject: Re: Head Map Parser
PostPosted: January 30th, 2021, 15:28 
Offline
User avatar

Joined: September 8th, 2009, 18:21
Posts: 15461
Location: Australia
@sin, I refer to the "zones" as serpentine segments because that's what others call them:

https://hddscan.com/doc/HDD_Tracks_and_Zones.html

I apply the LBA size to the total LBA count at the end of my program. I always use 512 bytes as the default because I can't tell which is appropriate for that particular model. I took your Palmer and Charger examples and calculated the total capacity based on 512 bytes. When that didn't produce a sensible capacity, I tried 4096 bytes, but that didn't make sense, either.

I am currently limited to Win 10 32-bit, so I can't compile for Linux.

I suspect that nobody has been able to reproduce the problem because they all moved on to 64-bit years ago. You could probably reproduce it if you were to recompile your tool for 32-bit by using the "-m32" option in the command line.

I am now wondering whether your previously stated failure to write more than one byte at a time to your DDI map file may be indicative of another bug in the compiler.

If anyone else is experiencing my problem, here is my FreeBasic tool:

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

_________________
A backup a day keeps DR away.


Top
 Profile  
 
 Post subject: Re: Head Map Parser
PostPosted: January 31st, 2021, 6:52 
Offline

Joined: November 7th, 2020, 5:31
Posts: 1084
Location: The_UK
fzabkar wrote:
If anyone else is experiencing my problem, here is my FreeBasic tool:


Nice code - comments and error handling too :shock: :lol:

I'm too ashamed to show the nasty hack I made particularly with the endianness and ubytes :oops:

I've turned my attention to the head.map file DE creates by default rather than an export of the submapped heads (which I can't actually see how to generate here anyway). Slow progress - I'm thick as two short planks :P

_________________
Data Recovery Services in the UK.
https://www.usbrecovery.co.uk/


Top
 Profile  
 
 Post subject: Re: Head Map Parser
PostPosted: January 31st, 2021, 9:45 
Offline

Joined: September 17th, 2016, 16:06
Posts: 430
Location: India
Lardman wrote:
fzabkar wrote:
If anyone else is experiencing my problem, here is my FreeBasic tool:


Nice code - comments and error handling too :shock: :lol:

I'm too ashamed to show the nasty hack I made particularly with the endianness and ubytes :oops:

I've turned my attention to the head.map file DE creates by default rather than an export of the submapped heads (which I can't actually see how to generate here anyway). Slow progress - I'm thick as two short planks :P



Sounds just great.. Infact my findings are just done now :D
The way head.map stores info is pretty cool.

I am really wondering if i should use C to code a new tool or python...or perhaps code in both (to learn and advance my skill set).


Top
 Profile  
 
 Post subject: Re: Head Map Parser
PostPosted: January 31st, 2021, 9:49 
Offline

Joined: September 17th, 2016, 16:06
Posts: 430
Location: India
Just offtopic: What kind of skills would one require to work for a tool mfg ?
I understand that their dev team consists of constants (core team) and variables (contractors).
What do such companies look out for in a candidate to have them on board?

--


Top
 Profile  
 
 Post subject: Re: Head Map Parser
PostPosted: January 31st, 2021, 13:06 
Offline
User avatar

Joined: September 8th, 2009, 18:21
Posts: 15461
Location: Australia
@sin, I have one more observation. As you and I are both using SSDs, I'm wondering whether writing a 2GB file, one byte at a time, will prematurely wear out the drive. I checked my SMART data, and ISTM that it shows 1TB more writes than I expected.

_________________
A backup a day keeps DR away.


Top
 Profile  
 
 Post subject: Re: Head Map Parser
PostPosted: January 31st, 2021, 13:47 
Offline

Joined: September 17th, 2016, 16:06
Posts: 430
Location: India
LOL :) quite possible too... I started with about 4tb overall lifetime writes on sentinel and now it is about 6TB.
No health falls noted.......One can always run the tool and make a binary map on a PD for that matter.

this has remained constant
The health is determined by SSD specific S.M.A.R.T. attribute(s): #177 Wear Leveling Count


Top
 Profile  
 
 Post subject: Re: Head Map Parser
PostPosted: January 31st, 2021, 14:01 
Offline
User avatar

Joined: September 8th, 2009, 18:21
Posts: 15461
Location: Australia
Yeah, my wear levelling count hasn't changed, either, so it looks like caching may have prevented undue wear ???

_________________
A backup a day keeps DR away.


Top
 Profile  
 
 Post subject: Re: Head Map Parser
PostPosted: January 31st, 2021, 16:53 
Offline

Joined: January 29th, 2012, 1:43
Posts: 982
Location: United States
LOL :lol:
Yes, caching is saving you. I have only briefly looked at the c++ code, but from what I can see the call to filewrite will probably invoke the actual final write when fclose is called. The single byte write loop will be cached as the OS desires until the fclose, although even then it could still be cached by the OS.

FYI if there were really that many single byte writes to the drive, it would be very slow, even with the SSD.

_________________
http://www.hddsuperclone.com
Home of HDDSuperClone


Top
 Profile  
 
 Post subject: Re: Head Map Parser
PostPosted: February 1st, 2021, 2:17 
Offline
User avatar

Joined: September 8th, 2009, 18:21
Posts: 15461
Location: Australia
I downloaded this Dev-C++ fork ...

https://github.com/Embarcadero/Dev-Cpp/releases/download/v6.2/Embarcadero_Dev-Cpp_6.2_TDM-GCC_9.2_Setup.zip

... but it still has the same bug.

The date stamps of the compiler (g++.exe) are 6 years apart (2020 versus 2014).

The new version produces a 2.4MB EXE whereas the old version produces a 1.4MB EXE ???

_________________
A backup a day keeps DR away.


Top
 Profile  
 
 Post subject: Re: Head Map Parser
PostPosted: February 1st, 2021, 3:36 
Offline

Joined: September 17th, 2016, 16:06
Posts: 430
Location: India
maximus wrote:
LOL :lol:
Yes, caching is saving you. I have only briefly looked at the c++ code, but from what I can see the call to filewrite will probably invoke the actual final write when fclose is called. The single byte write loop will be cached as the OS desires until the fclose, although even then it could still be cached by the OS.

FYI if there were really that many single byte writes to the drive, it would be very slow, even with the SSD.


thanks for the input...I will try to write in some other way. Writing with arguments as per syntax and not via the for loop causes parts of same .map file to be written into the parsed file :D
I have seen some strange country names too.... if i use fwrite(&BinaryHeadNumber, 1, length_of_Sectors , binary_map);
--


Top
 Profile  
 
 Post subject: Re: Head Map Parser
PostPosted: February 1st, 2021, 6:03 
Offline

Joined: September 17th, 2016, 16:06
Posts: 430
Location: India
As an update, windows task manager shows write speeds of about 25megabytes per sec.

--


Top
 Profile  
 
 Post subject: Re: Head Map Parser
PostPosted: February 1st, 2021, 6:52 
Offline
User avatar

Joined: September 8th, 2009, 18:21
Posts: 15461
Location: Australia
It's not a bug in the compiler, it's a bug in your code.

You have declared temp_read_length_buffer as an array with 7 elements (0 to 6), but the FOR loop writes to temp_read_length_buffer[7]. It would appear that temp_read_length_buffer[7] occupies the same location as footer[0], so that is the reason that the footer is overwritten.

Code:
         unsigned char temp_read_length_buffer[7];
         int length_Value_Feeder=0;
         
         for(length_Value_Feeder =0; length_Value_Feeder <= 7; length_Value_Feeder++  )
         
         {
            temp_read_length_buffer[length_Value_Feeder] = buffer[length_Offset-length_Value_Feeder];
         }

This code works correctly:

Code:
         unsigned char temp_read_length_buffer[8];
         int length_Value_Feeder=0;
         
         for(length_Value_Feeder =0; length_Value_Feeder <= 7; length_Value_Feeder++  )
         
         {
            temp_read_length_buffer[length_Value_Feeder] = buffer[length_Offset-length_Value_Feeder];
         }

My apologies to the developers of GCC. :-)

_________________
A backup a day keeps DR away.


Top
 Profile  
 
 Post subject: Re: Head Map Parser
PostPosted: February 1st, 2021, 8:31 
Offline

Joined: September 17th, 2016, 16:06
Posts: 430
Location: India
I will surely install a windows 7/10 32bit and try this out myself.

Unsure, why the code would work for me.

To verify your claim, you can always print the address with printf with & sign for argument.

--


Top
 Profile  
 
 Post subject: Re: Head Map Parser
PostPosted: February 1st, 2021, 13:10 
Offline
User avatar

Joined: September 8th, 2009, 18:21
Posts: 15461
Location: Australia
I suspect that the 64-bit version of the compiler stacks the variables in RAM in a different order. Even if you see no problems now, there may be an insidious problem which may show up if you make updates to your code.

I have already verified my claim twice in previous posts with appropriate debug lines.

You don't need to install a 32-bit version of Windows. You just need to select the 32-bit compiler in the Dev-C++ menu options.

_________________
A backup a day keeps DR away.


Top
 Profile  
 
 Post subject: Re: Head Map Parser
PostPosted: February 1st, 2021, 13:41 
Offline

Joined: September 17th, 2016, 16:06
Posts: 430
Location: India
Ok, let me try...thats why there are BETA testers :D
One man job and army gets difficult.

Thanks for pointing. The machine I am running is i3 , 2nd gen with 2Gb ram.


--
PS: If time allows and 3k supports, I will do HM of a 12TB Seagate Exos drive and share the map.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 101 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6  Next

All times are UTC - 5 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 11 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group