Exemple #1
0
uint8_t CFIWalker::processMixedInstr(void* opaque, int (*mapRegisterNumber)(void*, int), uint8_t instr)
{
    int origRegNo = int(instr) & 0x3f;
    int newRegNo = mapRegisterNumber(opaque, origRegNo);

    if (origRegNo != newRegNo)
        return (uint8_t) (instr & 0xC0) | newRegNo;
    else
        return instr;
}
Exemple #2
0
void CFIWalker::processNextReg(void* opaque, int (*mapRegisterNumber)(void*, int))
{
    uint64_t reg, newReg;

    reg = m_buffer.readULEB128();
    newReg = mapRegisterNumber(opaque, reg);

    if (newReg != reg)
    {
        LOG << "Updating register number: " << reg << " -> " << newReg << std::endl;
        m_buffer.updateLastULEB128(newReg);
    }
}
Exemple #3
0
uint8_t CFIWalker::processMixedInstr(void* opaque, int (*mapRegisterNumber)(void*, int), uint8_t instr)
{
	int origRegNo = int(instr) & 0x3f;
	int newRegNo = mapRegisterNumber(opaque, origRegNo);
	
	if (origRegNo != newRegNo)
	{
		LOG << "Updating mixed instr. register number: " << origRegNo << " -> " << newRegNo << std::endl;
		return (uint8_t) (instr & 0xC0) | (newRegNo & 0x3f);
	}
	else
		return instr;
}