Search in sources :

Example 1 with Mappings

use of net.runelite.deob.deobfuscators.lvt.Mappings in project runelite by runelite.

the class Lvt method process.

private void process(Method method) {
    Code code = method.getCode();
    if (code == null) {
        return;
    }
    Mappings mappings = new Mappings(code.getMaxLocals());
    for (Instruction ins : code.getInstructions().getInstructions()) {
        if (!(ins instanceof LVTInstruction)) {
            continue;
        }
        LVTInstruction lv = (LVTInstruction) ins;
        Integer newIdx = mappings.remap(lv.getVariableIndex(), lv.type());
        if (newIdx == null) {
            continue;
        }
        assert newIdx != lv.getVariableIndex();
        Instruction newIns = lv.setVariableIndex(newIdx);
        assert ins == newIns;
        ++count;
    }
}
Also used : Mappings(net.runelite.deob.deobfuscators.lvt.Mappings) Instruction(net.runelite.asm.attributes.code.Instruction) LVTInstruction(net.runelite.asm.attributes.code.instruction.types.LVTInstruction) LVTInstruction(net.runelite.asm.attributes.code.instruction.types.LVTInstruction) Code(net.runelite.asm.attributes.Code)

Aggregations

Code (net.runelite.asm.attributes.Code)1 Instruction (net.runelite.asm.attributes.code.Instruction)1 LVTInstruction (net.runelite.asm.attributes.code.instruction.types.LVTInstruction)1 Mappings (net.runelite.deob.deobfuscators.lvt.Mappings)1