Closed sheinz closed 8 years ago
Same issue here
$ uname -a
Linux novi-ThinkPad-X120e 4.2.0-34-generic #39-Ubuntu SMP Thu Mar 10 22:13:01 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
$ python3 -V
Python 3.4.3+
$ python3 scratchabit.py example-elf
Traceback (most recent call last):
File "scratchabit.py", line 721, in <module>
load_target_file(loader, sys.argv[1])
File "scratchabit.py", line 623, in load_target_file
entry = loader.load(engine.ADDRESS_SPACE, fname)
File "/opt/ScratchABit/plugins/loader/elf.py", line 407, in load
return load_sections(aspace, elffile)
File "/opt/ScratchABit/plugins/loader/elf.py", line 280, in load_sections
if reloc["r_addend"] != 0:
File "/opt/ScratchABit/plugins/loader/pyelftools/elftools/elf/relocation.py", line 35, in __getitem__
return self.entry[name]
File "/opt/ScratchABit/plugins/loader/pyelftools/elftools/construct/lib/container.py", line 35, in __getitem__
return self.__dict__[name]
KeyError: 'r_addend'
Thanks for the reports, confirmed.
Partial fix was pushed, though it still crashes later. The issue is that recently "advanced" loading of Xtensa ELF files was added, which was implemented in an adhoc way and now clashes with x86. I'm on it.
That's a pretty solid response time :).
In the event it's helpful, this is the new error on my machine (although I imagine it's what you were referring to):
# python3 scratchabit.py example-elf
Traceback (most recent call last):
File "scratchabit.py", line 721, in <module>
load_target_file(loader, sys.argv[1])
File "scratchabit.py", line 623, in load_target_file
entry = loader.load(engine.ADDRESS_SPACE, fname)
File "/opt/ScratchABit/plugins/loader/elf.py", line 409, in load
return load_sections(aspace, elffile)
File "/opt/ScratchABit/plugins/loader/elf.py", line 296, in load_sections
rel_type = RELOC_TYPES[reloc["r_info_type"]]
KeyError: 7
Yes, that was the other error, and it's now fixed too. python scratchabit.py example-elf
now works as expected.
Works for me now. My first time using this tool -- pretty handy! Very impressed.
Thanks again!
You're welcome. And I know it could be made better, and that's on todo ;-).
Hi,
I'm having trouble running ScratchABit on my machine:
Am I missing something? I use Ubuntu 14.04 with Python 3.4.3 Thanks