igogo-x86 / HexRaysPyTools

IDA Pro plugin which improves work with HexRays decompiler and helps in process of reconstruction structures and classes
1.41k stars 223 forks source link

AttributeError: class Cache has no attribute 'temporary_structure' #19

Closed emc2314 closed 6 years ago

emc2314 commented 6 years ago

Open any x64 file with IDA, do nothing and just exit. Got this warning:

Failed while executing plugin_t.term(): Traceback (most recent call last): File "C:/Program Files/IDA 7.0/plugins/HexRaysPyTools.py", line 243, in term if Cache.temporary_structure: AttributeError: class Cache has no attribute 'temporary_structure'

emc2314 commented 6 years ago

And it doesn't work, either.

igogo-x86 commented 6 years ago

I was unable to reproduce it. What messages do you have in Output window after starting IDA and loading file?

emc2314 commented 6 years ago

Actually there is nothing about this plugin.... Here is the full output, sorry for so many plugins:

[IDASkins] v1.4.1 by athre0z (zyantific.com) loaded! [IDASkins] Skin file successfully applied! Labeless::Labeless Labeless: Python initialized... OK Possible file format: ELF64 for x86-64 (Relocatable) (C:\Program Files\IDA 7.0\loaders\elf64.dll)

bytes pages size description

638976 78 8192 allocating memory for b-tree... 638976 78 8192 allocating memory for virtual array... 262144 32 8192 allocating memory for name pointers...

1540096 total memory allocated

Loading file 'C:\Users***\Desktop\mpi.o' into database... Detected file format: ELF64 for x86-64 (Relocatable) Loading processor module C:\Program Files\IDA 7.0\procs\pc64.dll for metapc...OK Autoanalysis subsystem has been initialized. [FRIEND]: plugin loaded 20 [ERROR] Failed to write or update config file at C:\Program Files\IDA 7.0\cfg\HexRaysPyTools.cfg. Default settings will be used instead. Consider running IDA Pro under administrator once prefix v1.1 initialized... [IDAtropy] Plugin loaded [INFO] Installed the 'Code coverage file' menu entry (lighthouse_plugin:_install_load_file) [INFO] Installed the 'Code coverage batch' menu entry (lighthouse_plugin:_install_load_batch) [INFO] Installed the 'Coverage Overview' menu entry (lighthouse_plugin:_install_open_coverage_overview) [INFO] [Lighthouse] (log:write) [Lighthouse] [INFO] [Lighthouse] --------------------------------------------------------------------------- (log:write) [Lighthouse] --------------------------------------------------------------------------- [INFO] [Lighthouse] ---[ Lighthouse v0.6.0 - (c) Markus Gaasedelen - 2017 (log:write) [Lighthouse] ---[ Lighthouse v0.6.0 - (c) Markus Gaasedelen - 2017 [INFO] [Lighthouse] --------------------------------------------------------------------------- (log:write) [Lighthouse] --------------------------------------------------------------------------- [INFO] [Lighthouse] (log:write) [Lighthouse] [INFO] Successfully initialized (lighthouse_plugin:init)

  1. Creating a new segment (0000000000000000-0000000000000001) ... ... OK
  2. Creating a new segment (0000000000000010-0000000000000110) ... ... OK
  3. Creating a new segment (0000000000000110-0000000000009C38) ... ... OK
  4. Creating a new segment (0000000000009C38-0000000000009E08) ... ... OK
  5. Creating a new segment (0000000000009E08-000000000000A130) ... ... OK Assuming __cdecl calling convention by default Type library 'gnulnx_x64' loaded. Applying types... Types applied to 0 names.
  6. Creating a new segment (000000000000A130-000000000000A198) ... ... OK
  7. Creating a new segment (000000000000A198-000000000000A238) ... ... OK Adding relocations... Skipping relocation section .rela.debug_info because it refers to unloaded section #7 Skipping relocation section .rela.debug_line because it refers to unloaded section #8 Skipping relocation section .rela.debug_frame because it refers to unloaded section #10 DWARF: File "C:\Users*\Desktop\mpi.o" contains DWARF information. DWARF: Functions: 16 symbols applied DWARF: Globals: 0 symbols applied Marking typical code sequences... Flushing buffers, please wait...ok File 'C:\Users*\Desktop\mpi.o' has been successfully loaded into the database. [INFO] [DEBUG] Demangled names have been initialized (log:write) [DEBUG] Demangled names have been initialized [INFO] [Info] Collecting information about imports (log:write) [Info] Collecting information about imports [INFO] [Info] Done... (log:write) [Info] Done... IDA is analysing the input file... You may start to explore the input file right now. Hex-Rays Decompiler plugin has been loaded (v7.0.0.170914) License: 55-BAE5-8A04-93 Jiang Ying, Personal license (1 user) The hotkeys are F5: decompile, Ctrl-F5: decompile all. Please check the Edit/Plugins menu for more informaton. IDAPython Hex-Rays bindings initialized. [!] Config file Ponce.cfg not found [INFO] ================================================================================ (log:write)

    [INFO] Findcrypt v0.2 by David BERARD, 2017 (log:write) Findcrypt v0.2 by David BERARD, 2017 [INFO] Findcrypt search shortcut key is Ctrl-Alt-F (log:write) Findcrypt search shortcut key is Ctrl-Alt-F [INFO] Rules in C:\Program Files\IDA 7.0\plugins\findcrypt3.rules (log:write) Rules in C:\Program Files\IDA 7.0\plugins\findcrypt3.rules [INFO] ================================================================================ (log:write)

    [INFO] Hexlight plugin installed (log:write) Hexlight plugin installed [INFO] (log:write) [INFO] . .__ .__ .____ . ..__ (log:write) [INFO] : |: \ : \ :. \ _/ /: / : .__/: \ (log:write) [INFO] | : || | || . || : |/\ _ / | |> \ | : /\ | __| (log:write) [INFO] | || . | || : || / \ | | | |> | / | : \ (log:write) [INFO] | ||. __/ |_| ||. __/ || |____/|.: /| |\ (log:write) [INFO] || :/ || :/ :/ || (log:write) . .__ .__ .____ . ..__
    : |: \ : \ :. \ _/ /: / : .__/: \ | : || | || . || : |/\ _ / | |> \ | : /\ | __| | || . | || : || / \ | | | |> | / | : \ | ||. __/ |_| ||. __/ || |____/|.: /| |\ || :/ || :/ :/ ||
    [IDAtropy] Plugin loaded [INFO] ================================================================================ (log:write)

    [INFO] Keypatch v2.2 (c) Nguyen Anh Quynh & Thanh Nguyen, 2016 (log:write) Keypatch v2.2 (c) Nguyen Anh Quynh & Thanh Nguyen, 2016 [INFO] Keypatch is using Keystone v0.9.1 (log:write) Keypatch is using Keystone v0.9.1 [INFO] Keypatch Patcher's shortcut key is Ctrl-Alt-K (log:write) Keypatch Patcher's shortcut key is Ctrl-Alt-K [INFO] Use the same hotkey Ctrl-Alt-K to open 'Fill Range' window on a selected range of code (log:write) Use the same hotkey Ctrl-Alt-K to open 'Fill Range' window on a selected range of code [INFO] To revert (undo) the last patching, choose menu Edit | Keypatch | Undo last patching (log:write) To revert (undo) the last patching, choose menu Edit | Keypatch | Undo last patching [INFO] Keypatch Search is available from menu Edit | Keypatch | Search (log:write) Keypatch Search is available from menu Edit | Keypatch | Search [INFO] Find more information about Keypatch at http://keystone-engine.org/keypatch (log:write) Find more information about Keypatch at http://keystone-engine.org/keypatch [INFO] ================================================================================ (log:write)

    OllyDumpEx v1.60 by low_priority, IDA64 7.0 (32/64bit) OllyMigrate v1.00 by low_priority, IDA64 7.0 (32/64bit) [uEmu]: Init plugin Shortcut Alt+F10 is used for two actions: Edit/Plugins/IDAtropy ProduceAsm Shortcut for "ProduceAsm" will be disabled. Shortcut Ctrl+P is used for two actions: Edit/Plugins/IDACyber msglist:CopyToCli Shortcut for "msglist:CopyToCli" will be disabled. Shortcut Ctrl+P is used for two actions: Edit/Plugins/IDACyber JumpFunction Shortcut for "JumpFunction" will be disabled. [uEmu]: UI ready. Run plugin [uEmu]: CPU arch set to [ x64 ] [FRIEND]: HexRays Decompiler is supported [INFO] --------------------------------------------------------------------------------------------- (log:write) [INFO] Python 2.7.13 (v2.7.13:a06454b1afa1, Dec 17 2016, 20:53:40) [MSC v.1500 64 bit (AMD64)] (log:write) [INFO] IDAPython 64-bit v1.7.0 final (serial 0) (c) The IDAPython Team idapython@googlegroups.com (log:write) Python 2.7.13 (v2.7.13:a06454b1afa1, Dec 17 2016, 20:53:40) [MSC v.1500 64 bit (AMD64)] IDAPython 64-bit v1.7.0 final (serial 0) (c) The IDAPython Team idapython@googlegroups.com [INFO] --------------------------------------------------------------------------------------------- (log:write)

    Propagating type information... Function argument information has been propagated The initial autoanalysis has been finished.

igogo-x86 commented 6 years ago

Okay, seems like nothing unusual... By "And it doesn't work, either" what do you mean? There's no any additional menus in decompiler when right-click variables? Is it possible to open Structure Builder (Alt + F8)?

emc2314 commented 6 years ago

Well, I mean I got the same AttributeError when using Alt + F8.

igogo-x86 commented 6 years ago
AttributeError: class Cache has no attribute 'temporary_structure'

Seems like there's class Cache implemented by some other plugin. Could you try to move other python plugins from plugins directory one by one?

If so, then probably it's a good moment to rename all modules according to PEP8 convention which I didn't know well when started work under this project.

emc2314 commented 6 years ago

Oh that's it. After I removed a plugin called IDACyber it suddenly works. And I decided to remove that plugin to make PyTools work. XD Thank you for your time.

igogo-x86 commented 6 years ago

Renamed all modules so now you can use both plugins simultaneously