From: Nguyen A. Q. <aq...@gm...> - 2015-01-21 15:17:29
|
On Wed, Jan 21, 2015 at 10:22 PM, GROETZ, MICHAEL A CTR USAF AFMC AFRL/RYWA <mic...@us...> wrote: > Hi Everyone - > > I'm really new to Capstone and I'm trying to just get the basic java > example on the capstone website to work. Here is my code: > a quick question: do you have any problem with the TestX86.java code? what is the output of it? thanks. Q > > ---------------------- > package malwaredisassembler; > > import capstone.Capstone; > > import java.io.FileInputStream; > import java.io.File; > > public class MalwareDisassembler > { > public static byte [] CODE = { 0x55, 0x48, (byte) 0x8b, 0x05, (byte) > 0xb8, 0x13, 0x00, 0x00 }; > > public static void main(String[] args) > { > Capstone cs = new Capstone(Capstone.CS_ARCH_X86, > Capstone.CS_MODE_64); > > try > { > //FileInputStream fileInputStream = null; > > //File file = new File("C:/test/test.exe"); > > //byte[] bFile = new byte[(int) file.length()]; > //fileInputStream = new FileInputStream(file); > //fileInputStream.read(bFile); > //fileInputStream.close(); > > Capstone.CsInsn[] allInstructions = cs.disasm(CODE, 0x1000); > > for (int i=0; i < allInstructions.length; i++) > { > System.out.printf("0x%x:\t%s\t%s\n", > allInstructions[i].address, allInstructions[i].mnemonic, > allInstructions[i].opStr); > } > } > catch (Exception e) > { > } > } > } > ------------------------------------------- > > Here's my output: > > 0x1000: null null > 0x1001: null null > > What am I doing wrong? I have the capstone jar file included in my > project. I also have the capstone.dll included in my project directory. I'm > running Java 1.8.0. > > If someone could help me understand why I'm getting the nulls I would > appreciate it. > > Thanks, Mike > > > > > ------------------------------------------------------------------------------ > New Year. New Location. New Benefits. New Data Center in Ashburn, VA. > GigeNET is offering a free month of service with a new server in Ashburn. > Choose from 2 high performing configs, both with 100TB of bandwidth. > Higher redundancy.Lower latency.Increased capacity.Completely compliant. > http://p.sf.net/sfu/gigenet > _______________________________________________ > Capstone-users mailing list > Cap...@li... > https://lists.sourceforge.net/lists/listinfo/capstone-users > |