def lookupswitch(loc, code): """ https://cs.au.dk/~mis/dOvs/jvmspec/ref--41.html :return: """ loc_offset = loc + 1 operands = [] while loc_offset % 4 != 0: loc_offset += 1 default_offset = unpack_int(code[loc_offset: loc_offset + 4]) loc_offset += 4 operands.append(default_offset) n = unpack_int(code[loc_offset: loc_offset + 4]) loc_offset += 4 operands.append(n) for i in range(n): key = unpack_int(code[loc_offset: loc_offset + 4]) loc_offset += 4 operands.append(key) offset = unpack_int(code[loc_offset: loc_offset + 4]) loc_offset += 4 operands.append(offset) return (loc_offset - loc, Bytecode(loc, 0xab, operands))
def goto_w(loc, code): """ :return (size, Bytecode) """ division_arr = [4] operands = [] offset = 1 for op in division_arr: cur_op_slice = code[loc + offset : loc + offset + op] if op == 1: operands.append(unpack_byte(cur_op_slice)) elif op == 2: operands.append(unpack_short(cur_op_slice)) elif op == 4: operands.append(unpack_int(cur_op_slice)) offset += op return (1 + 4, Bytecode(loc, 0xc8, operands))
def lstore_3(loc, code): """ :return (size, Bytecode) """ return (1, Bytecode(loc, 0x42, []))
def swap(loc, code): """ :return (size, Bytecode) """ return (1, Bytecode(loc, 0x5f, []))
def l2i(loc, code): """ :return (size, Bytecode) """ return (1, Bytecode(loc, 0x88, []))
def pop2(loc, code): """ :return (size, Bytecode) """ return (1, Bytecode(loc, 0x58, []))
def saload(loc, code): """ :return (size, Bytecode) """ return (1, Bytecode(loc, 0x35, []))
def lxor(loc, code): """ :return (size, Bytecode) """ return (1, Bytecode(loc, 0x83, []))
def monitorexit(loc, code): """ :return (size, Bytecode) """ return (1, Bytecode(loc, 0xc3, []))
def ldiv(loc, code): """ :return (size, Bytecode) """ return (1, Bytecode(loc, 0x6d, []))
def lload_1(loc, code): """ :return (size, Bytecode) """ return (1, Bytecode(loc, 0x1f, []))
def lcmp(loc, code): """ :return (size, Bytecode) """ return (1, Bytecode(loc, 0x94, []))
def lconst_1(loc, code): """ :return (size, Bytecode) """ return (1, Bytecode(loc, 0x0a, []))
def land(loc, code): """ :return (size, Bytecode) """ return (1, Bytecode(loc, 0x7f, []))
def laload(loc, code): """ :return (size, Bytecode) """ return (1, Bytecode(loc, 0x2f, []))
def ladd(loc, code): """ :return (size, Bytecode) """ return (1, Bytecode(loc, 0x61, []))
def lsub(loc, code): """ :return (size, Bytecode) """ return (1, Bytecode(loc, 0x65, []))
def lload_3(loc, code): """ :return (size, Bytecode) """ return (1, Bytecode(loc, 0x21, []))
def lushr(loc, code): """ :return (size, Bytecode) """ return (1, Bytecode(loc, 0x7d, []))
def lmul(loc, code): """ :return (size, Bytecode) """ return (1, Bytecode(loc, 0x69, []))
def monitorenter(loc, code): """ :return (size, Bytecode) """ return (1, Bytecode(loc, 0xc2, []))
def lneg(loc, code): """ :return (size, Bytecode) """ return (1, Bytecode(loc, 0x75, []))
def nop(loc, code): """ :return (size, Bytecode) """ return (1, Bytecode(loc, 0x0, []))
def lreturn(loc, code): """ :return (size, Bytecode) """ return (1, Bytecode(loc, 0xad, []))
def return_(loc, code): """ :return (size, Bytecode) """ return (1, Bytecode(loc, 0xb1, []))
def ishr(loc, code): """ :return (size, Bytecode) """ return (1, Bytecode(loc, 0x7a, []))
def sastore(loc, code): """ :return (size, Bytecode) """ return (1, Bytecode(loc, 0x56, []))
def lstore_0(loc, code): """ :return (size, Bytecode) """ return (1, Bytecode(loc, 0x3f, []))
def lshl(loc, code): """ :return (size, Bytecode) """ return (1, Bytecode(loc, 0x79, []))
def istore_3(loc, code): """ :return (size, Bytecode) """ return (1, Bytecode(loc, 0x3e, []))