use of jadx.plugins.input.java.data.DataReader in project jadx by skylot.
the class LookupSwitchDecoder method read.
private static void read(CodeDecodeState state, boolean skip) {
DataReader reader = state.reader();
JavaInsnData insn = state.insn();
int dataOffset = reader.getOffset();
int insnOffset = insn.getOffset();
reader.skip(3 - insnOffset % 4);
int defTarget = insnOffset + reader.readS4();
int pairs = reader.readS4();
if (skip) {
reader.skip(pairs * 8);
} else {
state.pop(0);
int[] keys = new int[pairs];
int[] targets = new int[pairs];
for (int i = 0; i < pairs; i++) {
keys[i] = reader.readS4();
int target = insnOffset + reader.readS4();
targets[i] = target;
state.registerJump(target);
}
insn.setTarget(defTarget);
state.registerJump(defTarget);
insn.setPayload(new SwitchPayload(pairs, keys, targets));
}
insn.setPayloadSize(reader.getOffset() - dataOffset);
}
use of jadx.plugins.input.java.data.DataReader in project jadx by skylot.
the class WideDecoder method skip.
@Override
public void skip(CodeDecodeState state) {
DataReader reader = state.reader();
JavaInsnData insn = state.insn();
int opcode = reader.readU1();
if (opcode == IINC) {
reader.skip(4);
insn.setPayloadSize(5);
} else {
reader.skip(2);
insn.setPayloadSize(3);
}
}
Aggregations