Path: blob/master/external/source/exploits/CVE-2017-13861/liboffsetfinder64/all_liboffsetfinder.hpp
19851 views
//1// all_liboffsetfinder.hpp2// liboffsetfinder643//4// Created by tihmstar on 09.03.18.5// Copyright © 2018 tihmstar. All rights reserved.6//78#ifndef all_liboffsetfinder_h9#define all_liboffsetfinder_h1011#ifdef DEBUG12#define OFFSETFINDER64_VERSION_COMMIT_COUNT "Debug"13#define OFFSETFINDER64_VERSION_COMMIT_SHA "Build: " __DATE__ " " __TIME__1415#include <stdint.h>16static uint64_t BIT_RANGE(uint64_t v, int begin, int end) { return ((v)>>(begin)) % (1 << ((end)-(begin)+1)); }17static uint64_t BIT_AT(uint64_t v, int pos){ return (v >> pos) % 2; }1819#else20#define BIT_RANGE(v,begin,end) ( ((v)>>(begin)) % (1 << ((end)-(begin)+1)) )21#define BIT_AT(v,pos) ( (v >> pos) % 2 )22#endif2324#define info(a ...) ({printf(a),printf("\n");})25#define log(a ...) ({if (dbglog) printf(a),printf("\n");})26#define warning(a ...) ({if (dbglog) printf("[WARNING] "), printf(a),printf("\n");})27#define error(a ...) ({printf("[Error] "),printf(a),printf("\n");})2829#define safeFree(ptr) ({if (ptr) free(ptr),ptr=NULL;})3031#define reterror(err) throw tihmstar::exception(__LINE__, err, LOCAL_FILENAME)32#define retcustomerror(err,except) throw tihmstar::except(__LINE__, err, LOCAL_FILENAME)33#define assure(cond) if ((cond) == 0) throw tihmstar::exception(__LINE__, "assure failed", LOCAL_FILENAME)34#define doassure(cond,code) do {if (!(cond)){(code);assure(cond);}} while(0)35#define retassure(cond, err) if ((cond) == 0) throw tihmstar::exception(__LINE__,err,LOCAL_FILENAME)36#define assureclean(cond) do {if (!(cond)){clean();assure(cond);}} while(0)373839#endif /* all_liboffsetfinder_h */404142