-
Notifications
You must be signed in to change notification settings - Fork 1
/
ghidra_diff.patch
7337 lines (7095 loc) · 281 KB
/
ghidra_diff.patch
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
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
diff --git a/Ghidra/Features/Base/.launch/Ghidra Code Coverage.launch b/Ghidra/Features/Base/.launch/Ghidra Code Coverage.launch
index ae7716504..7373b0c81 100644
--- a/Ghidra/Features/Base/.launch/Ghidra Code Coverage.launch
+++ b/Ghidra/Features/Base/.launch/Ghidra Code Coverage.launch
@@ -20,6 +20,7 @@
<listAttribute key="org.eclipse.jdt.launching.CLASSPATH">
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry path="5" projectName="Framework Utility" type="1"/> "/>
</listAttribute>
+ <stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="org.eclipse.buildship.core.classpathprovider"/>
<booleanAttribute key="org.eclipse.jdt.launching.DEFAULT_CLASSPATH" value="false"/>
<stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11"/>
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="ghidra.GhidraLauncher"/>
diff --git a/Ghidra/Features/Base/.launch/Ghidra.launch b/Ghidra/Features/Base/.launch/Ghidra.launch
index e9f428a5d..bc07f4280 100644
--- a/Ghidra/Features/Base/.launch/Ghidra.launch
+++ b/Ghidra/Features/Base/.launch/Ghidra.launch
@@ -23,6 +23,7 @@
<listAttribute key="org.eclipse.jdt.launching.CLASSPATH">
<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry path="5" projectName="Framework Utility" type="1"/> "/>
</listAttribute>
+ <stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="org.eclipse.buildship.core.classpathprovider"/>
<booleanAttribute key="org.eclipse.jdt.launching.DEFAULT_CLASSPATH" value="false"/>
<stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11"/>
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="ghidra.GhidraLauncher"/>
diff --git a/Ghidra/Features/Base/ghidra_scripts/PropagateX86ConstantReferences.java b/Ghidra/Features/Base/ghidra_scripts/PropagateX86ConstantReferences.java
index 6d4379c26..586c0691c 100644
--- a/Ghidra/Features/Base/ghidra_scripts/PropagateX86ConstantReferences.java
+++ b/Ghidra/Features/Base/ghidra_scripts/PropagateX86ConstantReferences.java
@@ -40,6 +40,7 @@ import ghidra.program.model.symbol.*;
import ghidra.program.util.SymbolicPropogator;
import ghidra.program.util.VarnodeContext;
import ghidra.util.exception.*;
+import ghidra.util.Msg;
public class PropagateX86ConstantReferences extends GhidraScript {
@@ -153,6 +154,9 @@ public class PropagateX86ConstantReferences extends GhidraScript {
String mnemonic = instr.getMnemonicString();
if ((mnemonic.compareToIgnoreCase("CMP") == 0)) {
int numOps = instr.getNumOperands();
+ Msg.debug(this,instr.getAddress());
+ Msg.debug(this,instr.getPcode(0).toString());
+ Msg.debug(this,instr.getPcode(1).toString());
if (numOps > 1) {
Register reg = instr.getRegister(numOps - 2);
if ((reg != null)) {
diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/cmd/disassemble/DisassembleCommand.java b/Ghidra/Features/Base/src/main/java/ghidra/app/cmd/disassemble/DisassembleCommand.java
index 9521ec3ec..a9aa8dbb0 100644
--- a/Ghidra/Features/Base/src/main/java/ghidra/app/cmd/disassemble/DisassembleCommand.java
+++ b/Ghidra/Features/Base/src/main/java/ghidra/app/cmd/disassemble/DisassembleCommand.java
@@ -28,6 +28,8 @@ import ghidra.program.model.mem.MemoryBlock;
import ghidra.util.exception.CancelledException;
import ghidra.util.task.TaskMonitor;
+import ghidra.util.Msg;
+
/**
* Command object for performing disassembly
*/
@@ -348,6 +350,7 @@ public class DisassembleCommand extends BackgroundCommand {
*/
private static void analyzeIfNeeded(AutoAnalysisManager mgr, AddressSetView startSet,
AddressSetView disassembledSet, TaskMonitor monitor) {
+
if (disassembledSet == null || disassembledSet.isEmpty()) {
return;
}
@@ -359,6 +362,7 @@ public class DisassembleCommand extends BackgroundCommand {
AddressRange firstRange = disassembledSet.getFirstRange();
Address rangeEnd = firstRange.getMaxAddress();
Address nextAddr = rangeEnd.next();
+ Msg.debug(DisassembleCommand.class,"In analyzeIfNeeded");
if (nextAddr != null && startSet.contains(rangeEnd) && startSet.contains(nextAddr)) {
mgr.startAnalysis(monitor, false);
}
diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/analysis/AnalysisBackgroundCommand.java b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/analysis/AnalysisBackgroundCommand.java
index 120e48a72..68191d250 100644
--- a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/analysis/AnalysisBackgroundCommand.java
+++ b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/analysis/AnalysisBackgroundCommand.java
@@ -27,6 +27,8 @@ import ghidra.program.util.GhidraProgramUtilities;
import ghidra.util.SystemUtilities;
import ghidra.util.task.TaskMonitor;
+import ghidra.util.Msg;
+
/**
* Background task to artificially kick off Auto analysis by
* calling anything that analyzes bytes.
@@ -50,11 +52,13 @@ public class AnalysisBackgroundCommand extends MergeableBackgroundCommand {
this.markAsAnalyzed = markAsAnalyzed;
}
+ //muqi:to flowConstants step 3
@Override
public boolean applyTo(DomainObject obj, TaskMonitor monitor) {
if (markAsAnalyzed) {
GhidraProgramUtilities.setAnalyzedFlag((Program) obj, true);
}
+ Msg.debug(this, "In applyTo of AnalysisBackgroundCommand");
mgr.startAnalysis(monitor);
return true;
}
diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/analysis/AutoAnalysisManager.java b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/analysis/AutoAnalysisManager.java
index 042882c9a..470cbd1ac 100644
--- a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/analysis/AutoAnalysisManager.java
+++ b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/analysis/AutoAnalysisManager.java
@@ -629,6 +629,7 @@ public class AutoAnalysisManager implements DomainObjectListener, DomainObjectCl
* @param monitor the monitor
*/
public void startAnalysis(TaskMonitor monitor) {
+ Msg.debug(this,"In startAnalysis");
startAnalysis(monitor, true);
}
@@ -647,6 +648,7 @@ public class AutoAnalysisManager implements DomainObjectListener, DomainObjectCl
* will be printed to the log.
*/
public void startAnalysis(TaskMonitor monitor, boolean printTaskTimes) {
+
if (Thread.currentThread() == analysisThread) {
// TODO: should this yield for analysis?
// Thinking was that if some analysis causes disassembly to occur,
@@ -686,6 +688,7 @@ public class AutoAnalysisManager implements DomainObjectListener, DomainObjectCl
startTime = System.currentTimeMillis();
try {
task.applyTo(p, monitor);
+ Msg.debug(this, "In run of AnalysisTaskWrapper Analysis Task: " + task.getName());
}
catch (RuntimeException th) {
if (debugOn) {
@@ -733,7 +736,8 @@ public class AutoAnalysisManager implements DomainObjectListener, DomainObjectCl
*/
private void startAnalysis(TaskMonitor monitor, boolean yield, Integer limitPriority,
boolean printTaskTimes) {
-
+ //muqi : here we start our analysis~!
+ Msg.debug(this,"second startAnalysis");
// the program may have been closed before while this thread was waiting
if (program == null || program.isClosed()) {
return;
@@ -772,7 +776,7 @@ public class AutoAnalysisManager implements DomainObjectListener, DomainObjectCl
backgroundAnalysisPending = false;
}
}
-
+ Msg.debug(this,"assign the first task to activetask");
try {
if (printTaskTimes) {
clearTimedTasks();
@@ -797,7 +801,7 @@ public class AutoAnalysisManager implements DomainObjectListener, DomainObjectCl
}
}
}
-
+ Msg.debug(this,"finished while loop of activeTask");
if (!yield) {
notifyAnalysisEnded();
if (printTaskTimes) {
@@ -885,10 +889,11 @@ public class AutoAnalysisManager implements DomainObjectListener, DomainObjectCl
}
synchronized boolean schedule(BackgroundCommand cmd, int priority) {
-
+
if (cmd == null) {
throw new IllegalArgumentException("Can't schedule a null command");
}
+ Msg.debug(this,"In schedule, name is: "+cmd.getName()+" priority: "+ priority);
queue.add(cmd, priority);
return startBackgroundAnalysis();
@@ -901,7 +906,7 @@ public class AutoAnalysisManager implements DomainObjectListener, DomainObjectCl
* scheduled/running.
*/
public synchronized boolean startBackgroundAnalysis() {
-
+ Msg.debug(this,"In startBackgroundAnalysis");
if (!isEnabled) {
return false;
}
@@ -910,8 +915,11 @@ public class AutoAnalysisManager implements DomainObjectListener, DomainObjectCl
}
analysisTool = getActiveTool(program);
+
if (analysisTool != null) {
+ Msg.debug(this,"name of analysisTool is: "+analysisTool.getName());
AnalysisBackgroundCommand analysisCmd = new AnalysisBackgroundCommand(this, false);
+ Msg.debug(this,"name of analysisCmd is: "+analysisCmd.getName());
backgroundAnalysisPending = true;
analysisTool.scheduleFollowOnCommand(analysisCmd, program);
return true;
diff --git a/Ghidra/Features/Base/src/main/java/ghidra/program/database/ProgramBuilder.java b/Ghidra/Features/Base/src/main/java/ghidra/program/database/ProgramBuilder.java
index c2814d7c1..d6f517ccb 100644
--- a/Ghidra/Features/Base/src/main/java/ghidra/program/database/ProgramBuilder.java
+++ b/Ghidra/Features/Base/src/main/java/ghidra/program/database/ProgramBuilder.java
@@ -55,6 +55,8 @@ import ghidra.util.exception.*;
import ghidra.util.task.TaskMonitor;
import utility.function.ExceptionalCallback;
+import ghidra.util.Msg;
+
// TODO: Move this class into a different package (i.e., ghidra.test.program)
public class ProgramBuilder {
@@ -150,7 +152,7 @@ public class ProgramBuilder {
*/
public void analyze() {
AutoAnalysisManager mgr = AutoAnalysisManager.getAnalysisManager(program);
-
+ Msg.debug(this,"In analyzeIfNeeded");
tx(() -> {
mgr.reAnalyzeAll(program.getMemory().getLoadedAndInitializedAddressSet());
mgr.startAnalysis(TaskMonitor.DUMMY, false);
diff --git a/Ghidra/Features/Base/src/main/java/ghidra/program/flatapi/FlatProgramAPI.java b/Ghidra/Features/Base/src/main/java/ghidra/program/flatapi/FlatProgramAPI.java
index c2840f7f2..c77681c34 100644
--- a/Ghidra/Features/Base/src/main/java/ghidra/program/flatapi/FlatProgramAPI.java
+++ b/Ghidra/Features/Base/src/main/java/ghidra/program/flatapi/FlatProgramAPI.java
@@ -51,6 +51,9 @@ import ghidra.util.exception.*;
import ghidra.util.search.memory.*;
import ghidra.util.task.TaskMonitor;
+
+import ghidra.util.Msg;
+
/**
* This class is a flattened version of the Program API.
* <p>
@@ -226,7 +229,7 @@ public class FlatProgramAPI {
// analysis will start immediately in background if GUI analysis tool exists
// and script is not running as analysis worker in background
-
+ Msg.debug(this,"In analyzeChanges");
PluginTool analysisTool = mgr.getAnalysisTool();
if (analysisTool == null || analysisTool.threadIsBackgroundTaskThread()) {
mgr.startAnalysis(monitor, true); // yields to analysis
diff --git a/Ghidra/Features/Base/src/main/java/ghidra/program/util/SymbolicPropogator.java b/Ghidra/Features/Base/src/main/java/ghidra/program/util/SymbolicPropogator.java
index 0ec949884..614e38b18 100644
--- a/Ghidra/Features/Base/src/main/java/ghidra/program/util/SymbolicPropogator.java
+++ b/Ghidra/Features/Base/src/main/java/ghidra/program/util/SymbolicPropogator.java
@@ -772,10 +772,10 @@ public class SymbolicPropogator {
boolean mustClearAll = false;
// if inject pcode, don't want to do any store pcode ops for the injected code
boolean injected = false;
-
+ Msg.debug(this, "total length is "+ops.length);
int ptype = 0;
for (int pcodeIndex = 0; pcodeIndex < ops.length; pcodeIndex++) {
-
+ Msg.debug(this, "index is "+pcodeIndex);
mustClearAll = pcodeIndex < mustClearAllUntil_PcodeIndex;
ptype = ops[pcodeIndex].getOpcode();
@@ -1141,11 +1141,32 @@ public class SymbolicPropogator {
(BinaryOpBehavior) OpBehaviorFactory.getOpBehavior(ptype);
val1 = vContext.getValue(in[0], false, evaluator);
val2 = vContext.getValue(in[1], false, evaluator);
+ //muqi add debug
+
+ Msg.debug(this, "val1 is: " + val1.getOffset());
+ Msg.debug(this, "address of val1 is: " +val1.getAddress().toString());
+ Msg.debug(this, "val2 is: " + val2.getOffset());
+ Msg.debug(this, "address of val2 is: " +val2.getAddress().toString());
+
lresult = binaryBehavior.evaluateBinary(out.getSize(), in[0].getSize(),
vContext.getConstant(val1, evaluator),
vContext.getConstant(val2, evaluator));
result = vContext.createConstantVarnode(lresult, val1.getSize());
vContext.putValue(out, result, mustClearAll);
+
+ /* used for tracing called function
+ int temp = 1;
+ if (temp == 1){
+ try
+ {
+ throw new NullPointerException("demo");
+ }
+ catch(NullPointerException e)
+ {
+ System.out.println("Caught inside fun().");
+ throw e; // rethrowing the exception
+ }}
+ */
break;
case PcodeOp.INT_2COMP:
diff --git a/Ghidra/Features/Base/src/main/java/ghidra/util/state/ResultsState.java b/Ghidra/Features/Base/src/main/java/ghidra/util/state/ResultsState.java
index ae3fc3064..f14713277 100644
--- a/Ghidra/Features/Base/src/main/java/ghidra/util/state/ResultsState.java
+++ b/Ghidra/Features/Base/src/main/java/ghidra/util/state/ResultsState.java
@@ -1094,6 +1094,8 @@ public class ResultsState {
// TODO: Implement constant case
case PcodeOp.INT_SBORROW: // TRUE if borrow in signed subtraction of 2 ops
+ Msg.debug(ResultsState.class, "val1 is" + values[0].getOffset());
+ Msg.debug(ResultsState.class, "val2 is" + values[1].getOffset());
if ((values[1].isConstant() && values[1].getOffset() == 0) ||
(values[0].isConstant() && values[0].getOffset() == 0)) {
result = new Varnode(addrFactory.getConstantAddress(0), 1);
diff --git a/Ghidra/Features/Decompiler/ghidra_scripts/GraphAST.java b/Ghidra/Features/Decompiler/ghidra_scripts/GraphAST.java
index aa610ac73..53e63afcf 100644
--- a/Ghidra/Features/Decompiler/ghidra_scripts/GraphAST.java
+++ b/Ghidra/Features/Decompiler/ghidra_scripts/GraphAST.java
@@ -97,6 +97,7 @@ public class GraphAST extends GhidraScript {
"Unable to initialize: " + ifc.getLastMessage());
}
ifc.setSimplificationStyle("normalize");
+ Msg.debug(this,"Inside private void buildAST()");
DecompileResults res = ifc.decompileFunction(func, 30, null);
high = res.getHighFunction();
diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/action.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/action.cc
index 7b1b2062a..466ca9a4d 100644
--- a/Ghidra/Features/Decompiler/src/decompile/cpp/action.cc
+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/action.cc
@@ -17,6 +17,10 @@
#include "funcdata.hh"
#include "coreaction.hh"
+#include <unistd.h>
+
+
+#define DEBUG_MUQI_type_recovery
/// Specify the name, group, and properties of the Action
/// \param f is the collection of property flags
@@ -809,6 +813,16 @@ Rule *ActionPool::getSubRule(const string &specify)
return lastrule;
}
+vector<string> blacklist;
+#define vContains(v, arg) (std::find(v.begin(), v.end(), arg) != v.end())
+void streamToVec(ifstream& infile, vector<string>& vec) {
+ std::string line;
+ while (std::getline(infile, line))
+ {
+ vec.push_back(line);
+ }
+}
+
/// This method attempts to apply each Rule to the current PcodeOp
/// Action breakpoints are checked if the Rule successfully applies.
/// 0 is returned for no breakpoint, -1 if a breakpoint occurs.
@@ -820,67 +834,499 @@ Rule *ActionPool::getSubRule(const string &specify)
int4 ActionPool::processOp(PcodeOp *op,Funcdata &data)
{
+
+ ofstream myfile;
+ ofstream myfile2;
+ #ifdef DEBUG_MUQI_0x80
+ int instruction_address_being_logged1 = 4198820; //004011a4->4198820 004011a9->4198825
+ int instruction_address_being_logged2 = 4198825;
+ int instruction_address_being_logged3 = 4198840; //004011b8->4198840 004011bd->4198845
+ int instruction_address_being_logged4 = 4198845;
+
+ int instruction_address_being_logged5 = 4198816; //004011a0->4198816 004011b4->4198836
+ int instruction_address_being_logged6 = 4198836;
+ #endif
+ #ifdef DEBUG_MUQI_type_recovery
+ int instruction_address_being_logged = 4198786; //401182 -> 4198786 40118d->4198797 401191->4198801 401196->4198806 401199->4198809
+ int instruction_address_being_logged1 = 4198797;
+ //int instruction_address_being_logged2 = 4198801; //401191->4198801
+ int instruction_address_being_logged2 = 4198768; //401170->4198768
+ int instruction_address_being_logged3 = 4198806;
+ int instruction_address_being_logged4 = 4198809;
+ int instruction_address_being_logged5 = 4198768; //401170->4198768
+ #endif
+
+ #ifdef DEBUG_MUQI_type_recovery
+ myfile.open("/home/muqi/Downloads/ghidra/build/dist/example1.txt", std::ios_base::app);
+ myfile2.open("/home/muqi/Downloads/ghidra/build/dist/example2.txt", std::ios_base::app);
+ if(op->getAddr().getOffset()==instruction_address_being_logged){
+
+ if(op && op->code()){
+ myfile<<"Inside ActionPool::processOp \n";
+ myfile <<"p name is : " << op->getOpName() << "\n op name is : "<< get_opname(op->code())<<" \n address is "<< std::hex << op->getAddr().getOffset() <<"\n";
+ myfile << "seqnum is : "<< op->getSeqNum().getTime() <<"\n";
+
+ myfile << "data address is: " << std::hex << data.getAddress().getOffset() << "\n";
+ myfile << "data name is: " << data.getName() <<"\n";
+ for (int i = 0; i <op->numInput(); i ++){
+ if (op->getIn(i)){
+ myfile << "var"<< i<<" of op is: "<< op->getIn(i)->getOffset() << "\n";
+ myfile << "addr of var is: "<< op->getIn(i)->getAddr().getOffset() <<"\n";
+ myfile << "name of addr space is: " <<op->getIn(i)->getSpace()->getName() <<"\n";
+ string temp;
+ if(op->getIn(i)->getType()){
+ metatype2string(op->getIn(i)->getType()->getMetatype(),temp);
+ myfile << "var's type is: "<< temp <<"\n";
+ }else{
+ myfile << "var's type is: NOT known\n";
+ }
+ myfile << "raw info ------------- :\n";
+ op->getIn(i)->printRaw(myfile);
+ myfile <<" \n-----------end raw \n";
+
+ }
+ }
+
+ }
+ else{
+ myfile << "op is null \n";
+ }
+ }
+
+ if(op->getAddr().getOffset()==instruction_address_being_logged2){
+
+ if(op && op->code()){
+ myfile2<<"Inside ActionPool::processOp \n";
+ myfile2 <<"p name is : " << op->getOpName() << "\n op name is : "<< get_opname(op->code())<<" \n address is "<< std::hex << op->getAddr().getOffset() <<"\n";
+ myfile2 << "seqnum is : "<< op->getSeqNum().getTime() <<"\n";
+
+ myfile2 << "data address is: " << std::hex << data.getAddress().getOffset() << "\n";
+ myfile2 << "data name is: " << data.getName() <<"\n";
+ for (int i = 0; i <op->numInput(); i ++){
+ if (op->getIn(i)){
+ myfile2 << "var"<< i<<" of op is: "<< op->getIn(i)->getOffset() << "\n";
+ myfile2 << "addr of var is: "<< op->getIn(i)->getAddr().getOffset() <<"\n";
+ myfile2 << "name of addr space is: " <<op->getIn(i)->getSpace()->getName() <<"\n";
+ string temp;
+ if(op->getIn(i)->getType()){
+ metatype2string(op->getIn(i)->getType()->getMetatype(),temp);
+ myfile2 << "var's type is: "<< temp <<"\n";
+ }else{
+ myfile2 << "var's type is: NOT known\n";
+ }
+ myfile2 << "raw info ------------- :\n";
+ op->getIn(i)->printRaw(myfile2);
+ myfile2 <<" \n-----------end raw \n";
+
+ }
+ }
+
+ }
+ else{
+ myfile2 << "op is null \n";
+ }
+ }
+ myfile.close();
+ myfile2.close();
+ #endif
+
Rule *rl;
int4 res;
uint4 opc;
+
+
if (op->isDead()) {
+ #ifdef DEBUG_MUQI_type_recovery
+ myfile.open("/home/muqi/Downloads/ghidra/build/dist/example1.txt", std::ios_base::app);
+ myfile2.open("/home/muqi/Downloads/ghidra/build/dist/example2.txt", std::ios_base::app);
+ if(op->getAddr().getOffset()==instruction_address_being_logged
+ ){
+ myfile << "OP is dead! \n";
+ }
+ if(op->getAddr().getOffset()==instruction_address_being_logged2
+ ){
+ myfile2 << "OP is dead! \n";
+ }
+ myfile.close();
+ myfile2.close();
+ #endif
op_state++;
data.opDeadAndGone(op);
rule_index = 0;
return 0;
}
+
+ #ifdef DEBUG_MUQI_type_recovery
+ myfile.open("/home/muqi/Downloads/ghidra/build/dist/example1.txt", std::ios_base::app);
+ myfile2.open("/home/muqi/Downloads/ghidra/build/dist/example2.txt", std::ios_base::app);
+ if(op->getAddr().getOffset()==instruction_address_being_logged
+ ){
+ myfile << "OP DOes not dead! \n";
+ }
+ if(op->getAddr().getOffset()==instruction_address_being_logged2
+ ){
+ myfile2 << "OP DOes not dead! \n";
+ }
+ myfile.close();
+ myfile2.close();
+ #endif
+
opc = op->code();
while(rule_index < perop[opc].size()) {
+
+
rl = perop[opc][rule_index++];
- if (rl->isDisabled()) continue;
+
+
+
+ myfile.open("/home/muqi/Downloads/ghidra/build/dist/example1.txt", std::ios_base::app);
+
+ #ifdef DEBUG_MUQI_0x80
+ if(op->getAddr().getOffset()==instruction_address_being_logged1||op->getAddr().getOffset()==instruction_address_being_logged2||op->getAddr().getOffset()==instruction_address_being_logged5
+ ){
+
+ myfile << "inside ActionPool::processOp: \n";
+ myfile <<"p name is : " << op->getOpName() << "\n op name is : "<< get_opname(op->code())<<" \n address is "<< std::hex << op->getAddr().getOffset() <<"\n";
+ myfile << "seqnum is : "<< op->getSeqNum().getTime() <<"\n";
+ myfile << "data address is: " << std::hex << data.getAddress().getOffset() << "\n";
+ myfile << "data name is: " << data.getName() <<"\n";
+ if (op->getIn(0)){
+ myfile << "var1 of op is: "<< op->getIn(0)->getOffset() << "\n";
+ }else {
+ myfile << "var1 of op is null \n ";
+ }
+ if (op->getIn(1)){
+ myfile << "var2 of op is: "<< op->getIn(1)->getOffset() << "\n";
+ }else {
+ myfile << "var2 of op is null \n ";
+ }
+
+ //usleep(10);
+ //myfile << "op num1 is:"
+
+ }
+ #endif
+
+ myfile2.open("/home/muqi/Downloads/ghidra/build/dist/example2.txt", std::ios_base::app);
+
+ #ifdef DEBUG_MUQI_0x80
+ if(
+ op->getAddr().getOffset()==instruction_address_being_logged3||op->getAddr().getOffset()==instruction_address_being_logged4||op->getAddr().getOffset()==instruction_address_being_logged6
+ ){
+
+ myfile2 << "inside ActionPool::processOp: \n";
+ myfile2 <<"p name is : " << op->getOpName() << "\n op name is : "<< get_opname(op->code())<<" \n address is "<< std::hex << op->getAddr().getOffset() <<"\n";
+ myfile2 << "seqnum is : "<< op->getSeqNum().getTime() <<"\n";
+ myfile2 << "data address is: " << std::hex << data.getAddress().getOffset() << "\n";
+ myfile2 << "data name is: " << data.getName() <<"\n";
+ if (op->getIn(0)){
+ myfile2 << "var1 of op is: "<< op->getIn(0)->getOffset() << "\n";
+ }else {
+ myfile2 << "var1 of op is null \n ";
+ }
+ if (op->getIn(1)){
+ myfile2 << "var2 of op is: "<< op->getIn(1)->getOffset() << "\n";
+ }else {
+ myfile2 << "var2 of op is null \n ";
+ }
+
+ //usleep(10);
+ //myfile << "op num1 is:"
+
+ }
+#endif
+ myfile.close();
+ myfile2.close();
+
+
+ try {
+ string start_program_name_function = data.getprogram_name_function();
+ string final_program_name_function;
+ char buff[1000];
+ strcpy(buff, start_program_name_function.c_str());
+ if (!start_program_name_function.empty()){
+ char *token = strtok(buff, "/");
+ vector<string> list_of_path;
+ while (token != NULL)
+ {
+ list_of_path.push_back(token);
+ token = strtok(NULL, "/");
+ }
+ final_program_name_function = list_of_path [list_of_path.size() - 3];
+ ifstream myfile_gate;
+
+ myfile_gate.open ("/tmp/ghidra_gate_"+final_program_name_function);
+ streamToVec(myfile_gate, blacklist);
+ }
+ } catch (std::system_error& e) {
+
+ }
+ if (vContains(blacklist, rl->getName())){
+ }else{
+
+
+ if (rl->isDisabled()) continue;
#ifdef OPACTION_DEBUG
- data.debugActivate();
+ data.debugActivate();
#endif
- rl->count_tests += 1;
- res = rl->applyOp(op,data);
+ rl->count_tests += 1;
+ res = rl->applyOp(op,data);
#ifdef OPACTION_DEBUG
- data.debugModPrint(rl->getName());
+ data.debugModPrint(rl->getName());
#endif
- if (res>0) {
- rl->count_apply += 1;
- count += res;
- rl->issueWarning(data.getArch()); // Check if we need to issue a warning
- if (rl->checkActionBreak())
- return -1;
+ if (res>0) {
+
+
+ #ifdef DEBUG_MUQI_type_recovery
+
+ myfile.open("/home/muqi/Downloads/ghidra/build/dist/example1.txt", std::ios_base::app);
+ myfile2.open("/home/muqi/Downloads/ghidra/build/dist/example2.txt", std::ios_base::app);
+
+ #endif
+ /*
+ if(op && op->code()){
+ myfile<<"Inside ActionPool::processOp \n";
+ myfile <<"p name is : " << op->getOpName() << "\n op name is : "<< get_opname(op->code())<<" \n address is "<< std::hex << op->getAddr().getOffset() <<"\n";
+ myfile << "seqnum is : "<< op->getSeqNum().getTime() <<"\n";
+
+ myfile << "data address is: " << std::hex << data.getAddress().getOffset() << "\n";
+ myfile << "data name is: " << data.getName() <<"\n";
+ for (int i = 0; i <op->numInput(); i ++){
+ if (op->getIn(i)){
+ myfile << "var"<< i<<" of op is: "<< op->getIn(i)->getOffset() << "\n";
+ myfile << "addr of var is: "<< op->getIn(i)->getAddr().getOffset() <<"\n";
+ myfile << "name of addr space is: " <<op->getIn(i)->getSpace()->getName() <<"\n";
+ }
+ }
+
+ }
+ else{
+ myfile << "op is null \n";
+ }
+ myfile <<" name of rl applied is: " <<rl->getName() <<"\n";
+ */
+ #ifdef DEBUG_MUQI_0x80
+ if(op->getAddr().getOffset()==instruction_address_being_logged1||op->getAddr().getOffset()==instruction_address_being_logged2||op->getAddr().getOffset()==instruction_address_being_logged5
+ ){
+
+ myfile <<" name of rl applied is: " <<rl->getName() <<"\n";
+
+ }
+ #endif
+
+ #ifdef DEBUG_MUQI_type_recovery
+ if(op->getAddr().getOffset()==instruction_address_being_logged
+ ){
+ if(rl){
+ myfile <<" name of rl applied is: " <<rl->getName() <<"\n";
+
+ }
+ }
+ if(op->getAddr().getOffset()==instruction_address_being_logged2
+ ){
+ if(rl){
+ myfile2 <<" name of rl applied is: " <<rl->getName() <<"\n";
+ }
+ }
+ myfile.close();
+ myfile2.close();
+ #endif
+
+ #ifdef DEBUG_MUQI_0x80
+ if(
+ op->getAddr().getOffset()==instruction_address_being_logged3||op->getAddr().getOffset()==instruction_address_being_logged4||op->getAddr().getOffset()==instruction_address_being_logged6
+ ){
+
+ myfile2 <<" name of rl applied is: " <<rl->getName() <<"\n";
+
+ }
+ #endif
+
+
+ rl->count_apply += 1;
+ count += res;
+ rl->issueWarning(data.getArch()); // Check if we need to issue a warning
+ if (rl->checkActionBreak())
+ return -1;
#ifdef OPACTION_DEBUG
- if (data.debugBreak()) {
- data.debugHandleBreak();
- return -1;
- }
+ if (data.debugBreak()) {
+ data.debugHandleBreak();
+ return -1;
+ }
#endif
- if (op->isDead()) break;
- if (opc != op->code()) { // Set of rules to apply to this op has changed
- opc = op->code();
- rule_index = 0;
- }
- }
- else if (opc != op->code()) {
- data.getArch()->printMessage("ERROR: Rule " + rl->getName() + " changed op without returning result of 1!");
- opc = op->code();
- rule_index = 0;
- }
- }
+ if (op->isDead()) break;
+ if (opc != op->code()) { // Set of rules to apply to this op has changed
+ opc = op->code();
+ rule_index = 0;
+ }
+ }
+ else if (opc != op->code()) {
+ data.getArch()->printMessage("ERROR: Rule " + rl->getName() + " changed op without returning result of 1!");
+ opc = op->code();
+ rule_index = 0;
+ }
+ }
+ }
op_state++;
rule_index = 0;
+ #ifdef DEBUG_MUQI_type_recovery
+ myfile.open("/home/muqi/Downloads/ghidra/build/dist/example1.txt", std::ios_base::app);
+ myfile2.open("/home/muqi/Downloads/ghidra/build/dist/example2.txt", std::ios_base::app);
+ if(op->getAddr().getOffset()==instruction_address_being_logged){
+
+ if(op && op->code()){
+ myfile<<"After rule!!! \n";
+ myfile <<"p name is : " << op->getOpName() << "\n op name is : "<< get_opname(op->code())<<" \n address is "<< std::hex << op->getAddr().getOffset() <<"\n";
+ myfile << "seqnum is : "<< op->getSeqNum().getTime() <<"\n";
+
+ myfile << "data address is: " << std::hex << data.getAddress().getOffset() << "\n";
+ myfile << "data name is: " << data.getName() <<"\n";
+ for (int i = 0; i <op->numInput(); i ++){
+ if (op->getIn(i)){
+ myfile << "var"<< i<<" of op is: "<< op->getIn(i)->getOffset() << "\n";
+ myfile << "addr of var is: "<< op->getIn(i)->getAddr().getOffset() <<"\n";
+ myfile << "name of addr space is: " <<op->getIn(i)->getSpace()->getName() <<"\n";
+ string temp;
+ if(op->getIn(i)->getType()){
+ metatype2string(op->getIn(i)->getType()->getMetatype(),temp);
+ myfile << "var's type is: "<< temp <<"\n";
+ }else{
+ myfile << "var's type is: NOT known\n";
+ }
+ myfile << "raw info ------------- :\n";
+ op->getIn(i)->printRaw(myfile);
+ myfile <<" \n-----------end raw \n";
+
+ }
+ }
+
+ }
+ else{
+ myfile << "op is null \n";
+ }
+ }
+
+ if(op->getAddr().getOffset()==instruction_address_being_logged2){
+
+ if(op && op->code()){
+ myfile2<<"After rule!!! \n";
+ myfile2 <<"p name is : " << op->getOpName() << "\n op name is : "<< get_opname(op->code())<<" \n address is "<< std::hex << op->getAddr().getOffset() <<"\n";
+ myfile2 << "seqnum is : "<< op->getSeqNum().getTime() <<"\n";
+
+ myfile2 << "data address is: " << std::hex << data.getAddress().getOffset() << "\n";
+ myfile2 << "data name is: " << data.getName() <<"\n";
+ for (int i = 0; i <op->numInput(); i ++){
+ if (op->getIn(i)){
+ myfile2 << "var"<< i<<" of op is: "<< op->getIn(i)->getOffset() << "\n";
+ myfile2 << "addr of var is: "<< op->getIn(i)->getAddr().getOffset() <<"\n";
+ myfile2 << "name of addr space is: " <<op->getIn(i)->getSpace()->getName() <<"\n";
+ string temp;
+ if(op->getIn(i)->getType()){
+ metatype2string(op->getIn(i)->getType()->getMetatype(),temp);
+ myfile2 << "var's type is: "<< temp <<"\n";
+ }else{
+ myfile2 << "var's type is: NOT known\n";
+ }
+ myfile2 << "raw info ------------- :\n";
+ op->getIn(i)->printRaw(myfile2);
+ myfile2 <<" \n-----------end raw \n";
+
+ }
+ }
+
+ }
+ else{
+ myfile2 << "op is null \n";
+ }
+ }
+ myfile.close();
+ myfile2.close();
+ #endif
+ #ifdef DEBUG_MUQI_type_recovery
+ myfile.open("/home/muqi/Downloads/ghidra/build/dist/example1.txt", std::ios_base::app);
+ myfile2.open("/home/muqi/Downloads/ghidra/build/dist/example2.txt", std::ios_base::app);
+ if(op->getAddr().getOffset()==instruction_address_being_logged
+ ){
+
+ myfile <<" end of ActionPool::processOp \n";
+
+ }
+ if(op->getAddr().getOffset()==instruction_address_being_logged2
+ ){
+
+ myfile2 <<" end of ActionPool::processOp \n";
+
+ }
+ myfile.close();
+ myfile2.close();
+ #endif
return 0;
}
int4 ActionPool::apply(Funcdata &data)
{
+ ofstream myfile;
+ ofstream myfile2;
+
+
+
+ #ifdef DEBUG_MUQI_type_recovery
+ myfile.open("/home/muqi/Downloads/ghidra/build/dist/example1.txt", std::ios_base::app);
+ myfile2.open("/home/muqi/Downloads/ghidra/build/dist/example2.txt", std::ios_base::app);
+
+ myfile << "HERE we are ActionPool::apply start \n";
+
+ myfile.close();
+ myfile2.close();
+ #endif
+
if (status != status_mid) {
+
op_state = data.beginOpAll(); // Initialize the derived action
rule_index = 0;
+ #ifdef DEBUG_MUQI_type_recovery
+ myfile.open("/home/muqi/Downloads/ghidra/build/dist/example1.txt", std::ios_base::app);
+ myfile2.open("/home/muqi/Downloads/ghidra/build/dist/example2.txt", std::ios_base::app);
+
+ myfile << "HERE we are status != status_mid \n";
+ myfile << "op_state start address is: "<< hex << (*op_state).second <<"\n";
+
+ myfile.close();
+ myfile2.close();
+ #endif
+
}
- for(;op_state!=data.endOpAll();)
+
+
+
+int i = 0;
+ for(;op_state!=data.endOpAll();){
+ #ifdef DEBUG_MUQI_type_recovery
+ myfile.open("/home/muqi/Downloads/ghidra/build/dist/example1.txt", std::ios_base::app);
+ myfile2.open("/home/muqi/Downloads/ghidra/build/dist/example2.txt", std::ios_base::app);
+
+ //myfile << "Inside loop of ActionPool::apply , i: "<< i<< "\n";
+
+ myfile.close();
+ myfile2.close();
+ i++;
+ #endif
if (0!=processOp((*op_state).second,data)) return -1;
+ }
+
+
+ #ifdef DEBUG_MUQI_type_recovery
+ myfile.open("/home/muqi/Downloads/ghidra/build/dist/example1.txt", std::ios_base::app);
+ myfile2.open("/home/muqi/Downloads/ghidra/build/dist/example2.txt", std::ios_base::app);
+
+ myfile << "HERE we are ActionPool::apply end \n";
+
+ myfile.close();
+ myfile2.close();
+ #endif
return 0; // Indicate successful completion
}
diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/address.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/address.cc
index b78862935..49dfd944f 100644
--- a/Ghidra/Features/Decompiler/src/decompile/cpp/address.cc
+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/address.cc
@@ -595,6 +595,7 @@ uintb uintb_negate(uintb in,int4 size)
return ((~in)&calc_mask(size));
}
+//#define DEBUG_MUQI_0x80
/// Take the first \b sizein bytes of the given \b in and sign-extend
/// this to \b sizeout bytes, keeping any more significant bytes zero
/// \param in is the given value
@@ -602,19 +603,69 @@ uintb uintb_negate(uintb in,int4 size)
/// \param sizeout is the size to sign-extend the value to
/// \return the sign-extended value
uintb sign_extend(uintb in,int4 sizein,int4 sizeout)
-
-{
+//in =7f, sizein=1 sizeout =4
+{
+ #ifdef DEBUG_MUQI_0x80
+ ofstream myfile;
+ ofstream myfile2;
+ myfile.open("/home/muqi/Downloads/ghidra/build/dist/example1.txt", std::ios_base::app);
+ myfile2.open("/home/muqi/Downloads/ghidra/build/dist/example2.txt", std::ios_base::app);
+ #endif
int4 signbit;
uintb mask;
signbit = sizein*8 - 1;
+
+ #ifdef DEBUG_MUQI_0x80
+ myfile<<"signbit: " << hex<<signbit <<"\n";
+ myfile2<<"signbit: " << hex<<signbit <<"\n";
+
+ myfile<<"sizein1: "<<hex<<sizein<<"\n";
+ myfile<<"sizeout1: "<<hex<<sizeout<<"\n";
+
+ myfile2<<"sizein1: "<<hex<<sizein<<"\n";
+ myfile2<<"sizeout1: "<<hex<<sizeout<<"\n";
+ #endif
+
in &= calc_mask(sizein);
+
+#ifdef DEBUG_MUQI_0x80
+ myfile<<"in: " << hex<<in <<"\n";
+ myfile2<<"in: " << hex<<in <<"\n";
+
+ myfile<<"sizein2: "<<hex<<sizein<<"\n";
+ myfile<<"sizeout2: "<<hex<<sizeout<<"\n";
+
+ myfile2<<"sizein2: "<<hex<<sizein<<"\n";
+ myfile2<<"sizeout2: "<<hex<<sizeout<<"\n";
+#endif
if (sizein >= sizeout) return in;
+#ifdef DEBUG_MUQI_0x80
+ myfile<<"in>>signbit" << (in>>signbit)<<"\n";
+ myfile2<<"in>>signbit" << (in>>signbit )<<"\n";
+#endif
if ((in>>signbit) != 0) {
mask = calc_mask(sizeout);
+
+#ifdef DEBUG_MUQI_0x80
+ myfile<<"mask: " << hex<<mask <<"\n";
+ myfile2<<"mask: " << hex<<mask <<"\n";
+#endif
uintb tmp = mask << signbit; // Split shift into two pieces
+#ifdef DEBUG_MUQI_0x80
+ myfile<<"tmp1: " << hex<<tmp <<"\n";
+ myfile2<<"tmp1: " << hex<<tmp <<"\n";
+#endif
tmp = (tmp<<1) & mask; // In case, everything is shifted out
+#ifdef DEBUG_MUQI_0x80
+ myfile<<"tmp2: " << hex<<tmp <<"\n";
+ myfile2<<"tmp2: " << hex<<tmp <<"\n";
+#endif
in |= tmp;
+#ifdef DEBUG_MUQI_0x80
+ myfile<<"in: " << hex<<in <<"\n";
+ myfile2<<"in: " << hex<<in <<"\n";
+ #endif
}
return in;
}
diff --git a/Ghidra/Features/Decompiler/src/decompile/cpp/block.cc b/Ghidra/Features/Decompiler/src/decompile/cpp/block.cc
index 86bbf61bc..560d261bd 100644
--- a/Ghidra/Features/Decompiler/src/decompile/cpp/block.cc
+++ b/Ghidra/Features/Decompiler/src/decompile/cpp/block.cc
@@ -105,7 +105,7 @@ void FlowBlock::halfDeleteOutEdge(int4 slot)
{
while(slot < outofthis.size()-1) {
BlockEdge &edge( outofthis[slot] );
- edge = outofthis[slot+1]; // Slide the edge
+ edge = outofthis[slot+1]; // Slide the edge ==> outofthis[slot] = outofthis[slot+1]
// Correct the index coming the other way
BlockEdge &edger( edge.point->intothis[edge.reverse_index] );
edger.reverse_index -= 1;
@@ -568,7 +568,7 @@ int4 FlowBlock::getOutIndex(const FlowBlock *bl) const
if (outofthis[blocknum].point==bl) return blocknum;
return -1;
}
-
+#define DEBUG_MUQI_check_Block
/// Only print a header for \b this single block
/// \param s is the output stream
void FlowBlock::printHeader(ostream &s) const
@@ -576,6 +576,20 @@ void FlowBlock::printHeader(ostream &s) const
{
s << dec << index;
if (!getStart().isInvalid() && !getStop().isInvalid()) {
+ ofstream myfile;
+ ofstream myfile2;
+
+
+
+ #ifdef DEBUG_MUQI_check_Block
+ myfile.open("/home/muqi/Downloads/ghidra/build/dist/example1.txt", std::ios_base::app);
+ myfile2.open("/home/muqi/Downloads/ghidra/build/dist/example2.txt", std::ios_base::app);
+
+ myfile << "HERE we are FlowBlock::printHeader \n";
+
+ myfile.close();
+ myfile2.close();
+ #endif
s << ' ' << getStart() << '-' << getStop();
}
}
@@ -2396,6 +2410,27 @@ void FlowBlock::saveXml(ostream &s) const