Shofel2_T124_python/venv/lib/python3.10/site-packages/qiling/cc/ppc.py

27 lines
714 B
Python
Raw Normal View History

2024-05-25 16:45:07 +00:00
#!/usr/bin/env python3
#
# Cross Platform and Multi Architecture Advanced Binary Emulation Framework
from qiling.cc import QlCommonBaseCC
from unicorn.ppc_const import (
UC_PPC_REG_3, UC_PPC_REG_4, UC_PPC_REG_5,
UC_PPC_REG_6, UC_PPC_REG_7, UC_PPC_REG_8,
)
class ppc(QlCommonBaseCC):
"""Default calling convention for PPC
First 6 arguments are passed in regs, the rest are passed on the stack.
"""
_retreg = UC_PPC_REG_3
_argregs = (UC_PPC_REG_3, UC_PPC_REG_4, UC_PPC_REG_5, UC_PPC_REG_6, UC_PPC_REG_7, UC_PPC_REG_8) + (None, ) * 10
@staticmethod
def getNumSlots(argbits: int):
return 1
def setReturnAddress(self, addr: int):
self.arch.regs.lr = addr