about summary refs log tree commit diff stats
path: root/miasm/tools/to_c_helper.py
diff options
context:
space:
mode:
Diffstat (limited to 'miasm/tools/to_c_helper.py')
-rw-r--r--miasm/tools/to_c_helper.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/miasm/tools/to_c_helper.py b/miasm/tools/to_c_helper.py
index be19ee8c..9bbda006 100644
--- a/miasm/tools/to_c_helper.py
+++ b/miasm/tools/to_c_helper.py
@@ -598,9 +598,12 @@ def gen_C_from_asmbloc(in_str, offset, symbol_pool, dont_dis = [], job_done = No
     f_name = "bloc_%.16X"%(offset&mask_int)
     l = symbol_pool.getby_offset_create(offset)
     cur_bloc = asmbloc.asm_bloc(l)
-        
-    asmbloc.dis_bloc(x86_mn, in_str, cur_bloc, offset, job_done, symbol_pool,[],
-                     follow_call = False, patch_instr_symb = True, dontdis_retcall = False,lines_wd = None, amode=x86_afs.u32, sex=0)
+    
+    try:
+        asmbloc.dis_bloc(x86_mn, in_str, cur_bloc, offset, job_done, symbol_pool,[],
+                         follow_call = False, patch_instr_symb = True, dontdis_retcall = False,lines_wd = None, amode=x86_afs.u32, sex=0)
+    except:
+        raise ValueError('cannot disasm at', hex(offset))
 
     f_dec, out = bloc_gen_C_func([cur_bloc], f_name, None, True, log_mn, log_reg, log_lbl, filtered_ad, tick_dbg)
     #print "\n".join(out)