-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOptions.cpp
More file actions
475 lines (387 loc) · 19.7 KB
/
Copy pathOptions.cpp
File metadata and controls
475 lines (387 loc) · 19.7 KB
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
#include "Options.hpp"
#include "TraceRules.hpp"
#include "Utils.hpp"
extern Options gOpt;
extern Console gConsole;
/*
* Knobs
*/
// Column
KNOB<BOOL> KnobSelectAll( KNOB_MODE_WRITEONCE, "pintool", "Sall", "0", "Select all columns");
KNOB<BOOL> KnobSelectTime( KNOB_MODE_WRITEONCE, "pintool", "St", "0", "Select time");
KNOB<BOOL> KnobSelectLogCnt( KNOB_MODE_WRITEONCE, "pintool", "Ss", "0", "Select log count");
KNOB<BOOL> KnobSelectInsBin( KNOB_MODE_WRITEONCE, "pintool", "Sh", "0", "Select binary");
KNOB<BOOL> KnobSelectBranch( KNOB_MODE_WRITEONCE, "pintool", "Sb", "0", "Select branch");
KNOB<BOOL> KnobSelectImgName( KNOB_MODE_WRITEONCE, "pintool", "Si", "0", "Select image name");
KNOB<BOOL> KnobSelectRtnName( KNOB_MODE_WRITEONCE, "pintool", "Sr", "0", "Select routine name");
KNOB<BOOL> KnobSelectRegFlag( KNOB_MODE_WRITEONCE, "pintool", "Sf", "0", "Select registry flags");
KNOB<BOOL> KnobSelectRegGen( KNOB_MODE_WRITEONCE, "pintool", "Sg", "0", "Select registry");
KNOB<BOOL> KnobSelectRegXMM( KNOB_MODE_WRITEONCE, "pintool", "Sx", "0", "Select xmm");
KNOB<BOOL> KnobSelectRegYMM( KNOB_MODE_WRITEONCE, "pintool", "Sy", "0", "Select ymm");
// Skip
KNOB<string> KnobSkipImg( KNOB_MODE_APPEND, "pintool", "Ki", "", "Image name to skip");
KNOB<string> KnobSkipRtn( KNOB_MODE_APPEND, "pintool", "Kr", "", "Routine name to skip");
KNOB<string> KnobSkipRange( KNOB_MODE_APPEND, "pintool", "Ka", "", "Address range to skip (e.g. 400000-408000)");
// Hook
KNOB<string> KnobHookImg( KNOB_MODE_APPEND, "pintool", "Hi", "", "Image name to hook");
KNOB<string> KnobHookRtn( KNOB_MODE_APPEND, "pintool", "Hr", "", "Routine name to hook");
KNOB<string> KnobHookRange( KNOB_MODE_APPEND, "pintool", "Ha", "", "Address range to hook (e.g. 400000-408000)");
// Filter
KNOB<string> KnobFilterImg( KNOB_MODE_APPEND, "pintool", "Fi", "", "Image name to filter");
KNOB<string> KnobFilterRtn( KNOB_MODE_APPEND, "pintool", "Fr", "", "Routine name to filter");
KNOB<string> KnobFilterRange( KNOB_MODE_APPEND, "pintool", "Fa", "", "Address range to filter (e.g. 400000-408000)");
KNOB<BOOL> KnobFilterBeforeEntryPoint( KNOB_MODE_WRITEONCE, "pintool", "Fe", "0", "Filter before entry point (Start from entry point)");
KNOB<BOOL> KnobFilterBeforeMainImage( KNOB_MODE_WRITEONCE, "pintool", "Fm", "0", "Filter before main image (Start from main image)");
KNOB<string> KnobFilterBeforeStart( KNOB_MODE_APPEND, "pintool", "Fs", "", "Filter before defined address (Start from defined address)");
KNOB<string> KnobFilterAfterEnd( KNOB_MODE_APPEND, "pintool", "Fd", "", "Filter after defined address (End in defined address)");
KNOB<BOOL> KnobFilterExceptJump( KNOB_MODE_WRITEONCE, "pintool", "Fj", "0", "Filter except jcc instructions");
KNOB<BOOL> KnobFilterExceptApi( KNOB_MODE_WRITEONCE, "pintool", "Fx", "0", "Filter all instructions (Log only API call)");
// Trace
KNOB<BOOL> KnobTraceAll( KNOB_MODE_WRITEONCE, "pintool", "a", "0", "Trace all instruction");
KNOB<string> KnobTraceImg( KNOB_MODE_APPEND, "pintool", "Ti", "", "Image name to trace");
KNOB<string> KnobTraceRtn( KNOB_MODE_APPEND, "pintool", "Tr", "", "Routine name to trace");
KNOB<string> KnobTraceRange( KNOB_MODE_APPEND, "pintool", "Ta", "", "Address range to trace (e.g. 400000-408000)");
KNOB<BOOL> KnobTraceInsideRtn( KNOB_MODE_WRITEONCE, "pintool", "Td", "0", "Trace inside routine");
// Exit
KNOB<BOOL> KnobExitInsLimitExceeded( KNOB_MODE_WRITEONCE, "pintool", "Ei", "0", "Instructions count limit");
KNOB<BOOL> KnobExitTimeLimitExceeded( KNOB_MODE_WRITEONCE, "pintool", "Et", "0", "Time limit");
// Bypass anti-debug
KNOB<BOOL> KnobBypassAntiDebugAll( KNOB_MODE_WRITEONCE, "pintool", "Mall", "0", "Bypass all anti-debug");
KNOB<BOOL> KnobIsDebuggerPresent( KNOB_MODE_WRITEONCE, "pintool", "Md", "0", "Bypass isDebuggerPresent technique");
KNOB<BOOL> KnobCheckRemoteDebuggerPresent(KNOB_MODE_WRITEONCE, "pintool", "Mr", "0", "Bypass CheckRemoteDebuggerPresent technique");
KNOB<BOOL> KnobSetInformationThread( KNOB_MODE_WRITEONCE, "pintool", "Mi", "0", "Bypass SetInformationThread technique");
KNOB<BOOL> KnobQueryInformationProcess( KNOB_MODE_WRITEONCE, "pintool", "Mq", "0", "Bypass QueryInformationProcess technique");
KNOB<BOOL> KnobUnhandledExceptionFilter( KNOB_MODE_WRITEONCE, "pintool", "Mu", "0", "Bypass UnhandledExceptionFilter technique");
KNOB<BOOL> KnobQueryObject( KNOB_MODE_WRITEONCE, "pintool", "Mo", "0", "Bypass QueryObject technique");
KNOB<BOOL> KnobGlobalFlag( KNOB_MODE_WRITEONCE, "pintool", "Mg", "0", "Bypass GlobalFlag technique");
KNOB<BOOL> KnobHeapFlags( KNOB_MODE_WRITEONCE, "pintool", "Mh", "0", "Bypass HeapFlags technique");
// Detection
KNOB<BOOL> KnobCryptAnalysisAll( KNOB_MODE_WRITEONCE, "pintool", "Dall", "0", "Detect all crypt elements");
KNOB<BOOL> KnobCryptMagicDetect( KNOB_MODE_WRITEONCE, "pintool", "Dc", "0", "Detect crypt magic numbers");
KNOB<BOOL> KnobCryptApiDetect( KNOB_MODE_WRITEONCE, "pintool", "Da", "0", "Detect crypt APIs");
KNOB<string> KnobRtnDetect( KNOB_MODE_APPEND, "pintool", "Dr", "", "Detect defined routine");
KNOB<string> KnobMagicDetect( KNOB_MODE_APPEND, "pintool", "Dm", "", "Detect defined magic number");
// Dump
KNOB<string> KnobDumpMem( KNOB_MODE_APPEND, "pintool", "Om", "", "Output memory dump (e.g. 401000:7F000000:100)");
KNOB<string> KnobDumpReg( KNOB_MODE_APPEND, "pintool", "Or", "", "Output registry (e.g. 401000)");
// Other
KNOB<BOOL> KnobQuiet( KNOB_MODE_WRITEONCE, "pintool", "q", "0", "Quiet");
KNOB<BOOL> KnobVerbose( KNOB_MODE_WRITEONCE, "pintool", "v", "0", "Verbose");
KNOB<BOOL> KnobVerbose2( KNOB_MODE_WRITEONCE, "pintool", "vv", "0", "Debug");
KNOB<BOOL> KnobOnlyMainThread( KNOB_MODE_WRITEONCE, "pintool", "mt", "0", "Trace only main thread");
//KNOB<BOOL> KnobOnlyMainImage(KNOB_MODE_WRITEONCE, "pintool", "mi", "0", "Trace only main image");
KNOB<BOOL> KnobTraceFileName( KNOB_MODE_WRITEONCE, "pintool", "o", "0", "Trace filename");
Options::Options()
{
tracefileBaseName = "trace-" + std::to_string(getNowTime() % 100000);
isFilteringInsideApi = true;
isFilteringInsideApiOrg = true;
isStartingFromEntryPoint = false;
isStartingFromMainImage = false;
startAddress = 0;
endAddress = 0;
startAddressRangeLow = 0;
startAddressRangeHigh = 0;
traceExitTimeLimit = 0;
traceExitInsLimit = 0;
verboseLevel = VERBOSE_NORMAL;
modeMainThreadOnly = false;
modeFilterExceptJump = false;
modeApiOnly = false;
modeMagicDetect = false;
modeCryptApiDetect = false;
printLogCount = false;
printTime = false;
printImgName = false;
printApiName = false;
printBranch = false;
printRegGeneral = false;
printRegFlag = false;
printRegXmm = false;
printRegYmm = false;
printInsBin = false;
anti_isDebuggerPresent = false;
anti_CheckRemoteDebuggerPresent = false;
anti_SetInformationThread = false;
anti_QueryInformationProcess = false;
anti_UnhandledExceptionFilter = false;
anti_QueryObject = false;
anti_GlobalFlag = false;
anti_HeapFlags = false;
}
string Options::getHelpForDisplay()
{
return KNOB_BASE::StringKnobSummary();
}
string Options::getSettingsForDisplay()
{
string str;
str += "Settings\n";
// log columns
{
str += " [Columns]\n";
string strColumns;
strColumns += string(printLogCount ? "SeqNo " : "");
strColumns += string(printTime ? "Time " : "");
strColumns += string(printImgName ? "ImgName " : "");
strColumns += string(printApiName ? "ApiName " : "");
strColumns += string(printBranch ? "Branch " : "");
strColumns += string(printRegFlag ? "RegFlag " : "");
strColumns += string(printRegGeneral ? "RegGeneral " : "");
strColumns += string(printRegXmm ? "RegXmm " : "");
strColumns += string(printRegYmm ? "RegYmm " : "");
strColumns += string(printInsBin ? "InsBin " : "");
str += PADDING("") + string("Default ") + (strColumns.empty() ? "" : strColumns) + string("\n");
}
// trigger
{
str += " [Trigger]\n";
string startAddr;
if (startAddressRangeLow) startAddr += to_hex(startAddressRangeLow) + "-" + to_hex(startAddressRangeHigh);
if (startAddress) startAddr += to_hex(startAddress);
str += PADDING(" Start") + string(startAddr.empty() ? "-" : startAddr) + string("\n");
string endAddr;
if (endAddress) endAddr += to_hex(endAddress);
str += PADDING(" End") + string(endAddr.empty() ? "-" : endAddr) + string("\n");
}
// rules
{
str += " [Rules]\n";
string strSkip;
for (auto imgName : traceRules.getSkipImgList()) strSkip += imgName + string(" ");
for (auto rtnName : traceRules.getSkipRtnList()) strSkip += rtnName + string(" ");
strSkip += traceRules.genSkipRangeListSettingMsg();
str += PADDING(" Skip") + string(strSkip.empty() ? "-" : strSkip) + string("\n");
string strHook;
for (auto imgName : traceRules.getHookImgList()) strHook += imgName + string(" ");
for (auto rtnName : traceRules.getHookRtnList()) strHook += rtnName + string(" ");
strHook += traceRules.genHookRangeListSettingMsg();
str += PADDING(" Hook") + string(strHook.empty() ? "-" : strHook) + string("\n");
string strFilter;
for (auto imgName : traceRules.getFilterImgList()) strFilter += imgName + string(" ");
for (auto rtnName : traceRules.getFilterRtnList()) strFilter += rtnName + string(" ");
strFilter += traceRules.genFilterRangeListSettingMsg();
str += PADDING(" Filter") + string(strFilter.empty() ? "-" : strFilter) + string("\n");
string strTrace;
for (auto imgName : traceRules.getTraceImgList()) strTrace += imgName + string(" ");
for (auto rtnName : traceRules.getTraceRtnList()) strTrace += rtnName + string(" ");
strTrace += traceRules.genTraceRangeListSettingMsg();
str += PADDING(" Trace") + string(strTrace.empty() ? "-" : strTrace) + string("\n");
}
// mode
{
str += " [Mode]\n";
str += PADDING(" Log file (base)") + tracefileBaseName + string("\n");
str += PADDING(" Verbose level") + std::to_string(verboseLevel) + string("\n");
str += PADDING(" Filter except jump") + string(modeFilterExceptJump ? "Yes" : "No") + string("\n");
str += PADDING(" Only API") + string(modeApiOnly ? "Yes" : "No") + string("\n");
str += PADDING(" Only main thread") + string(modeMainThreadOnly ? "Yes" : "No") + string("\n");
str += PADDING(" Detect crypt magic") + string(modeMagicDetect ? "Yes" : "No") + string("\n");
str += PADDING(" Detect crypt API") + string(modeCryptApiDetect ? "Yes" : "No") + string("\n");
}
// dump
{
str += " [Dump]\n";
string strDumpMem;
for (auto iter = _mapDumpMem.begin(); iter != _mapDumpMem.end(); iter++) {
ADDRINT insAddr = iter->first;
struct MemAddrSize memInfo = iter->second;
strDumpMem += to_hex(insAddr) + ":" + to_hex(memInfo.addr) + ":" + to_hex(memInfo.size) + string(" ");
}
str += PADDING(" Memory Dump") + string(strDumpMem.empty() ? "-" : strDumpMem) + string("\n");
string strDumpReg;
for (auto iter = _mapDumpReg.begin(); iter != _mapDumpReg.end(); iter++) {
ADDRINT insAddr = iter->first;
strDumpReg += to_hex(insAddr) + string(" ");
}
str += PADDING(" Registry Dump") + string(strDumpReg.empty() ? "-" : strDumpReg) + string("\n");
}
// Others
{
str += " [Others]\n";
str += PADDING(" Time Limit") + (traceExitTimeLimit ? std::to_string(traceExitTimeLimit) + " ms\n" : "-\n");
str += PADDING(" Ins Limit") + (traceExitInsLimit ? std::to_string(traceExitInsLimit) + " ins\n" : "-\n");
}
return str + "\n";
}
string Options::getDebugInfoForDisplay()
{
string str;
str += "Debug info\n";
str += string(" isFilteringInsideApi ") + (isFilteringInsideApi ? "Yes" : "No") + "\n";
str += string(" isStartingFromEntryPoint ") + (isStartingFromEntryPoint ? "Yes" : "No") + "\n";
str += string(" isStartingFromMainImage ") + (isStartingFromMainImage ? "Yes" : "No") + "\n";
str += string(" startAddress ") + (to_hex(startAddress) + "\n");
str += string(" endAddress ") + (to_hex(endAddress) + "\n");
str += string(" startAddressRangeLow ") + (to_hex(startAddressRangeLow) + "\n");
str += string(" startAddressRangeHigh ") + (to_hex(startAddressRangeHigh) + "\n");
return str + "\n";
}
BOOL Options::getOptions(int argc, char **argv)
{
/*
* Show columns
*/
if (KnobSelectAll || KnobSelectLogCnt) { printLogCount = true; }
if (KnobSelectAll || KnobSelectTime) { printTime = true; }
if (KnobSelectAll || KnobSelectInsBin) { printInsBin = true; }
if (KnobSelectAll || KnobSelectBranch) { printBranch = true; }
if (KnobSelectAll || KnobSelectImgName) { printImgName = true; }
if (KnobSelectAll || KnobSelectRtnName) { printApiName = true; }
if (KnobSelectAll || KnobSelectRegFlag) { printRegFlag = true; }
if (KnobSelectAll || KnobSelectRegGen) { printRegGeneral = true; }
if (KnobSelectAll || KnobSelectRegXMM) { printRegXmm = true; }
if (KnobSelectAll || KnobSelectRegYMM) { printRegYmm = true; }
/*
* Skip
*/
for (UINT32 i = 0; i < KnobSkipImg.NumberOfValues(); i++) {
traceRules.appendSkipImgList(KnobSkipImg.ValueString(i));
}
for (UINT32 i = 0; i < KnobSkipRtn.NumberOfValues(); i++) {
traceRules.appendSkipRtnList(KnobSkipRtn.ValueString(i));
}
for (UINT32 i = 0; i < KnobSkipRange.NumberOfValues(); i++) {
vector<string> args = split(KnobSkipRange.ValueString(), '-');
traceRules.appendSkipRangeList(from_hex(args[0]), from_hex(args[1]));
}
/*
* Hook
*/
for (UINT32 i = 0; i < KnobHookImg.NumberOfValues(); i++) {
traceRules.appendHookImgList(KnobHookImg.ValueString(i));
}
for (UINT32 i = 0; i < KnobHookRtn.NumberOfValues(); i++) {
traceRules.appendHookRtnList(KnobHookRtn.ValueString(i));
}
for (UINT32 i = 0; i < KnobHookRange.NumberOfValues(); i++) {
vector<string> args = split(KnobHookRange.ValueString(), '-');
traceRules.appendHookRangeList(from_hex(args[0]), from_hex(args[1]));
}
/*
* Filter
*/
if (KnobFilterBeforeEntryPoint) {
isStartingFromEntryPoint = true;
isFilteringInsideApi = false;
}
if (KnobFilterBeforeMainImage) {
isStartingFromMainImage = true;
isFilteringInsideApi = false;
}
if (!KnobFilterBeforeStart.ValueString().empty()) {
startAddress = from_hex(KnobFilterBeforeStart.ValueString());
//isStartingFromEntryPoint = true;
isFilteringInsideApi = false;
}
if (!KnobFilterAfterEnd.ValueString().empty()) {
endAddress = from_hex(KnobFilterAfterEnd.ValueString());
}
for (UINT32 i = 0; i < KnobFilterImg.NumberOfValues(); i++) {
traceRules.appendFilterImgList(KnobFilterImg.ValueString(i));
}
for (UINT32 i = 0; i < KnobFilterRtn.NumberOfValues(); i++) {
traceRules.appendFilterRtnList(KnobFilterRtn.ValueString(i));
}
if (!KnobFilterRange.ValueString().empty()) {
vector<string> args = split(KnobFilterRange.ValueString(), '-');
traceRules.appendFilterRangeList(from_hex(args[0]), from_hex(args[1]));
}
if (KnobFilterExceptJump) {
modeFilterExceptJump = true;
}
if (KnobFilterExceptApi) {
modeApiOnly = true;
}
/*
* Trace
*/
if (KnobTraceInsideRtn) {
isFilteringInsideApi = false;
isFilteringInsideApiOrg = false;
}
for (UINT32 i = 0; i < KnobTraceImg.NumberOfValues(); i++) {
traceRules.appendTraceImgList(KnobTraceImg.ValueString(i));
}
for (UINT32 i = 0; i < KnobTraceRtn.NumberOfValues(); i++) {
traceRules.appendTraceRtnList(KnobTraceRtn.ValueString(i));
}
if (!KnobTraceRange.ValueString().empty()) {
vector<string> args = split(KnobTraceRange.ValueString(), '-');
traceRules.appendTraceRangeList(from_hex(args[0]), from_hex(args[1]));
}
/*
* Exit
*/
if (KnobExitInsLimitExceeded) {
traceExitInsLimit = from_string(KnobExitInsLimitExceeded.ValueString());
}
if (KnobExitTimeLimitExceeded) {
traceExitTimeLimit = from_string(KnobExitTimeLimitExceeded.ValueString());
}
/*
* Bypass anti-debug
*/
if (KnobBypassAntiDebugAll || KnobIsDebuggerPresent) { anti_isDebuggerPresent = true; }
if (KnobBypassAntiDebugAll || KnobCheckRemoteDebuggerPresent) { anti_CheckRemoteDebuggerPresent = true; }
if (KnobBypassAntiDebugAll || KnobSetInformationThread) { anti_SetInformationThread = true; }
if (KnobBypassAntiDebugAll || KnobQueryInformationProcess) { anti_QueryInformationProcess = true; }
if (KnobBypassAntiDebugAll || KnobUnhandledExceptionFilter) { anti_UnhandledExceptionFilter = true; } // TODO
if (KnobBypassAntiDebugAll || KnobQueryObject) { anti_QueryObject = true; }
if (KnobBypassAntiDebugAll || KnobGlobalFlag) { anti_GlobalFlag = true; }
if (KnobBypassAntiDebugAll || KnobHeapFlags) { anti_HeapFlags = true; }
/*
* Detect
*/
// Crypt analysis
if (KnobCryptAnalysisAll || KnobCryptMagicDetect) { modeMagicDetect = true; }
if (KnobCryptAnalysisAll || KnobCryptApiDetect) { modeCryptApiDetect = true; }
// User-defined
for (UINT32 i = 0; i < KnobRtnDetect.NumberOfValues(); i++) {
traceRules.appendDetectApiList(KnobRtnDetect.ValueString(i));
}
for (UINT32 i = 0; i < KnobMagicDetect.NumberOfValues(); i++) {
traceRules.appendDetectMagicList(from_hex(KnobMagicDetect.ValueString(i)));
}
/*
* Dump
*/
for (UINT32 i = 0; i < KnobDumpMem.NumberOfValues(); i++) {
vector<string> args = split(KnobDumpMem.ValueString(i), ':');
ADDRINT insAddr = from_hex(args[0]);
ADDRINT memAddr = from_hex(args[1]);
size_t memSize = from_hex(args[2]);
_mapDumpMem[insAddr].addr = memAddr;
_mapDumpMem[insAddr].size = memSize;
}
for (UINT32 i = 0; i < KnobDumpReg.NumberOfValues(); i++) {
ADDRINT insAddr = from_hex(KnobDumpReg.ValueString(i));
_mapDumpReg[insAddr] = 1;
}
/*
* Others
*/
if (KnobQuiet) { verboseLevel = VERBOSE_QUIET; }
if (KnobVerbose) { verboseLevel = VERBOSE_INFO; }
if (KnobVerbose2) { verboseLevel = VERBOSE_DEBUG; }
if (KnobOnlyMainThread) { modeMainThreadOnly = true; }
if (KnobTraceFileName) { tracefileBaseName = KnobTraceFileName.ValueString(); }
if (KnobTraceAll) {
traceRules.clearAllLists();
isFilteringInsideApi = false;
isFilteringInsideApiOrg = false;
}
return true;
}
BOOL Options::isDumpMemTrigger(ADDRINT pc)
{
return _mapDumpMem.count(pc) > 0;
}
struct MemAddrSize Options::getDumpMem(ADDRINT pc)
{
return _mapDumpMem[pc];
}
BOOL Options::isDumpRegTrigger(ADDRINT pc)
{
return _mapDumpReg.count(pc) > 0;
}