NameError: global name 'KS_MODE_32' is not defined

See original GitHub issue

Prologue: Installed metame using pip install metame as recommended, ran metame and got the error.

Box: Linux kali 4.6.0-kali1-amd64 #1 SMP Debian 4.6.4-1kali1 (2016-07-21) x86_64 GNU/Linux (straight from Kali Linux VMWare Image Nightly Build)

Error Log:

root@kali:~# metame -i /root/Desktop/untitled.exe -o untitled_metamorphic.exe
[INFO] Opening file with r2
[INFO] Analyzing functions with r2
Function too big at 0x7c073377
Traceback (most recent call last):
  File "/usr/local/bin/metame", line 5, in <module>
    metame.main()
  File "/usr/local/lib/python2.7/dist-packages/metame/__init__.py", line 20, in main
    patches = r.iterate_fcn()
  File "/usr/local/lib/python2.7/dist-packages/metame/r2parser.py", line 32, in iterate_fcn
    arch = x86handler.X86Handler(self.bits, self.debug, self.force)
  File "/usr/local/lib/python2.7/dist-packages/metame/x86handler.py", line 73, in __init__
    ks_mode = KS_MODE_32 if self.bits == 32 else KS_MODE_64
NameError: global name 'KS_MODE_32' is not defined

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
AxDSancommented, Mar 31, 2017

Followed everything straight from https://github.com/keystone-engine/keystone/blob/master/docs/COMPILE-NIX.md

and now I get #5

root@kali:~# metame -i /root/Desktop/untitled.exe -o /root/Desktop/untitled_.exe 
Traceback (most recent call last):
  File "/usr/local/bin/metame", line 5, in <module>
    metame.main()
  File "/usr/local/lib/python2.7/dist-packages/metame/__init__.py", line 5, in main
    import metame.r2parser as r2parser
  File "/usr/local/lib/python2.7/dist-packages/metame/r2parser.py", line 2, in <module>
    import metame.x86handler as x86handler
  File "/usr/local/lib/python2.7/dist-packages/metame/x86handler.py", line 6, in <module>
    from keystone import *
  File "/usr/local/lib/python2.7/dist-packages/keystone/__init__.py", line 4, in <module>
    from .keystone import Ks, ks_version, ks_arch_supported, version_bind, debug, KsError, __version__
  File "/usr/local/lib/python2.7/dist-packages/keystone/keystone.py", line 74, in <module>
    raise ImportError("ERROR: fail to load the dynamic library.")
ImportError: ERROR: fail to load the dynamic library.
1reaction
cryptid11commented, Jan 23, 2019

same NameError: name 'Ks' is not defined just pipinstalling keystone, after keystone-engine then the new ImportError: ERROR: fail to load the dynamic library., that is solved with this so, you have to compile and install also shared libraries…

question is, wtf dont they say this already in the INSTALL.md? lol

I think case is closed.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Python: NameError: global name 'foobar' is not defined
What I am trying to so is to call an instance method from another instance method - and I am getting a NameError...
Read more >
NameError: global name 'layer' is not defined
Problem has been solved. I've changed the code a little bit. here is the final code. def btn_nuf_pressed(self): layer = geo_utils.
Read more >
python NameError: global name '__file__' is not defined
PYTHON : python NameError : global name '__file__' is not defined [ Gift : Animated Search Engine : https://www.hows.tech/p/recommended.html ] ...
Read more >
error: global name 'Primary_OH' is not defined - Esri Community
I am trying to run my program and when i get to this part of the program. I get the error that global...
Read more >
NameError: global name 'errno' is not defined #139 - GitHub
Hi, I attempted to run the example given on the client page: client = tabpy_client.Client('http://localhost:9004/') def add(x,y): import ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found