adb shell


setprop sys.usb.config diag,adb

You must be rooted to give these commands as you may guess. What’s it for ? Latest command will open your phone’s Qualcomm Diag Port to work with. There may be some exceptions of course in which it won’t work, let me know if this happens in comments.

Remember our example phone in Part 1 was Xiaomi Mi5, you can either use this command, or depending on which rom you are you can use dial pad combination too, *#*#7177171#*#*. This info is valid for all Xiaomi Qualcomm’s not just Mi5. In Part 2 i will use a Mi5 S  to work with,  all Snapdragon 820 and 821 chipsets are the same when it’s about partition table,  video will be ready on my Youtube Channel soon . I will give info about older chipsets too. By the way i’m sorry that this guide took some time to be finished, but better than none right ? Plus you will get world’s largest QCN archive soon.

So we all know what’s a Qcn backup now. It’s a backup of modem related partitions in Qualcomm structure. Which also includes modem baseband info + imei info. Having this backup, we can edit “imei” line (or lines; some phone models have 1 line, dual sim models have 2 lines obviously and all LG 1 sim models have 3 lines of imei info).  But before that we will see how we can restore/upload the modified Qcn backup to the phone. If your imei became “0” somehow, you can edit an other Qcn taken from same model and restore your imei (+baseband) uploading that Qcn to your phone, no need for any other steps. BUT if you messed up your baseband (=invalid imei), you need to get rid of the write protection before. For this we are going to “empty/zero” necessary modem partitions = to delete the old/wrong values. After that we will be able to upload any Qcn  we want, without any problems and errors. That is the answer why some readers having difficulties to restore Qcn’s to their phones. To do that, our phones must be rooted, because these are deep stuff now and we need to be very careful in every step. Saying it again, VERY CAREFULLY ! If you delete a wrong partition without checking it twice, you may end up with hard bricked phone in your hands. For many Chinese brands that won’t be a problem because they have their rescue roms, you can read those unbrick guides in my “UNBRICK” section, but for LG, HTC and some other known makers, you won’t have any PC based method to fix them, so VERY CAREFULLY !.

adb shell


ls -al /dev/block/platform/soc/624000.ufshc/by-name (this is for new Snapdragon 820 series, it’s just ls/list command with right parameters. If this command won’t list your partition table by name just go back till /platform and see what your partition tables continues with)


This is the inside of your Snapdragon 820/821 based Xiaomi. Only 3 part form here matters for us, modemst1, modemst2 and fsg, those the partititions hosting your baseband and imei info (not all Snapdragons, but most Chinese made Qualcomms). Please keep in mind, this is very important, numbers are variable depending on the phone model, so names are important for us, not numbers, don’t try these numbers on a phone other then Mi 5 series, just list your parititon table and look for modemst1, modemst2 and fsg. Let’s zero/emty these 3 partitions :

dd if=/dev/zero of=/dev/block/sdf3

dd if=/dev/zero of=/dev/block/sdf5

dd if=/dev/zero of=/dev/block/sde28


Your phone will boot with an “invalid” imei, this means all the info is deleted. No need to worry as long as you have your QCN backup somewhere safe. Speaking of, its time to edit our QCN backup, let’s say our friend’s QCN backup with our imei number so we can fix our baseband including the right imei number.


Search for the line starting with “088a“, IF your imei is starting with number “8”. The number before “A” is always your first imei number and thats what matters for us. If your imei number is starting with “3” for example, CTRL + F and find the line starting with “083a” (hex values only, untick “find text” if you are using same hex editor).


Prepare “imei converter” program that you have download before and put your desired imei number in it, click “convert imei” and you will get the right format that you need to put in your hex editor. Rest is easy just carefully change the line right after “08xA” including your first number with “x”.


Do the same for your second imei number hitting “F3” and finding the right line starting with “08xA“.


After you finished editing “SAVE AS” your QCN ! Don’t save it on the original backup, if you have done something wrong editing your original QCN file then you may corrupt it and there is no way to return and edit it again. So this is very important “save as” your new QCN with any name ending with “.qcn“.


You may guess the rest, remember we backed up our QCN in our Part 1 ? Now we will just do the same choosing “Restore” from “Software Download” opiton in QPST, with our new edited QCN file of course.


After you see “Memory Restore Completed” just reboot your manualy or with the “adb reboot” command from cmd.

You can use this method for almost every Chinese Qualcomm ( OnePlus owners sorry you can’t edit imei number, it’s encrypted ) + LG phones.

Your baseband including your imei number in it is fixed now, you are wellcome 🙂 See you in the next guide.

PS : Changing the imei number of your phone is ILLEGAL, do this steps to fix your lost original imei number or/and to fix your baseband ONLY !.

Ultimate Guide : Qualcomm Snapdragon imei and Baseband Repair / Fix – Part 1

Copyright © 2016 by All rights reserved.

Leave a Reply

141 Yorum - "Ultimate Guide : Qualcomm Snapdragon imei and Baseband Repair / Fix – Part 2"

Sıralama:   En Yeniler | Eskiler | Beğenilenler

I have a xiaomi mi5 and im trying to change the imei, but when i do everything and check the imei, it doesnt change. my phone is not root, but i enter to diagnostic mode with the keynumbers, i dont do the empty part because i just want to change the number but nothing works. the imei doesnt change


any idea if there is any way to make this work for sony xperia z5 compact? I did everthing successfully but it seems dd if=/dev/zero of=/dev/block/sdf3 functions can not remove imei info from device. After I restore changed .xqcn file and reboot, original imei appears again. Any help will be very much appreciated.


hi there, can you provide me qcn file for oppo r7f. my dual sim isn’t working and i never backup it before. how can i restore this?


Hi there,
I had successfully backed up the QCN, but when I open it in the hex editor I cannot find me converted IMEI in it. My IMEI starts with 8 but there is no hexadecimal string “088a” in the file.
I figured it out:
In my file IMEI is stored as string not as hex with spaces between each two figures.
So my IMEI string starts with “08 8A ” which in hex translation is “3038 2038 4120”.
I have Xiaomi Mi Note 2 with Global ROM

Hi there, I have two questions: 1) Do you have a anomymized / dummy QNC file for an Oppo Find 7? My phones is bricked ): Sahara Unbricking was succesful for the part regarding the recovery of the original partition layout. But ColorOS is still giving me the “NV partition is invalid” and the phone is now useless ): This would be so great, if someone could provide me a backup! 2) I read that you can also use QFIL for the backup and recovery of an qcn file. But when I use QFIL the file gets significantly smaller. Why… Read more »

Hello good day, I tried to convert the modemst1-2 and fsg partitions to zero but when I restart I do not get “invalid imei”, it is the same as before, it is a xiaomi my max
best regard.


Hi, I did something wrong on my Sony xz and now I don’t have a valid imei, I did everything on this tutorial and I didn’t get my imei back, can you help me? I can pay for the help =)


is this method work in le max 2?
i tried but still geting no service

actually i tried backed up with qcn after imei currupt so edited and restored no result


what will be the command list for partition table of redmi note 4 snapdragon 625?
i tried till /platform but it shows just
ls -al /dev/block/platform/
drwxr-xr-x root root 1970-03-14 07:44 soc

how i could get the full partition table? PLZZZZ HELP ASAP

for all those who face error:” Received an invalid command from the phone ” which I surf and see no one really answered, I used qpil instead of qpst and it worked. it has imei(qcn) restore/backup and it can connect and make successfuly repair it.(the driver name used: qualcomm hs-usb diagnostics 8000)and at first attempt and after reboot,only meid&imei was fixd,but again I click restore and after reboot, phones got working…plz admin add this as a notice at the bottom of the guide(i tried NV-items_reader_writer & writedualimei but none of those 3 worked…. it was frustrating and itersting how one… Read more »

can you explain further? since there’s no such thing as qpil… please explain!

Hi,just some device is OT-9022x qualcomm msm8909 SoC and I used partitions backup app for save my imei…it highlights the partitions EFSDATA, modem,modemst1, modemst2 which can have imei, while you only indicate modemst1,modemst2 and fsg ( I also have fsg partitions, please see below the output). So my question is : Are you sure that I only need to inject zeros in those partitions? For further details this is the command that I run : ls -al /dev/block/platform/7824900.sdhci/by-name my output is : lrwxrwxrwx root root 1970-01-01 02:41 DDR -> /dev/block/mmcblk0p19 lrwxrwxrwx root root 1970-01-01 02:41 aboot -> /dev/block/mmcblk0p22 lrwxrwxrwx… Read more »

Thanks for the answer…since I have rooted device,but not bootloader unlocked (I mean no custom recovery so far it seems available) is it safer not to follow this procedure ? Because in the event that something goes wrong I wasn’t able to restore my device. Can you confirm that?


Hi! the axon 7 owner again. I extract the QCN file, but I can’t restore a QCN file. The program QPST show me that “Memory Restore Completed” and the phone reboot; but the problem is the phone don’t change. The same happens with the program “WriteDualIMEI(W+G_eMMC)” it show me a green PASS, I reboot the phone but nothing change.

Paulo Barbosa

Hi, nice guides-and-tips. I need qcn file for redmi note 4x,do You Knowles Wheels i can get.


First of all: excellent tutorial!
But AndroidBrick, I’ve got a problem.
I have an Moto G Play (XT1600) which had a Qualcomm MSM8916 SoC.
I just can read information from QPST Configuration tool, I can even backup my QCN information, but I can’t restore QNC files to it, even the original QCN backup won’t write. I’ve tried QPST version 437 and various other versions, but everytime I get a message sayin’ that QPST can’t write information.
Can you help?

sravya raju

Hi Androidbrick, My Google Nexus 5 phone is formated and its now showing imei as zero, will this fix work for nexus 5?

Anees Rahman

I need to edit the imei and paste my original one in qcn

Anees Rahman

How to edit the qcn in OnePlus one
Mail id [email protected]

Chathura Madushan

is this method working with nexus 6p?

Filip Van Durme
Dear Androidbrick, thank you for the comprehensive guides. I have a Nubia Z11 mini NX529 64GB (Chinese version I think) and after a rom update I didn’t have any carrier service anymore. A second problem was that the phone only read SIM2. My IMEI and MEID numbers were OK. I followed your guide (backup QCN, delete modem partitions and restored QCN) but the result was the same. No service at all. I also tried the Nubia recovery tool with a recovery image and a stock Chinese rom but still no luck. Did you encounter a problem like that and can… Read more »
Özkan Sezer

Bildiğiniz gibi Türkiyede belirli lte bandları kullanılıyor. Bazı telefonların (özellikle asya ve amerika menşeli olanlar) lte bandları Türkiye’dekilerle kesişmiyor. Bunların eklenmesi mümkün müdür?

%d blogcu bunu beğendi: