📜 ⬆️ ⬇️

Receive phonebook entries from a mobile phone without a display

It is rather an entertaining story for those who, just like me, are not an expert in phones and data recovery.

One day, an employee brought a Fly Ezzy Trendy 3 phone.

image
(according to his version, the phone started first, but the employee was stronger)
')
The realization that the telephone book remained with the defeated did not come immediately. And after some time, the employee turned to the nearest service with a request to retrieve the phone book.

The story could have ended there, but for some reason the service was denied to him under the pretext that they did not have a specialized program for this phone.

Checked, it seems to turn on. In any case, the keyboard lights up.

We climb into Google and find out that the phone works on a MediaTek MT6261D processor. We look at what service programs are used to work with devices based on such processors. Choose MAUI META and at the same time download the driver package for devices based on MTK processors.

Here I became interested in the name of the program
And if META is Mobile Engineering Testing Architecture, as it follows from the documentation found , then with MAUI it is not entirely clear.

Here are the options:

  • Most Advanced User Interface
  • Multimodal Affective User Interface
  • Multimedia Application User Interface

But this is all the lyrics.

We install drivers, run MauiMETA, select FAT Editor, connect the phone and see the file system of the phone.

image

We copy the contents of NVRAM \ NVD_DATA to a computer and begin to study it intensively. It turned out that we need only two files MP0C_003 (names are stored here) and MP0H_006 (phone numbers are stored here). Also, there was a file with SMS MPA3_001, but we did not need them.

We will use Frhed. Determine the size of records in these files.

image
(here you can clearly see where the data ends and empty entries go)

The format of the record in the file with the names:


The format of the entry in the phone file is:


Now it would be nice to somehow automate the process of extracting phone numbers and names from files. Since there was a web server at hand and I can do a bit in php, I sketched a script, threw the files onto the server. The result was a file with entries of this type: contact name, phone number . Then imported into the table.

The content owner of the phone went away with a list of his contacts into the sunset.

PS Of sports interest, I decided to check whether the last two bytes of each record really are some checksum and, if so, what is its algorithm.

I read about 16-bit checksums like CRC16 and unsuccessfully selected the one that would suit me. Worn out and decided to use the "help room" "call a friend", who suggested that everything is much easier and there can be used a simple sum of all bytes of the record.

It turned out to be a bit more complicated: the odd bytes are summed separately and the result is compared with the first byte of the checksum, even numbers are compared with the second byte. Summation occurs without overflow.

Simple script
<?php $fd1 = fopen("MP0C_003", "rb") or die(); $fd2 = fopen("MP0H_006", "rb") or die(); while(!feof($fd1)) { // Name file $str = fread($fd1, 44); $data = substr($str, 0, -2); echo iconv("utf-16le", "utf-8", $data).","; // Number file $str = fread($fd2, 38); $data = substr($str, 0, -2); echo $data."\n"; } ?> 


Checking checksums on the example of a file with names
 <?php $fd1 = fopen("MP0C_003", "rb") or die(); while(!feof($fd1)) { $str = fread($fd1, 44); $cs1 = 0; $cs2 = 0; for($i = 0; $i < 42; $i++) { if($i%2) $cs1 = ($cs1 + ord($str[$i]))%256; else $cs2 = ($cs2 + ord($str[$i]))%256; } if($cs1 == ord($str[43]) && $cs2 == ord($str[42])) echo "Checksum is OK\n"; else echo "Checksum mismatch\n"; } ?> 


I hope that this note will help someone, but someone will just be amused.

Source: https://habr.com/ru/post/335528/


All Articles