python-validity icon indicating copy to clipboard operation
python-validity copied to clipboard

Support for 06cb:0081

Open sandervankasteel opened this issue 3 years ago • 11 comments

I'm trying to see, if it was possible to for this project to support the 06cb:0081, so I was trying to setup https://github.com/uunicorn/synaWudfBioUsb-sandbox and see if I could find something useful for the 06cb:0081 device.

But if I look at the README of the sandbox project, I need to copy over some .xpfwext-files (which doesn't exist for the Windows drivers belong to 06cb:0081 and the INF also has the only reference to the .xpfwext-files commented out:

;Firmware extensions - not used for this Customer Project
;6_07f_lenovo.xefwext=1

Contents of my extracted driver package:

[0] % innoextract huy103af07m6.exe 
Extracting "Finger Print Driver" - setup data version 5.5.7 (unicode)
 - "app/dpinst.exe" - overwritten
 - "app/dpinst.xml" - overwritten
 - "app/dpinst.exe"
 - "app/dpinst.xml"
 - "app/DpinstWaterMark.bmp"
 - "app/Source/synaAdvAdapter.dll"
 - "app/Source/synaumdf.cat"
 - "app/Source/synaWudfBioLenovoLBG.inf"
 - "app/Source/synaWudfBioUsb.dll"
 - "app/Source/WudfUpdate_01011.dll"
 - "app/dpinstWaterMark/DpinstWaterMark.bmp"
 - "app/dpinstWaterMark/DpinstWaterMark_right.bmp"

And when I try to run ./run.sh identify, it fails with the following error message;

=>0 0x000000007bc64eac stub_entry_point+0x5c(dll=<is not available>, name=<is not available>, ret_addr=<is not available>) [./dlls/ntdll/loader.c:282] in ntdll (0x0000000007f4ffd0)
  1 0x00000001800436e5 EntryPoint+0xfff4450c() in synawudfbiousb (0x0000000007f4ffd0)
  2 0x0000000180042cd0 EntryPoint+0xfff43af7() in synawudfbiousb (0x0000000007f4ffd0)
  3 0x0000000180042c95 EntryPoint+0xfff43abc() in synawudfbiousb (0x0000000007f4ffd0)
  4 0x000000007bcab4e1 call_thread_func+0x110(entry=0x180042c64, arg=0x23190) [./dlls/ntdll/signal_x86_64.c:4466] in ntdll (0x0000000007f4ffd0)
0x000000007bc64eac stub_entry_point+0x5c [./dlls/ntdll/loader.c:282] in ntdll: addq	$20,%rsp
Unable to access file './dlls/ntdll/loader.c'

Is there a way to make work without the xpfwext-files ?

Url of the driver: https://pcsupport.lenovo.com/nl/nl/products/laptops-and-netbooks/yoga-series/yoga-520-14ikb-type-81c8/downloads/driver-list/component?name=Vingerafdruklezer

sandervankasteel avatar Sep 16 '20 21:09 sandervankasteel

It should be safe to ignore xpfwext instructions as long as the Windows driver for your device does not have one. I'm not sure where or why it crashed, though. Can you upload the whole output?

uunicorn avatar Sep 17 '20 02:09 uunicorn

My logs can be found here: logs.zip

For future references, I had to comment out some parts of the run.sh because the script would fail without an output from ls ./*xpfwext

#!/bin/sh
set -e

#DEVICE=$(lsusb | grep 'Fingerprint' | awk -F '[^0-9]+' '{ print "/dev/bus/usb/" $2 "/" $3 }')
PWD=$(pwd)
BASENAME=$(basename "$PWD")
#XPFWEXT=$(ls ./*.xpfwext)

DEVICE=$(lsusb -d 06cb: | awk -F '[^0-9]+' '{ print "/dev/bus/usb/" $2 "/" $3 }')

docker run --rm -it \
    --device $DEVICE \
    --env-file ./.env \
    -v $PWD:/$BASENAME \
    -v $PWD/usb.txt:/root/.wine/drive_c/usb.txt \
    wine:validity wine64 "/${BASENAME}/a.exe" "$@" | tee "$(date +%s)".log

sandervankasteel avatar Sep 17 '20 10:09 sandervankasteel

Thanks.

My logs can be found here: logs.zip

Unhandled exception: unimplemented function POWRPROF.dll.PowerSettingRegisterNotification called in 64-bit code (0x000000007bc64eac).

This looks like the root cause of the crash. Your driver seems to be using API which is not unimplemented by this version of Wine. I'll try to add a stub later.

uunicorn avatar Sep 17 '20 10:09 uunicorn

Cool, thanks! :+1:

If you need any help, let me know :smile:

sandervankasteel avatar Sep 17 '20 11:09 sandervankasteel

Sorry I've disappeared for a month. I've just pushed the promised stub. I managed to reproduce your crash using the logs, and I can confirm that the stub stops it from happening. However it is still possible there are more missing things down the track.

uunicorn avatar Oct 17 '20 11:10 uunicorn

Sorry I've disappeared for a month. I've just pushed the promised stub. I managed to reproduce your crash using the logs, and I can confirm that the stub stops it from happening. However it is still possible there are more missing things down the track.

Don't worry about it :+1:

Thanks for stub, I'll check it out on my laptop :smile:. Should I run into other stuff missing, I'll see, if I can add those stubs myself (now I know how those stubs need to look like and of course make a PR to your repo)

sandervankasteel avatar Oct 18 '20 20:10 sandervankasteel

Hi, I tried to run the program as well and it still appears to be crashing. However, it did appear to print some blobs.

I'm not sure what's the cause of the crashing, but I'll send a log in case it's useful to someone.

1605168654.log

Danacus avatar Nov 12 '20 08:11 Danacus

Looking at the logs, winusb.dll stub has prevented the factory reset by intentionally crashing. The driver attempted to do a factory reset because of the initial handshake has failed. And it looks like the root cause of that is a bug in Wine crypto hacks:

0021:err:crypt:valid_protect_data info0 magic value not matched !
0021:err:crypt:valid_protect_data unrecognized CryptProtectData block
0021:fixme:crypt:CryptUnprotectData CryptUnprotectData received a DATA_BLOB that seems to have NOT been generated by Wine.  Please enable tracing ('export WINEDEBUG=crypt') to see details.
0021:trace:crypt:free_protect_data called
0021:trace:crypt:CryptUnprotectData returning FAIL

I'll have a closer look a bit later, but it looks promising.

uunicorn avatar Nov 12 '20 10:11 uunicorn

Any updates on this?

KarimTayie avatar Jan 17 '21 01:01 KarimTayie

Is this still being worked on? This project is by far the closest I've gotten to a working sensor on my flex 5-1570.

ZackGlenn avatar Oct 23 '21 07:10 ZackGlenn

User of one of these sensors, following the development.

Shot out if you need we run some test or whatsoever.

stdevPavelmc avatar Jul 23 '22 17:07 stdevPavelmc