39 outs << std::dec <<
tid;
46 OUT_PADDED(outs, level,
"\"susp_return_addr\" : ");
48 outs <<
"\"" << std::hex <<
susp_addr <<
"\"";
52 OUT_PADDED(outs, level,
"\"susp_callstack\" : ");
53 outs <<
"\"" << std::hex <<
stack_ptr <<
"\"";
57 OUT_PADDED(outs, level,
"\"thread_state\" : ");
62 OUT_PADDED(outs, level,
"\"thread_wait_reason\" : ");
69 outs <<
"\"" << std::hex <<
protection <<
"\"";
79 OUT_PADDED(outs, level,
"\"thread_scan\" : {\n");
110 _ctx_details(
bool _is64b =
false, ULONGLONG _rip = 0, ULONGLONG _rsp = 0, ULONGLONG _rbp = 0, ULONGLONG _ret_addr = 0)
117 void init(
bool _is64b =
false, ULONGLONG _rip = 0, ULONGLONG _rsp = 0, ULONGLONG _rbp = 0, ULONGLONG _ret_addr = 0)
119 this->is64b = _is64b;
123 this->last_ret = _ret_addr;
virtual const bool toJSON(std::stringstream &outs, size_t level)
A base class of all the reports detailing on the output of the performed module's scan.
virtual const bool _toJSON(std::stringstream &outs, size_t level=JSON_LEVEL, const pesieve::t_json_level &jdetails=JSON_BASIC)
A container of all the process modules that were scanned.
A base class for all the scanners checking appropriate process' features.
A report from the thread scan, generated by ThreadScanner.
virtual const void fieldsToJSON(std::stringstream &outs, size_t level, const pesieve::t_json_level &jdetails)
ThreadScanReport(DWORD _tid)
static std::string translate_wait_reason(DWORD thread_wait_reason)
static const DWORD THREAD_STATE_UNKNOWN
static const DWORD THREAD_STATE_WAITING
virtual const bool toJSON(std::stringstream &outs, size_t level, const pesieve::t_json_level &jdetails)
static std::string translate_thread_state(DWORD thread_state)
ThreadScanner(HANDLE hProc, bool _isReflection, const util::thread_info &_info, ModulesInfo &_modulesInfo, peconv::ExportsMapper *_exportsMap, ProcessSymbolsManager *_symbols)
virtual ThreadScanReport * scanRemote()
bool reportSuspiciousAddr(ThreadScanReport *my_report, ULONGLONG susp_addr)
size_t fillCallStackInfo(IN HANDLE hProcess, IN HANDLE hThread, IN LPVOID ctx, IN OUT ctx_details &cDetails)
void printThreadInfo(const util::thread_info &threadi)
bool fillAreaStats(ThreadScanReport *my_report)
bool isAddrInShellcode(ULONGLONG addr)
size_t analyzeCallStack(IN const std::vector< ULONGLONG > &stack_frame, IN OUT ctx_details &cDetails)
peconv::ExportsMapper * exportsMap
const util::thread_info & info
bool fetchThreadCtxDetails(IN HANDLE hProcess, IN HANDLE hThread, OUT ctx_details &c)
bool printResolvedAddr(ULONGLONG addr)
ProcessSymbolsManager * symbols
bool scanRemoteThreadCtx(HANDLE hThread, ThreadScanReport *my_report)
ModulesInfo & modulesInfo
bool checkReturnAddrIntegrity(IN const std::vector< ULONGLONG > &callStack)
struct pesieve::_ctx_details ctx_details
A custom structure keeping a fragment of a thread context.
A custom structure keeping a fragment of a thread context.
void init(bool _is64b=false, ULONGLONG _rip=0, ULONGLONG _rsp=0, ULONGLONG _rbp=0, ULONGLONG _ret_addr=0)
std::set< ULONGLONG > shcCandidates
_ctx_details(bool _is64b=false, ULONGLONG _rip=0, ULONGLONG _rsp=0, ULONGLONG _rbp=0, ULONGLONG _ret_addr=0)