Skip to content

Commit 82cbe05

Browse files
committed
why armhf
1 parent f1eaafb commit 82cbe05

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

pwnlib/asm.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1029,12 +1029,12 @@ def get_cs_disassembler(eabi=None):
10291029
'thumb' : (cs.CS_ARCH_ARM, cs.CS_MODE_THUMB + E),
10301030
'arm' : (cs.CS_ARCH_ARM, cs.CS_MODE_ARM + E),
10311031
'aarch64': (cs.CS_ARCH_AARCH64, cs.CS_MODE_ARM + E),
1032-
'armhf' : (cs.CS_ARCH_ARM, cs.CS_MODE_ARM + cs.CS_MODE_THUMB + E),
1032+
'armhf' : (cs.CS_ARCH_ARM, cs.CS_MODE_THUMB + E),
10331033
'mips' : (cs.CS_ARCH_MIPS, cs.CS_MODE_32 + E),
10341034
'mips64' : (cs.CS_ARCH_MIPS, cs.CS_MODE_64 + E),
1035-
'sparc': (cs.CS_ARCH_SPARC, cs.CS_MODE_32 + E),
1035+
'sparc' : (cs.CS_ARCH_SPARC, cs.CS_MODE_32 + E),
10361036
'sparc64': (cs.CS_ARCH_SPARC, cs.CS_MODE_64 + E),
1037-
'ppc': (cs.CS_ARCH_PPC, B + E),
1037+
'ppc' : (cs.CS_ARCH_PPC, B + E),
10381038
'powerpc': (cs.CS_ARCH_PPC, E + cs.CS_MODE_32),
10391039
'powerpc64': (cs.CS_ARCH_PPC, E + cs.CS_MODE_64),
10401040
'em_s390': (cs.CS_ARCH_SYSTEMZ, cs.CS_MODE_BIG_ENDIAN + cs.CS_MODE_64),

pwnlib/context/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -412,6 +412,7 @@ class ContextType(object):
412412
'avr': little_8,
413413
'amd64': little_64,
414414
'arm': little_32,
415+
'armhf': little_32,
415416
'cris': little_32,
416417
'i386': little_32,
417418
'ia64': big_64,

pwnlib/elf/elf.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1172,19 +1172,20 @@ def libc_start_main_return(self):
11721172

11731173
func = self.functions['__libc_start_main']
11741174
exit_addr = self.symbols['exit']
1175-
eabi = None
11761175
# `__libc_start_call_main` is usually smaller than `__libc_start_main`,
11771176
# (except for powerpc which uses a bigger `generic_start_main`), so
11781177
# we might disassemble a bit too much, but it's a good dynamic estimate.
11791178
callee_size = func.size
11801179
# most arch's call instruction has the first operands as an intermidiate, except s390
11811180
imm_index = 0
1181+
eabi = None
11821182

11831183
# If there's no delay slot, execution continues on the next instruction after a call.
11841184
call_return_offset = 1
11851185
call_instructions = set([cs.CS_GRP_CALL])
11861186
if self.arch in ['arm', 'thumb']:
11871187
if b'armhf' in self.linker:
1188+
# FIXME: I have no idea why setting self.arch = 'armhf' does not work
11881189
eabi = 'hf'
11891190
if exit_addr & 1: exit_addr -= 1
11901191
elif self.arch == 'aarch64':

0 commit comments

Comments
 (0)