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