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

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

Open
Clingto opened this issue Nov 8, 2023 · 4 comments

Comments

@Clingto
Copy link

Clingto commented Nov 8, 2023

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
Copy link
Collaborator

0ddc0de commented Nov 8, 2023

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
Copy link
Author

Clingto commented Nov 9, 2023

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
Copy link
Collaborator

0ddc0de commented Nov 9, 2023

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

@Clingto Clingto closed this as completed Nov 10, 2023
@Clingto Clingto reopened this Nov 10, 2023
@Clingto
Copy link
Author

Clingto commented Nov 10, 2023

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

@HexHive HexHive deleted a comment from Clingto Nov 14, 2023
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