Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ARM and PPC Support #32

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ def __init__(self):

def bufferize(self, f=None):
"""Activate message's bufferization, can also be used as a decorater."""

return
if f != None:
@functools.wraps(f)
def wrapper(*args, **kwargs):
Expand Down
15 changes: 6 additions & 9 deletions peda.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,13 @@
import config
from nasm import *

ARM_REGS = ['sp'] + list(map(lambda x: "r%i" % x, range(32))) + ['cpsr']

REGISTERS = {
8 : ["al", "ah", "bl", "bh", "cl", "ch", "dl", "dh"],
16: ["ax", "bx", "cx", "dx"],
32: ["eax", "ebx", "ecx", "edx", "esi", "edi", "ebp", "esp", "eip"],
64: ["rax", "rbx", "rcx", "rdx", "rsi", "rdi", "rbp", "rsp", "rip",
"r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15"]
32: ["eax", "ebx", "ecx", "edx", "esi", "edi", "ebp", "esp", "eip"] + ARM_REGS,
64: ["rax", "rbx", "rcx", "rdx", "rsi", "rdi", "rbp", "rsp", "rip"] + ARM_REGS
}

###########################################################################
Expand Down Expand Up @@ -498,7 +499,6 @@ def getregs(self, reglist=None):
r = r.split()
if len(r) > 1 and to_int(r[1]) is not None:
result[r[0]] = to_int(r[1])

return result

def getreg(self, register):
Expand Down Expand Up @@ -4167,7 +4167,6 @@ def profile(self, *arg):

return

@msg.bufferize
def context_register(self, *arg):
"""
Display register information of current execution context
Expand All @@ -4181,10 +4180,8 @@ def context_register(self, *arg):
# display register info
msg("[%s]" % "registers".center(78, "-"), "blue")
self.xinfo("register")

return

@msg.bufferize
def context_code(self, *arg):
"""
Display nearby disassembly at $PC of current execution context
Expand Down Expand Up @@ -4254,7 +4251,6 @@ def context_code(self, *arg):

return

@msg.bufferize
def context_stack(self, *arg):
"""
Display stack of current execution context
Expand Down Expand Up @@ -4284,7 +4280,6 @@ def context(self, *arg):
"""

(opt, count) = normalize_argv(arg, 2)

if to_int(count) is None:
count = 8
if opt is None:
Expand Down Expand Up @@ -4679,6 +4674,8 @@ def eflags(self, *arg):
MYNAME
MYNAME [set|clear] flagname
"""
return ""
Copy link

@anthraxx anthraxx Jun 1, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why does the eflags function now always return nothing, was this a mistake?

EDIT: Sry, just now noticed the mentioned comment on the EFLAGS, however this needs investigation before being considered for merging. Can look into this at the weekend


FLAGS = ["CF", "PF", "AF", "ZF", "SF", "TF", "IF", "DF", "OF"]
FLAGS_TEXT = ["Carry", "Parity", "Adjust", "Zero", "Sign", "Trap",
"Interrupt", "Direction", "Overflow"]
Expand Down