-
Notifications
You must be signed in to change notification settings - Fork 209
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WIN32: Libirecovery is not working with Apple device drivers 423.36.0.0 from Windows Update #41
Comments
It seems to fail at this line 1747 on libirecovery.c with error code -1: |
iTunes logs from older driver: iTunes logs from 423.36.0.0 driver: In libirecovery.c function irecv_usb_control_transfer() bRet gets false and last error code is 2: |
@taanders it seems issue with DeviceIoControl but 3utools and itunes is also using DeviceIoControl and able to restore the device with latest drivers as well...not sure might be possible they are using different dwIoControlCode |
|
Ah forget my comment, I didn't see the second sscanf of your changes since it was off screen, sorry. |
How about this patch: |
@Johnny314 if you have any fix it would be nice to post it here so others can profit from it too. Thanks. |
@nikias Your patch seems to work well with those new Apple drivers. @Johnny314 Can you send working dwIoControlCode to this issue? |
@taanders pushed to master. |
Thanks @nikias for your commit . I tried to set other DeviceIoControl dwIoControlCode values for those packets which bm_request_type is 65. With value 0x2200B8 I got then error code -4 which means IRECV_E_INVALID_INPUT and with value 0x22000C I got error code -8 which means IRECV_E_USB_INTERFACE.
I'm not sure if those values are helpful for solving this issue. |
@Johnny314 Should there be also some other modifications on libirecovery? I was not able to finish device flashing by replacing only that line on IRECV_API int irecv_usb_bulk_transfer(...) to use 0x2201b6 dwIoControlCode. I tried to set that value 0x2201b6 also there but then device Extracting iBEC.iphone6.RELEASE.im4p... This code below seems to exit because bRet is set to false. It seems to happen on bm_request_type 65 package.
|
@taanders i just changed dwIoControlCode and able to restore device successfully |
Hello, Thank you for this patch, it works with new drivers in Windows 10. Nevertheless, new drivers don't seems to be available in Windows 7, Windows Update indicate old drivers are up to date. Is it possible to add compatibility with both old and new drivers ? Thank you. |
@Orbif i have tested iphone 7 in Windows 10 its working with both old and new driver |
this code current work with both old and new driver |
Thanks @Johnny314, I got idevicerestore also working with adding that 0x2201B6 to IRECV_API int irecv_usb_bulk_transfer(...). @nikias I think there is still some issue when parsing that device serial number line. With modifications on your earlier commit it seems to work ok with new Apple drivers but with older Apple drivers parsing gets confused to last line part "\0000". I had problems when I tested with my old modifications from first commit. That code missed adding end line at the end of string. Those modifications caused then some strange actions later.
|
@taanders hmm ok right... I didn't really test the code. I committed another fix for it. |
so guys, what is the solution now? I am a little confused what makes it actually work. I wonder how we would determine when to use what dwIoControlCode value. 0x220195 certainly came from somewhere but the question is when did it change and how do we detect that... |
I think those dwIoControlCode values have been used long time. I found some other 7-year-old Ruby project where those dwIoControlCodes are listed. This dwIoControlCode change from 0x220195->0x2201B6 might have been some bug/security issue/protocol change on older Apple drivers which is now fixed on those new drivers. https://github.com/lite/irestore-win32 0x22000C = reset |
@airwolf2026 can you explain the second DeviceIoControl there? It seems to read a status code or something? It wasn't there before and it doesn't seem to be necessary for it to work... |
@taanders so you modified both irecv_usb_bulk_transfer and irecv_usb_control_transfer? Or just irecv_usb_bulk_transfer? |
Ok so I tried @airwolf2026's approach, but to make it work I had to change this part in error = irecv_usb_set_interface(client, 1, 0);
/*error = irecv_usb_set_interface(client, 0, 0);
if (client->mode > IRECV_K_RECOVERY_MODE_2) {
if (client->mode > IRECV_K_RECOVERY_MODE_2) {
error = irecv_usb_set_interface(client, 1, 1);
}
}*/ I took it from the win32device.rb - did you guys have to do that too @taanders @Johnny314 ? |
By now ,I can't reproduce The second DeviceIoControl program flow. maybe reverse from another tool? 3u |
Hi @nikias, sorry for late reply. I had that change only at irecv_usb_bulk_transfer function. It was possible to bypass this error when that line changed: "ERROR: Unable to send iBEC component: Unable to upload data to device" |
I spent last week by testing situation like in this issue: libimobiledevice/idevicerestore#132 I had some strange actions on Windows side. I had uninstalled those 423.36.0.0 drivers with pnputil /delete-driver oemXX.inf /force. Those drivers appeared still somewhere for devices which changed mode from normal mode -> recovery mode -> flashing mode. I used USBDeview to get rid of 423 drivers. It is strange that I was able to flash 4 ios devices succesfully at the same time with that Startech ST1030USBM USB hub sometimes multiple times sequentially. When I disconnected devices and then restarted same test with same HW setup then it might work very different way. Sometimes only 2/4 devices were flashed successfully on sequentially test runs. I got this error: ERROR: Unable to receive message from FDR 03CF0870 (-4). 0/2 bytes Followed by endless entries of: It was strange that usually those failing flashed were coming from same USB ports of those hubs. Another strange thing is that I get maybe only 1/100 of those FDR errors if I use some other USB hubs like this cheap and awful (works great, just build quality is cheap): |
Hi @nikias and @taanders i use 0x2201b6 dwIoControlCode. I tried to set that value 0x2201b6 also there but then device Extracting iBEC.iphone6.RELEASE.im4p... Kindly provide me updated where is fail my code. or another solution for it... Thanks in Advanced |
hi @nikias and @taanders, |
Hi All, i restore my device but it create error again and again on windows 10... Extracting recoverymode@1334~iphone-lightning.im4p... Details in attached file.. kindly provide the update what is the solution of this error, i am using latest libmobiledevice code with visual studio 2019... thanks in advanced.... |
libirecovery is not working with Apple device drivers 423.36.0.0 from Window Update. I tried to use idevicerestore -e -l command with iPhone 5S model and it cannot complete. iTunes can do restore process with this Windows Update driver and older Apple delivered driver from AppleApplicationSupport.msi.
Not working driver:
'''
Original Name: appleusb.inf
Provider Name: Apple, Inc.
Class Name: Universal Serial Bus -laitteet
Class GUID: {88bae032-5a81-49f0-bc3d-a4ff138216d6}
Driver Version: 05/07/2018 423.36.0.0
Signer Name: Microsoft Windows Hardware Compatibility Publisher
'''
Device instance path line seems to be changed to line like on libirecovery mobiledevice_connect(recv_client_t* client, unsigned long long ecid) "get iBoot path" line 669 :
'''
\?\usb#vid_05ac&pid_1281&mi_00#8&37932c9b&0&0000#{ed82a167-d61a-4af6-9ab6-11e52236c576}\usb#vid_05ac&pid_1281#cpid:8960_cprv:11_cpfm:03_scep:01_bdid:02_ecid:000007f6f24358d0_ibfl:1d_srnm:[dnplr9abffgc]#mux1
'''
I modified that code to like this and was able to move little longer on idevicerestore process with those drivers.
My modified code:
'''
'''
After this modification idevicerestore fails at libidevicerestore at this point:
Sending iBEC (714456 bytes)...
ERROR: Unable to send iBEC component: Unable to upload data to device
The text was updated successfully, but these errors were encountered: