HexHive / teezz-fuzzer

22 stars 2 forks source link

IndexError:list index out of range in /opt/caid/caid/libdeps.py, line 394, in build_dependency_graph #2

Open Clingto opened 1 year ago

Clingto commented 1 year ago

Hi, when I use teezz-caid tool on HUAWEI P20 device, my command is "make run DEVICE_ID=xxx LIB_PATH=/system/lib64", and I get the error bellow:

INFO:caid.libdeps: Building dependency graphINFO:caid.libdeps:ELF dep graphINFO:caid.libdeps:VDEX dep
graphINFO:caid.libdeps:Accumulating results 1
Traceback (most recent call last): File "/usr/lib/python3.8/runpy.py", line 194, in run module asreturn _run_code(code, main globals, None, File "/usr/lib/python3.8/runpy.py", line 87, in _run_codeexec(code, run_globals)
File "/opt/caid/caid/main..py", line 74, in df .main() File "/opt/caid/caid/libdeps.py", line 526, in maindependencies = self.build dependency_graph(
File "/opt/caid/caid/libdeps.py", line 394, in build dependencydep_path = candidates[o].full name
IndexError: list index out of rangemake: ***[Makefile:19; run] Error 1

IndexError:list index out of range in /opt/caid/caid/libdeps.py, line 394, in build_dependency_graph

0ddc0de commented 1 year ago

Hi @Clingto, thanks for your interest in TEEzz.

The LIB_PATH should point to the vendor library that provides a common interface to the TEE driver. On Huawei devices LIB_PATH is ususally /vendor/lib64/libteec.so. But, check again where the libteec.so is located on your device.

Clingto commented 1 year ago

Hi @Clingto, thanks for your interest in TEEzz.

The LIB_PATH should point to the vendor library that provides a common interface to the TEE driver. On Huawei devices LIB_PATH is ususally /vendor/lib64/libteec.so. But, check again where the libteec.so is located on your device.

Thank you for your reply. I have done a detailed search on Huawei P20 device using the "find -name libteec.so" command with superuser privileges in ADB , and found that the only directories where the libteec.so file exists are /system/lib64/libteec.so and /system/lib/libteec.so. I tried the command "make run DEVICE_ID=xxx LIB_PATH=/system/lib64/libteec.so", but the error remains the same.

0ddc0de commented 1 year ago

Are you using the docker compose setup? I ran it again on my P20Lite and cannot reproduce your error. Can you share some stats of the inout directory? E.g.,

It looks like the files from the phone are not copied to your host. For my P20 Lite the stats look like this:

$ find inout/ -maxdepth 2
inout/
inout/elfs
inout/elfs/vendor
inout/elfs/cust
inout/elfs/data
inout/elfs/system
inout/elfs/mnt
inout/elfs/odm
inout/elfs/root
inout/elfs/product
inout/elfs/sbin
inout/vdexs.json
inout/deps.png
inout/deps.dot
inout/elfs.json
inout/deps_flat.dot
inout/jadx-source
inout/jadx-source/cust
inout/jadx-source/data
inout/jadx-source/system
$ find inout/elfs/ | wc -l
4471
$ find inout/jadx-source/ | wc -l
200494
Clingto commented 1 year ago

Are you using the docker compose setup? I ran it again on my P20Lite and cannot reproduce your error. Can you share some stats of the inout directory? E.g.,

  • find inout/ -maxdepth 2
  • find inout/elfs/ | wc -l
  • find inout/jadx-source/ | wc -l

It looks like the files from the phone are not copied to your host. For my P20 Lite the stats look like this:

$ find inout/ -maxdepth 2
inout/
inout/elfs
inout/elfs/vendor
inout/elfs/cust
inout/elfs/data
inout/elfs/system
inout/elfs/mnt
inout/elfs/odm
inout/elfs/root
inout/elfs/product
inout/elfs/sbin
inout/vdexs.json
inout/deps.png
inout/deps.dot
inout/elfs.json
inout/deps_flat.dot
inout/jadx-source
inout/jadx-source/cust
inout/jadx-source/data
inout/jadx-source/system
$ find inout/elfs/ | wc -l
4471
$ find inout/jadx-source/ | wc -l
200494

Yes, I use docker compose setup as the command of teezz-caid repo's README.md file.

$ find inout/ -maxdepth 2
inout/
inout/elfs.json
inout/elfs
inout/elfs/data
inout/elfs/prets
inout/elfs/vendor
inout/elfs/hw_product
inout/elfs/apex
inout/elfs/sbin
inout/elfs/system
inout/elfs/preavs
inout/elfs/odm
inout/jadx-source
inout/jadx-source/data
inout/jadx-source/system
inout/vdexs.json
$ find inout/elfs/ | wc -l
6391
$ find inout/jadx-source/ | wc -l
3976