File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -388,7 +388,7 @@ def _bfdname():
388388 'sparc64' : 'elf64-sparc' ,
389389 }
390390
391- name = bfdnames .get (arch , None )
391+ name = bfdnames .get (arch )
392392 if not name :
393393 raise Exception ("Cannot find bfd name for architecture %r" % arch )
394394 return name
@@ -409,7 +409,7 @@ def _bfdarch():
409409 'loongarch64' : 'loongarch64'
410410 }
411411
412- return convert .get (arch , None ) or arch
412+ return convert .get (arch , arch )
413413
414414def _run (cmd , stdin = None ):
415415 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):
11751175 elif self .arch == 'aarch64' :
11761176 call_instructions = set ([cs .CS_GRP_CALL ])
11771177 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
11791179 call_instructions = set ([cs .CS_GRP_CALL , cs .CS_GRP_BRANCH_RELATIVE ])
1180+ # call_instructions = set([cs.CS_GRP_CALL])
11801181 # Account for the delay slot.
11811182 call_return_offset = 2
11821183 elif self .arch in ['i386' , 'amd64' , 'ia64' ]:
@@ -1190,12 +1191,12 @@ def libc_start_main_return(self):
11901191 func = self .functions ['__libc_start_main' ]
11911192 code = self .read (func .address , func .size )
11921193 dis = list (md .disasm (code , func .address ))
1193- print ("dis:" , dis )
1194+ # print("dis:", dis)
11941195
11951196 exit_addr = self .symbols ['exit' ]
11961197
11971198 calls = [(i , x ) for i , x in enumerate (dis ) if call_instructions & set (x .groups )]
1198- print ("calls:" , calls )
1199+ # print("calls:", calls)
11991200
12001201 def find_ret_main_addr (caller_dis , calls ):
12011202 call_to_main = - 1
You can’t perform that action at this time.
0 commit comments