Repository: angr/angr

Issue:
CFGFast | ERROR | 'RdTmp' object has no attribute 'con'
### Description

Hello,
I try to analyse **malware** and get the following error on creating a CFG for function discovery:

> 2022-11-09 21:57:40 | __main__ | INFO | creating BlockAnalysis for 75bf8cf9e7b9b06f08396a6d6ecf3bca428c00cd79e4b9bf6e56619b67d7c4de
> 2022-11-09 21:57:40 | __main__ | ERROR | 'RdTmp' object has no attribute 'con'
> Traceback (most recent call last):
>   File "/home/james/src/app.py", line 35, in <module>
>     ba = BlockAnalysis(binary)
>   File "/home/james/src/analysis/block/block_analysis.py", line 32, in __init__
>     self.project.analyses.CFGFast(data_references=False, skip_unmapped_addrs=False)
>   File "/home/james/.local/lib/python3.10/site-packages/angr/analyses/analysis.py", line 138, in __call__
>     r = w(*args, **kwargs)
>   File "/home/james/.local/lib/python3.10/site-packages/angr/analyses/analysis.py", line 122, in wrapper
>     oself.__init__(*args, **kwargs)
>   File "/home/james/.local/lib/python3.10/site-packages/angr/analyses/cfg/cfg_fast.py", line 756, in __init__
>     self._analyze()
>   File "/home/james/.local/lib/python3.10/site-packages/angr/analyses/forward_analysis/forward_analysis.py", line 241, in _analyze
>     self._analysis_core_baremetal()
>   File "/home/james/.local/lib/python3.10/site-packages/angr/analyses/forward_analysis/forward_analysis.py", line 365, in _analysis_core_baremetal
>     self._job_queue_empty()
>   File "/home/james/.local/lib/python3.10/site-packages/angr/analyses/cfg/cfg_fast.py", line 1369, in _job_queue_empty
>     self._process_unresolved_indirect_jumps()
>   File "/home/james/.local/lib/python3.10/site-packages/angr/analyses/cfg/cfg_base.py", line 2577, in _process_unresolved_indirect_jumps
>     all_targets |= self._process_one_indirect_jump(jump)
>   File "/home/james/.local/lib/python3.10/site-packages/angr/analyses/cfg/cfg_base.py", line 2603, in _process_one_indirect_jump
>     resolved, targets = resolver.resolve(self, jump.addr, jump.func_addr, block, jump.jumpkind)
>   File "/home/james/.local/lib/python3.10/site-packages/angr/analyses/cfg/indirect_jump_resolvers/jumptable.py", line 719, in resolve
>     r, targets = self._resolve(cfg, addr, func_addr, b)
>   File "/home/james/.local/lib/python3.10/site-packages/angr/analyses/cfg/indirect_jump_resolvers/jumptable.py", line 842, in _resolve
>     simgr.run()
>   File "/home/james/.local/lib/python3.10/site-packages/angr/sim_manager.py", line 318, in run
>     self.step(stash=stash, **kwargs)
>   File "/home/james/.local/lib/python3.10/site-packages/angr/misc/hookset.py", line 90, in __call__
>     result = current_hook(self.func.__self__, *args, **kwargs)
>   File "/home/james/.local/lib/python3.10/site-packages/angr/exploration_techniques/explorer.py", line 112, in step
>     return simgr.step(stash=stash, extra_stop_points=base_extra_stop_points | self._extra_stop_points, **kwargs)
>   File "/home/james/.local/lib/python3.10/site-packages/angr/misc/hookset.py", line 90, in __call__
>     result = current_hook(self.func.__self__, *args, **kwargs)
>   File "/home/james/.local/lib/python3.10/site-packages/angr/exploration_techniques/suggestions.py", line 41, in step
>     simgr.step(stash=stash, **kwargs)
>   File "/home/james/.local/lib/python3.10/site-packages/angr/misc/hookset.py", line 95, in __call__
>     return self.func(*args, **kwargs)
>   File "/home/james/.local/lib/python3.10/site-packages/angr/sim_manager.py", line 407, in step
>     successors = self.step_state(state, successor_func=successor_func, error_list=error_list, **run_args)
>   File "/home/james/.local/lib/python3.10/site-packages/angr/misc/hookset.py", line 90, in __call__
>     result = current_hook(self.func.__self__, *args, **kwargs)
>   File "/home/james/.local/lib/python3.10/site-packages/angr/exploration_techniques/slicecutor.py", line 39, in step_state
>     stashes = simgr.step_state(state, **kwargs)
>   File "/home/james/.local/lib/python3.10/site-packages/angr/misc/hookset.py", line 95, in __call__
>     return self.func(*args, **kwargs)
>   File "/home/james/.local/lib/python3.10/site-packages/angr/sim_manager.py", line 448, in step_state
>     successors = self.successors(state, successor_func=successor_func, **run_args)
>   File "/home/james/.local/lib/python3.10/site-packages/angr/misc/hookset.py", line 90, in __call__
>     result = current_hook(self.func.__self__, *args, **kwargs)
>   File "/home/james/.local/lib/python3.10/site-packages/angr/exploration_techniques/local_loop_seer.py", line 42, in successors
>     succs = simgr.successors(state, **kwargs)
>   File "/home/james/.local/lib/python3.10/site-packages/angr/misc/hookset.py", line 90, in __call__
>     result = current_hook(self.func.__self__, *args, **kwargs)
>   File "/home/james/.local/lib/python3.10/site-packages/angr/exploration_techniques/slicecutor.py", line 115, in successors
>     return simgr.successors(state, **kwargs)
>   File "/home/james/.local/lib/python3.10/site-packages/angr/misc/hookset.py", line 95, in __call__
>     return self.func(*args, **kwargs)
>   File "/home/james/.local/lib/python3.10/site-packages/angr/sim_manager.py", line 496, in successors
>     return self._project.factory.successors(state, **run_args)
>   File "/home/james/.local/lib/python3.10/site-packages/angr/factory.py", line 60, in successors
>     return self.default_engine.process(*args, **kwargs)
>   File "/home/james/.local/lib/python3.10/site-packages/angr/engines/vex/light/slicing.py", line 19, in process
>     return super().process(*args, **kwargs)
>   File "/home/james/.local/lib/python3.10/site-packages/angr/engines/engine.py", line 159, in process
>     self.process_successors(self.successors, **kwargs)
>   File "/home/james/.local/lib/python3.10/site-packages/angr/engines/failure.py", line 21, in process_successors
>     return super().process_successors(successors, **kwargs)
>   File "/home/james/.local/lib/python3.10/site-packages/angr/engines/syscall.py", line 18, in process_successors
>     return super().process_successors(successors, **kwargs)
>   File "/home/james/.local/lib/python3.10/site-packages/angr/engines/hook.py", line 54, in process_successors
>     return super().process_successors(successors, procedure=procedure, **kwargs)
>   File "/home/james/.local/lib/python3.10/site-packages/angr/engines/unicorn.py", line 363, in process_successors
>     return super().process_successors(successors, **kwargs)
>   File "/home/james/.local/lib/python3.10/site-packages/angr/engines/soot/engine.py", line 65, in process_successors
>     return super().process_successors(successors, **kwargs)
>   File "/home/james/.local/lib/python3.10/site-packages/angr/engines/vex/heavy/heavy.py", line 118, in process_successors
>     if irsb.jumpkind == 'Ijk_NoDecode' and irsb.next.con.value == irsb.addr \
> AttributeError: 'RdTmp' object has no attribute 'con'

### Steps to reproduce the bug

> loader = angr.cle.loader.Loader(BytesIO(binary), use_system_libs=False, auto_load_libs=False)
> self.project = angr.Project(loader, use_sim_procedures=True, support_selfmodifying_code=True)
> self.project.analyses.CFGFast(data_references=False, skip_unmapped_addrs=False)

### Environment

_No response_

### Additional context

Link to file: https://bazaar.abuse.ch/download/75bf8cf9e7b9b06f08396a6d6ecf3bca428c00cd79e4b9bf6e56619b67d7c4de/
**Be careful, it's malware.**


Discussion:

Resolving patch:
diff --git a/angr/engines/vex/heavy/heavy.py b/angr/engines/vex/heavy/heavy.py
--- a/angr/engines/vex/heavy/heavy.py
+++ b/angr/engines/vex/heavy/heavy.py
@@ -115,7 +115,7 @@ def process_successors(self,
                     extra_stop_points=extra_stop_points,
                     opt_level=opt_level)
 
-            if irsb.jumpkind == 'Ijk_NoDecode' and irsb.next.con.value == irsb.addr \
+            if irsb.jumpkind == 'Ijk_NoDecode' and irsb.next.tag == 'Iex_Const' and irsb.next.con.value == irsb.addr \
                     and not self.state.project.is_hooked(irsb.addr):
                 raise errors.SimIRSBNoDecodeError(f"IR decoding error at 0x{addr:02x}. You can hook this "
                                                   "instruction with a python replacement using project.hook"


Test patch: