Predator  [unstable] git snapshot
symbin.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2009-2010 Kamil Dudka <kdudka@redhat.com>
3  *
4  * This file is part of predator.
5  *
6  * predator is free software: you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation, either version 3 of the License, or
9  * any later version.
10  *
11  * predator is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with predator. If not, see <http://www.gnu.org/licenses/>.
18  */
19 
20 #ifndef H_GUARD_SYM_BIN_H
21 #define H_GUARD_SYM_BIN_H
22 
23 /**
24  * @file symbin.hh
25  * implementation of built-in functions
26  */
27 
28 #include <vector>
29 
30 class SymExecCore;
31 class SymState;
32 
33 namespace CodeStorage {
34  struct Insn;
35 }
36 
37 /// list of indexes of operands in an instruction
38 typedef std::vector<unsigned /* idx */> TOpIdxList;
39 
40 /// list of operands which have dereference semantics for a detected built-in
42  SymExecCore &core,
43  const CodeStorage::Insn &insn);
44 
45 /**
46  * analyze the given @b call instruction and handle any recognized built-in
47  * function eventually. There is nothing done if no built-in is recognized
48  * that case is signalized by the return value.
49  * @param dst where to store results of the execution of the built-in
50  * @param core an instance of SymExecCore used in read/write mode
51  * @param insn an instruction that should be analyzed and eventually executed
52  * @return return true if a built-in has been recognized; false otherwise
53  */
54 bool handleBuiltIn(SymState &dst,
55  SymExecCore &core,
56  const CodeStorage::Insn &insn);
57 
58 #endif /* H_GUARD_SYM_BIN_H */