在Windows中使用pyinstaller将.py文件转换为.exe时出错

时间:2019-06-13 11:10:17

标签: python python-2.7 exe pyinstaller

我已使用pyinstxtractor.py将exe文件转换为pyc文件,然后使用uncompyle6将其反编译。更新了代码并编译了这些文件。 然后通过从其他文件添加python标头反编译入口点文件。 跑步时 pyinstaller gui.py 我遇到错误。

我尝试使用python 2.7,因为仅使用此版本构建了应用程序。

E:\PYZ-00.pyz_extracted>pyinstaller gu
i.py
184 INFO: PyInstaller: 3.4
184 INFO: Python: 2.7.16
184 INFO: Platform: Windows-7-6.1.7601-SP1
189 INFO: wrote E:\mytest\orig exe\xxxxxx.exe_extracted\PYZ-00.pyz_extracte
d\gui.spec
190 INFO: UPX is not available.
194 INFO: Extending PYTHONPATH with paths
['E:\\mytest\\orig exe\\xxxxxx.exe_extracted\\PYZ-00.pyz_extracted',
 'E:\\mytest\\orig exe\\xxxxxx.exe_extracted\\PYZ-00.pyz_extracted']
196 INFO: checking Analysis
196 INFO: Building Analysis because Analysis-00.toc is non existent
196 INFO: Initializing module dependency graph...
203 INFO: Initializing module graph hooks...
245 INFO: running Analysis Analysis-00.toc
275 INFO: Adding Microsoft.VC90.CRT to dependent assemblies of final executable
  required by c:\python27\python.exe
1217 INFO: Found C:\Windows\WinSxS\Manifests\amd64_policy.9.0.microsoft.vc90.crt
_1fc8b3b9a1e18e3b_9.0.21009.1_none_18ff9d83d18b6187.manifest
1236 INFO: Found C:\Windows\WinSxS\Manifests\amd64_policy.9.0.microsoft.vc90.crt
_1fc8b3b9a1e18e3b_9.0.21022.8_none_18f8a87fd1919cd9.manifest
1252 INFO: Found C:\Windows\WinSxS\Manifests\amd64_policy.9.0.microsoft.vc90.crt
_1fc8b3b9a1e18e3b_9.0.30729.1_none_3da38fdebd0e6822.manifest
1259 INFO: Found C:\Windows\WinSxS\Manifests\amd64_policy.9.0.microsoft.vc90.crt
_1fc8b3b9a1e18e3b_9.0.30729.4148_none_acd0e4ffe1daef0a.manifest
1273 INFO: Found C:\Windows\WinSxS\Manifests\amd64_policy.9.0.microsoft.vc90.crt
_1fc8b3b9a1e18e3b_9.0.30729.4940_none_acd19a1fe1da248a.manifest
1286 INFO: Found C:\Windows\WinSxS\Manifests\amd64_policy.9.0.microsoft.vc90.crt
_1fc8b3b9a1e18e3b_9.0.30729.6161_none_acd388d7e1d8689f.manifest
1371 INFO: Searching for assembly amd64_Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_9.0.
30729.6161_none ...
1371 INFO: Found manifest C:\Windows\WinSxS\Manifests\amd64_microsoft.vc90.crt_1
fc8b3b9a1e18e3b_9.0.30729.6161_none_08e61857a83bc251.manifest
1374 INFO: Searching for file msvcr90.dll
1374 INFO: Found file C:\Windows\WinSxS\amd64_microsoft.vc90.crt_1fc8b3b9a1e18e3
b_9.0.30729.6161_none_08e61857a83bc251\msvcr90.dll
1375 INFO: Searching for file msvcp90.dll
1375 INFO: Found file C:\Windows\WinSxS\amd64_microsoft.vc90.crt_1fc8b3b9a1e18e3
b_9.0.30729.6161_none_08e61857a83bc251\msvcp90.dll
1375 INFO: Searching for file msvcm90.dll
1375 INFO: Found file C:\Windows\WinSxS\amd64_microsoft.vc90.crt_1fc8b3b9a1e18e3
b_9.0.30729.6161_none_08e61857a83bc251\msvcm90.dll
1444 INFO: Found C:\Windows\WinSxS\Manifests\amd64_policy.9.0.microsoft.vc90.crt
_1fc8b3b9a1e18e3b_9.0.21009.1_none_18ff9d83d18b6187.manifest
1446 INFO: Found C:\Windows\WinSxS\Manifests\amd64_policy.9.0.microsoft.vc90.crt
_1fc8b3b9a1e18e3b_9.0.21022.8_none_18f8a87fd1919cd9.manifest
1447 INFO: Found C:\Windows\WinSxS\Manifests\amd64_policy.9.0.microsoft.vc90.crt
_1fc8b3b9a1e18e3b_9.0.30729.1_none_3da38fdebd0e6822.manifest
1447 INFO: Found C:\Windows\WinSxS\Manifests\amd64_policy.9.0.microsoft.vc90.crt
_1fc8b3b9a1e18e3b_9.0.30729.4148_none_acd0e4ffe1daef0a.manifest
1449 INFO: Found C:\Windows\WinSxS\Manifests\amd64_policy.9.0.microsoft.vc90.crt
_1fc8b3b9a1e18e3b_9.0.30729.4940_none_acd19a1fe1da248a.manifest
1450 INFO: Found C:\Windows\WinSxS\Manifests\amd64_policy.9.0.microsoft.vc90.crt
_1fc8b3b9a1e18e3b_9.0.30729.6161_none_acd388d7e1d8689f.manifest
1450 INFO: Adding redirect Microsoft.VC90.CRT version (9, 0, 21022, 8) -> (9, 0,
 30729, 6161)
1496 INFO: Caching module hooks...
1502 INFO: Analyzing E:\mytest\orig exe\xxxxxx.exe_extracted\PYZ-00.pyz_ext
racted\gui.py
2860 INFO: Processing pre-safe import module hook   _xmlplus
Traceback (most recent call last):
  File "C:\Python27\Scripts\pyinstaller-script.py", line 11, in <module>
    load_entry_point('PyInstaller==3.4', 'console_scripts', 'pyinstaller')()
  File "c:\python27\lib\site-packages\PyInstaller\__main__.py", line 111, in run

    run_build(pyi_config, spec_file, **vars(args))
  File "c:\python27\lib\site-packages\PyInstaller\__main__.py", line 63, in run_
build
    PyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs)
  File "c:\python27\lib\site-packages\PyInstaller\building\build_main.py", line
838, in main
    build(specfile, kw.get('distpath'), kw.get('workpath'), kw.get('clean_build'
))
  File "c:\python27\lib\site-packages\PyInstaller\building\build_main.py", line
784, in build
    exec(text, spec_namespace)
  File "<string>", line 17, in <module>
  File "c:\python27\lib\site-packages\PyInstaller\building\build_main.py", line
241, in __init__
    self.__postinit__()
  File "c:\python27\lib\site-packages\PyInstaller\building\datastruct.py", line
158, in __postinit__
    self.assemble()
  File "c:\python27\lib\site-packages\PyInstaller\building\build_main.py", line
443, in assemble
    priority_scripts.append(self.graph.run_script(script))
  File "c:\python27\lib\site-packages\PyInstaller\depend\analysis.py", line 201,
 in run_script
    self._top_script_node = super(PyiModuleGraph, self).run_script(pathname)
  File "c:\python27\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py
", line 1348, in run_script
    self._scan_code(m, co, co_ast)
  File "c:\python27\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py
", line 2544, in _scan_code
    self._process_imports(module)
  File "c:\python27\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py
", line 2743, in _process_imports
    target_module = self._safe_import_hook(*import_info, **kwargs)[0]
  File "c:\python27\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py
", line 2221, in _safe_import_hook
    target_attr_names=None, level=level, edge_attr=edge_attr)
  File "c:\python27\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py
", line 1421, in import_hook
    source_package, target_module_partname, level)
  File "c:\python27\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py
", line 1573, in _find_head_package
    target_module_headname, target_package_name, source_package)
  File "c:\python27\lib\site-packages\PyInstaller\depend\analysis.py", line 271,
 in _safe_import_module
    module_basename, module_name, parent_package)
  File "c:\python27\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py
", line 1990, in _safe_import_module
    module_name, file_handle, pathname, metadata)
  File "c:\python27\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py
", line 2082, in _load_module
    self._scan_code(m, co, co_ast)
  File "c:\python27\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py
", line 2544, in _scan_code
    self._process_imports(module)
  File "c:\python27\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py
", line 2743, in _process_imports
    target_module = self._safe_import_hook(*import_info, **kwargs)[0]
  File "c:\python27\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py
", line 2221, in _safe_import_hook
    target_attr_names=None, level=level, edge_attr=edge_attr)
  File "c:\python27\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py
", line 1421, in import_hook
    source_package, target_module_partname, level)
  File "c:\python27\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py
", line 1573, in _find_head_package
    target_module_headname, target_package_name, source_package)
  File "c:\python27\lib\site-packages\PyInstaller\depend\analysis.py", line 271,
 in _safe_import_module
    module_basename, module_name, parent_package)
  File "c:\python27\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py
", line 1990, in _safe_import_module
    module_name, file_handle, pathname, metadata)
  File "c:\python27\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py
", line 2082, in _load_module
    self._scan_code(m, co, co_ast)
  File "c:\python27\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py
", line 2544, in _scan_code
    self._process_imports(module)
  File "c:\python27\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py
", line 2743, in _process_imports
    target_module = self._safe_import_hook(*import_info, **kwargs)[0]
  File "c:\python27\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py
", line 2221, in _safe_import_hook
    target_attr_names=None, level=level, edge_attr=edge_attr)
  File "c:\python27\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py
", line 1421, in import_hook
    source_package, target_module_partname, level)
  File "c:\python27\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py
", line 1573, in _find_head_package
    target_module_headname, target_package_name, source_package)
  File "c:\python27\lib\site-packages\PyInstaller\depend\analysis.py", line 271,
 in _safe_import_module
    module_basename, module_name, parent_package)
  File "c:\python27\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py
", line 1990, in _safe_import_module
    module_name, file_handle, pathname, metadata)
  File "c:\python27\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py
", line 2082, in _load_module
    self._scan_code(m, co, co_ast)
  File "c:\python27\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py
", line 2544, in _scan_code
    self._process_imports(module)
  File "c:\python27\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py
", line 2743, in _process_imports
    target_module = self._safe_import_hook(*import_info, **kwargs)[0]
  File "c:\python27\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py
", line 2221, in _safe_import_hook
    target_attr_names=None, level=level, edge_attr=edge_attr)
  File "c:\python27\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py
", line 1421, in import_hook
    source_package, target_module_partname, level)
  File "c:\python27\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py
", line 1573, in _find_head_package
    target_module_headname, target_package_name, source_package)
  File "c:\python27\lib\site-packages\PyInstaller\depend\analysis.py", line 271,
 in _safe_import_module
    module_basename, module_name, parent_package)
  File "c:\python27\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py
", line 1990, in _safe_import_module
    module_name, file_handle, pathname, metadata)
  File "c:\python27\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py
", line 2082, in _load_module
    self._scan_code(m, co, co_ast)
  File "c:\python27\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py
", line 2544, in _scan_code
    self._process_imports(module)
  File "c:\python27\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py
", line 2743, in _process_imports
    target_module = self._safe_import_hook(*import_info, **kwargs)[0]
  File "c:\python27\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py
", line 2221, in _safe_import_hook
    target_attr_names=None, level=level, edge_attr=edge_attr)
  File "c:\python27\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py
", line 1421, in import_hook
    source_package, target_module_partname, level)
  File "c:\python27\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py
", line 1573, in _find_head_package
    target_module_headname, target_package_name, source_package)
  File "c:\python27\lib\site-packages\PyInstaller\depend\analysis.py", line 271,
 in _safe_import_module
    module_basename, module_name, parent_package)
  File "c:\python27\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py
", line 1990, in _safe_import_module
    module_name, file_handle, pathname, metadata)
  File "c:\python27\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py
", line 2082, in _load_module
    self._scan_code(m, co, co_ast)
  File "c:\python27\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py
", line 2544, in _scan_code
    self._process_imports(module)
  File "c:\python27\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py
", line 2743, in _process_imports
    target_module = self._safe_import_hook(*import_info, **kwargs)[0]
  File "c:\python27\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py
", line 2221, in _safe_import_hook
    target_attr_names=None, level=level, edge_attr=edge_attr)
  File "c:\python27\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py
", line 1421, in import_hook
    source_package, target_module_partname, level)
  File "c:\python27\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py
", line 1573, in _find_head_package
    target_module_headname, target_package_name, source_package)
  File "c:\python27\lib\site-packages\PyInstaller\depend\analysis.py", line 260,
 in _safe_import_module
    hook_module.pre_safe_import_module(hook_api)
  File "c:\python27\lib\site-packages\PyInstaller\hooks\pre_safe_import_module\h
ook-_xmlplus.py", line 31, in pre_safe_import_module
    for p in api.module_graph.findNode('xml').packagepath:
TypeError: 'NoneType' object is not iterable

exe应生成。 我的工作类似于 https://hshrzd.wordpress.com/2018/01/26/solving-a-pyinstaller-compiled-crackme/

0 个答案:

没有答案