File tree 2 files changed +6
-5
lines changed 2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -388,7 +388,7 @@ def _bfdname():
388
388
'sparc64' : 'elf64-sparc' ,
389
389
}
390
390
391
- name = bfdnames .get (arch , None )
391
+ name = bfdnames .get (arch )
392
392
if not name :
393
393
raise Exception ("Cannot find bfd name for architecture %r" % arch )
394
394
return name
@@ -409,7 +409,7 @@ def _bfdarch():
409
409
'loongarch64' : 'loongarch64'
410
410
}
411
411
412
- return convert .get (arch , None ) or arch
412
+ return convert .get (arch , arch )
413
413
414
414
def _run (cmd , stdin = None ):
415
415
log .debug ('%s' , subprocess .list2cmdline (cmd ))
Original file line number Diff line number Diff line change @@ -1175,8 +1175,9 @@ def libc_start_main_return(self):
1175
1175
elif self .arch == 'aarch64' :
1176
1176
call_instructions = set ([cs .CS_GRP_CALL ])
1177
1177
elif self .arch in ['mips' , 'mips64' ]:
1178
- # FIXME: might need to fix upstream to include bal to CS_GRP_CALL
1178
+ # FIXME: `bal` was not included in CS_GRP_CALL. This is fixed on capstone v6.alpha
1179
1179
call_instructions = set ([cs .CS_GRP_CALL , cs .CS_GRP_BRANCH_RELATIVE ])
1180
+ # call_instructions = set([cs.CS_GRP_CALL])
1180
1181
# Account for the delay slot.
1181
1182
call_return_offset = 2
1182
1183
elif self .arch in ['i386' , 'amd64' , 'ia64' ]:
@@ -1190,12 +1191,12 @@ def libc_start_main_return(self):
1190
1191
func = self .functions ['__libc_start_main' ]
1191
1192
code = self .read (func .address , func .size )
1192
1193
dis = list (md .disasm (code , func .address ))
1193
- print ("dis:" , dis )
1194
+ # print("dis:", dis)
1194
1195
1195
1196
exit_addr = self .symbols ['exit' ]
1196
1197
1197
1198
calls = [(i , x ) for i , x in enumerate (dis ) if call_instructions & set (x .groups )]
1198
- print ("calls:" , calls )
1199
+ # print("calls:", calls)
1199
1200
1200
1201
def find_ret_main_addr (caller_dis , calls ):
1201
1202
call_to_main = - 1
You can’t perform that action at this time.
0 commit comments