mirror of
https://github.com/Decompollaborate/rabbitizer.git
synced 2025-01-30 06:32:43 +00:00
getProcessedImmediate
This commit is contained in:
parent
6fc7be4517
commit
c129447463
@ -126,6 +126,7 @@ void RabbitizerInstruction_processUniqueId(RabbitizerInstruction *self);
|
||||
uint32_t RabbitizerInstruction_getRaw(const RabbitizerInstruction *self);
|
||||
|
||||
uint32_t RabbitizerInstruction_getImmediate(const RabbitizerInstruction *self);
|
||||
int32_t RabbitizerInstruction_getProcessedImmediate(const RabbitizerInstruction *self);
|
||||
uint32_t RabbitizerInstruction_getInstrIndex(const RabbitizerInstruction *self);
|
||||
uint32_t RabbitizerInstruction_getInstrIndexAsVram(const RabbitizerInstruction *self);
|
||||
|
||||
|
@ -25,6 +25,7 @@ class Instruction:
|
||||
|
||||
def getRaw(self) -> int: ...
|
||||
def getImmediate(self) -> int: ...
|
||||
def getProcessedImmediate(self) -> int: ...
|
||||
def getInstrIndexAsVram(self) -> int: ...
|
||||
def getBranchOffset(self) -> int: ...
|
||||
def getGenericBranchOffset(self, currentVram: int) -> int: ...
|
||||
|
@ -142,6 +142,7 @@ static PyGetSetDef Instr_getsetters[] = {
|
||||
|
||||
DEF_METHOD_GET_UINT(getRaw)
|
||||
DEF_METHOD_GET_UINT(getImmediate)
|
||||
DEF_METHOD_GET_INT(getProcessedImmediate)
|
||||
DEF_METHOD_GET_UINT(getInstrIndexAsVram)
|
||||
DEF_METHOD_GET_INT(getBranchOffset)
|
||||
|
||||
@ -295,6 +296,7 @@ static PyObject *rabbitizer_type_Instruction_disassemble(PyRabbitizerInstruction
|
||||
static PyMethodDef Instr_methods[] = {
|
||||
METHOD_NO_ARGS(getRaw, ""),
|
||||
METHOD_NO_ARGS(getImmediate, ""),
|
||||
METHOD_NO_ARGS(getProcessedImmediate, ""),
|
||||
METHOD_NO_ARGS(getInstrIndexAsVram, ""),
|
||||
METHOD_NO_ARGS(getBranchOffset, ""),
|
||||
METHOD_ARGS(getGenericBranchOffset, ""),
|
||||
|
@ -37,6 +37,12 @@ uint32_t RabbitizerInstruction_getRaw(const RabbitizerInstruction *self) {
|
||||
uint32_t RabbitizerInstruction_getImmediate(const RabbitizerInstruction *self) {
|
||||
return RAB_INSTR_GET_immediate(self);
|
||||
}
|
||||
int32_t RabbitizerInstruction_getProcessedImmediate(const RabbitizerInstruction *self) {
|
||||
if (RabbitizerInstrDescriptor_isUnsigned(self->descriptor)) {
|
||||
return RAB_INSTR_GET_immediate(self);
|
||||
}
|
||||
return RabbitizerUtils_From2Complement(RAB_INSTR_GET_immediate(self), 16);
|
||||
}
|
||||
|
||||
uint32_t RabbitizerInstruction_getInstrIndex(const RabbitizerInstruction *self) {
|
||||
return RAB_INSTR_GET_instr_index(self);
|
||||
|
Loading…
x
Reference in New Issue
Block a user