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.cpp
Views: 11784
1
//
2
// exception.cpp
3
// liboffsetfinder64
4
//
5
// Created by tihmstar on 09.03.18.
6
// Copyright © 2018 tihmstar. All rights reserved.
7
//
8
9
#include "all_liboffsetfinder.hpp"
10
#include "exception.hpp"
11
#include <string>
12
13
using namespace tihmstar;
14
15
exception::exception(int code, std::string err, std::string filename) :
16
_err(err),
17
_code(code),
18
_build_commit_count("1"),
19
_build_commit_sha("msf"),
20
_filename(filename){};
21
22
const char *exception::what(){
23
return _err.c_str();
24
}
25
26
int exception::code() const{
27
return _code | (int)(_filename.size()<<16);
28
}
29
30
const std::string& exception::build_commit_count() const {
31
return _build_commit_count;
32
};
33
34
const std::string& exception::build_commit_sha() const {
35
return _build_commit_sha;
36
};
37
38
out_of_range::out_of_range(std::string err) : exception(__LINE__, err, "exception.cpp"){};
39
40
symbol_not_found::symbol_not_found(int code, std::string sym, std::string filename) : exception(code,{"failed to find symbol: " + sym},filename) {};
41
42
load_command_not_found::load_command_not_found(int code, int cmd, std::string filename) : exception(code,{"failed to find cmd: " + std::to_string(cmd)},filename), _cmd(cmd) {};
43
int load_command_not_found::cmd() const { return _cmd;};
44
45
symtab_not_found::symtab_not_found(int code, std::string err, std::string filename) : exception(code,err,filename) {};
46
47
limit_reached::limit_reached(int code, std::string err, std::string filename) : exception(code,err,filename) {};
48
49
bad_branch_destination::bad_branch_destination(int code, std::string err, std::string filename) : exception(code,err,filename) {};
50
51
52