Java Code Examples for org.jf.util.IndentingWriter#printUnsignedLongAsHex()

The following examples show how to use org.jf.util.IndentingWriter#printUnsignedLongAsHex() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: LongRenderer.java    From atlas with Apache License 2.0 5 votes vote down vote up
public static void writeTo(IndentingWriter writer, long val) throws IOException {
    if (val<0) {
        writer.write("-0x");
        writer.printUnsignedLongAsHex(-val);
        writer.write('L');
    } else {
        writer.write("0x");
        writer.printUnsignedLongAsHex(val);
        writer.write('L');
    }
}
 
Example 2
Source File: LongRenderer.java    From HeyGirl with Apache License 2.0 5 votes vote down vote up
public static void writeSignedIntOrLongTo(IndentingWriter writer, long val) throws IOException {
    if (val<0) {
        writer.write("-0x");
        writer.printUnsignedLongAsHex(-val);
        if (val < Integer.MIN_VALUE) {
            writer.write('L');
        }
    } else {
        writer.write("0x");
        writer.printUnsignedLongAsHex(val);
        if (val > Integer.MAX_VALUE) {
            writer.write('L');
        }
    }
}
 
Example 3
Source File: ByteRenderer.java    From HeyGirl with Apache License 2.0 5 votes vote down vote up
public static void writeTo(IndentingWriter writer, byte val) throws IOException {
    if (val<0) {
        writer.write("-0x");
        writer.printUnsignedLongAsHex(-val);
        writer.write('t');
    } else {
        writer.write("0x");
        writer.printUnsignedLongAsHex(val);
        writer.write('t');
    }
}
 
Example 4
Source File: PreInstructionRegisterInfoMethodItem.java    From atlas with Apache License 2.0 5 votes vote down vote up
private void writeFullMerge(IndentingWriter writer, int registerNum) throws IOException {
    registerFormatter.writeTo(writer, registerNum);
    writer.write('=');
    analyzedInstruction.getPreInstructionRegisterType(registerNum).writeTo(writer);
    writer.write(":merge{");

    boolean first = true;

    for (AnalyzedInstruction predecessor: analyzedInstruction.getPredecessors()) {
        RegisterType predecessorRegisterType = predecessor.getPostInstructionRegisterType(registerNum);

        if (!first) {
            writer.write(',');
        }

        if (predecessor.getInstructionIndex() == -1) {
            //the fake "StartOfMethod" instruction
            writer.write("Start:");
        } else {
            writer.write("0x");
            writer.printUnsignedLongAsHex(methodAnalyzer.getInstructionAddress(predecessor));
            writer.write(':');
        }
        predecessorRegisterType.writeTo(writer);

        first = false;
    }
    writer.write('}');
}
 
Example 5
Source File: ShortRenderer.java    From atlas with Apache License 2.0 5 votes vote down vote up
public static void writeTo(IndentingWriter writer, short val) throws IOException {
    if (val < 0) {
        writer.write("-0x");
        writer.printUnsignedLongAsHex(-val);
        writer.write('s');
    } else {
        writer.write("0x");
        writer.printUnsignedLongAsHex(val);
        writer.write('s');
    }
}
 
Example 6
Source File: ByteRenderer.java    From atlas with Apache License 2.0 5 votes vote down vote up
public static void writeTo(IndentingWriter writer, byte val) throws IOException {
    if (val<0) {
        writer.write("-0x");
        writer.printUnsignedLongAsHex(-val);
        writer.write('t');
    } else {
        writer.write("0x");
        writer.printUnsignedLongAsHex(val);
        writer.write('t');
    }
}
 
Example 7
Source File: LongRenderer.java    From ZjDroid with Apache License 2.0 5 votes vote down vote up
public static void writeSignedIntOrLongTo(IndentingWriter writer, long val) throws IOException {
    if (val<0) {
        writer.write("-0x");
        writer.printUnsignedLongAsHex(-val);
        if (val < Integer.MIN_VALUE) {
            writer.write('L');
        }
    } else {
        writer.write("0x");
        writer.printUnsignedLongAsHex(val);
        if (val > Integer.MAX_VALUE) {
            writer.write('L');
        }
    }
}
 
Example 8
Source File: PreInstructionRegisterInfoMethodItem.java    From ZjDroid with Apache License 2.0 5 votes vote down vote up
private void writeFullMerge(IndentingWriter writer, int registerNum) throws IOException {
    registerFormatter.writeTo(writer, registerNum);
    writer.write('=');
    analyzedInstruction.getPreInstructionRegisterType(registerNum).writeTo(writer);
    writer.write(":merge{");

    boolean first = true;

    for (AnalyzedInstruction predecessor: analyzedInstruction.getPredecessors()) {
        RegisterType predecessorRegisterType = predecessor.getPostInstructionRegisterType(registerNum);

        if (!first) {
            writer.write(',');
        }

        if (predecessor.getInstructionIndex() == -1) {
            //the fake "StartOfMethod" instruction
            writer.write("Start:");
        } else {
            writer.write("0x");
            writer.printUnsignedLongAsHex(methodAnalyzer.getInstructionAddress(predecessor));
            writer.write(':');
        }
        predecessorRegisterType.writeTo(writer);

        first = false;
    }
    writer.write('}');
}
 
Example 9
Source File: LongRenderer.java    From atlas with Apache License 2.0 5 votes vote down vote up
public static void writeSignedIntOrLongTo(IndentingWriter writer, long val) throws IOException {
    if (val<0) {
        writer.write("-0x");
        writer.printUnsignedLongAsHex(-val);
        if (val < Integer.MIN_VALUE) {
            writer.write('L');
        }
    } else {
        writer.write("0x");
        writer.printUnsignedLongAsHex(val);
        if (val > Integer.MAX_VALUE) {
            writer.write('L');
        }
    }
}
 
Example 10
Source File: PreInstructionRegisterInfoMethodItem.java    From HeyGirl with Apache License 2.0 5 votes vote down vote up
private void writeFullMerge(IndentingWriter writer, int registerNum) throws IOException {
    registerFormatter.writeTo(writer, registerNum);
    writer.write('=');
    analyzedInstruction.getPreInstructionRegisterType(registerNum).writeTo(writer);
    writer.write(":merge{");

    boolean first = true;

    for (AnalyzedInstruction predecessor: analyzedInstruction.getPredecessors()) {
        RegisterType predecessorRegisterType = predecessor.getPostInstructionRegisterType(registerNum);

        if (!first) {
            writer.write(',');
        }

        if (predecessor.getInstructionIndex() == -1) {
            //the fake "StartOfMethod" instruction
            writer.write("Start:");
        } else {
            writer.write("0x");
            writer.printUnsignedLongAsHex(methodAnalyzer.getInstructionAddress(predecessor));
            writer.write(':');
        }
        predecessorRegisterType.writeTo(writer);

        first = false;
    }
    writer.write('}');
}
 
Example 11
Source File: LabelMethodItem.java    From ZjDroid with Apache License 2.0 5 votes vote down vote up
public boolean writeTo(IndentingWriter writer) throws IOException {
    writer.write(':');
    writer.write(labelPrefix);
    if (options.useSequentialLabels) {
        writer.printUnsignedLongAsHex(labelSequence);
    } else {
        writer.printUnsignedLongAsHex(this.getLabelAddress());
    }
    return true;
}
 
Example 12
Source File: ShortRenderer.java    From zjdroid with Apache License 2.0 5 votes vote down vote up
public static void writeTo(IndentingWriter writer, short val) throws IOException {
    if (val < 0) {
        writer.write("-0x");
        writer.printUnsignedLongAsHex(-val);
        writer.write('s');
    } else {
        writer.write("0x");
        writer.printUnsignedLongAsHex(val);
        writer.write('s');
    }
}
 
Example 13
Source File: LongRenderer.java    From zjdroid with Apache License 2.0 5 votes vote down vote up
public static void writeTo(IndentingWriter writer, long val) throws IOException {
    if (val<0) {
        writer.write("-0x");
        writer.printUnsignedLongAsHex(-val);
        writer.write('L');
    } else {
        writer.write("0x");
        writer.printUnsignedLongAsHex(val);
        writer.write('L');
    }
}
 
Example 14
Source File: ByteRenderer.java    From ZjDroid with Apache License 2.0 5 votes vote down vote up
public static void writeTo(IndentingWriter writer, byte val) throws IOException {
    if (val<0) {
        writer.write("-0x");
        writer.printUnsignedLongAsHex(-val);
        writer.write('t');
    } else {
        writer.write("0x");
        writer.printUnsignedLongAsHex(val);
        writer.write('t');
    }
}
 
Example 15
Source File: IntegerRenderer.java    From ZjDroid with Apache License 2.0 5 votes vote down vote up
public static void writeTo(IndentingWriter writer, int val) throws IOException {
    if (val<0) {
        writer.write("-0x");
        writer.printUnsignedLongAsHex(-((long) val));
    } else {
        writer.write("0x");
        writer.printUnsignedLongAsHex(val);
    }
}
 
Example 16
Source File: InstructionMethodItem.java    From HeyGirl with Apache License 2.0 4 votes vote down vote up
protected void writeFieldOffset(IndentingWriter writer) throws IOException {
    writer.write("field@0x");
    writer.printUnsignedLongAsHex(((FieldOffsetInstruction)instruction).getFieldOffset());
}
 
Example 17
Source File: InstructionMethodItem.java    From zjdroid with Apache License 2.0 4 votes vote down vote up
protected void writeFieldOffset(IndentingWriter writer) throws IOException {
    writer.write("field@0x");
    writer.printUnsignedLongAsHex(((FieldOffsetInstruction)instruction).getFieldOffset());
}
 
Example 18
Source File: ByteRenderer.java    From atlas with Apache License 2.0 4 votes vote down vote up
public static void writeUnsignedTo(IndentingWriter writer, byte val) throws IOException {
    writer.write("0x");
    writer.printUnsignedLongAsHex(val & 0xFF);
    writer.write('t');
}
 
Example 19
Source File: IntegerRenderer.java    From ZjDroid with Apache License 2.0 4 votes vote down vote up
public static void writeUnsignedTo(IndentingWriter writer, int val) throws IOException {
    writer.write("0x");
    writer.printUnsignedLongAsHex(val & 0xFFFFFFFFL);
}
 
Example 20
Source File: ByteRenderer.java    From zjdroid with Apache License 2.0 4 votes vote down vote up
public static void writeUnsignedTo(IndentingWriter writer, byte val) throws IOException {
    writer.write("0x");
    writer.printUnsignedLongAsHex(val & 0xFF);
    writer.write('t');
}