Skip to content

Commit 27cfcf1

Browse files
committed
fixme
1 parent d2c6c35 commit 27cfcf1

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

pwnlib/asm.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff 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

414414
def _run(cmd, stdin = None):
415415
log.debug('%s', subprocess.list2cmdline(cmd))

pwnlib/elf/elf.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)