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

Default to disassemble for CLI #2

Closed
pirapira opened this issue Sep 27, 2017 · 5 comments
Closed

Default to disassemble for CLI #2

pirapira opened this issue Sep 27, 2017 · 5 comments

Comments

@pirapira
Copy link

I tried to run the disassembler, and got the following error.

[16:20] yh@sri: ~/src/ethdasm$ python --version
Python 2.7.13
[16:20] yh@sri: ~/src/ethdasm$ cat test.hex 
0x60606040
[16:20] yh@sri: ~/src/ethdasm$ python ethdasm.py test.hex
Traceback (most recent call last):
  File "ethdasm.py", line 2, in <module>
    from contract import Contract
  File "/home/yh/src/ethdasm/contract.py", line 28
    address: int
           ^
SyntaxError: invalid syntax
@meyer9
Copy link
Owner

meyer9 commented Sep 29, 2017

Make sure you run it on Python 3.6+.

@meyer9 meyer9 closed this as completed Sep 29, 2017
@pirapira
Copy link
Author

Thanks.

@pirapira
Copy link
Author

I'm seeing

$ python3.6 ethdasm.py test.hex
Traceback (most recent call last):
  File "ethdasm.py", line 40, in <module>
    print(output)
NameError: name 'output' is not defined
Error in sys.excepthook:
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 63, in apport_excepthook
    from apport.fileutils import likely_packaged, get_recent_crashes
  File "/usr/lib/python3/dist-packages/apport/__init__.py", line 5, in <module>
    from apport.report import Report
  File "/usr/lib/python3/dist-packages/apport/report.py", line 30, in <module>
    import apport.fileutils
  File "/usr/lib/python3/dist-packages/apport/fileutils.py", line 23, in <module>
    from apport.packaging_impl import impl as packaging
  File "/usr/lib/python3/dist-packages/apport/packaging_impl.py", line 24, in <module>
    import apt
  File "/usr/lib/python3/dist-packages/apt/__init__.py", line 23, in <module>
    import apt_pkg
ModuleNotFoundError: No module named 'apt_pkg'

Original exception was:
Traceback (most recent call last):
  File "ethdasm.py", line 40, in <module>
    print(output)
NameError: name 'output' is not defined

but I guess this is due to https://bugs.launchpad.net/ubuntu/+source/python3.6/+bug/1685596

@meyer9
Copy link
Owner

meyer9 commented Sep 29, 2017

Hmm, so it looks like you didn't pass in --decompile or --disassemble. There should probably be a default. I'll reopen this so I remember to add that.

python3.6 ethdasm.py --disassemble test.hex

@meyer9 meyer9 reopened this Sep 29, 2017
@meyer9 meyer9 changed the title Python interpreter says invalid syntax Default to disassemble for CLI Sep 29, 2017
@meyer9
Copy link
Owner

meyer9 commented Sep 29, 2017

Made the default command disassemble.

@meyer9 meyer9 closed this as completed Sep 29, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants