mirror of
https://github.com/qilingframework/qiling.git
synced 2026-10-12 02:21:40 +00:00
Merge pull request #1367 from ucgJhe/dev
update return register accordingly for all arch
This commit is contained in:
+1
-2
@@ -20,8 +20,7 @@ class QlArmBaseCC(QlCommonBaseCC):
|
||||
return 1
|
||||
|
||||
def setReturnAddress(self, addr: int) -> None:
|
||||
# TODO: do we need to update LR?
|
||||
self.arch.stack_push(addr)
|
||||
self.arch.regs.lr = addr
|
||||
|
||||
def unwind(self, nslots: int) -> int:
|
||||
# TODO: cleanup?
|
||||
|
||||
@@ -12,6 +12,9 @@ class mipso32(QlCommonBaseCC):
|
||||
_shadow = 4
|
||||
_retaddr_on_stack = False
|
||||
|
||||
def setReturnAddress(self, addr: int):
|
||||
self.arch.regs.ra = addr
|
||||
|
||||
@staticmethod
|
||||
def getNumSlots(argbits: int):
|
||||
return 1
|
||||
|
||||
@@ -21,3 +21,6 @@ class ppc(QlCommonBaseCC):
|
||||
@staticmethod
|
||||
def getNumSlots(argbits: int):
|
||||
return 1
|
||||
|
||||
def setReturnAddress(self, addr: int):
|
||||
self.arch.regs.lr = addr
|
||||
|
||||
+4
-1
@@ -19,4 +19,7 @@ class riscv(QlCommonBaseCC):
|
||||
|
||||
@staticmethod
|
||||
def getNumSlots(argbits: int):
|
||||
return 1
|
||||
return 1
|
||||
|
||||
def setReturnAddress(self, addr: int):
|
||||
self.arch.regs.ra = addr
|
||||
|
||||
Reference in New Issue
Block a user