[Moto G5 Plus Guides, News, & Discussion] NZedPred:
dhob.bin but no dhob.bin.bak

OK, have done some more investigation into cases where there is a dhob.bin, but no dhob.bin.bak. This will be a long-ish post :D

So, a normal dhob.bin file looks like this in a hex editor / hex dump (limited to first 20 lines)

/persist/rfs/msm/mpss # hexdump dhob.bin | head -n20
0000000 7d60 fb6a 1c50 f9f9 54b0 04e1 76f3 7943
0000010 ae7b cb9b 7634 69e4 e6cc ac41 e54e 4444
0000020 860e 82c8 56d1 0cc0 0430 a6af 2652 7739
0000030 4936 1666 ee73 1e9e ef7f 2450 cc8b a999
0000040 56a0 d3ce 3e55 3852 bd23 fe5f 9c89 bdb9
0000050 b345 51e7 c056 43e6 6eba 9e3e 26cd fb9c
0000060 ea05 4edb 3dea 6cd5 a6ed 4b2f 1b16 8232
0000070 9203 d088 7477 5497 5ad6 cfa1 f176 98da
0000080 6d50 226e 8580 3ba3 c034 2176 b73d ec66
0000090 034c 97c7 a670 230a 04f0 318e c08e 930d
00000a0 7d51 3dc0 dd5c 2eb5 4fd2 b70a f929 83e3
00000b0 99fc 06dd a69d d5b5 4aca 8b35 f5bb c9cc
00000c0 3dcb ae6f 8d2d 5b00 55e8 bff3 7824 4ff5
00000d0 0399 cddd b337 709f 1b1c c828 972f 1cd7
00000e0 2420 c7fe 9981 1c42 5f8f a980 86c8 e416
00000f0 dccc 9847 cd26 a2b9 f6cc ecc5 7099 b466
0000100 d606 2fb4 dd08 048e d178 8d29 68c3 ed7e
0000110 2096 5751 39bd 6559 5e7d f43d 2184 e7e5
0000120 f6be ed1c 9722 92a9 a38a 4e7f d053 52a3
0000130 24d0 8347 62af 0f02 5e26 c3a9 b09a 1a26

A normal dhob.bin.bak looks like this (again, first 20 lines):

/persist/rfs/msm/mpss # hexdump dhob.bin.bak | head -n20
0000000 c0de 0002 3fb0 000c 1545 0006 d00d beef
0000010 0000 beef 0000 0000 0000 0000 0000 0000
0000020 0000 0000 0000 beef 0000 0000 0000 beef
0000030 0000 0000 0000 0000 0000 0000 0000 0000
0000040 0000 beef 0000 0000 0000 0000 0000 0000
0000050 0000 0000 0000 beef 3001 3030 3030 0030
0000060 beef 3001 3030 3030 0030 beef 0000 beef
0000070 0801 153a 0958 8248 0353 beef 0801 153a
0000080 0958 8248 0453 beef 5301 4283 5908 3518
0000090 0000 beef 5701 0000 beef 0000 beef 0000
00000a0 0000 0000 0000 0000 0000 0000 0000 0000
*
0000480 0000 0000 0000 0000 beef 0000 beef 0000
0000490 0000 0000 0000 0000 0000 0000 0000 0000
*
0000640 0000 0000 0000 0000 beef 0000 0000 0000
0000650 0000 0000 0000 0000 0000 0000 beef 0000
0000660 0000 0000 0000 0000 beef 0000 0000 0000
0000670 beef 0000 0000 0000 beef 0000 0000 0000
*

Reading the hexdump:

The left-most column is the address, so 0000000 is the top of the file, and it goes up in increments of 16 (10 hex).

The asterisks * in the latter just represent that the previous row was repeated up until it reached the row underneath. So row 00000a0 (which was all zeroes) was repeated right up until row 0000480 (which differed).

So, the summary of the two is this. 1) A dhob.bin looks like random stuff. 2) A dhob.bin.bak looks like slightly random stuff with a lot of zeroes. They are very distinct, and unlike what the bak extension may suggest, it is NOT a backup of dhob.bin.

So, as I mentioned a few posts previous, a couple of people have a dhob.bin, but no dhob.bin.bak. And interestingly, their dhob.bin does not look like a dhob.bin, it looks more like a dhob.bin.bak. I did a few experiments...

Experiment 1) - Change something in the dhob.bin and dhob.bin.bak

I changed a single byte in my dhob.bin and dhob.bin.bak (to ensure they were invalidated), erased EFS, and rebooted. In this case, the IMEI was of course not restored, and on checking the /persist/rfs/msm/mpss folder, the dhob.bin and dhob.bin.bak were both there.

Experiment 2) - Restore normal files, but delete dhob.bin

I restored my files, and removed the dhob.bin file, leaving the dhob.bin.bak and shob.bin. After rebooting, the dhob.bin file was restored, and so was my IMEI.

Experiment 3) - Delete dhob.bin, edit dhob.bin.bak

No dhob.bin, but a corrupt dhob.bin.bak. After reboot, there was a dhob.bin file, and no dhob.bin.bak. And, it seems, that the dhob.bin.bak file was simply renamed to dhob.bin.

So it appears that, for the dhob.bin.bak to become the dhob.bin file, someone/something has to remove the dhob.bin file. Keeping in mind that the dhob.bin.bak file appears to be used to recreate dhob.bin (probably with the help of shob.bin, I haven't experimented that much yet), and we know that the dhob.bin is encrypted in some way so that only the device it was made for can use it, it would appear that there has been some sort of manual intervention in the phones.

I suspect that is either 1) someone has restored another similar device's persist partition and manually or a custom rom has removed the dhob.bin file in an effort to get it recreated, or 2) well, I don't think there's a 2... (or rather, I can't think of it).

So at this point, if you only have a dhob.bin, and no dhob.bin.bak, and the guide doesn't work, something has been messed with, and at this point I have no solution.

Sorry for those that I'm working with at the moment, but I'm out of ideas.

Edit: Just to mention the obvious, for the couple of people that I have tried fixing by renaming dhob.bin to dhob.bin.bak, it didn't work. The dhob.bin.bak was simply renamed to dhob.bin again, indicating that the persist is probably not the one for the device, however that may have happened...