/
NightmareModule.cs
981 lines (884 loc) · 29.4 KB
/
NightmareModule.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace FE_Editor_Suite
{
public partial class NightmareModule : EditorModule
{
List<>
public NightmareModule()
{
InitializeComponent();
}
public override void uponOpen()
{
}
public override void updateData()
{
}
public override void writePendingChanges()
{
}
public override abstract string ToString()
{
return "NightmareModule";
}
private static class NightmareModuleModule //This is going to be pretty much translated from nm2's java
{
private static enum entryType {
TEXT,
HEXA,
NEHU,
NEDS,
NEDU,
NDHU,
NDDU,
STRUCT}
public static class EntryComponent {
private boolean validComponent = true;
private String name { get; set {
if (value == null)
validComponent = false;
else
name = value;
} };
private int numBitsOffset;
private int bitCount;
private EntryType type;
private File associatedList;
private AccessType accessType;
private int parseVerboseInt(String input) {
String loadedString = String.format("%s", input);
boolean negative = false;
int base = 10;
int shift = 3;
int retVal = -1;
if (input.charAt(0) == '-') {
negative = true;
input = input.substring(1);
}
if (input.indexOf("0x") == 0) {
base = 16;
input = input.substring(2);
}
if (input.indexOf("b") == input.length() - 1) {
shift = 0;
input = input.substring(0, input.length() - 1);
}
try {
retVal = Integer.parseInt(input, base);
} catch (Exception e) {
addGeneralError(loadedString);
validComponent = false;
}
if (validComponent) {
retVal <<= shift;
if (negative)
retVal = 0 - retVal;
}
return retVal;
}
public boolean isValid() { return validComponent; }
public void setName(String input) {
if (input == null)
validComponent = false;
else
name = input;
}
public void setNumBitsOffset(String input) {
if (input == null)
validComponent = false;
else
numBitsOffset = parseVerboseInt(input);
if (numBitsOffset < 0) {
if (!numBitsOffsetErrorDisplayed)
throw new IllegalArgumentException(
"You can't have negative " +
"offsets!"
);
numBitsOffsetErrorDisplayed = true;
validComponent = false;
}
}
public void setBitCount(String input) {
if (input == null)
validComponent = false;
else
bitCount = parseVerboseInt(input);
if (bitCount <= 0) {
if (!bitCountErrorDisplayed)
throw new IllegalArgumentException(
"You can't have absent or " +
"negative data lengths!"
);
bitCountErrorDisplayed = true;
validComponent = false;
}
}
public void setType(String input) {
if (input == null)
validComponent = false;
else {
try {
type = EntryType.valueOf(input);
} catch (Exception e) {
addGeneralError(input);
validComponent = false;
}
}
if (
(
type == EntryType.TEXT
|| type == EntryType.HEXA
)
&& (
numBitsOffset % 8 != 0
|| bitCount % 8 != 0
)
) {
if (!arrayTypeErrorDisplayed)
throw new IllegalArgumentException (
"Array editing components " +
"must be byte aligned and\n" +
"must have a length in bytes!"
);
arrayTypeErrorDisplayed = true;
validComponent = false;
}
if (
type != EntryType.TEXT
&& type != EntryType.HEXA
&& bitCount > 32
) {
if (!tooManyBitsErrorDisplayed)
throw new IllegalArgumentException(
"This application does not " +
"support bit arrays with\n" +
"more than 32 bits"
);
tooManyBitsErrorDisplayed = true;
validComponent = false;
}
if (
type == EntryType.STRUCT
&& getAccessType(0) != AccessType.WORD) {
if (!structErrorDisplayed)
throw new IllegalArgumentException(
"This application does not " +
"support struct pointers\n" +
"not aligned by 32 bits"
);
structErrorDisplayed = true;
validComponent = false;
}
}
public void setAssociatedList(String input) {
if (input == null)
validComponent = false;
else if (input.equals("NULL"))
associatedList = null;
else
associatedList = new File(input);
}
public String getName() { return name; }
public int getNumBitsOffset() { return numBitsOffset; }
public int getAddress(int index) {
return (numBitsOffset >> 3)
+ (entrySize * index) + baseAddress;
}
public int getBitCount() { return bitCount; }
private void calculateAccessType(int index) {
final int significand = (getAddress(index) << 3) + (numBitsOffset % 8);
final int bits = bitCount;
final AccessType supposedType = Target_File.calculateAccessType(
significand, true
);
if (supposedType != AccessType.BIT && bits == 8)
accessType = AccessType.BYTE;
else if ((
supposedType == AccessType.HALF
|| supposedType == AccessType.WORD)
&& bits == 16
)
accessType = AccessType.HALF;
else if (supposedType == AccessType.WORD && bits == 32)
accessType = AccessType.WORD;
else
accessType = AccessType.BIT;
}
public AccessType getAccessType(int index) {
if (accessType == null) calculateAccessType(index);
return accessType;
}
public EntryType getEntryType() { return type; }
public String getAssociatedListPath() {
return associatedList.getPath();
}
}
private static class TextTableEntry {
private String find;
private String replace;
public int findLength = 0;
public int replaceLength = 0;
public TextTableEntry(String findString, String replaceString) {
find = findString;
if (find != null)
findLength = find.length();
replace = replaceString;
if (replace != null)
replaceLength = replace.length();
}
public String getFind() { return find; }
public String getReplace() { return replace; }
}
private static boolean numBitsOffsetErrorDisplayed = false;
private static boolean bitCountErrorDisplayed = false;
private static boolean tooManyBitsErrorDisplayed = false;
private static boolean arrayTypeErrorDisplayed = false;
private static boolean structErrorDisplayed = false;
protected File thisModule = null;
private boolean valid = true;
private int line = 1;
private String errorString = "";
protected boolean useBasePointer = false;
protected boolean expanded = false;
private int hardwareOffset = 0;
private Integer checksum;
private String IDstring;
private Integer IDstringAddress;
protected String version;
protected String description;
protected int baseAddress;
protected int basePointer;
protected int defaultEntryCount;
protected int expandedEntryCount;
protected int entrySize;
private File entryList;
private File textTable;
private LinkedList<TextTableEntry> textTableEntryList =
new LinkedList<TextTableEntry>();
private TextTableEntry textTableTranslationEntries[];
private TextTableEntry textTableEncodingEntries[];
private LinkedList<EntryComponent> componentList =
new LinkedList<EntryComponent>();
private static final int partitionTableEntries(
TextTableEntry[] array, int left, int right,
boolean replaceElements
) {
TextTableEntry temp;
int storeIndex = right;
int leftComparator;
int rightComparator;
if (!replaceElements)
rightComparator = array[left].findLength;
else
rightComparator = array[left].replaceLength;
for (int i = right; i > left; i--) {
if (!replaceElements)
leftComparator = array[i].findLength;
else
leftComparator = array[i].replaceLength;
if (leftComparator < rightComparator) {
temp = array[i];
array[i] = array[storeIndex];
array[storeIndex--] = temp;
}
}
temp = array[left];
array[left] = array[storeIndex];
array[storeIndex] = temp;
return storeIndex;
}
private static final void quickSortTableEntries(
TextTableEntry[] array, int left, int right,
boolean replaceElements
) {
if (array == null)
return;
if (right <= left)
return;
int pivotNewIndex = partitionTableEntries(array, left, right, replaceElements);
quickSortTableEntries(array, left, pivotNewIndex - 1, replaceElements);
quickSortTableEntries(array, pivotNewIndex + 1, right, replaceElements);
}
private final String nextRelevantLine(Scanner input) {
String tempString;
try {
tempString = input.findWithinHorizon(".", 1);
while (
(tempString == null && input.hasNext())
|| tempString.equals("#")
) {
input.nextLine();
line++;
tempString = input.findWithinHorizon(".", 1);
}
if (!input.hasNext())
throw new RuntimeException(
"unexpected end of file"
);
} catch (Exception e) {
throw new RuntimeException(
"unknown processing error"
);
}
return tempString + input.nextLine();
}
private final int getInt(Scanner input) { return getInt(input, false); }
private final int getInt(Scanner input, Boolean silentlyFail) {
String originalString = nextRelevantLine(input);
int retVal = -1;
String loadedString;
boolean negative = false;
try {
loadedString = originalString;
if (loadedString.charAt(0) == '-') {
loadedString = loadedString
.substring(1);
negative = true;
}
int base = 10;
if (loadedString.indexOf("0x") == 0) {
base = 16;
loadedString = loadedString.substring(2);
}
retVal = Integer
.parseInt(loadedString, base);
} catch (Exception e) {
if (!silentlyFail || !input.hasNext()) {
addGeneralError(originalString);
valid = false;
retVal = -1;
}
silentlyFail = true;
}
line++;
if (valid && negative)
retVal = 0 - retVal;
return retVal;
}
private final void addToErrorString(String input, boolean general) {
if (general) {
errorString +=
"Line " + line
+ ": Error parsing \""
+ input + "\"";
}
else
errorString += input + "\n";
}
private final void addToErrorString(String input) {
addToErrorString(input, false);
}
private final void addGeneralError(String input) {
addToErrorString(input, true);
}
private final void processChecksum(Scanner theModule) {
if (theModule.findWithinHorizon("#0x", 3) != null) {
long checksumVal = -1;
String checksumString = theModule.nextLine();
try {
checksumVal =
Long.parseLong(checksumString, 16);
if ((checksumVal & 0xFFFFFFFF00000000L) == 0)
checksum = (int) checksumVal;
else
throw new Exception();
} catch (Exception e) {
throw new RuntimeException(
"checksum line is invalid; no "
+ "checksum is being used."
);
}
if (
!Target_File.isValid(checksum)
) {
valid = false;
throw new RuntimeException(
"File has invalid "
+ "checksum for use "
+ "with this module."
);
}
line++;
}
}
private final void processIDstring(Scanner theModule) {
if (theModule.findWithinHorizon("#0x", 3) != null) {
long IDaddress = -1;
String loadedString = theModule.nextLine();
try {
IDaddress =
Long.parseLong(loadedString, 16);
if (
IDaddress >= 0
&& IDaddress < Target_File.size()
)
IDstringAddress = (int) IDaddress;
else
throw new Exception();
} catch (Exception e) {
line++;
throw new RuntimeException(
"ID string address line is invalid; "
+ "no ID string is being used."
);
}
line++;
IDstring = theModule.nextLine();
IDstring = IDstring.substring(1);
IDstring = Util.condenseCharacterCodes(IDstring);
if (
IDstring.length() + IDstringAddress
> Target_File.size()
) {
throw new RuntimeException(
"ID string line is too long; "
+ "no ID string is being used."
);
}
if (
!Target_File.pullString(
Target_File.getData(),
IDstringAddress,
IDstringAddress + IDstring.length()
).equals(IDstring)
) {
valid = false;
throw new RuntimeException(
"ID string line doesn't match "
+ "ID string in file;\ncancelling "
+ "module loading."
);
}
line++;
}
}
private final void processBasePointerExpected(Scanner theModule) {
if (
theModule.findWithinHorizon("#BASEPOINTER", 12) != null
) {
useBasePointer = true;
theModule.nextLine();
line++;
}
}
private final void processTextTableEntries() {
if (textTable == null)
return;
Scanner textTableScanner;
try {
textTableScanner = new Scanner(textTable);
} catch (Exception e) {
throw new RuntimeException(
"Text table file failed to load;\n" +
"text tokens will not be translated"
);
}
String loadedString;
int assignmentOperatorIndex;
int count = 0;
while (textTableScanner.hasNext()) {
loadedString = textTableScanner.nextLine();
assignmentOperatorIndex = loadedString.indexOf(" = ");
if (assignmentOperatorIndex == -1)
continue;
textTableEntryList.add(new TextTableEntry(
Util.condenseCharacterCodes(
loadedString.substring(
0, assignmentOperatorIndex
)
),
Util.condenseCharacterCodes(
loadedString.substring(
assignmentOperatorIndex + 3
)
)
));
if (
textTableEntryList.peekLast().findLength == 0
|| textTableEntryList.peekLast().replaceLength == 0
)
textTableEntryList.removeLast();
else
count++;
}
try {
textTableScanner.close();
} catch (Exception e) {}
textTableTranslationEntries = new TextTableEntry[count];
textTableEncodingEntries = new TextTableEntry[count];
int i = 0;
for (TextTableEntry currEntry: textTableEntryList) {
textTableTranslationEntries[i] = currEntry;
textTableEncodingEntries[i++] = currEntry;
}
quickSortTableEntries(textTableTranslationEntries, 0, i - 1, true);
quickSortTableEntries(textTableEncodingEntries, 0, i - 1, false);
}
private final void processHeader(Scanner theModule) {
String loadedString = nextRelevantLine(theModule);
if (loadedString == null) {
valid = false;
return;
}
version = loadedString;
line++;
loadedString = nextRelevantLine(theModule);
if (loadedString == null) {
valid = false;
return;
}
description = loadedString;
line++;
baseAddress = getInt(theModule);
if (
baseAddress < 0
|| baseAddress > Target_File.size()
) {
valid = false;
throw new IllegalArgumentException(
"invalid base address"
);
}
if (theModule.findWithinHorizon("#", 1) != null)
hardwareOffset = getInt(theModule, true);
if (useBasePointer) {
if (theModule.findWithinHorizon("#", 1) == null)
basePointer = -1;
else
basePointer = getInt(theModule);
if (
basePointer < 0
|| basePointer > Target_File.size()
) {
valid = false;
throw new IllegalArgumentException(
"invalid base pointer"
);
}
int tempInt = Target_File.getInt(
basePointer
) - hardwareOffset;
if (
useBasePointer
&& tempInt != baseAddress
)
expanded = true;
baseAddress = tempInt;
}
defaultEntryCount = getInt(theModule);
if (defaultEntryCount <= 256)
expandedEntryCount = 256;
else if (defaultEntryCount < 65536)
expandedEntryCount = 65536;
else if (defaultEntryCount >= 65536) {
addToErrorString(
"Expansion cannot be supported:\n"
+ "maximum value of indexing data type is "
+ "too large"
);
expandedEntryCount = defaultEntryCount;
}
if (defaultEntryCount < 0) {
valid = false;
throw new IllegalArgumentException(
"invalid default entry count"
);
}
entrySize = getInt(theModule);
if (entrySize <= 0) {
valid = false;
throw new IllegalArgumentException(
"invalid entry size"
);
}
loadedString = nextRelevantLine(theModule);
if (loadedString == null) {
valid = false;
return;
}
if (loadedString.equals("NULL"))
textTable = null;
else
entryList = new File(
thisModule.getParent()
+ File.separator
+ loadedString
);
line++;
loadedString = nextRelevantLine(theModule);
if (loadedString == null) {
valid = false;
return;
}
if (loadedString.equals("NULL"))
textTable = null;
else
textTable = new File(
thisModule.getParent()
+ File.separator
+ loadedString
);
line++;
processTextTableEntries();
return;
}
private final void processValidComponents(Scanner theModule) {
while (true) {
EntryComponent currentComponent = new EntryComponent();
String loadedString = nextRelevantLine(theModule);
if (loadedString == null)
break;
currentComponent.setName(loadedString);
line++;
if (!currentComponent.isValid()) {
for (int i = 0; i < 4; i++)
loadedString = nextRelevantLine(theModule);
if (loadedString == null)
break;
continue;
}
loadedString = nextRelevantLine(theModule);
if (loadedString == null)
break;
currentComponent.setNumBitsOffset(loadedString);
line++;
if (!currentComponent.isValid()) {
for (int i = 0; i < 3; i++)
loadedString = nextRelevantLine(theModule);
if (loadedString == null)
break;
continue;
}
loadedString = nextRelevantLine(theModule);
if (loadedString == null)
break;
currentComponent.setBitCount(loadedString);
if (
currentComponent.getNumBitsOffset() + currentComponent.getBitCount()
> entrySize << 3
) {
addToErrorString(
"Line " + line
+ ": Warning: Size and/or offset of "
+ "component extends\nbeyond the entry "
+ "size for this module"
);
}
line++;
if (!currentComponent.isValid()) {
for (int i = 0; i < 2; i++)
loadedString = nextRelevantLine(theModule);
if (loadedString == null)
break;
continue;
}
loadedString = nextRelevantLine(theModule);
if (loadedString == null)
break;
currentComponent.setType(loadedString);
line++;
if (!currentComponent.isValid()) {
loadedString = nextRelevantLine(theModule);
if (loadedString == null)
break;
continue;
}
loadedString = nextRelevantLine(theModule);
if (loadedString == null)
break;
if (loadedString.equals("NULL"))
currentComponent.setAssociatedList(
loadedString
);
else
currentComponent.setAssociatedList(
thisModule.getParent()
+ File.separator
+ loadedString
);
line++;
if (currentComponent.isValid())
componentList.add(currentComponent);
if (!theModule.hasNext())
break;
}
}
public Module(File input) {
if (input == null) throw new RuntimeException("invalid path");
Scanner theModule = null;
try {
theModule = new Scanner(input);
} catch (Exception e) { valid = false; }
thisModule = input;
try {
processChecksum(theModule);
if (valid)
processIDstring(theModule);
if (valid)
processBasePointerExpected(theModule);
if (valid)
processHeader(theModule);
if (valid)
processValidComponents(theModule);
} catch (Exception e) {
errorString += e.getMessage() + "\n";
}
try {
theModule.close();
} catch (Exception e) {}
if (!valid) throw new RuntimeException(errorString);
}
public void expand() {
if (!canExpand())
throw new RuntimeException(
"attempt to expand non-expandable data"
);
int originalSize = (entrySize * defaultEntryCount);
int expandedSize = (entrySize * expandedEntryCount);
byte[] thisArray = java.util.Arrays.copyOfRange(
Target_File.getData(),
baseAddress,
baseAddress + originalSize
);
thisArray = java.util.Arrays.copyOf(thisArray, expandedSize);
int cleanBaseAddress = baseAddress;
baseAddress = Target_File.writeToFile(thisArray);
Target_File.findAndReplace(
cleanBaseAddress + hardwareOffset,
baseAddress + hardwareOffset
);
expanded = true;
byte[] wipedTable = new byte[originalSize];
Target_File.overwriteFile(wipedTable, cleanBaseAddress);
}
public final String translate(String input) {
if (input == null)
return null;
if (
textTable == null
|| textTableTranslationEntries.length == 0
)
return input;
String outputString = "";
boolean match;
while (input.length() > 0) {
match = false;
for (TextTableEntry currEntry: textTableTranslationEntries)
if (input.indexOf(currEntry.getFind()) == 0) {
outputString += currEntry.getReplace();
input = input.substring(
currEntry
.getFind()
.length()
);
match = true;
break;
}
if (!match) {
outputString += input.substring(0, 1);
input = input.substring(1);
}
}
return outputString;
}
public final String encode(String input) {
if (input == null)
return null;
if (
textTable == null
|| textTableEncodingEntries.length == 0
)
return input;
String outputString = "";
if (input.length() == 0)
return outputString;
boolean match;
while (input.length() > 0) {
match = false;
for (TextTableEntry currEntry: textTableEncodingEntries)
if (input.indexOf(currEntry.getReplace()) == 0) {
outputString += currEntry.getFind();
input = input.substring(
currEntry.getReplace().length()
);
match = true;
break;
}
if (!match) {
outputString += input.substring(0, 1);
input = input.substring(1);
}
}
return outputString;
}
public final String getErrors() { return errorString; }
public boolean isExpanded() { return expanded; }
public boolean canExpand() {
return !expanded
&& (expandedEntryCount != defaultEntryCount)
&& useBasePointer;
}
public final String getDescription() { return description; }
public final int getHardwareOffset() { return hardwareOffset; }
public int getEntryCount() {
return expanded ? expandedEntryCount : defaultEntryCount;
}
public final File getEntryList() { return entryList; }
public final LinkedList<EntryComponent> getComponentList() {
return componentList;
}
public final void setHardwareOffset(int newOffset) {
hardwareOffset = newOffset;
}
@Override
public String toString() {
String outputString = "\n";
outputString += "Path: " + thisModule.getPath() + "\n";
outputString += "Version: " + version + "\n";
outputString += "Description: " + description + "\n";
outputString +=
"Base address: "
+ String.format("0x%08X", baseAddress)
+ "\n"
;
outputString +=
"Base pointer: "
+ String.format("0x%08X", basePointer)
+ "\n"
;
outputString +=
"Default entry count: "
+ String.format("0x%X", defaultEntryCount)
+ "\n"
;
outputString +=
"Expanded entry count: "
+ String.format("0x%X", expandedEntryCount)
+ "\n"
;
outputString +=
"Entry size: "
+ String.format("0x%X", entrySize)
+ "\n"
;
if (entryList != null)
outputString += "Entry list path: " + entryList.getPath() + "\n";
else
outputString += "No entry list\n";
if (textTable != null)
outputString += "Text table path: " + textTable.getPath();
else
outputString += "No text table\n";
return outputString;
}
}
}
}