Coder Social home page Coder Social logo

AssertionError about python-xasm HOT 9 CLOSED

rocky avatar rocky commented on June 2, 2024
AssertionError

from python-xasm.

Comments (9)

rocky avatar rocky commented on June 2, 2024

Please copy and post the first 10 lines of myfile.pyasm

from python-xasm.

CoverDisc avatar CoverDisc commented on June 2, 2024
# pydisasm version 6.0.5.dev0
# Python bytecode 3.10.0 (3439)
# Disassembled from Python 3.10.4 (main, Dec  1 2022, 10:22:11) [GCC 7.5.0]
# Timestamp in code: 0 (1970-01-01 01:00:00)
# Source code size mod 2**32: 0 bytes

# Method Name:       contatore
# Filename:         myfile.py
# Argument count:    1
# Position-only argument count: 0
# Keyword-only arguments: 0
# Number of locals:  5
# Stack size:        4
# Flags:             0x00000043 (NOFREE | NEWLOCALS | OPTIMIZED)
# First Line:        22

from python-xasm.

rocky avatar rocky commented on June 2, 2024

I can't reproduce this problem. If you are not using the latest github master, try with that. (I just changed the version number to a dev branch to distinguish from the last release).

Also there was an unrelated bug in xdis, so pull from the master use that.

If this doesn't correct things, then attach the entire disassembled file and the pyc file.

from python-xasm.

CoverDisc avatar CoverDisc commented on June 2, 2024

tank's , reproduce the same error with new dev branch

Traceback (most recent call last):
  File "/usr/local/bin/pyc-xasm", line 33, in <module>
    sys.exit(load_entry_point('xasm==1.2.1.dev0', 'console_scripts', 'pyc-xasm')())
  File "/usr/local/lib/python3.10/site-packages/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.10/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.10/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/xasm-1.2.1.dev0-py3.10.egg/xasm/xasm_cli.py", line 28, in main
  File "/usr/local/lib/python3.10/site-packages/xasm-1.2.1.dev0-py3.10.egg/xasm/assemble.py", line 290, in asm_file
AssertionError: File needs to start out with: # Python bytecode <version>

the project it's a private with ip of my server if it's possible i send you in pm

from python-xasm.

rocky avatar rocky commented on June 2, 2024

Ok - send email to [email protected] and I'll look at it when I can.

from python-xasm.

CoverDisc avatar CoverDisc commented on June 2, 2024

thank's again i will send now

from python-xasm.

rocky avatar rocky commented on June 2, 2024

The file you sent doesn't match what you report above. The first line in the file sent is:

/root/python-xdis

The other thing about the file sent is that xdis needs to be redone to correct for changes in the instruction operand format for jump instructions in 3.10. I made yet another change just before writing this. So make sure to refresh your xdis development version, and run the disassembly again (and don't add further lines).

from python-xasm.

CoverDisc avatar CoverDisc commented on June 2, 2024

thank's for your time i don't know why the file that i have send report in frist line /root/python-xdis i ran again
pydisasm -F xasm myfile.pyc | tee > myfile.pyasm
and reinstall xdis from dev branch
this is the output of comand pyc-xasm myfile.pyasm

Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/xasm-1.2.1.dev0-py3.10.egg/xasm/assemble.py", line 461, in create_code
KeyError: 'L40'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/local/bin/pyc-xasm", line 33, in
sys.exit(load_entry_point('xasm==1.2.1.dev0', 'console_scripts', 'pyc-xasm')())
File "/usr/local/lib/python3.10/site-packages/click/core.py", line 1130, in call
return self.main(*args, **kwargs)
File "/usr/local/lib/python3.10/site-packages/click/core.py", line 1055, in main
rv = self.invoke(ctx)
File "/usr/local/lib/python3.10/site-packages/click/core.py", line 1404, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/local/lib/python3.10/site-packages/click/core.py", line 760, in invoke
return __callback(*args, **kwargs)
File "/usr/local/lib/python3.10/site-packages/xasm-1.2.1.dev0-py3.10.egg/xasm/xasm_cli.py", line 28, in main
File "/usr/local/lib/python3.10/site-packages/xasm-1.2.1.dev0-py3.10.egg/xasm/assemble.py", line 173, in asm_file
File "/usr/local/lib/python3.10/site-packages/xasm-1.2.1.dev0-py3.10.egg/xasm/assemble.py", line 465, in create_code
File "/usr/local/lib/python3.10/site-packages/xasm-1.2.1.dev0-py3.10.egg/xasm/assemble.py", line 401, in err
RuntimeError: Label L40 not found.
I know about { POP_JUMP_IF_TRUE L2 (to 4), POP_JUMP_IF_FALSE L40 (to 80)}. Instruction 1:
POP_JUMP_IF_FALSE L40 (to 80)

from python-xasm.

CoverDisc avatar CoverDisc commented on June 2, 2024

from python-xasm.

Related Issues (17)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.