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

Subject: Issue with angr.misc.autoimport: procedure_dict.py Module Not Found #4618

Open
bluekaka opened this issue May 5, 2024 · 1 comment
Labels
bug Something is broken

Comments

@bluekaka
Copy link

bluekaka commented May 5, 2024

Description

I encountered an issue while working with angr. My environment consists of Python 3.11.9, and I installed angr using pip. I was trying to run angr through the IDAPython console while loading

DEBUG:angr.misc.autoimport:Not a module: procedure_dict.py

Below, I've included the full log output for your reference:

DEBUG:claripy.backend:Operation StringV not in op_module <module 'claripy.bv' from '/usr/local/Cellar/python@3.11/3.11.9/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/claripy/bv.py'>.
DEBUG:claripy.backend:Operation FPV not in op_module <module 'claripy.bv' from '/usr/local/Cellar/python@3.11/3.11.9/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/claripy/bv.py'>.
DEBUG:claripy.backend:Operation FPS not in op_module <module 'claripy.fp' from '/usr/local/Cellar/python@3.11/3.11.9/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/claripy/fp.py'>.
DEBUG:claripy.backend:Operation fpSqrt not in op_module <module 'claripy.fp' from '/usr/local/Cellar/python@3.11/3.11.9/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/claripy/fp.py'>.
DEBUG:claripy.backend:Operation RotateLeft not in op_module <class 'claripy.backends.backend_vsa.BackendVSA'>.
DEBUG:claripy.backend:Operation RotateRight not in op_module <class 'claripy.backends.backend_vsa.BackendVSA'>.
DEBUG:pyvex.lifting.lift_function:Registering lifter LibVEXLifter for architecture ARMEL.
DEBUG:pyvex.lifting.lift_function:Registering lifter LibVEXLifter for architecture ARM.
DEBUG:pyvex.lifting.lift_function:Registering lifter LibVEXLifter for architecture ARMCortexM.
DEBUG:pyvex.lifting.lift_function:Registering lifter LibVEXLifter for architecture AMD64.
DEBUG:pyvex.lifting.lift_function:Registering lifter LibVEXLifter for architecture MIPS64.
DEBUG:pyvex.lifting.lift_function:Registering lifter LibVEXLifter for architecture AARCH64.
DEBUG:pyvex.lifting.lift_function:Registering lifter LibVEXLifter for architecture PPC32.
DEBUG:pyvex.lifting.lift_function:Registering lifter LibVEXLifter for architecture MIPS32.
DEBUG:pyvex.lifting.lift_function:Registering lifter LibVEXLifter for architecture S390X.
DEBUG:pyvex.lifting.lift_function:Registering lifter LibVEXLifter for architecture X86.
DEBUG:pyvex.lifting.lift_function:Registering lifter LibVEXLifter for architecture RISCV64.
DEBUG:pyvex.lifting.lift_function:Registering lifter LibVEXLifter for architecture PPC64.
DEBUG:pyvex.lifting.lift_function:Registering lifter LibVEXLifter for architecture ARMHF.
DEBUG:pyvex.lifting.lift_function:Registering lifter AARCH64Spotter for architecture AARCH64.
DEBUG:pyvex.lifting.lift_function:Registering lifter ARMSpotter for architecture ARM.
DEBUG:pyvex.lifting.lift_function:Registering lifter ARMSpotter for architecture ARMEL.
DEBUG:pyvex.lifting.lift_function:Registering lifter ARMSpotter for architecture ARMHF.
DEBUG:pyvex.lifting.lift_function:Registering lifter ARMSpotter for architecture ARMCortexM.
DEBUG:pyvex.lifting.lift_function:Registering lifter AMD64Spotter for architecture AMD64.
DEBUG:pyvex.lifting.lift_function:Registering lifter X86Spotter for architecture X86.
DEBUG:cle.backends.elf.relocation:Importing ELF relocation module: armel
DEBUG:cle.backends.elf.relocation:Importing ELF relocation module: arm_cortex_m
DEBUG:cle.backends.elf.relocation:Importing ELF relocation module: i386
DEBUG:cle.backends.elf.relocation:Importing ELF relocation module: sparc
DEBUG:cle.backends.elf.relocation:Importing ELF relocation module: mips64
DEBUG:cle.backends.elf.relocation:Importing ELF relocation module: arm64
DEBUG:cle.backends.elf.relocation:Importing ELF relocation module: s390x
DEBUG:cle.backends.elf.relocation:Importing ELF relocation module: generic
DEBUG:cle.backends.elf.relocation:Importing ELF relocation module: ppc
DEBUG:cle.backends.elf.relocation:Importing ELF relocation module: elfreloc
DEBUG:cle.backends.elf.relocation:Importing ELF relocation module: arm
DEBUG:cle.backends.elf.relocation:Importing ELF relocation module: mips
DEBUG:cle.backends.elf.relocation:Importing ELF relocation module: armhf
DEBUG:cle.backends.elf.relocation:Importing ELF relocation module: pcc64
DEBUG:cle.backends.elf.relocation:Importing ELF relocation module: amd64
DEBUG:cle.backends.pe.relocation:Importing PE relocation module: i386
DEBUG:cle.backends.pe.relocation:Importing PE relocation module: riscv
DEBUG:cle.backends.pe.relocation:Importing PE relocation module: generic
DEBUG:cle.backends.pe.relocation:Importing PE relocation module: arm
DEBUG:cle.backends.pe.relocation:Importing PE relocation module: mips
DEBUG:cle.backends.pe.relocation:Importing PE relocation module: amd64
DEBUG:cle.backends.pe.relocation:Importing PE relocation module: pereloc
DEBUG:angr.engines.vex.claripy.irop:1006 matched (626 supported) and 54 unmatched operations
INFO:angr.state_plugins.unicorn_engine:native plugin is enabled
DEBUG:angr.misc.autoimport:Loading angr.procedures.java_jni
DEBUG:angr.misc.autoimport:Loading angr.procedures.cgc
DEBUG:angr.misc.autoimport:Loading angr.procedures.tracer
DEBUG:angr.misc.autoimport:Loading angr.procedures.stubs
DEBUG:angr.misc.autoimport:Loading angr.procedures.posix
DEBUG:angr.misc.autoimport:Loading angr.procedures.libc
DEBUG:angr.misc.autoimport:Loading angr.procedures.uclibc
DEBUG:angr.misc.autoimport:Loading angr.procedures.ntdll
DEBUG:angr.misc.autoimport:Not a module: __init__.py
DEBUG:angr.misc.autoimport:Loading angr.procedures.java
DEBUG:angr.misc.autoimport:Loading angr.procedures.java_lang
DEBUG:angr.misc.autoimport:Loading angr.procedures.linux_kernel
DEBUG:angr.misc.autoimport:Loading angr.procedures.testing
DEBUG:angr.misc.autoimport:Loading angr.procedures.advapi32
DEBUG:angr.misc.autoimport:Loading angr.procedures.msvcr
DEBUG:angr.misc.autoimport:Loading angr.procedures.glibc
DEBUG:angr.misc.autoimport:Loading angr.procedures.libstdcpp
DEBUG:angr.misc.autoimport:Loading angr.procedures.java_util
DEBUG:angr.misc.autoimport:Loading angr.procedures.win32
DEBUG:angr.misc.autoimport:Loading angr.procedures.gnulib
DEBUG:angr.misc.autoimport:Loading angr.procedures.linux_loader
DEBUG:angr.misc.autoimport:Loading angr.procedures.win_user32
DEBUG:angr.misc.autoimport:Not a module: procedure_dict.py
DEBUG:angr.misc.autoimport:Loading angr.procedures.win32_kernel
DEBUG:angr.misc.autoimport:Loading angr.procedures.java_io
DEBUG:angr.procedures.definitions.glibc:Libc provides 1117 function prototypes, and has 404 unsupported function prototypes.

Could you please provide any guidance on how to resolve this issue?

Thank you for your assistance.

Best regards,

Steps to reproduce the bug

No response

Environment

python3.11 -m angr.misc.bug_report
angr environment report
=============================
Date: 2024-05-05 19:41:07.282957
!!! running in global environment.  Are you sure? !!!
/usr/local/lib/python3.11/site-packages/angr/misc/bug_report.py:88: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
  import pkg_resources  # pylint:disable=import-outside-toplevel
Platform: macosx-13.0-x86_64
Python version: 3.11.9 (main, Apr  2 2024, 08:25:04) [Clang 15.0.0 (clang-1500.1.0.2.5)]
######## angr #########
Python found it in /usr/local/lib/python3.11/site-packages/angr/__init__.py
Pip version angr 9.2.101
Couldn't find git info
######## ailment #########
Python found it in /usr/local/lib/python3.11/site-packages/ailment/__init__.py
Pip version ailment 9.2.101
Couldn't find git info
######## cle #########
Python found it in /usr/local/lib/python3.11/site-packages/cle/__init__.py
Pip version cle 9.2.101
Couldn't find git info
######## pyvex #########
Python found it in /usr/local/lib/python3.11/site-packages/pyvex/__init__.py
Pip version pyvex 9.2.101
Couldn't find git info
######## claripy #########
Python found it in /usr/local/lib/python3.11/site-packages/claripy/__init__.py
Pip version claripy 9.2.101
Couldn't find git info
######## archinfo #########
Python found it in /usr/local/lib/python3.11/site-packages/archinfo/__init__.py
Pip version archinfo 9.2.101
Couldn't find git info
######## z3 #########
Python found it in /usr/local/lib/python3.11/site-packages/z3/__init__.py
Pip version z3-solver 4.10.2.0
Couldn't find git info
######## unicorn #########
Python found it in /usr/local/lib/python3.11/site-packages/unicorn/__init__.py
Pip version unicorn 2.0.1.post1
Couldn't find git info
######### Native Module Info ##########
angr: <CDLL '/usr/local/lib/python3.11/site-packages/angr/state_plugins/../lib/angr_native.dylib', handle 7ff91a4f2a40 at 0x1162561d0>
unicorn: <CDLL '/usr/local/lib/python3.11/site-packages/unicorn/lib/libunicorn.2.dylib', handle 7ff91a4f25b0 at 0x110f07850>
pyvex: <cffi.api._make_ffi_library.<locals>.FFILibrary object at 0x110e2c6d0>
z3: <CDLL '/usr/local/lib/python3.11/site-packages/z3/lib/libz3.dylib', handle 7ff91a4f0d10 at 0x110a0e790>

Additional context

No response

@bluekaka bluekaka added bug Something is broken needs-triage Issue has yet to be looked at by a maintainer labels May 5, 2024
@twizmwazin
Copy link
Member

This isn't an error, but we could improve the logging. To explain what is happening here, the autoimport module is checking every file in angr/procedures and attempting to import it. Specifically, it assumes each file is a folder with its own __init__.py. Because __init__.py and procedure_dict.py are regular files and not folders, they don't have an __init__.py in them, and this reports it in a way that implies there is an error.

@ltfish ltfish removed the needs-triage Issue has yet to be looked at by a maintainer label May 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is broken
Projects
None yet
Development

No branches or pull requests

3 participants