diff options
| author | serpilliere <serpilliere@users.noreply.github.com> | 2021-09-20 07:39:40 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-09-20 07:39:40 +0200 |
| commit | 5522eb059ad5fe2b5ef0194923b3b6c24d778946 (patch) | |
| tree | 4c5d12e728b4a237333be7245cf73325582e5f6c | |
| parent | 9a36c6d7849335c83a9460fc558afb55ff0a2aa1 (diff) | |
| parent | f2c0c38b67b65e3f5309d358c59fcee9a501854d (diff) | |
| download | focaccia-miasm-5522eb059ad5fe2b5ef0194923b3b6c24d778946.tar.gz focaccia-miasm-5522eb059ad5fe2b5ef0194923b3b6c24d778946.zip | |
Merge pull request #1386 from serpilliere/fix_incomplete_ircfg_analysis
Fix incomplete ircfg analysis
| -rw-r--r-- | miasm/analysis/data_flow.py | 4 | ||||
| -rw-r--r-- | miasm/loader/pe_init.py | 4 |
2 files changed, 7 insertions, 1 deletions
diff --git a/miasm/analysis/data_flow.py b/miasm/analysis/data_flow.py index ae44ed59..9274d9d6 100644 --- a/miasm/analysis/data_flow.py +++ b/miasm/analysis/data_flow.py @@ -1280,6 +1280,8 @@ def update_phi_with_deleted_edges(ircfg, edges_to_del): modified = False blocks = dict(ircfg.blocks) for loc_dst, loc_srcs in viewitems(phi_locs_to_srcs): + if loc_dst not in ircfg.blocks: + continue block = ircfg.blocks[loc_dst] if not irblock_has_phi(block): continue @@ -1353,6 +1355,8 @@ def del_unused_edges(ircfg, heads): for src, dst in edges_to_del_1.union(edges_to_del_2): ircfg.del_edge(src, dst) for node in nodes_to_del: + if node not in ircfg.blocks: + continue block = ircfg.blocks[node] ircfg.del_node(node) del ircfg.blocks[node] diff --git a/miasm/loader/pe_init.py b/miasm/loader/pe_init.py index 3e0c660e..202a7b00 100644 --- a/miasm/loader/pe_init.py +++ b/miasm/loader/pe_init.py @@ -46,8 +46,10 @@ class ContectRva(object): @rva_start: rva start address @rva_stop: rva stop address """ + if rva_start is None: + raise IOError("Out of range") if rva_start < 0: - raise ValueError("Out of range") + raise IOError("Out of range") if rva_stop is not None: if rva_stop > len(self.parent.img_rva): rva_stop = len(self.parent.img_rva) |