ipwndfu icon indicating copy to clipboard operation
ipwndfu copied to clipboard

problem with "ValueError: The device has no langid" everytime

Open Veisen opened this issue 5 years ago • 14 comments

under windows

C:\hackicko\ipwndfu-master>python ipwndfu -p *** checkm8 exploit by axi0mX *** Found: CPID:8960 CPRV:11 CPFM:03 SCEP:01 BDID:10 ECID:00000575F25BD9D0 IBFL:1C SRTG:[iBoot-1704.10] Traceback (most recent call last): File "ipwndfu", line 66, in checkm8.exploit() File "C:\hackicko\ipwndfu-master\checkm8.py", line 489, in exploit device.serial_number File "C:\hackicko\ipwndfu-master\usb\core.py", line 830, in serial_number self._serial_number = util.get_string(self, self.iSerialNumber) File "C:\hackicko\ipwndfu-master\usb\util.py", line 314, in get_string raise ValueError("The device has no langid") ValueError: The device has no langid

under ubuntu

root@ubuntu:/home/ubuntu/ipwndfu# sudo python ipwndfu -p *** checkm8 exploit by axi0mX *** Found: CPID:8960 CPRV:11 CPFM:03 SCEP:01 BDID:10 ECID:00000575F25BD9D0 IBFL:1C SRTG:[iBoot-1704.10] Traceback (most recent call last): File "ipwndfu", line 66, in checkm8.exploit() File "/home/ubuntu/ipwndfu/checkm8.py", line 510, in exploit if 'PWND:[checkm8]' not in device.serial_number: File "/home/ubuntu/ipwndfu/usb/core.py", line 830, in serial_number self._serial_number = util.get_string(self, self.iSerialNumber) File "/home/ubuntu/ipwndfu/usb/util.py", line 314, in get_string raise ValueError("The device has no langid") ValueError: The device has no langid

Veisen avatar Sep 29 '19 02:09 Veisen

same error with iPhone 7 plus , iOS 12.4.1 on macOS 10.14.5

oylbin avatar Sep 29 '19 05:09 oylbin

same error with iPhone 7 plus , iOS 12.4.1 on macOS 10.14.5

under windows

C:\hackicko\ipwndfu-master>python ipwndfu -p *** checkm8 exploit by axi0mX *** Found: CPID:8960 CPRV:11 CPFM:03 SCEP:01 BDID:10 ECID:00000XXXXXXXXXX IBFL:1C SRTG:[iBoot-1704.10] Traceback (most recent call last): File "ipwndfu", line 66, in checkm8.exploit() File "C:\hackicko\ipwndfu-master\checkm8.py", line 489, in exploit device.serial_number File "C:\hackicko\ipwndfu-master\usb\core.py", line 830, in serial_number self._serial_number = util.get_string(self, self.iSerialNumber) File "C:\hackicko\ipwndfu-master\usb\util.py", line 314, in get_string raise ValueError("The device has no langid") ValueError: The device has no langid

under ubuntu

root@ubuntu:/home/ubuntu/ipwndfu# sudo python ipwndfu -p *** checkm8 exploit by axi0mX *** Found: CPID:8960 CPRV:11 CPFM:03 SCEP:01 BDID:10 ECID:00000XXXXXXXXXX IBFL:1C SRTG:[iBoot-1704.10] Traceback (most recent call last): File "ipwndfu", line 66, in checkm8.exploit() File "/home/ubuntu/ipwndfu/checkm8.py", line 510, in exploit if 'PWND:[checkm8]' not in device.serial_number: File "/home/ubuntu/ipwndfu/usb/core.py", line 830, in serial_number self._serial_number = util.get_string(self, self.iSerialNumber) File "/home/ubuntu/ipwndfu/usb/util.py", line 314, in get_string raise ValueError("The device has no langid") ValueError: The device has no langid

This can happen here and there. It means, it could not return a 16-bit integer. As stated in: util.py

A USBError may be raised from this function for some devices that have no string support, instead of returning an empty tuple. The accessor for the langids property on Device catches that case and supplies an empty tuple, so client code can ignore this detail by using the langids property instead of directly calling this function.

Use Language Id for Reference: https://github.com/haiku/haiku/blob/master/headers/os/drivers/usb/USB_langIDs.h In the same file;

if 0 == index:
    return None
from usb.control import get_descriptor //Import the get_descriptor from usb.control class/function.
langids = dev.langids //Set up the Device object to return a string.
if 0 == len(langids): //If 0x0000 is returned from the 'integer bit' and equal to the length of language identifer then, Raise an error (also called an exception)

=> raise ValueError("The device has no langid") //Error [You're getting] if langid is None: //If it is "" || Null. langid = langids[0] elif langid not in langids: //else if language identifier/Id is NOT in languageId return Error. raise ValueError("The device does not support the specified langid") // Device is simply not supported?

TempAccountNull avatar Sep 29 '19 09:09 TempAccountNull

help same

smokinjs247DriodStyle avatar Sep 29 '19 13:09 smokinjs247DriodStyle

Try running CMD as Administrator.

wxb1ank avatar Sep 29 '19 14:09 wxb1ank

Try running CMD as Administrator.

alse not work, I've try it in ubuntu using "sudo ./ipwndfu -p"

Levin000 avatar Sep 29 '19 16:09 Levin000

That happened when the device was reset and wasn't set up yet, for example if the boot menu asks you to set up a language).

Patch (that is usb/util.py, around line 313`):

    if 0 == len(langids):
        # raise ValueError("The device has no langid")
        langid = 0x0409 # or just pick one from the list in USB_langIDs.h
    if langid is None:
        langid = langids[0]
    elif langid not in langids:
        print(langids)
        # raise ValueError("The device does not support the specified langid")

However, after that the device still fails with ERROR: Exploit failed. Device did not enter pwned DFU Mode. so it's probably best to get it set up first.

infosecabaret avatar Sep 29 '19 17:09 infosecabaret

That happened when the device was reset and wasn't set up yet, for example if the boot menu asks you to set up a language).

Patch (that is usb/util.py, around line 313`):

    if 0 == len(langids):
        # raise ValueError("The device has no langid")
        langid = 0x0409 # or just pick one from the list in USB_langIDs.h
    if langid is None:
        langid = langids[0]
    elif langid not in langids:
        print(langids)
        # raise ValueError("The device does not support the specified langid")

However, after that the device still fails with ERROR: Exploit failed. Device did not enter pwned DFU Mode. so it's probably best to get it set up first.

on windows is not working on linux with sudo is it without errors but it is not working (reboot only)

Veisen avatar Sep 29 '19 19:09 Veisen

This is fixed as of the latest commits

elihwyma avatar Sep 30 '19 19:09 elihwyma

Why i have this issue in last commit

Veisen avatar Oct 02 '19 07:10 Veisen

Theres two conversations going about this. I wouldn't call it fixed, but the issue can come down to a number of factors external to ipwndfu. Like as a few have pointed out permissions, or the device disconnecting.

geelongmicrosoldering avatar Oct 02 '19 07:10 geelongmicrosoldering

easy fix. i had the same problem on ubuntu. you have to run type sudo in front of the command. for example: sudo ./ipwndfu -p --boot for verbose boot. although, some people are having issues with verbose boot not working even though the device goes into pwnd dfu mode

thatguypix19 avatar Oct 06 '19 22:10 thatguypix19

Same issue on my device

izaman1 avatar Oct 11 '19 15:10 izaman1

easy fix. i had the same problem on ubuntu. you have to run type sudo in front of the command. for example: sudo ./ipwndfu -p --boot for verbose boot. although, some people are having issues with verbose boot not working even though the device goes into pwnd dfu mode

doubted this solution at first XD but fixed the langid issue but nicely gave me a better error "Device not supported" on my IPhone 6s im happier with a simple explanation like "not supported yet" than a cryptic issues like langid

ghost avatar Oct 29 '19 00:10 ghost

easy fix. i had the same problem on ubuntu. you have to run type sudo in front of the command. for example: sudo ./ipwndfu -p --boot for verbose boot. although, some people are having issues with verbose boot not working even though the device goes into pwnd dfu mode

doubted this solution at first XD but fixed the langid issue but nicely gave me a better error "Device not supported" on my IPhone 6s im happier with a simple explanation like "not supported yet" than a cryptic issues like langid

Do you happen to know if there is something else to do after you get the message "not supported yet" ?

xmarin avatar May 01 '20 02:05 xmarin