|
@@ -49,12 +49,12 @@ public class XAPDisAsm {
|
|
for(int i=0;i<opcode.length;i++)
|
|
for(int i=0;i<opcode.length;i++)
|
|
{
|
|
{
|
|
byte[] opcodeWord = Shorts.toByteArray(opcode[i]);
|
|
byte[] opcodeWord = Shorts.toByteArray(opcode[i]);
|
|
- System.out.println(opcodeWord[0]);
|
|
|
|
|
|
+ if(EntryPoint.verbose)System.out.println(opcodeWord[0]);
|
|
opcodeValues[i]=opcodeWord[0];
|
|
opcodeValues[i]=opcodeWord[0];
|
|
opcodeReal=(opcodeWord[1]); //stompy stomp, only keeps the last
|
|
opcodeReal=(opcodeWord[1]); //stompy stomp, only keeps the last
|
|
}
|
|
}
|
|
String rawValue = Utils.bytesToHex(opcodeValues);
|
|
String rawValue = Utils.bytesToHex(opcodeValues);
|
|
- System.out.println(rawValue);
|
|
|
|
|
|
+ if(EntryPoint.verbose)System.out.println(rawValue);
|
|
|
|
|
|
int valueUnsigned = XAPDisAsmGeneratedCode.unsignedCounts.get(rawValue);
|
|
int valueUnsigned = XAPDisAsmGeneratedCode.unsignedCounts.get(rawValue);
|
|
int valueSigned =XAPDisAsmGeneratedCode.signedCounts.get(rawValue);
|
|
int valueSigned =XAPDisAsmGeneratedCode.signedCounts.get(rawValue);
|
|
@@ -156,7 +156,7 @@ public class XAPDisAsm {
|
|
opcodeReal=(opcodeWord[1]); //stompy stomp, only keeps the last
|
|
opcodeReal=(opcodeWord[1]); //stompy stomp, only keeps the last
|
|
}
|
|
}
|
|
String rawVal = Utils.bytesToHex(opcodeValues);
|
|
String rawVal = Utils.bytesToHex(opcodeValues);
|
|
- System.out.println(rawVal);
|
|
|
|
|
|
+ if(EntryPoint.verbose)System.out.println(rawVal);
|
|
int valueUnsigned = XAPDisAsmGeneratedCode.unsignedCounts.get(rawVal);
|
|
int valueUnsigned = XAPDisAsmGeneratedCode.unsignedCounts.get(rawVal);
|
|
int valueSigned =XAPDisAsmGeneratedCode.signedCounts.get(Utils.bytesToHex(opcodeValues));
|
|
int valueSigned =XAPDisAsmGeneratedCode.signedCounts.get(Utils.bytesToHex(opcodeValues));
|
|
String register = "";
|
|
String register = "";
|
|
@@ -813,15 +813,15 @@ public class XAPDisAsm {
|
|
private static int untwiddleOpcodeParamBra(byte[] opcode,int opcodelocation)
|
|
private static int untwiddleOpcodeParamBra(byte[] opcode,int opcodelocation)
|
|
{
|
|
{
|
|
int out = opcode[0];
|
|
int out = opcode[0];
|
|
- System.out.println(out);
|
|
|
|
- System.out.println(String.format("0x%08X", out));
|
|
|
|
|
|
+ if(EntryPoint.verbose)System.out.println(out);
|
|
|
|
+ if(EntryPoint.verbose)System.out.println(String.format("0x%08X", out));
|
|
for(int i=1;i<opcode.length;i++)
|
|
for(int i=1;i<opcode.length;i++)
|
|
{
|
|
{
|
|
out=out<<8;
|
|
out=out<<8;
|
|
out+=opcode[i];
|
|
out+=opcode[i];
|
|
- System.out.println(out);
|
|
|
|
- System.out.println(opcode[i]);
|
|
|
|
- System.out.println(String.format("0x%08X", out));
|
|
|
|
|
|
+ if(EntryPoint.verbose)System.out.println(out);
|
|
|
|
+ if(EntryPoint.verbose)System.out.println(opcode[i]);
|
|
|
|
+ if(EntryPoint.verbose)System.out.println(String.format("0x%08X", out));
|
|
}
|
|
}
|
|
out=out+opcodelocation;
|
|
out=out+opcodelocation;
|
|
out = out &0x00FFFFFF;
|
|
out = out &0x00FFFFFF;
|
|
@@ -918,9 +918,9 @@ public class XAPDisAsm {
|
|
for(int i=0;i<assemblyLength;i++)
|
|
for(int i=0;i<assemblyLength;i++)
|
|
{
|
|
{
|
|
Short word = f.readShort();
|
|
Short word = f.readShort();
|
|
- System.out.println("READ:"+ (word&0xff));
|
|
|
|
- System.out.println(addressToString(i));
|
|
|
|
- System.out.println(addressToString(baseAddressLastOpcode));
|
|
|
|
|
|
+ if(EntryPoint.verbose)System.out.println("READ:"+ (word&0xff));
|
|
|
|
+ if(EntryPoint.verbose)System.out.println(addressToString(i));
|
|
|
|
+ if(EntryPoint.verbose)System.out.println(addressToString(baseAddressLastOpcode));
|
|
opcodeHoldingBay.add(word);
|
|
opcodeHoldingBay.add(word);
|
|
if(word==(short)0xfe09) //specialcasing one specific opcode
|
|
if(word==(short)0xfe09) //specialcasing one specific opcode
|
|
{
|
|
{
|
|
@@ -951,7 +951,7 @@ public class XAPDisAsm {
|
|
opcode[j]=opcodeHoldingBay.get(j);
|
|
opcode[j]=opcodeHoldingBay.get(j);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- System.out.println("Mangling Opcode with length"+opcode.length);
|
|
|
|
|
|
+ if(EntryPoint.verbose)System.out.println("Mangling Opcode with length"+opcode.length);
|
|
try{
|
|
try{
|
|
disassembled.println(manglers[word&0xff].mangleOpCode(modifier,opcode,baseAddressLastOpcode));
|
|
disassembled.println(manglers[word&0xff].mangleOpCode(modifier,opcode,baseAddressLastOpcode));
|
|
}
|
|
}
|
|
@@ -974,7 +974,7 @@ public class XAPDisAsm {
|
|
opcodeHoldingBay.clear();
|
|
opcodeHoldingBay.clear();
|
|
baseAddressLastOpcode++;
|
|
baseAddressLastOpcode++;
|
|
}
|
|
}
|
|
- System.out.println("VALUE");
|
|
|
|
|
|
+ if(EntryPoint.verbose)System.out.println("VALUE");
|
|
//opcodeHoldingBay.add(word);
|
|
//opcodeHoldingBay.add(word);
|
|
}
|
|
}
|
|
|
|
|