libimobiledevice / libirecovery

Library and utility to talk to iBoot/iBSS via USB on Mac OS X, Windows, and Linux
https://libimobiledevice.org
GNU Lesser General Public License v2.1
550 stars 207 forks source link

device path parsing for winusb driver #113

Closed mexmer closed 1 year ago

mexmer commented 1 year ago

fix for https://github.com/libimobiledevice/libirecovery/issues/112 also replacing PSP_DEVICE_INTERFACE_DETAIL_DATA with PSP_DEVICE_INTERFACE_DETAIL_DATA_A (ansi version) and CreateFile with CreateFileA (ansi version), to prevent errors when compiling with msvc and unicode support ( -DUNICODE )

nikias commented 1 year ago

Hi, I already merged the ANSI change, but I am confused a bit about the path parsing, since the example you mention on #112

\\?\usb#vid_05ac&pid_1281&mi_01#7&fe42a63&0&0001#{b8085869-feb9-404b-8cb1-1e5c14fa8c54}\usb#vid_05ac&pid_1281#sdom:01_cpid:8010_cprv:11_cpfm:03_scep:01_bdid:0c_ecid:ECIDNUMBER_ibfl:3d_srnm:[DEVICESERIAL]#mux1"

Is perfectly fine parsed with the current code. It doesn't match the first \usb but the second (the one without the &mi_01) and can extract the values just fine. Or am I missing something?

mexmer commented 1 year ago

@nikias your original code didn't parse nonce from code for some reason, but when i look at it now, it should, since as you say, it should skip first usb with mi, and proceed to second.

i will check it again, maybe it's unnecessary, as you say.

nikias commented 1 year ago

Ok I will close the PR. If you discover this is still an issue, feel free to reopen it.