DBG: (probably) resolved issue #732
This commit is contained in:
parent
f60c38e47b
commit
137b3f3164
|
|
@ -937,7 +937,7 @@ CMDRESULT cbInstrRefFindRange(int argc, char* argv[])
|
|||
if(refFindType != CURRENT_REGION && refFindType != CURRENT_MODULE && refFindType != ALL_MODULES)
|
||||
refFindType = CURRENT_REGION;
|
||||
|
||||
int found = RefFind(addr, size, cbRefFind, &range, false, title, (REFFINDTYPE)refFindType);
|
||||
int found = RefFind(addr, size, cbRefFind, &range, false, title, (REFFINDTYPE)refFindType, false);
|
||||
dprintf("%u reference(s) in %ums\n", found, GetTickCount() - ticks);
|
||||
varset("$result", found, false);
|
||||
return STATUS_CONTINUE;
|
||||
|
|
@ -1003,7 +1003,7 @@ CMDRESULT cbInstrRefStr(int argc, char* argv[])
|
|||
refFindType = CURRENT_REGION;
|
||||
|
||||
duint ticks = GetTickCount();
|
||||
int found = RefFind(addr, size, cbRefStr, 0, false, "Strings", (REFFINDTYPE)refFindType);
|
||||
int found = RefFind(addr, size, cbRefStr, 0, false, "Strings", (REFFINDTYPE)refFindType, false);
|
||||
dprintf("%u string(s) in %ums\n", found, GetTickCount() - ticks);
|
||||
varset("$result", found, false);
|
||||
return STATUS_CONTINUE;
|
||||
|
|
@ -1439,7 +1439,7 @@ CMDRESULT cbInstrModCallFind(int argc, char* argv[])
|
|||
refFindType = CURRENT_REGION;
|
||||
|
||||
duint ticks = GetTickCount();
|
||||
int found = RefFind(addr, size, cbModCallFind, 0, false, "Calls", (REFFINDTYPE)refFindType);
|
||||
int found = RefFind(addr, size, cbModCallFind, 0, false, "Calls", (REFFINDTYPE)refFindType, false);
|
||||
dprintf("%u call(s) in %ums\n", found, GetTickCount() - ticks);
|
||||
varset("$result", found, false);
|
||||
return STATUS_CONTINUE;
|
||||
|
|
@ -1715,7 +1715,7 @@ CMDRESULT cbInstrFindAsm(int argc, char* argv[])
|
|||
duint ticks = GetTickCount();
|
||||
char title[256] = "";
|
||||
sprintf_s(title, "Command: \"%s\"", basicinfo.instruction);
|
||||
int found = RefFind(addr, size, cbFindAsm, (void*)&basicinfo.instruction[0], false, title, (REFFINDTYPE)refFindType);
|
||||
int found = RefFind(addr, size, cbFindAsm, (void*)&basicinfo.instruction[0], false, title, (REFFINDTYPE)refFindType, true);
|
||||
dprintf("%u result(s) in %ums\n", found, GetTickCount() - ticks);
|
||||
varset("$result", found, false);
|
||||
return STATUS_CONTINUE;
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
#include "module.h"
|
||||
#include "threading.h"
|
||||
|
||||
int RefFind(duint Address, duint Size, CBREF Callback, void* UserData, bool Silent, const char* Name, REFFINDTYPE type)
|
||||
int RefFind(duint Address, duint Size, CBREF Callback, void* UserData, bool Silent, const char* Name, REFFINDTYPE type, bool disasmText)
|
||||
{
|
||||
char fullName[deflen];
|
||||
char moduleName[MAX_MODULE_SIZE];
|
||||
|
|
@ -63,7 +63,7 @@ int RefFind(duint Address, duint Size, CBREF Callback, void* UserData, bool Sile
|
|||
{
|
||||
GuiReferenceSetCurrentTaskProgress(percent, "Region Search");
|
||||
GuiReferenceSetProgress(percent);
|
||||
});
|
||||
}, false);
|
||||
}
|
||||
else if(type == CURRENT_MODULE) // Search in current Module
|
||||
{
|
||||
|
|
@ -104,7 +104,7 @@ int RefFind(duint Address, duint Size, CBREF Callback, void* UserData, bool Sile
|
|||
{
|
||||
GuiReferenceSetCurrentTaskProgress(percent, "Module Search");
|
||||
GuiReferenceSetProgress(percent);
|
||||
});
|
||||
}, false);
|
||||
}
|
||||
else if(type == ALL_MODULES) // Search in all Modules
|
||||
{
|
||||
|
|
@ -151,7 +151,7 @@ int RefFind(duint Address, duint Size, CBREF Callback, void* UserData, bool Sile
|
|||
|
||||
GuiReferenceSetCurrentTaskProgress(percent, modList[i].name);
|
||||
GuiReferenceSetProgress(totalPercent);
|
||||
});
|
||||
}, disasmText);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -160,7 +160,7 @@ int RefFind(duint Address, duint Size, CBREF Callback, void* UserData, bool Sile
|
|||
return refInfo.refcount;
|
||||
}
|
||||
|
||||
int RefFindInRange(duint scanStart, duint scanSize, CBREF Callback, void* UserData, bool Silent, REFINFO & refInfo, Capstone & cp, bool initCallBack, CBPROGRESS cbUpdateProgress)
|
||||
int RefFindInRange(duint scanStart, duint scanSize, CBREF Callback, void* UserData, bool Silent, REFINFO & refInfo, Capstone & cp, bool initCallBack, CBPROGRESS cbUpdateProgress, bool disasmText)
|
||||
{
|
||||
// Allocate and read a buffer from the remote process
|
||||
Memory<unsigned char*> data(scanSize, "reffind:data");
|
||||
|
|
@ -196,7 +196,7 @@ int RefFindInRange(duint scanStart, duint scanSize, CBREF Callback, void* UserDa
|
|||
if(cp.Disassemble(scanStart, data() + i, disasmMaxSize))
|
||||
{
|
||||
BASIC_INSTRUCTION_INFO basicinfo;
|
||||
fillbasicinfo(&cp, &basicinfo, false);
|
||||
fillbasicinfo(&cp, &basicinfo, disasmText);
|
||||
|
||||
if(Callback(&cp, &basicinfo, &refInfo))
|
||||
refInfo.refcount++;
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ typedef enum
|
|||
typedef bool (*CBREF)(Capstone* disasm, BASIC_INSTRUCTION_INFO* basicinfo, REFINFO* refinfo);
|
||||
typedef std::function<void(int)> CBPROGRESS;
|
||||
|
||||
int RefFind(duint Address, duint Size, CBREF Callback, void* UserData, bool Silent, const char* Name, REFFINDTYPE type);
|
||||
int RefFindInRange(duint scanStart, duint scanSize, CBREF Callback, void* UserData, bool Silent, REFINFO & refInfo, Capstone & cp, bool initCallBack, CBPROGRESS cbUpdateProgress);
|
||||
int RefFind(duint Address, duint Size, CBREF Callback, void* UserData, bool Silent, const char* Name, REFFINDTYPE type, bool disasmText);
|
||||
int RefFindInRange(duint scanStart, duint scanSize, CBREF Callback, void* UserData, bool Silent, REFINFO & refInfo, Capstone & cp, bool initCallBack, CBPROGRESS cbUpdateProgress, bool disasmText);
|
||||
|
||||
#endif // _REFERENCE_H
|
||||
Loading…
Reference in New Issue