eybisi / kavanoz

Statically unpacking common android banker malware.
MIT License
131 stars 21 forks source link

pip install breaks on python 3.12.3 #12

Closed ruchna closed 1 week ago

ruchna commented 2 weeks ago
$ pip install kavanoz
...
...
      [ 10%] Performing download step (verify and extract) for 'lief_utfcpp'
      -- verifying file...
           file='/tmp/pip-install-7qn33k2v/lief_6bdd83b5549c4790bcdd6deb34543315/third-party//utfcpp-3.2.1.zip'
      -- verifying file... done
      -- extracting...
           src='/tmp/pip-install-7qn33k2v/lief_6bdd83b5549c4790bcdd6deb34543315/third-party/utfcpp-3.2.1.zip'
           dst='/tmp/pip-install-7qn33k2v/lief_6bdd83b5549c4790bcdd6deb34543315/build/temp.linux-x86_64-cpython-312/lief_utfcpp-prefix/src/lief_utfcpp'
      -- extracting... [tar xfz]
      -- extracting... [analysis]
      -- extracting... [rename]
      -- extracting... [clean up]
      -- extracting... done
      [ 10%] No update step for 'lief_utfcpp'
      [ 10%] No patch step for 'lief_utfcpp'
      [ 10%] No configure step for 'lief_utfcpp'
      [ 10%] No build step for 'lief_utfcpp'
      [ 10%] No install step for 'lief_utfcpp'
      [ 10%] Completed 'lief_utfcpp'
      [ 10%] Built target lief_utfcpp
      [ 10%] Generating internal/utfcpp/utf8.h
      [ 10%] Generating include/LIEF/third-party/internal/leaf.hpp
      [ 10%] Generating include/LIEF/third-party/internal/span.hpp
      [ 10%] Generating internal/nlohmann/json.hpp
      [ 10%] Building CXX object CMakeFiles/LIB_LIEF.dir/src/errors.cpp.o
      [ 10%] Building CXX object CMakeFiles/LIB_LIEF.dir/src/hash_stream.cpp.o
      [ 11%] Building CXX object CMakeFiles/LIB_LIEF.dir/src/logging.cpp.o
      [ 11%] Building CXX object CMakeFiles/LIB_LIEF.dir/src/exception.cpp.o
      In file included from /tmp/pip-install-7qn33k2v/lief_6bdd83b5549c4790bcdd6deb34543315/src/exception.cpp:19:
      /tmp/pip-install-7qn33k2v/lief_6bdd83b5549c4790bcdd6deb34543315/include/LIEF/exception.hpp:75:38: error: expected ‘)’ before ‘offset’
         75 |   explicit read_out_of_bound(uint64_t offset, uint64_t size);
            |                             ~        ^~~~~~~
            |                                      )
      /tmp/pip-install-7qn33k2v/lief_6bdd83b5549c4790bcdd6deb34543315/include/LIEF/exception.hpp:76:38: error: expected ‘)’ before ‘offset’
         76 |   explicit read_out_of_bound(uint64_t offset);
            |                             ~        ^~~~~~~
            |                                      )
      /tmp/pip-install-7qn33k2v/lief_6bdd83b5549c4790bcdd6deb34543315/src/exception.cpp:50:1: error: no declaration matches ‘LIEF::read_out_of_bound::read_out_of_bound(uint64_t, uint64_t)’
         50 | read_out_of_bound::read_out_of_bound(uint64_t offset, uint64_t size) : LIEF::exception("") {
            | ^~~~~~~~~~~~~~~~~
      /tmp/pip-install-7qn33k2v/lief_6bdd83b5549c4790bcdd6deb34543315/include/LIEF/exception.hpp:71:16: note: candidates are: ‘LIEF::read_out_of_bound::read_out_of_bound(LIEF::read_out_of_bound&&)’
         71 | class LIEF_API read_out_of_bound : public exception {
            |                ^~~~~~~~~~~~~~~~~
      /tmp/pip-install-7qn33k2v/lief_6bdd83b5549c4790bcdd6deb34543315/include/LIEF/exception.hpp:71:16: note:                 ‘LIEF::read_out_of_bound::read_out_of_bound(const LIEF::read_out_of_bound&)’
      /tmp/pip-install-7qn33k2v/lief_6bdd83b5549c4790bcdd6deb34543315/include/LIEF/exception.hpp:71:16: note:                 ‘LIEF::read_out_of_bound::read_out_of_bound()’
      /tmp/pip-install-7qn33k2v/lief_6bdd83b5549c4790bcdd6deb34543315/include/LIEF/exception.hpp:73:20: note:                 ‘LIEF::read_out_of_bound::read_out_of_bound(const LIEF::exception&) [inherited from LIEF::exception]’
         73 |   using exception::exception;
            |                    ^~~~~~~~~
      /tmp/pip-install-7qn33k2v/lief_6bdd83b5549c4790bcdd6deb34543315/include/LIEF/exception.hpp:73:20: note:                 ‘LIEF::read_out_of_bound::read_out_of_bound(std::string) [inherited from LIEF::exception]’
      /tmp/pip-install-7qn33k2v/lief_6bdd83b5549c4790bcdd6deb34543315/include/LIEF/exception.hpp:73:20: note:                 ‘LIEF::read_out_of_bound::read_out_of_bound(const char*) [inherited from LIEF::exception]’
      /tmp/pip-install-7qn33k2v/lief_6bdd83b5549c4790bcdd6deb34543315/include/LIEF/exception.hpp:71:16: note: ‘class LIEF::read_out_of_bound’ defined here
         71 | class LIEF_API read_out_of_bound : public exception {
            |                ^~~~~~~~~~~~~~~~~
      /tmp/pip-install-7qn33k2v/lief_6bdd83b5549c4790bcdd6deb34543315/src/exception.cpp:58:1: error: no declaration matches ‘LIEF::read_out_of_bound::read_out_of_bound(uint64_t)’
         58 | read_out_of_bound::read_out_of_bound(uint64_t offset) : LIEF::exception("") {
            | ^~~~~~~~~~~~~~~~~
      /tmp/pip-install-7qn33k2v/lief_6bdd83b5549c4790bcdd6deb34543315/include/LIEF/exception.hpp:71:16: note: candidates are: ‘LIEF::read_out_of_bound::read_out_of_bound(LIEF::read_out_of_bound&&)’
         71 | class LIEF_API read_out_of_bound : public exception {
            |                ^~~~~~~~~~~~~~~~~
      /tmp/pip-install-7qn33k2v/lief_6bdd83b5549c4790bcdd6deb34543315/include/LIEF/exception.hpp:71:16: note:                 ‘LIEF::read_out_of_bound::read_out_of_bound(const LIEF::read_out_of_bound&)’
      /tmp/pip-install-7qn33k2v/lief_6bdd83b5549c4790bcdd6deb34543315/include/LIEF/exception.hpp:71:16: note:                 ‘LIEF::read_out_of_bound::read_out_of_bound()’
      /tmp/pip-install-7qn33k2v/lief_6bdd83b5549c4790bcdd6deb34543315/include/LIEF/exception.hpp:73:20: note:                 ‘LIEF::read_out_of_bound::read_out_of_bound(const LIEF::exception&) [inherited from LIEF::exception]’
         73 |   using exception::exception;
            |                    ^~~~~~~~~
      /tmp/pip-install-7qn33k2v/lief_6bdd83b5549c4790bcdd6deb34543315/include/LIEF/exception.hpp:73:20: note:                 ‘LIEF::read_out_of_bound::read_out_of_bound(std::string) [inherited from LIEF::exception]’
      /tmp/pip-install-7qn33k2v/lief_6bdd83b5549c4790bcdd6deb34543315/include/LIEF/exception.hpp:73:20: note:                 ‘LIEF::read_out_of_bound::read_out_of_bound(const char*) [inherited from LIEF::exception]’
      /tmp/pip-install-7qn33k2v/lief_6bdd83b5549c4790bcdd6deb34543315/include/LIEF/exception.hpp:71:16: note: ‘class LIEF::read_out_of_bound’ defined here
         71 | class LIEF_API read_out_of_bound : public exception {
            |                ^~~~~~~~~~~~~~~~~
      make[3]: *** [CMakeFiles/LIB_LIEF.dir/build.make:138: CMakeFiles/LIB_LIEF.dir/src/exception.cpp.o] Error 1
      make[2]: *** [CMakeFiles/Makefile2:411: CMakeFiles/LIB_LIEF.dir/all] Error 2
      make[1]: *** [CMakeFiles/Makefile2:472: api/python/CMakeFiles/pyLIEF.dir/rule] Error 2
      make: *** [Makefile:306: pyLIEF] Error 2
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/tmp/pip-install-7qn33k2v/lief_6bdd83b5549c4790bcdd6deb34543315/setup.py", line 484, in <module>
          setup(
        File "/usr/lib/python3/dist-packages/setuptools/__init__.py", line 107, in setup
          return distutils.core.setup(**attrs)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/usr/lib/python3/dist-packages/setuptools/_distutils/core.py", line 185, in setup
          return run_commands(dist)
                 ^^^^^^^^^^^^^^^^^^
        File "/usr/lib/python3/dist-packages/setuptools/_distutils/core.py", line 201, in run_commands
          dist.run_commands()
        File "/usr/lib/python3/dist-packages/setuptools/_distutils/dist.py", line 969, in run_commands
          self.run_command(cmd)
        File "/usr/lib/python3/dist-packages/setuptools/dist.py", line 1233, in run_command
          super().run_command(command)
        File "/usr/lib/python3/dist-packages/setuptools/_distutils/dist.py", line 988, in run_command
          cmd_obj.run()
        File "/usr/lib/python3/dist-packages/wheel/bdist_wheel.py", line 368, in run
          self.run_command("build")
        File "/usr/lib/python3/dist-packages/setuptools/_distutils/cmd.py", line 318, in run_command
          self.distribution.run_command(command)
        File "/usr/lib/python3/dist-packages/setuptools/dist.py", line 1233, in run_command
          super().run_command(command)
        File "/usr/lib/python3/dist-packages/setuptools/_distutils/dist.py", line 988, in run_command
          cmd_obj.run()
        File "/usr/lib/python3/dist-packages/setuptools/_distutils/command/build.py", line 131, in run
          self.run_command(cmd_name)
        File "/usr/lib/python3/dist-packages/setuptools/_distutils/cmd.py", line 318, in run_command
          self.distribution.run_command(command)
        File "/usr/lib/python3/dist-packages/setuptools/dist.py", line 1233, in run_command
          super().run_command(command)
        File "/usr/lib/python3/dist-packages/setuptools/_distutils/dist.py", line 988, in run_command
          cmd_obj.run()
        File "/tmp/pip-install-7qn33k2v/lief_6bdd83b5549c4790bcdd6deb34543315/setup.py", line 98, in run
          self.build_extension(ext)
        File "/tmp/pip-install-7qn33k2v/lief_6bdd83b5549c4790bcdd6deb34543315/setup.py", line 308, in build_extension
          subprocess.check_call(['make', '-j', str(jobs), targets['python_bindings']], cwd=self.build_temp, env=env)
        File "/usr/lib/python3.12/subprocess.py", line 413, in check_call
          raise CalledProcessError(retcode, cmd)
      subprocess.CalledProcessError: Command '['make', '-j', '1', 'pyLIEF']' returned non-zero exit status 2.
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for lief
  Running setup.py clean for lief
Failed to build lief
ERROR: Could not build wheels for lief, which is required to install pyproject.toml-based projects
eybisi commented 1 week ago

Is this related to kavanoz? Can you install lief on itself ?

eybisi commented 1 week ago

This should be fixed with https://github.com/eybisi/kavanoz/commit/e0b495f2ee20da4cc7a12e165e607684ed8075ac . I've bumped lief version to latest, you can uninstall/install kavanoz to see changes.