ROSE 2.1.0
Loading...
Searching...
No Matches
CilStringFinder.h
1#ifndef ROSE_BinaryAnalysis_CilStringFinder_H
2#define ROSE_BinaryAnalysis_CilStringFinder_H 1
3
4#include <featureTests.h>
5
6#ifdef ROSE_ENABLE_BINARY_ANALYSIS
7
8#include <rosedll.h>
9#include <functional>
10#include <vector>
11#include <string>
12
13class SgProject;
14
15namespace Rose {
16namespace BinaryAnalysis {
17
20struct ROSE_DLL_API CilStringFinder
21{
22 using StringCollectorFn = std::function<void(std::string s)>;
23
26 {
27 none = 0,
28 literals = 1 << 0,
29 metadata = 1 << 1,
30 all = literals | metadata,
31 };
32
33
38 void
39 collect(const SgProject& proj, StringCollectorFn collector, CilStringKinds kinds = CilStringKinds::all) const;
40
46 std::vector<std::string>
47 find(const SgProject& proj, CilStringKinds kinds = CilStringKinds::all) const;
48};
49
50}
51}
52
53#endif /* ROSE_ENABLE_BINARY_ANALYSIS */
54
55#endif /* ROSE_BinaryAnalysis_CilStringFinder_H */
This class represents a source project, with a list of SgFile objects and global information about th...
The ROSE library.
A StringFinder class for CIL binaries.
std::vector< std::string > find(const SgProject &proj, CilStringKinds kinds=CilStringKinds::all) const
depending on the settings of kind finds strings in proj and calls collector for each one.
void collect(const SgProject &proj, StringCollectorFn collector, CilStringKinds kinds=CilStringKinds::all) const
depending on the settings of kind finds strings in proj and calls collector for each one.
std::function< void(std::string s)> StringCollectorFn
callback for storing strings
CilStringKinds
Settings for specifying which kind of CIL strings shall be found.