CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
rapid7

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.

GitHub Repository: rapid7/metasploit-framework
Path: blob/master/external/source/exploits/CVE-2017-13861/liboffsetfinder64/exception.hpp
Views: 11784
1
//
2
// exception.hpp
3
// liboffsetfinder64
4
//
5
// Created by tihmstar on 09.03.18.
6
// Copyright © 2018 tihmstar. All rights reserved.
7
//
8
9
#ifndef exception_hpp
10
#define exception_hpp
11
12
#include <string>
13
14
namespace tihmstar {
15
class exception : public std::exception{
16
std::string _err;
17
int _code;
18
std::string _build_commit_count;
19
std::string _build_commit_sha;
20
std::string _filename;
21
public:
22
exception(int code, std::string err, std::string filename);
23
24
//custom error can be used
25
const char *what();
26
27
/*
28
-first lowest two bytes of code is sourcecode line
29
-next two bytes is strlen of filename in which error happened
30
*/
31
int code() const;
32
33
//Information about build
34
const std::string& build_commit_count() const;
35
const std::string& build_commit_sha() const;
36
};
37
38
//custom exceptions for makeing it easy to catch
39
class out_of_range : public exception{
40
public:
41
out_of_range(std::string err);
42
};
43
44
class symbol_not_found : public exception{
45
public:
46
symbol_not_found(int code, std::string sym, std::string filename);
47
};
48
49
class load_command_not_found : public exception{
50
int _cmd;
51
public:
52
int cmd() const;
53
load_command_not_found(int code, int cmd, std::string filename);
54
};
55
56
class symtab_not_found : public exception{
57
public:
58
symtab_not_found(int code, std::string err, std::string filename);
59
};
60
61
class limit_reached : public exception{
62
public:
63
limit_reached(int code, std::string err, std::string filename);
64
};
65
66
class bad_branch_destination : public exception{
67
public:
68
bad_branch_destination(int code, std::string err, std::string filename);
69
};
70
71
};
72
73
#endif /* exception_hpp */
74
75