Beispiel #1
0
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))
Beispiel #2
0
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)) 
Beispiel #3
0
def lstore_3(loc, code):
    """
    :return (size, Bytecode)
    """
    return (1, Bytecode(loc, 0x42, []))
Beispiel #4
0
def swap(loc, code):
    """
    :return (size, Bytecode)
    """
    return (1, Bytecode(loc, 0x5f, []))
    
Beispiel #5
0
def l2i(loc, code):
    """
    :return (size, Bytecode)
    """
    return (1, Bytecode(loc, 0x88, []))
Beispiel #6
0
def pop2(loc, code):
    """
    :return (size, Bytecode)
    """
    return (1, Bytecode(loc, 0x58, []))
Beispiel #7
0
def saload(loc, code):
    """
    :return (size, Bytecode)
    """
    return (1, Bytecode(loc, 0x35, []))
Beispiel #8
0
def lxor(loc, code):
    """
    :return (size, Bytecode)
    """
    return (1, Bytecode(loc, 0x83, []))
Beispiel #9
0
def monitorexit(loc, code):
    """
    :return (size, Bytecode)
    """
    return (1, Bytecode(loc, 0xc3, []))
Beispiel #10
0
def ldiv(loc, code):
    """
    :return (size, Bytecode)
    """
    return (1, Bytecode(loc, 0x6d, []))
Beispiel #11
0
def lload_1(loc, code):
    """
    :return (size, Bytecode)
    """
    return (1, Bytecode(loc, 0x1f, []))
Beispiel #12
0
def lcmp(loc, code):
    """
    :return (size, Bytecode)
    """
    return (1, Bytecode(loc, 0x94, []))
Beispiel #13
0
def lconst_1(loc, code):
    """
    :return (size, Bytecode)
    """
    return (1, Bytecode(loc, 0x0a, []))
Beispiel #14
0
def land(loc, code):
    """
    :return (size, Bytecode)
    """
    return (1, Bytecode(loc, 0x7f, []))
Beispiel #15
0
def laload(loc, code):
    """
    :return (size, Bytecode)
    """
    return (1, Bytecode(loc, 0x2f, []))
Beispiel #16
0
def ladd(loc, code):
    """
    :return (size, Bytecode)
    """
    return (1, Bytecode(loc, 0x61, []))
Beispiel #17
0
def lsub(loc, code):
    """
    :return (size, Bytecode)
    """
    return (1, Bytecode(loc, 0x65, []))
Beispiel #18
0
def lload_3(loc, code):
    """
    :return (size, Bytecode)
    """
    return (1, Bytecode(loc, 0x21, []))
Beispiel #19
0
def lushr(loc, code):
    """
    :return (size, Bytecode)
    """
    return (1, Bytecode(loc, 0x7d, []))
Beispiel #20
0
def lmul(loc, code):
    """
    :return (size, Bytecode)
    """
    return (1, Bytecode(loc, 0x69, []))
Beispiel #21
0
def monitorenter(loc, code):
    """
    :return (size, Bytecode)
    """
    return (1, Bytecode(loc, 0xc2, []))
Beispiel #22
0
def lneg(loc, code):
    """
    :return (size, Bytecode)
    """
    return (1, Bytecode(loc, 0x75, []))
Beispiel #23
0
def nop(loc, code):
    """
    :return (size, Bytecode)
    """
    return (1, Bytecode(loc, 0x0, []))
Beispiel #24
0
def lreturn(loc, code):
    """
    :return (size, Bytecode)
    """
    return (1, Bytecode(loc, 0xad, []))
Beispiel #25
0
def return_(loc, code):
    """
    :return (size, Bytecode)
    """
    return (1, Bytecode(loc, 0xb1, []))
Beispiel #26
0
def ishr(loc, code):
    """
    :return (size, Bytecode)
    """
    return (1, Bytecode(loc, 0x7a, []))
Beispiel #27
0
def sastore(loc, code):
    """
    :return (size, Bytecode)
    """
    return (1, Bytecode(loc, 0x56, []))
Beispiel #28
0
def lstore_0(loc, code):
    """
    :return (size, Bytecode)
    """
    return (1, Bytecode(loc, 0x3f, []))
Beispiel #29
0
def lshl(loc, code):
    """
    :return (size, Bytecode)
    """
    return (1, Bytecode(loc, 0x79, []))
Beispiel #30
0
def istore_3(loc, code):
    """
    :return (size, Bytecode)
    """
    return (1, Bytecode(loc, 0x3e, []))