Skip to content
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

Type Error #32

Open
paulsonmathew21 opened this issue Jul 1, 2021 · 1 comment
Open

Type Error #32

paulsonmathew21 opened this issue Jul 1, 2021 · 1 comment

Comments

@paulsonmathew21
Copy link

Continuous Type error exceptions are occurred whilst executing the tool as shown below.

[INFO ] [Interface] Calling get_descriptor (stage: "interface_descriptor")
[ERROR ] Traceback (most recent call last):
File "/usr/local/lib/python3.9/dist-packages/umap2/fuzz/helpers.py", line 76, in wrapper
response = func(self, *args, **kwargs)
File "/usr/local/lib/python3.9/dist-packages/umap2/core/usb_interface.py", line 130, in get_descriptor
d += e.get_descriptor(usb_type, valid)
File "/usr/local/lib/python3.9/dist-packages/umap2/core/usb_cs_interface.py", line 63, in get_descriptor
response = struct.pack('BB', length & 0xff, descriptor_type) + self.cs_config
TypeError: can't concat str to bytes

[ERROR ] File "/usr/local/bin/umap2scan", line 8, in
sys.exit(main())
File "/usr/local/lib/python3.9/dist-packages/umap2/apps/scan.py", line 80, in main
app.run()
File "/usr/local/lib/python3.9/dist-packages/umap2/apps/scan.py", line 50, in run
device.run()
File "/usr/local/lib/python3.9/dist-packages/umap2/core/usb_device.py", line 144, in run
self.phy.run()
File "/usr/local/lib/python3.9/dist-packages/umap2/phy/facedancer/max342x_phy.py", line 194, in run
self.service_irqs()
File "/usr/local/lib/python3.9/dist-packages/umap2/phy/facedancer/max342x_phy.py", line 217, in service_irqs
self.connected_device.handle_request(b)
File "/usr/local/lib/python3.9/dist-packages/umap2/core/usb_device.py", line 250, in handle_request
handler(req)
File "/usr/local/lib/python3.9/dist-packages/umap2/core/usb_device.py", line 322, in handle_get_descriptor_request
response = response(dindex)
File "/usr/local/lib/python3.9/dist-packages/umap2/core/usb_device.py", line 337, in get_configuration_descriptor
return self.configurations[num].get_descriptor()
File "/usr/local/lib/python3.9/dist-packages/umap2/fuzz/helpers.py", line 76, in wrapper
response = func(self, *args, **kwargs)
File "/usr/local/lib/python3.9/dist-packages/umap2/core/usb_configuration.py", line 97, in get_descriptor
interface_descriptors += i.get_descriptor(usb_type, valid)
File "/usr/local/lib/python3.9/dist-packages/umap2/fuzz/helpers.py", line 76, in wrapper
response = func(self, *args, **kwargs)
File "/usr/local/lib/python3.9/dist-packages/umap2/dev/audio.py", line 173, in get_descriptor
return super(USBAudioControlInterface, self).get_descriptor(usb_type, valid)
File "/usr/local/lib/python3.9/dist-packages/umap2/fuzz/helpers.py", line 79, in wrapper
self.logger.error(''.join(traceback.format_stack()))

[ERROR ] Traceback (most recent call last):
File "/usr/local/lib/python3.9/dist-packages/umap2/fuzz/helpers.py", line 76, in wrapper
response = func(self, *args, **kwargs)
File "/usr/local/lib/python3.9/dist-packages/umap2/dev/audio.py", line 173, in get_descriptor
return super(USBAudioControlInterface, self).get_descriptor(usb_type, valid)
File "/usr/local/lib/python3.9/dist-packages/umap2/fuzz/helpers.py", line 80, in wrapper
raise e
File "/usr/local/lib/python3.9/dist-packages/umap2/fuzz/helpers.py", line 76, in wrapper
response = func(self, *args, **kwargs)
File "/usr/local/lib/python3.9/dist-packages/umap2/core/usb_interface.py", line 130, in get_descriptor
d += e.get_descriptor(usb_type, valid)
File "/usr/local/lib/python3.9/dist-packages/umap2/core/usb_cs_interface.py", line 63, in get_descriptor
response = struct.pack('BB', length & 0xff, descriptor_type) + self.cs_config
TypeError: can't concat str to bytes

[ERROR ] File "/usr/local/bin/umap2scan", line 8, in
sys.exit(main())
File "/usr/local/lib/python3.9/dist-packages/umap2/apps/scan.py", line 80, in main

@zackcheema
Copy link

I fixed this issue by using python2.7. You'll need to specify the path for the command. This can be found using the whereis command as so "whereis umap2scan". Make sure you're installing the package for python2.7. When installing packages use the target parameter like so "pip install --target=/usr/lib/python2.7/dist-packages/". Here is an example of running the scanning command "python2.7 /usr/local/bin/umap2scan –P fd:/dev/ttyUSB0".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants