Open naderfyi opened 1 year ago
If this helps to anyone, in octopus/arch/evm/emulator.py, function emul_comparaison_logic_instruction(self, instr, state)
, you can put args=None
at the start of the code and it will work. I faced the same issue.
If this helps to anyone, in octopus/arch/evm/emulator.py, function
emul_comparaison_logic_instruction(self, instr, state)
, you can putargs=None
at the start of the code and it will work. I faced the same issue.
Hello, I also have the same problem, but after you put args=None at the beginning of the function according to your answer, there are other problems. Do you have other problems?
I get the following error:
Traceback (most recent call last):
File "W:\pycharm\octopus-master\octopus_eth_evm.py", line 187, in <module>
main()
File "W:\pycharm\octopus-master\octopus_eth_evm.py", line 164, in main
octo_cfg = EthereumCFG(octo_bytecode)
File "W:\pycharm\octopus-master\octopus\platforms\ETH\cfg.py", line 9, in __new__
return EvmCFG(bytecode, analysis=evm_analysis)
File "W:\pycharm\octopus-master\octopus\arch\evm\cfg.py", line 160, in __init__
self.run_dynamic_analysis()
File "W:\pycharm\octopus-master\octopus\arch\evm\cfg.py", line 173, in run_dynamic_analysis
emul.emulate()
File "W:\pycharm\octopus-master\octopus\arch\evm\emulator.py", line 122, in emulate
halt = self.emulate_one_instruction(instr, state, depth)
File "W:\pycharm\octopus-master\octopus\arch\evm\emulator.py", line 168, in emulate_one_instruction
halt = self.ssa_stack_memory_storage_flow_instruction(instr, state, depth)
File "W:\pycharm\octopus-master\octopus\arch\evm\emulator.py", line 432, in ssa_stack_memory_storage_flow_instruction
self.emulate(new_state, depth=depth + 1)
File "W:\pycharm\octopus-master\octopus\arch\evm\emulator.py", line 122, in emulate
halt = self.emulate_one_instruction(instr, state, depth)
File "W:\pycharm\octopus-master\octopus\arch\evm\emulator.py", line 168, in emulate_one_instruction
halt = self.ssa_stack_memory_storage_flow_instruction(instr, state, depth)
File "W:\pycharm\octopus-master\octopus\arch\evm\emulator.py", line 399, in ssa_stack_memory_storage_flow_instruction
self.emulate(new_state, depth=depth + 1)
File "W:\pycharm\octopus-master\octopus\arch\evm\emulator.py", line 122, in emulate
halt = self.emulate_one_instruction(instr, state, depth)
File "W:\pycharm\octopus-master\octopus\arch\evm\emulator.py", line 168, in emulate_one_instruction
halt = self.emulate_one_instruction(instr, state, depth)
File "W:\pycharm\octopus-master\octopus\arch\evm\emulator.py", line 168, in emulate_one_instruction
halt = self.ssa_stack_memory_storage_flow_instruction(instr, state, depth)
File "W:\pycharm\octopus-master\octopus\arch\evm\emulator.py", line 352, in ssa_stack_memory_storage_flow_instruction
target = next(filter(lambda element: element.offset == jump_addr, self.instructions))
StopIteration
Bytecode can be found here if you want to test it: Download
For some bytecodes when I try to extract the CFG using:
python3 main.py -f bb.bin -g
I get the following error:
Anyone knows what might be the exact problem here?
I would gladly work on a fix for this if there is any guidance on how the emulator is working.