Sha256: 8a2b42ed457bec811d25dcc1aa7949840074264015924d59d3e9a3734816f629

Contents?: true

Size: 1.13 KB

Versions: 80

Compression:

Stored size: 1.13 KB

Contents

import java.nio.ByteBuffer;

import diStorm3.distorm3.*;
import diStorm3.CodeInfo;
import diStorm3.DecodedInst;
import diStorm3.OpcodeEnum;
import diStorm3.distorm3;
import diStorm3.DecodedResult;
import diStorm3.DecomposedResult;
import diStorm3.DecomposedInst;

public class Main {

	public static void main(String[] args) {
		byte[] buf = new byte[4];
		buf[0] = (byte)0xc3;
		buf[1] = (byte)0x33;
		buf[2] = (byte)0xc0;
		buf[3] = (byte)0xc3;
		CodeInfo ci = new CodeInfo((long)0x1000, buf, DecodeType.Decode32Bits, 0);
		DecodedResult dr = new DecodedResult(10);
		distorm3.Decode(ci, dr);

		for (DecodedInst x : dr.mInstructions) {
			String s = String.format("%x %s %s", x.getOffset(), x.getMnemonic(), x.getOperands());
			System.out.println(s);
		}

		DecomposedResult dr2 = new DecomposedResult(10);
		distorm3.Decompose(ci, dr2);

		for (DecomposedInst y: dr2.mInstructions) {
			if (y.getOpcode() != OpcodeEnum.RET) {
				DecodedInst x = distorm3.Format(ci, y);
				String s = String.format("%x %s %s", x.getOffset(), x.getMnemonic(), x.getOperands());
				System.out.println(s);
			}
		}

	}


}

Version data entries

80 entries across 80 versions & 1 rubygems

Version Path
contrast-agent-7.6.1 funchook/distorm/examples/java/distorm/src/Main.java
contrast-agent-7.6.0 funchook/distorm/examples/java/distorm/src/Main.java
contrast-agent-7.5.0 funchook/distorm/examples/java/distorm/src/Main.java
contrast-agent-7.4.1 funchook/distorm/examples/java/distorm/src/Main.java
contrast-agent-7.4.0 funchook/distorm/examples/java/distorm/src/Main.java
contrast-agent-7.3.2 funchook/distorm/examples/java/distorm/src/Main.java
contrast-agent-7.3.1 funchook/distorm/examples/java/distorm/src/Main.java
contrast-agent-7.3.0 funchook/distorm/examples/java/distorm/src/Main.java
contrast-agent-7.2.0 funchook/distorm/examples/java/distorm/src/Main.java
contrast-agent-7.1.0 funchook/distorm/examples/java/distorm/src/Main.java
contrast-agent-7.0.0 funchook/distorm/examples/java/distorm/src/Main.java
contrast-agent-6.15.3 funchook/distorm/examples/java/distorm/src/Main.java
contrast-agent-6.15.2 funchook/distorm/examples/java/distorm/src/Main.java
contrast-agent-6.15.1 funchook/distorm/examples/java/distorm/src/Main.java
contrast-agent-6.15.0 funchook/distorm/examples/java/distorm/src/Main.java
contrast-agent-6.14.0 funchook/distorm/examples/java/distorm/src/Main.java
contrast-agent-6.13.0 funchook/distorm/examples/java/distorm/src/Main.java
contrast-agent-6.12.0 funchook/distorm/examples/java/distorm/src/Main.java
contrast-agent-6.11.0 funchook/distorm/examples/java/distorm/src/Main.java
contrast-agent-6.10.0 funchook/distorm/examples/java/distorm/src/Main.java