Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Path: blob/master/external/source/exploits/CVE-2017-13861/liboffsetfinder64/exception.cpp
Views: 11784
//1// exception.cpp2// liboffsetfinder643//4// Created by tihmstar on 09.03.18.5// Copyright © 2018 tihmstar. All rights reserved.6//78#include "all_liboffsetfinder.hpp"9#include "exception.hpp"10#include <string>1112using namespace tihmstar;1314exception::exception(int code, std::string err, std::string filename) :15_err(err),16_code(code),17_build_commit_count("1"),18_build_commit_sha("msf"),19_filename(filename){};2021const char *exception::what(){22return _err.c_str();23}2425int exception::code() const{26return _code | (int)(_filename.size()<<16);27}2829const std::string& exception::build_commit_count() const {30return _build_commit_count;31};3233const std::string& exception::build_commit_sha() const {34return _build_commit_sha;35};3637out_of_range::out_of_range(std::string err) : exception(__LINE__, err, "exception.cpp"){};3839symbol_not_found::symbol_not_found(int code, std::string sym, std::string filename) : exception(code,{"failed to find symbol: " + sym},filename) {};4041load_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) {};42int load_command_not_found::cmd() const { return _cmd;};4344symtab_not_found::symtab_not_found(int code, std::string err, std::string filename) : exception(code,err,filename) {};4546limit_reached::limit_reached(int code, std::string err, std::string filename) : exception(code,err,filename) {};4748bad_branch_destination::bad_branch_destination(int code, std::string err, std::string filename) : exception(code,err,filename) {};49505152