|
Lines 610-621
Link Here
|
| 610 |
} |
610 |
} |
| 611 |
// determine instruction byte length |
611 |
// determine instruction byte length |
| 612 |
BigInteger instrLength= null; |
612 |
BigInteger instrLength= null; |
| 613 |
if (j < instructions.length - 1) { |
613 |
if (instructions[j].getSize() != null) { |
| 614 |
instrLength= instructions[j+1].getAdress().subtract(instruction.getAdress()).abs(); |
614 |
instrLength= new BigInteger(instructions[j].getSize().toString()); |
| 615 |
} |
615 |
} else { |
| 616 |
if (instrLength == null) { |
616 |
if (j < instructions.length - 1) { |
| 617 |
// cannot determine length of last instruction |
617 |
instrLength= instructions[j+1].getAdress().subtract(instruction.getAdress()).abs(); |
| 618 |
break; |
618 |
} |
|
|
619 |
if (instrLength == null) { |
| 620 |
// cannot determine length of last instruction |
| 621 |
break; |
| 622 |
} |
| 619 |
} |
623 |
} |
| 620 |
final String opCode; |
624 |
final String opCode; |
| 621 |
// insert function name+offset instead of opcode bytes |
625 |
// insert function name+offset instead of opcode bytes |
|
Lines 727-752
Link Here
|
| 727 |
} |
731 |
} |
| 728 |
// determine instruction byte length |
732 |
// determine instruction byte length |
| 729 |
BigInteger instrLength= null; |
733 |
BigInteger instrLength= null; |
| 730 |
if (j < instructions.length - 1) { |
734 |
if (instructions[j].getSize() != null) { |
| 731 |
instrLength= instructions[j+1].getAdress().subtract(instruction.getAdress()).abs(); |
735 |
instrLength= new BigInteger(instructions[j].getSize().toString()); |
| 732 |
} else if (i < mixedInstructions.length - 1) { |
736 |
} else { |
| 733 |
int nextSrcLineIdx= i+1; |
737 |
if (j < instructions.length - 1) { |
| 734 |
while (nextSrcLineIdx < mixedInstructions.length) { |
738 |
instrLength= instructions[j+1].getAdress().subtract(instruction.getAdress()).abs(); |
| 735 |
IInstruction[] nextInstrs= mixedInstructions[nextSrcLineIdx].getInstructions(); |
739 |
} else if (i < mixedInstructions.length - 1) { |
| 736 |
if (nextInstrs.length > 0) { |
740 |
int nextSrcLineIdx= i+1; |
| 737 |
instrLength= nextInstrs[0].getAdress().subtract(instruction.getAdress()).abs(); |
741 |
while (nextSrcLineIdx < mixedInstructions.length) { |
|
|
742 |
IInstruction[] nextInstrs= mixedInstructions[nextSrcLineIdx].getInstructions(); |
| 743 |
if (nextInstrs.length > 0) { |
| 744 |
instrLength= nextInstrs[0].getAdress().subtract(instruction.getAdress()).abs(); |
| 745 |
break; |
| 746 |
} |
| 747 |
++nextSrcLineIdx; |
| 748 |
} |
| 749 |
if (nextSrcLineIdx >= mixedInstructions.length) { |
| 738 |
break; |
750 |
break; |
| 739 |
} |
751 |
} |
| 740 |
++nextSrcLineIdx; |
|
|
| 741 |
} |
752 |
} |
| 742 |
if (nextSrcLineIdx >= mixedInstructions.length) { |
753 |
if (instrLength == null) { |
|
|
754 |
// cannot determine length of last instruction |
| 743 |
break; |
755 |
break; |
| 744 |
} |
756 |
} |
| 745 |
} |
757 |
} |
| 746 |
if (instrLength == null) { |
|
|
| 747 |
// cannot determine length of last instruction |
| 748 |
break; |
| 749 |
} |
| 750 |
final String opCode; |
758 |
final String opCode; |
| 751 |
// insert function name+offset instead of opcode bytes |
759 |
// insert function name+offset instead of opcode bytes |
| 752 |
if (functionName != null && functionName.length() > 0) { |
760 |
if (functionName != null && functionName.length() > 0) { |