From 83b5fa7d1295efabc50307fc91f3a7b1af69906d Mon Sep 17 00:00:00 2001 From: shuangxiang kan <18550887212@163.com> Date: Tue, 11 Jul 2023 23:06:34 +1000 Subject: [PATCH 1/5] Use extapi.bc to replace ExtAPI.json --- .config.in | 1 + CMakeLists.txt | 15 + build.sh | 2 +- svf-llvm/include/SVF-LLVM/LLVMUtil.h | 39 +- svf-llvm/include/SVF-LLVM/SVFIRBuilder.h | 19 +- svf-llvm/lib/LLVMModule.cpp | 100 +- svf-llvm/lib/LLVMUtil.cpp | 4 +- svf-llvm/lib/SVFIRBuilder.cpp | 87 +- svf-llvm/lib/SVFIRExtAPI.cpp | 695 +-- svf-llvm/lib/SymbolTableBuilder.cpp | 8 +- svf/include/SVFIR/SVFModule.h | 1 - svf/include/Util/ExtAPI.h | 537 -- svf/include/Util/ExtAPI.json | 5833 ---------------------- svf/include/Util/SVFUtil.h | 48 +- svf/lib/SVFIR/SVFModule.cpp | 1 - svf/lib/Util/ExtAPI.cpp | 694 --- svf/lib/Util/Options.cpp | 2 +- svf/lib/Util/extapi.c | 734 +++ 18 files changed, 1088 insertions(+), 7732 deletions(-) delete mode 100644 svf/include/Util/ExtAPI.h delete mode 100644 svf/include/Util/ExtAPI.json delete mode 100644 svf/lib/Util/ExtAPI.cpp create mode 100644 svf/lib/Util/extapi.c diff --git a/.config.in b/.config.in index daa940669..c316c1755 100644 --- a/.config.in +++ b/.config.in @@ -2,5 +2,6 @@ #define CONFIG_H_IN #define PROJECT_PATH "@CMAKE_CURRENT_SOURCE_DIR@" +#define EXTAPI_PATH PROJECT_PATH "/@CMAKE_BUILD_TYPE@-build/include/Util" #endif diff --git a/CMakeLists.txt b/CMakeLists.txt index 0e22f9863..7fb931882 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -87,3 +87,18 @@ install( DESTINATION include/svf FILES_MATCHING PATTERN "**/*.h") + +# Compile extapi.c to extapi.bc +add_custom_command( + OUTPUT ${PROJECT_BINARY_DIR}/include/Util/extapi.bc + COMMAND ${PROJECT_SOURCE_DIR}/llvm-14.0.0.obj/bin/clang -S -c -Xclang -disable-O0-optnone -fno-discard-value-names -emit-llvm ${PROJECT_SOURCE_DIR}/svf/lib/Util/extapi.c -o ${PROJECT_BINARY_DIR}/include/Util/extapi.bc + DEPENDS ${PROJECT_SOURCE_DIR}/svf/lib/Util/extapi.c +) + +add_custom_target(extapi_ir ALL DEPENDS ${PROJECT_BINARY_DIR}/include/Util/extapi.bc) + +install( + FILES ${PROJECT_BINARY_DIR}/include/Util/extapi.bc + COMPONENT devel + DESTINATION include/svf/Util +) \ No newline at end of file diff --git a/build.sh b/build.sh index 86f1d07fe..5cc632f5a 100755 --- a/build.sh +++ b/build.sh @@ -115,7 +115,7 @@ function build_llvm_from_source { mkdir llvm-build cd llvm-build # /*/ is a dirty hack to get llvm-project-llvmorg-version... - cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="$SVFHOME/$LLVMHome" ../llvm-source/*/llvm + cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="$SVFHOME/$LLVMHome" -DLLVM_ENABLE_PROJECTS=clang ../llvm-source/*/llvm cmake --build . -j ${jobs} cmake --install . diff --git a/svf-llvm/include/SVF-LLVM/LLVMUtil.h b/svf-llvm/include/SVF-LLVM/LLVMUtil.h index 81fc276f4..4a2ae7e8c 100644 --- a/svf-llvm/include/SVF-LLVM/LLVMUtil.h +++ b/svf-llvm/include/SVF-LLVM/LLVMUtil.h @@ -34,7 +34,6 @@ #include "SVF-LLVM/BasicTypes.h" #include "SVF-LLVM/LLVMModule.h" #include "SVFIR/SVFValue.h" -#include "Util/ExtAPI.h" #include "Util/ThreadAPI.h" namespace SVF @@ -99,6 +98,42 @@ inline const Function* getProgFunction(const std::string& funName) return nullptr; } +inline bool isHeapAllocExtCallViaRet(const Instruction* inst) +{ + if (isCallSite(inst)) + { + const Function* func = getCallee(getLLVMCallSite(inst)); + return func && (func->getName().str().find("_ALLOC_RET") != std::string::npos + || func->getName().str().find("_REALLOC_RET") != std::string::npos); + } + return false; +} + +inline bool isHeapAllocExtCallViaArg(const Instruction* inst) +{ + if (isCallSite(inst)) + { + const Function* func = getCallee(getLLVMCallSite(inst)); + return func && func->getName().str().find("_ALLOC_ARG") != std::string::npos; + } + return false; +} + +inline bool isHeapAllocExtCall(const Instruction* inst) +{ + return isHeapAllocExtCallViaRet(inst) || isHeapAllocExtCallViaArg(inst); +} + +inline bool isStaticExtCall(const Instruction* inst) +{ + if (isCallSite(inst)) + { + const Function* func = getCallee(getLLVMCallSite(inst)); + return func && func->getName().str().find("_STATIC") != std::string::npos; + } + return false; +} + /// Check whether a function is an entry function (i.e., main) inline bool isProgEntryFunction(const Function* fun) { @@ -145,7 +180,7 @@ inline const PointerType *getRefTypeOfHeapAllocOrStatic(const CallBase* cs) // Case 2: heap/static object held by return value. else { - assert((SVFUtil::isStaticExtCall(svfcs) || SVFUtil::isHeapAllocExtCallViaRet(svfcs)) + assert((isStaticExtCall(cs) || isHeapAllocExtCallViaRet(cs)) && "Must be heap alloc via ret, or static allocation site"); refType = SVFUtil::dyn_cast(cs->getType()); } diff --git a/svf-llvm/include/SVF-LLVM/SVFIRBuilder.h b/svf-llvm/include/SVF-LLVM/SVFIRBuilder.h index 1d80164dc..db15a39be 100644 --- a/svf-llvm/include/SVF-LLVM/SVFIRBuilder.h +++ b/svf-llvm/include/SVF-LLVM/SVFIRBuilder.h @@ -31,10 +31,10 @@ #define PAGBUILDER_H_ #include "SVFIR/SVFIR.h" -#include "Util/ExtAPI.h" #include "SVF-LLVM/BasicTypes.h" #include "SVF-LLVM/ICFGBuilder.h" #include "SVF-LLVM/LLVMModule.h" +#include "SVF-LLVM/LLVMUtil.h" namespace SVF { @@ -232,18 +232,9 @@ class SVFIRBuilder: public llvm::InstVisitor /// Handle external call //@{ - virtual SVFCallInst* addSVFExtCallInst(const SVFCallInst* svfInst, SVFBasicBlock* svfBB, const SVFFunction* svfCaller, const SVFFunction* svfCallee); - virtual void addSVFExtRetInst(SVFCallInst* svfCall, SVFBasicBlock* svfBB, SVFFunction* svfCaller); - virtual SVFInstruction* addSVFExtInst(const std::string& instName, const SVFCallInst* svfInst, SVFBasicBlock* svfBB, SVF::ExtAPI::OperationType opType, const SVFType* svfType); - virtual void extFuncAtomaticOperation(ExtAPI::Operand& atomicOp, const SVFCallInst* svfInst); - virtual SVFBasicBlock* extFuncInitialization(const SVFCallInst* svfInst, SVFFunction* svfCaller); - virtual void handleExtCallStat(ExtAPI::ExtFunctionOps &extFunctionOps, const SVFCallInst* svfInst); - virtual NodeID getExtID(ExtAPI::OperationType operationType, const std::string &s, const SVFCallInst* svfCall); - virtual void parseAtomaticOp(SVF::ExtAPI::Operand &atomaticOp, const SVFCallInst* svfCall, std::map &nodeIDMap); - virtual void parseExtFunctionOps(ExtAPI::ExtFunctionOps &extFunctionOps, const SVFCallInst* svfCall); - virtual void preProcessExtCall(CallBase* cs); - virtual void handleExtCall(const SVFInstruction* svfInst, const SVFFunction* svfCallee); - void addComplexConsForExt(const SVFValue* D, const SVFValue* S, const SVFValue* sz); + virtual const Type *getBaseTypeAndFlattenedFields(const Value *V, std::vector &fields, const Value* szValue); + virtual void addComplexConsForExt(Value *D, Value *S, const Value* sz); + virtual void handleExtCall(const CallBase* cs, const SVFFunction* svfCallee); //@} /// Set current basic block in order to keep track of control flow information @@ -287,7 +278,7 @@ class SVFIRBuilder: public llvm::InstVisitor return nullPtr; } - NodeID getGepValVar(const SVFValue* val, const AccessPath& ap, const SVFType* baseType); + NodeID getGepValVar(const Value* val, const AccessPath& ls, const SVFType* elementType); void setCurrentBBAndValueForPAGEdge(PAGEdge* edge); diff --git a/svf-llvm/lib/LLVMModule.cpp b/svf-llvm/lib/LLVMModule.cpp index 40f02f44b..f732f8167 100644 --- a/svf-llvm/lib/LLVMModule.cpp +++ b/svf-llvm/lib/LLVMModule.cpp @@ -153,8 +153,9 @@ void LLVMModuleSet::build() void LLVMModuleSet::createSVFDataStructure() { getSVFType(IntegerType::getInt8Ty(getContext())); - Set candidateDecls; - Set candidateDefs; + // Functions need to be retrieved in the order of insertion + std::vector candidateDecls; + std::vector candidateDefs; for (Module& mod : modules) { @@ -165,7 +166,7 @@ void LLVMModuleSet::createSVFDataStructure() if (func.isDeclaration()) { /// if this function is declaration - candidateDecls.insert(&func); + candidateDecls.push_back(&func); } else { @@ -180,7 +181,7 @@ void LLVMModuleSet::createSVFDataStructure() { /// if this function is in app bc, any def func should be added. /// if this function is in ext bc, only functions which have declarations(should be used by app bc) can be inserted. - candidateDefs.insert(&func); + candidateDefs.push_back(&func); } } } @@ -553,8 +554,11 @@ void LLVMModuleSet::loadExtAPIModules() Err.print("SVFModuleLoader", llvm::errs()); abort(); } - modules.emplace_back(*mod); - owned_modules.emplace_back(std::move(mod)); + // The module of ext.bc needs to be imported before other modules. + // Otherwise, when overwriting the app function with SVF extern function, + // the corresponding SVFFunction of the extern function will not be found. + modules.insert(modules.begin(), *mod); + owned_modules.insert(owned_modules.begin(),std::move(mod)); } } @@ -744,25 +748,39 @@ void LLVMModuleSet::addSVFMain() void LLVMModuleSet::buildFunToFunMap() { - Set funDecls, funDefs; + Set funDecls, funDefs, extFuncs, overwriteExtFuncs; OrderedSet declNames, defNames, intersectNames; typedef Map NameToFunDefMapTy; typedef Map> NameToFunDeclsMapTy; + FunDeclToDefMapTy appFunToExtFun; for (Module& mod : modules) { - /// Function - for (const Function& fun : mod.functions()) + // extapi.bc functions + if (mod.getName().str() == Options::ExtAPIInput()) { - if (fun.isDeclaration()) + for (const Function& fun : mod.functions()) { - funDecls.insert(&fun); - declNames.insert(fun.getName().str()); + if (fun.getName().str().find("_OVERWRITE") != std::string::npos) + overwriteExtFuncs.insert(&fun); + extFuncs.insert(&fun); } - else + } + else + { + /// app functions + for (const Function& fun : mod.functions()) { - funDefs.insert(&fun); - defNames.insert(fun.getName().str()); + if (fun.isDeclaration()) + { + funDecls.insert(&fun); + declNames.insert(fun.getName().str()); + } + else + { + funDefs.insert(&fun); + defNames.insert(fun.getName().str()); + } } } } @@ -827,6 +845,58 @@ void LLVMModuleSet::buildFunToFunMap() decls.push_back(decl); } } + + /// App Func decl -> SVF extern Func def + for (const Function* fdecl : funDecls) + { + for (const Function* extfun : extFuncs) + { + std::string declName = fdecl->getName().str(); + std::string svfExtName = "svf_"; + svfExtName.reserve(svfExtName.size() + declName.size()); + svfExtName.append(declName); + std::replace(svfExtName.begin(), svfExtName.end(), '.', '_'); + if ((fdecl->arg_size() == extfun->arg_size() || (fdecl->isVarArg() && extfun->isVarArg())) + && ((extfun->getName().str().length() == svfExtName.length() && extfun->getName().str().compare(svfExtName) == 0) || + (extfun->getName().str().length() > svfExtName.length() && extfun->getName().str().find(svfExtName + "_") != std::string::npos))) + { + assert(extfun->getName().str().length() > 4 && extfun->getName().str().substr(0, 4).compare("svf_") == 0 && "Function in extapi.bc should be start with 'svf_'"); + FunDeclToDefMap[fdecl] = extfun; + std::vector& decls = FunDefToDeclsMap[extfun]; + decls.push_back(fdecl); + } + } + } + + /// Overwrite + /// App Func def -> SVF extern Func def + for (const Function* appfunc : funDefs) + { + for (const Function* owfunc : overwriteExtFuncs) + { + + if (owfunc->getName().str().find("svf_" + appfunc->getName().str() + "_") != std::string::npos && + (owfunc->arg_size() == appfunc->arg_size() || (owfunc->isVarArg() && appfunc->isVarArg()))) + { + assert(owfunc->getName().str().length() > 4 && owfunc->getName().str().substr(0, 4).compare("svf_") == 0 && "Function in extapi.bc should be start with 'svf_'"); + appFunToExtFun[appfunc] = owfunc; + + Function* fun = const_cast(appfunc); + Module* mod = fun->getParent(); + FunctionType* funType = fun->getFunctionType(); + std::string funName = fun->getName().str(); + Function* declaration = Function::Create(funType, GlobalValue::ExternalLinkage, funName, mod); + // Replace app function with svf extern function + fun->replaceAllUsesWith(declaration); + fun->eraseFromParent(); + declaration->setName(funName); + + FunDeclToDefMap[declaration] = owfunc; + std::vector& decls = FunDefToDeclsMap[owfunc]; + decls.push_back(declaration); + } + } + } } void LLVMModuleSet::buildGlobalDefToRepMap() diff --git a/svf-llvm/lib/LLVMUtil.cpp b/svf-llvm/lib/LLVMUtil.cpp index fdbb3e0ea..eee2dd102 100644 --- a/svf-llvm/lib/LLVMUtil.cpp +++ b/svf-llvm/lib/LLVMUtil.cpp @@ -53,9 +53,9 @@ const std::string structName = "struct."; */ bool LLVMUtil::isObject(const Value* ref) { - if (SVFUtil::isa(ref) && SVFUtil::isStaticExtCall(LLVMModuleSet::getLLVMModuleSet()->getSVFInstruction(SVFUtil::cast(ref))) ) + if (SVFUtil::isa(ref) && isStaticExtCall(SVFUtil::cast(ref))) return true; - if (SVFUtil::isa(ref) && SVFUtil::isHeapAllocExtCallViaRet(LLVMModuleSet::getLLVMModuleSet()->getSVFInstruction(SVFUtil::cast(ref)))) + if (SVFUtil::isa(ref) && isHeapAllocExtCallViaRet(SVFUtil::cast(ref))) return true; if (SVFUtil::isa(ref)) return true; diff --git a/svf-llvm/lib/SVFIRBuilder.cpp b/svf-llvm/lib/SVFIRBuilder.cpp index 4a0ce9afe..bfb29d0f1 100644 --- a/svf-llvm/lib/SVFIRBuilder.cpp +++ b/svf-llvm/lib/SVFIRBuilder.cpp @@ -470,7 +470,7 @@ NodeID SVFIRBuilder::getGlobalVarField(const GlobalVariable *gvar, u32_t offset, /// then we need to create a gep node for this field else { - return getGepValVar(LLVMModuleSet::getLLVMModuleSet()->getSVFValue(gvar), AccessPath(offset), tpy); + return getGepValVar(gvar, AccessPath(offset), tpy); } } @@ -847,9 +847,7 @@ void SVFIRBuilder::visitCallSite(CallBase* cs) const SVFFunction* svfcallee = LLVMModuleSet::getLLVMModuleSet()->getSVFFunction(callee); if (isExtCall(svfcallee)) { - // There is no extpag for the function, use the old method. - preProcessExtCall(cs); - handleExtCall(svfcall, svfcallee); + handleExtCall(cs, svfcallee); } else { @@ -1115,73 +1113,6 @@ const Value* SVFIRBuilder::getBaseValueForExtArg(const Value* V) return value; } -void SVFIRBuilder::preProcessExtCall(CallBase* cs) -{ - const SVFInstruction* svfinst = LLVMModuleSet::getLLVMModuleSet()->getSVFInstruction(cs); - const SVFCallInst* svfcall = SVFUtil::cast(svfinst); - /// Currently focusing on providing specialized treatment for the extern function void *dlsym(void *handle, const char *funname) - /// and generalization will be done later. - if (svfcall->getCalledFunction()->getName() == "dlsym") - { - const Value* src = cs->getArgOperand(1); - if(const GetElementPtrInst* gep = SVFUtil::dyn_cast(src)) - src = stripConstantCasts(gep->getPointerOperand()); - - auto getHookFn = [](const Value* src)->const Function* - { - if (!SVFUtil::isa(src)) - return nullptr; - - auto *glob = SVFUtil::cast(src); - if (!glob->hasInitializer() || !SVFUtil::isa(glob->getInitializer())) - return nullptr; - - auto *constarray = SVFUtil::cast(glob->getInitializer()); - return LLVMUtil::getProgFunction(constarray->getAsCString().str()); - }; - - if (const Function *fn = getHookFn(src)) - { - NodeID srcNode = getValueNode(fn); - addCopyEdge(srcNode, getValueNode(cs)); - } - return; - } - /// Preprocess the arguments of functions such as memset() and memcpy() that involve arrays or structures, - /// and identify the original data types of these arguments, flattening each subfield. - if (isMemSetOrCpyExtFun(svfcall->getCalledFunction())) - { - for (u32_t i = 0; i < cs->arg_size(); i++) - { - const Type* T = getBaseValueForExtArg(cs->getArgOperand(i))->getType(); - while (const PointerType *ptype = SVFUtil::dyn_cast(T)) - T = getPtrElementType(ptype); - const SVFType *st = LLVMModuleSet::getLLVMModuleSet()->getSVFType(T); - std::vector fields; - u32_t numOfElems = pag->getSymbolInfo()->getNumOfFlattenElements(st); - LLVMContext& context = LLVMModuleSet::getLLVMModuleSet()->getContext(); - for(u32_t ei = 0; ei < numOfElems; ei++) - { - AccessPath ap(ei); - // make a ConstantInt and create char for the content type due to byte-wise copy - const ConstantInt* offset = ConstantInt::get(context, llvm::APInt(32, ei)); - const SVFValue* svfOffset = LLVMModuleSet::getLLVMModuleSet()->getSVFValue(offset); - if (!pag->getSymbolInfo()->hasValSym(svfOffset)) - { - SymbolTableBuilder builder(pag->getSymbolInfo()); - builder.collectSym(offset); - pag->addValNode(svfOffset, pag->getSymbolInfo()->getValSym(svfOffset)); - } - ap.addOffsetVarAndGepTypePair(getPAG()->getGNode(getPAG()->getValueNode(svfOffset)), nullptr); - fields.push_back(ap); - } - NodeID argId = pag->getValueNode(svfcall->getArgOperand(i)); - std::pair> pairToInsert = std::make_pair(st, fields); - pag->addToTypeLocSetsMap(argId, pairToInsert); - } - } -} - /*! * Indirect call is resolved on-the-fly during pointer analysis */ @@ -1211,9 +1142,8 @@ void SVFIRBuilder::updateCallGraph(PTACallGraph* callgraph) if (isExtCall(*func_iter)) { setCurrentLocation(callee, callee->empty() ? nullptr : &callee->getEntryBlock()); - SVFInstruction* svfinst = LLVMModuleSet::getLLVMModuleSet()->getSVFInstruction(callbase); const SVFFunction* svfcallee = LLVMModuleSet::getLLVMModuleSet()->getSVFFunction(callee); - handleExtCall(svfinst, svfcallee); + handleExtCall(callbase, svfcallee); } else { @@ -1257,10 +1187,10 @@ void SVFIRBuilder::sanityCheck() * Add a temp field value node according to base value and offset * this node is after the initial node method, it is out of scope of symInfo table */ -NodeID SVFIRBuilder::getGepValVar(const SVFValue* val, const AccessPath& ap, const SVFType* elementType) +NodeID SVFIRBuilder::getGepValVar(const Value* val, const AccessPath& ls, const SVFType* elementType) { - NodeID base = pag->getBaseValVar(pag->getValueNode(val)); - NodeID gepval = pag->getGepValVar(curVal, base, ap); + NodeID base = pag->getBaseValVar(getValueNode(val)); + NodeID gepval = pag->getGepValVar(curVal, base, ls); if (gepval==UINT_MAX) { assert(((int) UINT_MAX)==-1 && "maximum limit of unsigned int is not -1?"); @@ -1279,8 +1209,9 @@ NodeID SVFIRBuilder::getGepValVar(const SVFValue* val, const AccessPath& ap, con const SVFValue* cval = getCurrentValue(); const SVFBasicBlock* cbb = getCurrentBB(); setCurrentLocation(curVal, nullptr); - NodeID gepNode= pag->addGepValNode(curVal, val, ap, NodeIDAllocator::get()->allocateValueId(),elementType->getPointerTo()); - addGepEdge(base, gepNode, ap, true); + LLVMModuleSet* llvmmodule = LLVMModuleSet::getLLVMModuleSet(); + NodeID gepNode= pag->addGepValNode(curVal, llvmmodule->getSVFValue(val),ls, NodeIDAllocator::get()->allocateValueId(),elementType->getPointerTo()); + addGepEdge(base, gepNode, ls, true); setCurrentLocation(cval, cbb); return gepNode; } diff --git a/svf-llvm/lib/SVFIRExtAPI.cpp b/svf-llvm/lib/SVFIRExtAPI.cpp index 32aa887c6..e9cf5df39 100644 --- a/svf-llvm/lib/SVFIRExtAPI.cpp +++ b/svf-llvm/lib/SVFIRExtAPI.cpp @@ -28,31 +28,68 @@ */ #include "SVF-LLVM/SVFIRBuilder.h" +#include "SVF-LLVM/SymbolTableBuilder.h" using namespace std; using namespace SVF; using namespace SVFUtil; +using namespace LLVMUtil; +/*! + * Find the base type and the max possible offset of an object pointed to by (V). + */ +const Type* SVFIRBuilder::getBaseTypeAndFlattenedFields(const Value* V, std::vector &fields, const Value* szValue) +{ + assert(V); + const Value* value = getBaseValueForExtArg(V); + const Type* T = value->getType(); + while (const PointerType *ptype = SVFUtil::dyn_cast(T)) + T = getPtrElementType(ptype); + + u32_t numOfElems = pag->getSymbolInfo()->getNumOfFlattenElements(LLVMModuleSet::getLLVMModuleSet()->getSVFType(T)); + /// use user-specified size for this copy operation if the size is a constaint int + if(szValue && SVFUtil::isa(szValue)) + { + numOfElems = (numOfElems > SVFUtil::cast(szValue)->getSExtValue()) ? SVFUtil::cast(szValue)->getSExtValue() : numOfElems; + } + + LLVMContext& context = LLVMModuleSet::getLLVMModuleSet()->getContext(); + for(u32_t ei = 0; ei < numOfElems; ei++) + { + AccessPath ls(ei); + // make a ConstantInt and create char for the content type due to byte-wise copy + const ConstantInt* offset = ConstantInt::get(context, llvm::APInt(32, ei)); + const SVFValue* svfOffset = LLVMModuleSet::getLLVMModuleSet()->getSVFValue(offset); + if (!pag->getSymbolInfo()->hasValSym(svfOffset)) + { + SymbolTableBuilder builder(pag->getSymbolInfo()); + builder.collectSym(offset); + pag->addValNode(svfOffset, pag->getSymbolInfo()->getValSym(svfOffset)); + } + ls.addOffsetVarAndGepTypePair(getPAG()->getGNode(getPAG()->getValueNode(svfOffset)), nullptr); + fields.push_back(ls); + } + return T; +} /*! * Add the load/store constraints and temp. nodes for the complex constraint * *D = *S (where D/S may point to structs). */ -void SVFIRBuilder::addComplexConsForExt(const SVFValue* D, const SVFValue* S, const SVFValue* szValue) +void SVFIRBuilder::addComplexConsForExt(Value *D, Value *S, const Value* szValue) { assert(D && S); - NodeID vnD= pag->getValueNode(D), vnS= pag->getValueNode(S); + NodeID vnD= getValueNode(D), vnS= getValueNode(S); if(!vnD || !vnS) return; std::vector fields; //Get the max possible size of the copy, unless it was provided. - const SVFType* stype = pag->getTypeLocSetsMap(vnS).first; - const SVFType* dtype = pag->getTypeLocSetsMap(vnD).first; - std::vector srcFields = pag->getTypeLocSetsMap(vnS).second; - std::vector dstFields = pag->getTypeLocSetsMap(vnD).second; - + std::vector srcFields; + std::vector dstFields; + const Type* stype = getBaseTypeAndFlattenedFields(S, srcFields, szValue); + const Type* dtype = getBaseTypeAndFlattenedFields(D, dstFields, szValue); if(srcFields.size() > dstFields.size()) fields = dstFields; else @@ -60,13 +97,8 @@ void SVFIRBuilder::addComplexConsForExt(const SVFValue* D, const SVFValue* S, co /// If sz is 0, we will add edges for all fields. u32_t sz = fields.size(); - if (szValue && SVFUtil::dyn_cast(szValue)) - { - const SVFConstantInt* arg2 = SVFUtil::dyn_cast(szValue); - sz = (fields.size() > static_cast(arg2->getSExtValue())) ? arg2->getSExtValue() : fields.size(); - } - if (fields.size() == 1 && (SVFUtil::isa(D) || SVFUtil::isa(S))) + if (fields.size() == 1 && (LLVMUtil::isConstDataOrAggData(D) || LLVMUtil::isConstDataOrAggData(S))) { NodeID dummy = pag->addDummyValNode(); addLoadEdge(vnD,dummy); @@ -77,9 +109,10 @@ void SVFIRBuilder::addComplexConsForExt(const SVFValue* D, const SVFValue* S, co //For each field (i), add (Ti = *S + i) and (*D + i = Ti). for (u32_t index = 0; index < sz; index++) { - const SVFType* dElementType = pag->getSymbolInfo()->getFlatternedElemType(dtype, + LLVMModuleSet* llvmmodule = LLVMModuleSet::getLLVMModuleSet(); + const SVFType* dElementType = pag->getSymbolInfo()->getFlatternedElemType(llvmmodule->getSVFType(dtype), fields[index].getConstantFieldIdx()); - const SVFType* sElementType = pag->getSymbolInfo()->getFlatternedElemType(stype, + const SVFType* sElementType = pag->getSymbolInfo()->getFlatternedElemType(llvmmodule->getSVFType(stype), fields[index].getConstantFieldIdx()); NodeID dField = getGepValVar(D,fields[index],dElementType); NodeID sField = getGepValVar(S,fields[index],sElementType); @@ -89,427 +122,103 @@ void SVFIRBuilder::addComplexConsForExt(const SVFValue* D, const SVFValue* S, co } } -NodeID SVFIRBuilder::getExtID(ExtAPI::OperationType operationType, const std::string &s, const SVFCallInst* svfCall) +void SVFIRBuilder::handleExtCall(const CallBase* cs, const SVFFunction* svfCallee) { - s32_t nodeIDType = ExtAPI::getExtAPI()->getNodeIDType(s); + const SVFInstruction* svfInst = LLVMModuleSet::getLLVMModuleSet()->getSVFInstruction(cs); + const SVFCallInst* svfCall = SVFUtil::cast(svfInst); - // return value >= 0 is an argument node - if (nodeIDType >= 0) - { - assert(svfCall->arg_size() > (u32_t) nodeIDType && "Argument out of bounds!"); - if (operationType == ExtAPI::OperationType::Memcpy_like || operationType == ExtAPI::OperationType::Memset_like) - return nodeIDType; - else - return pag->getValueNode(svfCall->getArgOperand(nodeIDType)); - } - // return value = -1 is an inst node - else if (nodeIDType == -1) - return pag->getValueNode(svfCall); - // return value = -2 is a Dummy node - else if (nodeIDType == -2) - return pag->addDummyValNode(); - // return value = -3 is an object node - else if (nodeIDType == -3) - { - assert(svfCall->getType()->isPointerTy() && "The operand should be a pointer type!"); - NodeID objId; - // Indirect call - if (getCallee(svfCall) == nullptr) - objId = pag->addDummyObjNode(svfCall->getType()); - else // Direct call - objId = pag->getObjectNode(svfCall); - return objId; - } - // return value = -4 is a nullptr node - else if (nodeIDType == -4) - return pag->getNullPtr(); - // return value = -5 is an offset - else if (nodeIDType == -5) - { - for (char const &c : s) - { - if (std::isdigit(c) == 0) - assert(false && "Invalid offset!"); - } - return atoi(s.c_str()); - } - // return value = -6 is an illegal operand format - else + if (LLVMUtil::isHeapAllocExtCallViaRet(cs) || LLVMUtil::isStaticExtCall(cs)) { - assert(false && "The operand format of function operation is illegal!"); - abort(); + NodeID val = pag->getValueNode(svfInst); + NodeID obj = pag->getObjectNode(svfInst); + addAddrEdge(obj, val); } -} - -void SVFIRBuilder::parseAtomaticOp(SVF::ExtAPI::Operand &atomaticOp, const SVFCallInst* svfCall, std::map &nodeIDMap) -{ - // Skip Rb_tree operation, which is handled in extFuncAtomaticOperation() - if (atomaticOp.getType() == ExtAPI::OperationType::Rb_tree_ops) - return; - // Get src and dst node ID - if (!atomaticOp.getSrcValue().empty()) + // case 2: *arg = new obj + else if (LLVMUtil::isHeapAllocExtCallViaArg(cs)) { - const std::string s = atomaticOp.getSrcValue(); - if (nodeIDMap.find(s) != nodeIDMap.end()) - atomaticOp.setSrcID(nodeIDMap[s]); - else + u32_t arg_pos = getHeapAllocHoldingArgPosition(svfCallee); + const SVFValue* arg = svfCall->getArgOperand(arg_pos); + if (arg->getType()->isPointerTy()) { - NodeID srcId = getExtID(atomaticOp.getType(), atomaticOp.getSrcValue(), svfCall); - atomaticOp.setSrcID(srcId); - nodeIDMap[s] = srcId; + NodeID vnArg = pag->getValueNode(arg); + NodeID dummy = pag->addDummyValNode(); + NodeID obj = pag->addDummyObjNode(arg->getType()); + if (vnArg && dummy && obj) + { + addAddrEdge(obj, dummy); + addStoreEdge(dummy, vnArg); + } } - } - else - assert(false && "The 'src' operand cannot be empty."); - - if (!atomaticOp.getDstValue().empty()) - { - const std::string s = atomaticOp.getDstValue(); - if (nodeIDMap.find(s) != nodeIDMap.end()) - atomaticOp.setDstID(nodeIDMap[s]); else { - NodeID dstId = getExtID(atomaticOp.getType(), atomaticOp.getDstValue(), svfCall); - atomaticOp.setDstID(dstId); - nodeIDMap[s] = dstId; + writeWrnMsg("Arg receiving new object must be pointer type"); } } - else - assert(false && "The 'dst' operand cannot be empty."); - - // Get offset or size - if (!atomaticOp.getOffsetOrSizeStr().empty()) + else if (isMemcpyExtFun(svfCallee)) { - std::string s = atomaticOp.getOffsetOrSizeStr(); - if (nodeIDMap.find(s) != nodeIDMap.end()) - atomaticOp.setOffsetOrSize(nodeIDMap[s]); + if(svfCallee->getName().find("iconv") != std::string::npos) + addComplexConsForExt(cs->getArgOperand(3), cs->getArgOperand(1), nullptr); + else if(svfCallee->getName().find("bcopy") != std::string::npos) + addComplexConsForExt(cs->getArgOperand(1), cs->getArgOperand(0), cs->getArgOperand(2)); + if(svfCall->arg_size() == 3) + addComplexConsForExt(cs->getArgOperand(0), cs->getArgOperand(1), cs->getArgOperand(2)); else - { - NodeID offsetOrSize = getExtID(atomaticOp.getType(), atomaticOp.getOffsetOrSizeStr(), svfCall); - atomaticOp.setOffsetOrSize(offsetOrSize); - nodeIDMap[s] = offsetOrSize; - } - } -} - -void SVFIRBuilder::parseExtFunctionOps(ExtAPI::ExtFunctionOps &extFunctionOps, const SVFCallInst* svfCall) -{ - // CallStmt operation - if (extFunctionOps.getCallStmtNum() != 0) - handleExtCallStat(extFunctionOps, svfCall); - // Record all dummy nodes - std::map nodeIDMap; - for (ExtAPI::ExtOperation& extOperation : extFunctionOps.getOperations()) - { - // CondStmt operation - if(extOperation.isConOp()) - { - for (ExtAPI::Operand &atomaticOp : extOperation.getTrueBranchOperands()) - parseAtomaticOp(atomaticOp, svfCall, nodeIDMap); - for (ExtAPI::Operand &atomaticOp : extOperation.getFalseBranchOperands()) - parseAtomaticOp(atomaticOp, svfCall, nodeIDMap); - } - // General operation, e.g., "AddrStmt", "CopyStmt", .... - else if (!extOperation.isCallOp()) - parseAtomaticOp(extOperation.getBasicOp(), svfCall, nodeIDMap); - } -} - -SVFCallInst* SVFIRBuilder::addSVFExtCallInst(const SVFCallInst* svfInst, SVFBasicBlock* svfBB, const SVFFunction* svfCaller, const SVFFunction* svfCallee) -{ - SVFCallInst* svfCall = new SVFCallInst(svfCallee->getFunctionType(), svfBB, false, false); - svfCall->setName("ext_inst"); - LLVMModuleSet::getLLVMModuleSet()->SVFValue2LLVMValue[svfCall] = nullptr; - svfCall->setCalledOperand(svfCallee); - setCurrentLocation(svfCall, svfBB); - SymbolTableInfo::ValueToIDMapTy::iterator iter = pag->getSymbolInfo()->valSyms().find(svfCall); - if (iter == pag->getSymbolInfo()->valSyms().end()) - { - SymID id = NodeIDAllocator::get()->allocateValueId(); - pag->getSymbolInfo()->valSyms().insert(std::make_pair(svfCall, id)); - DBOUT(DMemModel, outs() << "create a new value sym " << id << "\n"); - pag->addValNode(svfCall, id); - } - svfCall->setName(svfCall->getName() + "_" + std::to_string(pag->getValueNode(svfCall))); - - for(u32_t i = 0; i < svfCallee->arg_size(); i++) - { - SVFInstruction* svfArg = addSVFExtInst("ext_inst", svfInst, svfBB, ExtAPI::OperationType::Other, svfCallee->getArg(i)->getType()); - svfArg->setName(svfArg->getName() + "_" + std::to_string(pag->getValueNode(svfArg))); - svfCall->addArgument(svfArg); + addComplexConsForExt(cs->getArgOperand(0), cs->getArgOperand(1), nullptr); + if(SVFUtil::isa(cs->getType())) + addCopyEdge(getValueNode(cs->getArgOperand(0)), getValueNode(cs)); } - - svfBB->addInstruction(svfCall); - - CallICFGNode* callBlockNode = pag->getICFG()->getCallICFGNode(svfCall); - pag->addCallSite(callBlockNode); - - if (!svfCallee->isNotRetFunction() && !isExtCall(svfCallee)) - { - NodeID srcret = getReturnNode(svfCallee); - NodeID dstrec = pag->getValueNode(svfCall); - CallICFGNode* callICFGNode = pag->getICFG()->getCallICFGNode(svfCall); - FunExitICFGNode* exitICFGNode = pag->getICFG()->getFunExitICFGNode(svfCallee); - RetICFGNode* retBlockNode = pag->getICFG()->getRetICFGNode(svfCall); - addRetEdge(srcret, dstrec,callICFGNode, exitICFGNode); - pag->addCallSiteRets(retBlockNode,pag->getGNode(pag->getValueNode(svfCall))); - } - - return svfCall; -} - -void SVFIRBuilder::addSVFExtRetInst(SVFCallInst* svfCall, SVFBasicBlock* svfBB, SVFFunction* svfCaller) -{ - SVFInstruction* retInst = addSVFExtInst("ext_inst", svfCall, svfBB, ExtAPI::OperationType::Return, nullptr); - retInst->setName(retInst->getName() + "_" + std::to_string(pag->getValueNode(retInst))); - setCurrentLocation(retInst, svfBB); - - NodeID rnF = getReturnNode(svfCaller); - NodeID vnS = pag->getValueNode(svfCall); - const ICFGNode* icfgNode = pag->getICFG()->getICFGNode(retInst); - //vnS may be null if src is a null ptr - addPhiStmt(rnF,vnS,icfgNode); -} - -SVFInstruction* SVFIRBuilder::addSVFExtInst(const std::string& instName, const SVFCallInst* svfInst, SVFBasicBlock* svfBB, SVF::ExtAPI::OperationType opType, const SVFType* svfType) -{ - // Get new SVFInstruction type; - const SVFType* ptType = nullptr; - if (svfType != nullptr) - ptType = svfType; - else + else if(isMemsetExtFun(svfCallee)) { - if (opType == ExtAPI::OperationType::Addr - || opType == ExtAPI::OperationType::Copy - || opType == ExtAPI::OperationType::Load - || opType == ExtAPI::OperationType::Gep) + // this is for memset(void *str, int c, size_t n) + // which copies the character c (an unsigned char) to the first n characters of the string pointed to, by the argument str + std::vector dstFields; + const Type *dtype = getBaseTypeAndFlattenedFields(cs->getArgOperand(0), dstFields, cs->getArgOperand(2)); + u32_t sz = dstFields.size(); + //For each field (i), add store edge *(arg0 + i) = arg1 + for (u32_t index = 0; index < sz; index++) { - for (u32_t i = 0; i < svfInst->arg_size(); ++i) - if (svfInst->getArgOperand(i)->getType()->isPointerTy()) - { - ptType = svfInst->getArgOperand(i)->getType(); - break; - } + LLVMModuleSet* llvmmodule = LLVMModuleSet::getLLVMModuleSet(); + const SVFType* dElementType = pag->getSymbolInfo()->getFlatternedElemType(llvmmodule->getSVFType(dtype), dstFields[index].getConstantFieldIdx()); + NodeID dField = getGepValVar(cs->getArgOperand(0), dstFields[index], dElementType); + addStoreEdge(getValueNode(cs->getArgOperand(1)),dField); } - else - ptType = svfInst->getParent()->getType(); + if(SVFUtil::isa(cs->getType())) + addCopyEdge(getValueNode(cs->getArgOperand(0)), getValueNode(cs)); } - - assert(ptType != nullptr && "At least one argument of an external call is of pointer type!"); - SVFInstruction* inst = new SVFInstruction(ptType, svfBB, false, false); - inst->setName(instName); - LLVMModuleSet::getLLVMModuleSet()->SVFValue2LLVMValue[inst] = nullptr; - svfBB->addInstruction(inst); - SymbolTableInfo::ValueToIDMapTy::iterator iter = pag->getSymbolInfo()->valSyms().find(inst); - if (iter == pag->getSymbolInfo()->valSyms().end()) + else if (svfCallee->getName().find("_ZNSt5arrayIPK1ALm2EE4backEv") != std::string::npos) { - SymID id = NodeIDAllocator::get()->allocateValueId(); - pag->getSymbolInfo()->valSyms().insert(std::make_pair(inst, id)); - DBOUT(DMemModel, outs() << "create a new value sym " << id << "\n"); - pag->addValNode(inst, id); - } - inst->setName(inst->getName() + "_" + std::to_string(pag->getValueNode(inst))); - return inst; -} - -SVFBasicBlock* SVFIRBuilder::extFuncInitialization(const SVFCallInst* svfInst, SVFFunction* svfCaller) -{ - // Initialization, linking actual parameters with formal parameters, - // adding basic blocks for external functions, - // and creating return edges (if the external function has a return value) - CallICFGNode* callSiteICFGNode = pag->getICFG()->getCallICFGNode(svfInst); - FunEntryICFGNode* funEntryICFGNode = pag->getICFG()->getFunEntryICFGNode(svfCaller); - FunExitICFGNode* funExitICFGNode = pag->getICFG()->getFunExitICFGNode(svfCaller); - for(u32_t i = 0; i < svfCaller->arg_size(); i++) - { - const SVFValue *AA = svfInst->getArgOperand(i); - const SVFValue *FA = svfCaller->getArg(i); - NodeID srcAA = pag->getValueNode(AA); - NodeID dstFA = pag->getValueNode(FA); - addCallEdge(srcAA, dstFA, callSiteICFGNode, funEntryICFGNode); - pag->addFunArgs(svfCaller,pag->getGNode(dstFA)); + NodeID dummy = pag->addDummyValNode(); + AccessPath ap1(0); + addNormalGepEdge(getValueNode(cs->getArgOperand(0)), dummy, ap1); + AccessPath ap2(0); + addNormalGepEdge(dummy, getValueNode(cs), ap2); } - - SVFBasicBlock* svfBB = new SVFBasicBlock(svfInst->getParent()->getType(), svfCaller); - svfBB->setName("ext_bb"); - LLVMModuleSet::getLLVMModuleSet()->SVFValue2LLVMValue[svfBB] = nullptr; - - if (!svfCaller->isNotRetFunction()) + else if(svfCallee->getName().compare("dlsym") == 0) { - NodeID srcret = getReturnNode(svfCaller); - NodeID dstrec = pag->getValueNode(svfInst); - addRetEdge(srcret, dstrec,callSiteICFGNode, funExitICFGNode); - pag->addFunRet(svfCaller,pag->getGNode(srcret)); - } - return svfBB; -} + const Value* src = cs->getArgOperand(1); + if(const GetElementPtrInst* gep = SVFUtil::dyn_cast(src)) + src = stripConstantCasts(gep->getPointerOperand()); -void SVFIRBuilder::handleExtCallStat(ExtAPI::ExtFunctionOps &extFunctionOps, const SVFCallInst* svfInst) -{ - SVFFunction* svfCaller = const_cast(svfModule->getSVFFunction(svfInst->getCalledFunction()->getName())); - SVFBasicBlock* svfBB = extFuncInitialization(svfInst, svfCaller); - // Map an operand to its new created SVFInstruction - std::map operandToSVFValueMap; - for (ExtAPI::ExtOperation& extOperation : extFunctionOps.getOperations()) - { - if (extOperation.isCallOp()) + auto getHookFn = [](const Value* src)->const Function* { - // To create a CallInst for the callee - const SVFFunction* svfCallee = svfModule->getSVFFunction(extOperation.getCalleeName()); - SVFCallInst* svfCall = addSVFExtCallInst(svfInst, svfBB, svfCaller, svfCallee); - setCurrentLocation(svfCall, getCurrentBB()); - operandToSVFValueMap[svfCallee->getName()] = svfCall; - CallICFGNode* callBlockNode = pag->getICFG()->getCallICFGNode(svfCall); + if (!SVFUtil::isa(src)) + return nullptr; - assert(extOperation.getCalleeOperands().size() >= svfCallee->arg_size() - && "Number of arguments set in CallStmt in ExtAPI.json is inconsistent with the number of arguments required by the Callee?"); - // To parse the operations contained in ‘CallStmt’, obtain the NodeID, and add the callEdge - for (ExtAPI::Operand &operand : extOperation.getCalleeOperands()) - { - std::string src = operand.getSrcValue(); - std::string dst = operand.getDstValue(); - // ReturnStmt - if (operand.getType() == ExtAPI::OperationType::Return && !svfCaller->isNotRetFunction()) - { - addSVFExtRetInst(svfCall, svfBB, svfCaller); - continue; - } + auto *glob = SVFUtil::cast(src); + if (!glob->hasInitializer() || !SVFUtil::isa(glob->getInitializer())) + return nullptr; - auto getCallStmtOperands = [](const std::string& str) -> std::pair - { - size_t pos = str.find('_'); - assert(pos != std::string::npos && "The operand format in CallStmt is incorrect! It should be either 'funName_Argi' or 'funName_Ret'!"); - return std::make_pair(str.substr(0, pos), str.substr(pos + 1)); - }; - // 'src' operand - if (src.find('_') != std::string::npos) - { - std::pair srcRet = getCallStmtOperands(src); - s32_t argPos = ExtAPI::getExtAPI()->getNodeIDType(srcRet.second); - // operand like "caller_Argi" - if (svfCaller->getName() == srcRet.first) - { - assert(argPos >= 0 && static_cast(argPos) < svfCaller->arg_size() && "The argument index is out of bounds in CallStmt?"); - operand.setSrcID(pag->getValueNode(svfCaller->getArg(argPos))); - } - // operand like "callee_Ret" - else - { - assert(argPos == -1 && "The operand format in CallStmt is incorrect! It should be either 'funName_Argi' or 'funName_Ret'!"); - assert(operandToSVFValueMap.find(srcRet.first) != operandToSVFValueMap.end() && "No created SVFCallInst in external functions?"); - operand.setSrcID(pag->getValueNode(operandToSVFValueMap[srcRet.first])); - } - } - // operand like self-defined "x", which should be created beforehand - else - { - assert(operandToSVFValueMap.find(src) != operandToSVFValueMap.end() - && "Cannot find manual create ext inst, incorrect invocation order for external functions?"); - operand.setSrcID(pag->getValueNode(operandToSVFValueMap[src])); - } - // 'dst' operand - if (dst.find('_') != std::string::npos) - { - // operand like "callee_Argi" - std::pair dstRet = getCallStmtOperands(dst); - assert(svfCallee->getName() == dstRet.first && "The operand format of 'dst' in external CallStmt is illegal!"); - s32_t argPos = ExtAPI::getExtAPI()->getNodeIDType(dstRet.second); - assert(argPos >= 0 && static_cast(argPos) < svfCallee->arg_size() && "The argument index is out of bounds of callee in CallStmt?"); - // Create an new SVFInstruction for "callee_Argi". - if(operandToSVFValueMap.find(dst) == operandToSVFValueMap.end()) - { - SVFInstruction* inst = addSVFExtInst("ext_inst", svfInst, svfBB, operand.getType(), nullptr); - operand.setDstID(pag->getValueNode(inst)); - operandToSVFValueMap[dst] = inst; - pag->addCallSiteArgs(callBlockNode,pag->getGNode(pag->getValueNode(inst))); - } - CallICFGNode* icfgNode = pag->getICFG()->getCallICFGNode(svfCall); - FunEntryICFGNode* entry = pag->getICFG()->getFunEntryICFGNode(svfCallee); - addCallEdge(operand.getDstID(), pag->getValueNode(svfCallee->getArg(argPos)), icfgNode, entry); - } - else - { - // operand like self-defined "x", if there are no SVFInstructions for 'x', create an new SVFInstruction. - SVFInstruction* inst = addSVFExtInst(dst, svfInst, svfBB, operand.getType(), nullptr); - operand.setDstID(pag->getValueNode(inst)); - operandToSVFValueMap[dst] = inst; - } - } - } - } - svfCaller->addBasicBlock(svfBB); -} + auto *constarray = SVFUtil::cast(glob->getInitializer()); + return LLVMUtil::getProgFunction(constarray->getAsCString().str()); + }; -void SVFIRBuilder::extFuncAtomaticOperation(ExtAPI::Operand& atomicOp, const SVFCallInst* svfCall) -{ - if (atomicOp.getType() == ExtAPI::OperationType::Addr) - { - if (!atomicOp.getSrcValue().empty() && !atomicOp.getDstValue().empty()) - addAddrEdge(atomicOp.getSrcID(), atomicOp.getDstID()); - else - writeWrnMsg("We need two valid NodeIDs to add an Addr edge"); - } - else if (atomicOp.getType() == ExtAPI::OperationType::Copy) - { - if (!atomicOp.getSrcValue().empty() && !atomicOp.getDstValue().empty()) - addCopyEdge(atomicOp.getSrcID(), atomicOp.getDstID()); - else - writeWrnMsg("We need two valid NodeIDs to add a Copy edge"); - } - else if (atomicOp.getType() == ExtAPI::OperationType::Load) - { - if (!atomicOp.getSrcValue().empty() && !atomicOp.getDstValue().empty()) - addLoadEdge(atomicOp.getSrcID(), atomicOp.getDstID()); - else - writeWrnMsg("We need two valid NodeIDs to add a Load edge"); - } - else if (atomicOp.getType() == ExtAPI::OperationType::Store) - { - if (!atomicOp.getSrcValue().empty() && !atomicOp.getDstValue().empty()) - addStoreEdge(atomicOp.getSrcID(), atomicOp.getDstID()); - else - writeWrnMsg("We need two valid NodeIDs to add a Store edge"); - } - else if (atomicOp.getType() == ExtAPI::OperationType::Gep) - { - if (!atomicOp.getSrcValue().empty() && !atomicOp.getDstValue().empty() && !atomicOp.getOffsetOrSizeStr().empty()) + if (const Function *fn = getHookFn(src)) { - AccessPath ap(atomicOp.getOffsetOrSize()); - addNormalGepEdge(atomicOp.getSrcID(), atomicOp.getDstID(), ap); + NodeID srcNode = getValueNode(fn); + addCopyEdge(srcNode, getValueNode(cs)); } - else - writeWrnMsg("We need two valid NodeIDs and an offset to add a Gep edge"); } - else if (atomicOp.getType() == ExtAPI::OperationType::Return) - return; - else if (atomicOp.getType() == ExtAPI::OperationType::Memset_like) - { - // this is for memset(void *str, int c, size_t n) - // which copies the character c (an unsigned char) to the first n characters of the string pointed to, by the argument str - // const SVFConstantInt* arg2 = SVFUtil::dyn_cast(svfCall->getArgOperand(op.getOperands()[2])); - NodeID argId = pag->getValueNode(svfCall->getArgOperand(0)); - std::vector dstFields = pag->getTypeLocSetsMap(argId).second; - u32_t sz = dstFields.size(); - if (const SVFConstantInt* arg2 = SVFUtil::dyn_cast(svfCall->getArgOperand(2))) - sz = (dstFields.size() > static_cast(arg2->getSExtValue())) ? arg2->getSExtValue() : dstFields.size(); - //For each field (i), add store edge *(arg0 + i) = arg1 - for (u32_t index = 0; index < sz; index++) - { - const SVFType* dElementType = pag->getSymbolInfo()->getFlatternedElemType(pag->getTypeLocSetsMap(argId).first, dstFields[index].getConstantFieldIdx()); - NodeID dField = getGepValVar(svfCall->getArgOperand(0), dstFields[index], dElementType); - addStoreEdge(pag->getValueNode(svfCall->getArgOperand(1)),dField); - } - if(svfCall->getType()->isPointerTy()) - addCopyEdge(pag->getValueNode(svfCall->getArgOperand(0)), pag->getValueNode(svfCall)); - } - else if (atomicOp.getType() == ExtAPI::OperationType::Memcpy_like) - { - if(svfCall->arg_size() == 3) - addComplexConsForExt(svfCall->getArgOperand(0), svfCall->getArgOperand(1), svfCall->getArgOperand(2)); - else - addComplexConsForExt(svfCall->getArgOperand(0), svfCall->getArgOperand(1), nullptr); - } - else if (atomicOp.getType() == ExtAPI::OperationType::Rb_tree_ops) + else if(svfCallee->getName().find("_ZSt29_Rb_tree_insert_and_rebalancebPSt18_Rb_tree_node_baseS0_RS_") != std::string::npos) { assert(svfCall->arg_size() == 4 && "_Rb_tree_insert_and_rebalance should have 4 arguments.\n"); @@ -529,155 +238,71 @@ void SVFIRBuilder::extFuncAtomaticOperation(ExtAPI::Operand& atomicOp, const SVF break; const SVFType* elementType = pag->getSymbolInfo()->getFlatternedElemType(pag->getTypeLocSetsMap(vnArg3).first, fields[i].getConstantFieldIdx()); - NodeID vnD = getGepValVar(svfCall->getArgOperand(3), fields[i], elementType); + NodeID vnD = getGepValVar(cs->getArgOperand(3), fields[i], elementType); NodeID vnS = pag->getValueNode(svfCall->getArgOperand(1)); if(vnD && vnS) addStoreEdge(vnS,vnD); } } - // default - // illegal function operation of external function - else - { - assert(false && "new type of SVFStmt for external calls?"); - } -} - -/*! - * Handle external calls - */ -void SVFIRBuilder::handleExtCall(const SVFInstruction* svfInst, const SVFFunction* svfCallee) -{ - const SVFCallInst* svfCall = SVFUtil::cast(svfInst); - if (isHeapAllocOrStaticExtCall(svfInst)) + if (isThreadForkCall(svfInst)) { - // case 1: ret = new obj - if (isHeapAllocExtCallViaRet(svfInst) || isStaticExtCall(svfInst)) - { - NodeID val = pag->getValueNode(svfInst); - NodeID obj = pag->getObjectNode(svfInst); - addAddrEdge(obj, val); - } - // case 2: *arg = new obj - else + if (const SVFFunction* forkedFun = SVFUtil::dyn_cast(getForkedFun(svfInst))) { - assert(isHeapAllocExtCallViaArg(svfInst) && "Must be heap alloc call via arg."); - u32_t arg_pos = getHeapAllocHoldingArgPosition(svfCallee); - const SVFValue* arg = svfCall->getArgOperand(arg_pos); - if (arg->getType()->isPointerTy()) + forkedFun = forkedFun->getDefFunForMultipleModule(); + const SVFValue* actualParm = getActualParmAtForkSite(svfInst); + /// pthread_create has 1 arg. + /// apr_thread_create has 2 arg. + assert((forkedFun->arg_size() <= 2) && "Size of formal parameter of start routine should be one"); + if (forkedFun->arg_size() <= 2 && forkedFun->arg_size() >= 1) { - NodeID vnArg = pag->getValueNode(arg); - NodeID dummy = pag->addDummyValNode(); - NodeID obj = pag->addDummyObjNode(arg->getType()); - if (vnArg && dummy && obj) + const SVFArgument* formalParm = forkedFun->getArg(0); + /// Connect actual parameter to formal parameter of the start routine + if (actualParm->getType()->isPointerTy() && formalParm->getType()->isPointerTy()) { - addAddrEdge(obj, dummy); - addStoreEdge(dummy, vnArg); + CallICFGNode *icfgNode = pag->getICFG()->getCallICFGNode(svfInst); + FunEntryICFGNode *entry = pag->getICFG()->getFunEntryICFGNode(forkedFun); + addThreadForkEdge(pag->getValueNode(actualParm), pag->getValueNode(formalParm), icfgNode, entry); } } - else - { - writeWrnMsg("Arg receiving new object must be pointer type"); - } } - } - else - { - if (isExtCall(svfCallee)) + else { - ExtAPI::ExtFunctionOps extFunctionOps = ExtAPI::getExtAPI()->getExtFunctionOps(svfCallee); - if (extFunctionOps.getOperations().size() == 0) - { - std::string str; - std::stringstream rawstr(str); - rawstr << "function " << svfCallee->getName() << " not in the external function summary ExtAPI.json file"; - writeWrnMsg(rawstr.str()); - } - else - { - parseExtFunctionOps(extFunctionOps, svfCall); - for (ExtAPI::ExtOperation op : extFunctionOps.getOperations()) - { - if (op.isCallOp()) - for (ExtAPI::Operand atomicOp : op.getCalleeOperands()) - extFuncAtomaticOperation(atomicOp, svfCall); - else if(op.isConOp()) - { - for (ExtAPI::Operand atomicOp : op.getTrueBranchOperands()) - extFuncAtomaticOperation(atomicOp, svfCall); - for (ExtAPI::Operand atomicOp : op.getFalseBranchOperands()) - extFuncAtomaticOperation(atomicOp, svfCall); - } - else - { - ExtAPI::Operand atomicOp = op.getBasicOp(); - extFuncAtomaticOperation(atomicOp, svfCall); - } - } - } + /// handle indirect calls at pthread create APIs e.g., pthread_create(&t1, nullptr, fp, ...); + /// const Value* fun = ThreadAPI::getThreadAPI()->getForkedFun(inst); + /// if(!SVFUtil::isa(fun)) + /// pag->addIndirectCallsites(cs,pag->getValueNode(fun)); } + /// If forkedFun does not pass to spawnee as function type but as void pointer + /// remember to update inter-procedural callgraph/SVFIR/SVFG etc. when indirect call targets are resolved + /// We don't connect the callgraph here, further investigation is need to hanle mod-ref during SVFG construction. + } - /// create inter-procedural SVFIR edges for thread forks - if (isThreadForkCall(svfInst)) + /// create inter-procedural SVFIR edges for hare_parallel_for calls + else if (isHareParForCall(svfInst)) + { + if (const SVFFunction* taskFunc = SVFUtil::dyn_cast(getTaskFuncAtHareParForSite(svfInst))) { - if (const SVFFunction* forkedFun = SVFUtil::dyn_cast(getForkedFun(svfInst))) - { - forkedFun = forkedFun->getDefFunForMultipleModule(); - const SVFValue* actualParm = getActualParmAtForkSite(svfInst); - /// pthread_create has 1 arg. - /// apr_thread_create has 2 arg. - assert((forkedFun->arg_size() <= 2) && "Size of formal parameter of start routine should be one"); - if (forkedFun->arg_size() <= 2 && forkedFun->arg_size() >= 1) - { - const SVFArgument* formalParm = forkedFun->getArg(0); - /// Connect actual parameter to formal parameter of the start routine - if (actualParm->getType()->isPointerTy() && formalParm->getType()->isPointerTy()) - { - CallICFGNode *icfgNode = pag->getICFG()->getCallICFGNode(svfInst); - FunEntryICFGNode *entry = pag->getICFG()->getFunEntryICFGNode(forkedFun); - addThreadForkEdge(pag->getValueNode(actualParm), pag->getValueNode(formalParm), icfgNode, entry); - } - } - } - else + /// The task function of hare_parallel_for has 3 args. + assert((taskFunc->arg_size() == 3) && "Size of formal parameter of hare_parallel_for's task routine should be 3"); + const SVFValue* actualParm = getTaskDataAtHareParForSite(svfInst); + const SVFArgument* formalParm = taskFunc->getArg(0); + /// Connect actual parameter to formal parameter of the start routine + if (actualParm->getType()->isPointerTy() && formalParm->getType()->isPointerTy()) { - /// handle indirect calls at pthread create APIs e.g., pthread_create(&t1, nullptr, fp, ...); - /// const Value* fun = ThreadAPI::getThreadAPI()->getForkedFun(inst); - /// if(!SVFUtil::isa(fun)) - /// pag->addIndirectCallsites(cs,pag->getValueNode(fun)); + CallICFGNode *icfgNode = pag->getICFG()->getCallICFGNode(svfInst); + FunEntryICFGNode *entry = pag->getICFG()->getFunEntryICFGNode(taskFunc); + addThreadForkEdge(pag->getValueNode(actualParm), pag->getValueNode(formalParm), icfgNode, entry); } - /// If forkedFun does not pass to spawnee as function type but as void pointer - /// remember to update inter-procedural callgraph/SVFIR/SVFG etc. when indirect call targets are resolved - /// We don't connect the callgraph here, further investigation is need to hanle mod-ref during SVFG construction. } - - /// create inter-procedural SVFIR edges for hare_parallel_for calls - else if (isHareParForCall(svfInst)) + else { - if (const SVFFunction* taskFunc = SVFUtil::dyn_cast(getTaskFuncAtHareParForSite(svfInst))) - { - /// The task function of hare_parallel_for has 3 args. - assert((taskFunc->arg_size() == 3) && "Size of formal parameter of hare_parallel_for's task routine should be 3"); - const SVFValue* actualParm = getTaskDataAtHareParForSite(svfInst); - const SVFArgument* formalParm = taskFunc->getArg(0); - /// Connect actual parameter to formal parameter of the start routine - if (actualParm->getType()->isPointerTy() && formalParm->getType()->isPointerTy()) - { - CallICFGNode *icfgNode = pag->getICFG()->getCallICFGNode(svfInst); - FunEntryICFGNode *entry = pag->getICFG()->getFunEntryICFGNode(taskFunc); - addThreadForkEdge(pag->getValueNode(actualParm), pag->getValueNode(formalParm), icfgNode, entry); - } - } - else - { - /// handle indirect calls at hare_parallel_for (e.g., hare_parallel_for(..., fp, ...); - /// const Value* fun = ThreadAPI::getThreadAPI()->getForkedFun(inst); - /// if(!SVFUtil::isa(fun)) - /// pag->addIndirectCallsites(cs,pag->getValueNode(fun)); - } + /// handle indirect calls at hare_parallel_for (e.g., hare_parallel_for(..., fp, ...); + /// const Value* fun = ThreadAPI::getThreadAPI()->getForkedFun(inst); + /// if(!SVFUtil::isa(fun)) + /// pag->addIndirectCallsites(cs,pag->getValueNode(fun)); } - - /// TODO: inter-procedural SVFIR edges for thread joins } + + /// TODO: inter-procedural SVFIR edges for thread joins } \ No newline at end of file diff --git a/svf-llvm/lib/SymbolTableBuilder.cpp b/svf-llvm/lib/SymbolTableBuilder.cpp index 011bc0a51..6ef9adb65 100644 --- a/svf-llvm/lib/SymbolTableBuilder.cpp +++ b/svf-llvm/lib/SymbolTableBuilder.cpp @@ -742,18 +742,14 @@ void SymbolTableBuilder::initTypeInfo(ObjTypeInfo* typeinfo, const Value* val, objSize = getObjSize(objTy); } else if (SVFUtil::isa(val) && - isHeapAllocExtCall( - LLVMModuleSet::getLLVMModuleSet()->getSVFInstruction( - SVFUtil::cast(val)))) + isHeapAllocExtCall(SVFUtil::cast(val))) { analyzeHeapObjType(typeinfo,val); // Heap object, label its field as infinite here objSize = typeinfo->getMaxFieldOffsetLimit(); } else if (SVFUtil::isa(val) && - isStaticExtCall( - LLVMModuleSet::getLLVMModuleSet()->getSVFInstruction( - SVFUtil::cast(val)))) + isStaticExtCall(SVFUtil::cast(val))) { analyzeStaticObjType(typeinfo,val); // static object allocated before main, label its field as infinite here diff --git a/svf/include/SVFIR/SVFModule.h b/svf/include/SVFIR/SVFModule.h index 4970f6bce..60827032f 100644 --- a/svf/include/SVFIR/SVFModule.h +++ b/svf/include/SVFIR/SVFModule.h @@ -31,7 +31,6 @@ #define INCLUDE_SVFMODULE_H_ #include "SVFIR/SVFValue.h" -#include "Util/ExtAPI.h" #include "Util/NodeIDAllocator.h" #include "Util/ThreadAPI.h" diff --git a/svf/include/Util/ExtAPI.h b/svf/include/Util/ExtAPI.h deleted file mode 100644 index 08a2a0f97..000000000 --- a/svf/include/Util/ExtAPI.h +++ /dev/null @@ -1,537 +0,0 @@ -//===- ExtAPI.h -- External functions -----------------------------------------// -// -// SVF: Static Value-Flow Analysis -// -// Copyright (C) <2013-2017> -// - -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Affero General Public License for more details. - -// You should have received a copy of the GNU Affero General Public License -// along with this program. If not, see . -// -//===----------------------------------------------------------------------===// - -/* - * ExtAPI.h - * - * Created on: July 1, 2022 - * Author: Shuangxiang Kan - */ - -#ifndef __ExtAPI_H -#define __ExtAPI_H - -#include "SVFIR/SVFValue.h" -#include -#include -#include -#include - -#define EXTAPI_JSON_PATH "svf/include/Util/ExtAPI.json" -#define JSON_OPT_OVERWRITE "overwrite_app_function" -#define JSON_OPT_FUNCTIONTYPE "type" - -namespace SVF -{ - -/* - -** Specifications in ExtAPI.json - -**** Overview of the Specification Language -The specification language of external functions is based on the JSON format. And every function defined by the Specification Language is an object that represents the specification rules. These Specification Language objects for functions contain four parts: -1. the signature of the function, (Mandatory) -2. the type of the function, (Mandatory) -3. the switch that controls whether the specification rules defined in the ExtAPI.json overwrite the functions defined in the user code, (Mandatory) -4. the side-effect of the function. (Optional) - -*** [1] the signature of the function (Mandatory) -"return": return value type (Only care about whether the return value is a pointer during analysis) -"argument": argument types (Only care about the number of arguments during analysis) - - -*** [2] the type of the function (Mandatory) -Function type represents the properties of the function. -For example, -"EFT_ALLOC" represents if this external function allocates a new object and assigns it to one of its arguments, -For the selection of function type and a more detailed explanation, please refer to the definition of enum *extType* in ExtAPI.h. - - -*** [3] the switch that controls whether the specification rules defined in the ExtAPI.json overwrite the functions defined in the user code (Mandatory) -The switch *overwrite_app_function* controls whether the specification rules defined in the ExtAPI.json overwrite the functions defined in the user code (e.g., CPP files). When the switch *overwrite_app_function* is set to a value of 1, SVF will use the specification rules in ExtAPI.json to conduct the analysis and ignore the user-defined functions in the input CPP/bc files. -overwrite_app_function = 0: Analyze the user-defined functions. -overwrite_app_function = 1: Use specifications in ExtAPI.json to overwrite the user-defined functions. - -For example, The following is the code to be analyzed, which has a foo() function, --------------------------------------------------------- -char* foo(char* arg) -{ - return arg; -} - -int main() -{ - char* ret = foo("abc"); - return 0; -} --------------------------------------------------------- -function foo() has a definition, but you want SVF not to use this definition when analyzing, and you think foo () should do nothing, Then you can add a new entry in ExtAPI.json, and set *"overwrite_app_function": 1* - "foo": { - "return": "char*", - "arguments": "(char*)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - } -When SVF is analyzing foo(), SVF will use the entry you defined in ExtAPI.json, and ignore the actual definition of foo() in the program. - -Most of the time, overwrite_app_function is 0, unless you want to redefine a function. - - -*** [4] the side-effect of the function (Optional, if there is no side-effect of that function) -Function side-effect indicate the relationships between input and output, -mainly between function parameters or between parameters and return values after the execution. -For example, -"CopyStmt": ["Arg2", "Ret"] indicates that after this external function is executed, the value of the 2nd parameter is copied into the return value. - -For operators of function operation, there are the following options: -"AddrStmt", -"CopyStmt", -"LoadStmt" -"StoreStmt", -"GepStmt", -"BinaryOPStmt", -"UnaryOPStmt", -"CmpStmt", -"memset_like": the function has similar side-effect to function "void *memset(void *str, int c, size_t n)", -"memcpy_like": the function has similar side-effect to function "void *memcpy(void *dest, const void * src, size_t n)", -"funptr_ops": the function has similar side-effect to function "void *dlsym(void *handle, const char *symbol)", -"Rb_tree_ops: the function has similar side-effect to function "_ZSt29_Rb_tree_insert_and_rebalancebPSt18_Rb_tree_node_baseS0_RS_". - -For operands of function operation,, there are the following options: -"Arg": represents a parameter, -"Obj": represents a object, -"Ret": represents a return value, -"Dummy": represents a dummy node. - -*/ - -class ExtAPI -{ -public: - - // External Function types - // Assume a call in the form LHS= F(arg0, arg1, arg2, arg3). - enum extType - { - EFT_NOOP = 0, // no effect on pointers - EFT_ALLOC, // returns a ptr to a newly allocated object - EFT_REALLOC, // like L_A0 if arg0 is a non-null ptr, else ALLOC - EFT_FREE, // free memory arg0 and all pointers passing into free function - EFT_FREE_MULTILEVEL, // any argument with 2-level pointer passing too a free wrapper function e.g., XFree(void**) which frees memory for void* and void** - EFT_NOSTRUCT_ALLOC, // like ALLOC but only allocates non-struct data - EFT_STAT, // retval points to an unknown static var X - EFT_STAT2, // ret -> X -> Y (X, Y - external static vars) - EFT_L_A0, // copies arg0, arg1, or arg2 into LHS - EFT_L_A1, - EFT_L_A2, - EFT_L_A8, - EFT_L_A0__A0R_A1, // stores arg1 into *arg0 and returns arg0 (currently only for memset) - EFT_L_A0__A0R_A1R, // copies the data that arg1 points to into the location - EFT_L_A1__FunPtr, // obtain the address of a symbol based on the arg1 (char*) and parse a function to LHS (e.g., void *dlsym(void *handle, char *funname);) - // arg0 points to; note that several fields may be - // copied at once if both point to structs. - // Returns arg0. - EFT_A1R_A0R, // copies *arg0 into *arg1, with non-ptr return - EFT_A3R_A1R_NS, // copies *arg1 into *arg3 (non-struct copy only) - EFT_A1R_A0, // stores arg0 into *arg1 - EFT_A2R_A1, // stores arg1 into *arg2 - EFT_A4R_A1, // stores arg1 into *arg4 - EFT_L_A0__A2R_A0, // stores arg0 into *arg2 and returns it - EFT_L_A0__A1_A0, // store arg1 into arg0's base and returns arg0 - EFT_A0R_NEW, // stores a pointer to an allocated object in *arg0 - EFT_A1R_NEW, // as above, into *arg1, etc. - EFT_A2R_NEW, - EFT_A4R_NEW, - EFT_A11R_NEW, - EFT_STD_RB_TREE_INSERT_AND_REBALANCE, // Some complex effects - EFT_STD_RB_TREE_INCREMENT, // Some complex effects - EFT_STD_LIST_HOOK, // Some complex effects - - CPP_EFT_A0R_A1, // stores arg1 into *arg0 - CPP_EFT_A0R_A1R, // copies *arg1 into *arg0 - CPP_EFT_A1R, // load arg1 - EFT_CXA_BEGIN_CATCH, //__cxa_begin_catch - CPP_EFT_DYNAMIC_CAST, // dynamic_cast - EFT_NULL // not found in the list - }; - -private: - - std::map type_pair = - { - {"EFT_NOOP", EFT_NOOP}, - {"EFT_ALLOC", EFT_ALLOC}, - {"EFT_REALLOC", EFT_REALLOC}, - {"EFT_FREE", EFT_FREE}, - {"EFT_FREE_MULTILEVEL", EFT_FREE_MULTILEVEL}, - {"EFT_NOSTRUCT_ALLOC", EFT_NOSTRUCT_ALLOC}, - {"EFT_STAT", EFT_STAT}, - {"EFT_STAT2", EFT_STAT2}, - {"EFT_L_A0", EFT_L_A0}, - {"EFT_L_A1", EFT_L_A1}, - {"EFT_L_A2", EFT_L_A2}, - {"EFT_L_A8", EFT_L_A8}, - {"EFT_L_A0__A0R_A1", EFT_L_A0__A0R_A1}, - {"EFT_L_A0__A0R_A1R", EFT_L_A0__A0R_A1R}, - {"EFT_L_A1__FunPtr", EFT_L_A1__FunPtr}, - {"EFT_A1R_A0R", EFT_A1R_A0R}, - {"EFT_A3R_A1R_NS", EFT_A3R_A1R_NS}, - {"EFT_A1R_A0", EFT_A1R_A0}, - {"EFT_A2R_A1", EFT_A2R_A1}, - {"EFT_A4R_A1", EFT_A4R_A1}, - {"EFT_L_A0__A2R_A0", EFT_L_A0__A2R_A0}, - {"EFT_L_A0__A1_A0", EFT_L_A0__A1_A0}, - {"EFT_A0R_NEW", EFT_A0R_NEW}, - {"EFT_A1R_NEW", EFT_A1R_NEW}, - {"EFT_A2R_NEW", EFT_A2R_NEW}, - {"EFT_A4R_NEW", EFT_A4R_NEW}, - {"EFT_A11R_NEW", EFT_A11R_NEW}, - {"EFT_STD_RB_TREE_INSERT_AND_REBALANCE", EFT_STD_RB_TREE_INSERT_AND_REBALANCE}, - {"EFT_STD_RB_TREE_INCREMENT", EFT_STD_RB_TREE_INCREMENT}, - {"EFT_STD_LIST_HOOK", EFT_STD_LIST_HOOK}, - {"CPP_EFT_A0R_A1R", CPP_EFT_A0R_A1R}, - {"CPP_EFT_A1R", CPP_EFT_A1R}, - {"EFT_CXA_BEGIN_CATCH", EFT_CXA_BEGIN_CATCH}, - {"CPP_EFT_DYNAMIC_CAST", CPP_EFT_DYNAMIC_CAST}, - {"", EFT_NULL} - }; - - static ExtAPI *extOp; - - // Store specifications of external functions in ExtAPI.json file - static cJSON *root; - - ExtAPI() = default; - -public: - - enum OperationType - { - Addr, - Copy, - Load, - Store, - Gep, - Call, - Return, - Rb_tree_ops, - Memcpy_like, - Memset_like, - Other - }; - - class Operand - { - public: - OperationType getType() const - { - return opType; - } - void setType(OperationType type) - { - opType = type; - } - const std::string &getSrcValue() const - { - return src; - } - void setSrcValue(const std::string &value) - { - src = value; - } - const std::string &getDstValue() const - { - return dst; - } - void setDstValue(const std::string &value) - { - dst = value; - } - NodeID getSrcID() const - { - return srcID; - } - void setSrcID(NodeID id) - { - srcID = id; - } - NodeID getDstID() const - { - return dstID; - } - void setDstID(NodeID id) - { - dstID = id; - } - const std::string &getOffsetOrSizeStr() const - { - return offsetOrSizeStr; - } - void setOffsetOrSizeStr(const std::string &str) - { - offsetOrSizeStr = str; - } - u32_t getOffsetOrSize() const - { - return offsetOrSize; - } - void setOffsetOrSize(u32_t off) - { - offsetOrSize = off; - } - private: - OperationType opType; // 操作数类型 - std::string src; // 操作数值 - std::string dst; // - std::string offsetOrSizeStr; // Gep - NodeID srcID; - NodeID dstID; - u32_t offsetOrSize; - }; - - class ExtOperation - { - public: - bool isCallOp() const - { - return callOp; - } - void setCallOp(bool isCall) - { - callOp = isCall; - } - bool isConOp() const - { - return conOp; - } - void setConOp(bool isCon) - { - conOp = isCon; - } - Operand& getBasicOp() - { - return basicOp; - } - void setBasicOp(Operand op) - { - basicOp = op; - } - const std::string &getCondition() const - { - return condition; - } - void setCondition(const std::string &cond) - { - condition = cond; - } - std::vector& getTrueBranchOperands() - { - return trueBranch_operands; - } - void setTrueBranchOperands(std::vector tbo) - { - trueBranch_operands = tbo; - } - std::vector& getFalseBranchOperands() - { - return falseBranch_operands; - } - void setFalseBranchOperands(std::vector fbo) - { - falseBranch_operands = fbo; - } - const std::string &getCalleeName() const - { - return callee_name; - } - void setCalleeName(const std::string &name) - { - callee_name = name; - } - const std::string &getCalleeReturn() const - { - return callee_return; - } - void setCalleeReturn(const std::string &ret) - { - callee_return = ret; - } - const std::string &getCalleeArguments() const - { - return callee_arguments; - } - void setCalleeArguments(const std::string &args) - { - callee_arguments = args; - } - std::vector& getCalleeOperands() - { - return callee_operands; - } - void setCalleeOperands(std::vector ops) - { - callee_operands = ops; - } - private: - bool callOp = false; - bool conOp = false; - Operand basicOp; - std::string condition; - std::vector trueBranch_operands; - std::vector falseBranch_operands; - std::string callee_name; - std::string callee_return; - std::string callee_arguments; - std::vector callee_operands; - }; - - class ExtFunctionOps - { - public: - ExtFunctionOps() {}; - ExtFunctionOps(const std::string &name, std::vector ops) : extFunName(name), extOperations(ops) {}; - const std::string &getExtFunName() const - { - return extFunName; - } - void setExtFunName(const std::string &name) - { - extFunName = name; - } - std::vector& getOperations() - { - return extOperations; - } - void setOperations(std::vector ops) - { - extOperations = ops; - } - u32_t getCallStmtNum() - { - return callStmtNum; - } - void setCallStmtNum(u32_t num) - { - callStmtNum = num; - } - private: - std::string extFunName; - std::vector extOperations; - u32_t callStmtNum = 0; - }; - -private: - // Map an external function to its operations - std::map extFunToOps; - -public: - - static ExtAPI *getExtAPI(const std::string& = ""); - - static void destory(); - - // Add an entry with the specified fields to the ExtAPI, which will be reflected immediately by further ExtAPI queries - void add_entry(const char* funName, const char* returnType, - std::vector argTypes, extType type, - bool overwrite_app_function); - - // Get numeric index of the argument in external function - u32_t getArgPos(const std::string& s); - - // return value >= 0 is an argument node - // return value = -1 is an inst node - // return value = -2 is a Dummy node - // return value = -3 is an object node - // return value = -4 is an offset - // return value = -5 is an illegal operand format - s32_t getNodeIDType(const std::string& s); - - // Get the corresponding name in ext_t, e.g. "EXT_ADDR" in {"addr", EXT_ADDR}, - std::string get_opName(const std::string& s); - // opposite for extType - const std::string& extType_toString(extType type); - - // Get external function name, e.g "memcpy" - std::string get_name(const SVFFunction *F); - - // Get arguments of the operation, e.g. ["A1R", "A0", "A2"] - std::vector get_opArgs(const cJSON *value); - - // Get specifications of external functions in ExtAPI.json file - cJSON *get_FunJson(const std::string &funName); - - // Get all operations of an extern function - Operand getBasicOperation(cJSON* obj); - ExtFunctionOps getExtFunctionOps(const SVFFunction* extFunction); - - // Get property of the operation, e.g. "EFT_A1R_A0R" - extType get_type(const SVF::SVFFunction *callee); - extType get_type(const std::string& funName); - - // Get priority of he function, return value - // 0: Apply user-defined functions - // 1: Apply function specification in ExtAPI.json - u32_t isOverwrittenAppFunction(const SVF::SVFFunction *callee); - u32_t isOverwrittenAppFunction(const std::string& funcName); - // set priority of the function - void setOverWrittenAppFunction(const std::string& funcName, u32_t overwrite_app_function); - - // Does (F) have a static var X (unavailable to us) that its return points to? - bool has_static(const SVFFunction *F); - - // Assuming hasStatic(F), does (F) have a second static Y where X -> Y? - bool has_static2(const SVFFunction *F); - - // Does (F) have a memset_like or memcpy_like operation? - bool is_memset_or_memcpy(const SVFFunction *F); - - // Does (F) allocate a new object and return it? - bool is_alloc(const SVFFunction *F); - - // Does (F) allocate a new object and assign it to one of its arguments? - bool is_arg_alloc(const SVFFunction *F); - - // Get the position of argument which holds the new object - s32_t get_alloc_arg_pos(const SVFFunction *F); - - // Does (F) allocate only non-struct objects? - bool no_struct_alloc(const SVFFunction *F); - - // Does (F) not free/release any memory? - bool is_dealloc(const SVFFunction *F); - - // Does (F) not do anything with the known pointers? - bool is_noop(const SVFFunction *F); - - // Does (F) reallocate a new object? - bool is_realloc(const SVFFunction *F); - - // Does (F) have the same return type(pointer or nonpointer) and same number of arguments - bool is_sameSignature(const SVFFunction *F); - - // Should (F) be considered "external" (either not defined in the program - // or a user-defined version of a known alloc or no-op)? - bool is_ext(const SVFFunction *F); -}; -} // End namespace SVF - -#endif diff --git a/svf/include/Util/ExtAPI.json b/svf/include/Util/ExtAPI.json deleted file mode 100644 index 0702606eb..000000000 --- a/svf/include/Util/ExtAPI.json +++ /dev/null @@ -1,5833 +0,0 @@ -{ - "creat64": { - "return": "int", - "arguments": "(const char *, mode_t)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "fseeko64": { - "return": "int", - "arguments": "(FILE, off64_t, int)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "fstat64": { - "return": "int", - "arguments": "(int, struct stat64 *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "fstatvfs64": { - "return": "int", - "arguments": "(int, struct statvfs64 *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "ftello64": { - "return": "off64_t", - "arguments": "(FILE)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "getrlimit64": { - "return": "int", - "arguments": "(int, struct rlimit64 *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "lstat64": { - "return": "int", - "arguments": "(const char *, struct stat64 *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "open64": { - "return": "int", - "arguments": "(const char *, int, ...)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "stat64": { - "return": "int", - "arguments": "(const char *, struct stat64 *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "statvfs64": { - "return": "int", - "arguments": "(const char *, struct statvfs64 *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "Gpm_GetEvent": { - "return": "int", - "arguments": "(Gpm_Event *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "Gpm_Open": { - "return": "int", - "arguments": "(Gpm_Connect *, int)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "RAND_seed": { - "return": "void", - "arguments": "(const void *, int)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "SSL_CTX_set_default_verify_paths": { - "return": "int", - "arguments": "(SSL_CTX *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "SSL_get_error": { - "return": "int", - "arguments": "(const SSL *, int)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "SSL_get_fd": { - "return": "int", - "arguments": "(const SSL *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "SSL_pending": { - "return": "int", - "arguments": "(const SSL *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "SSL_read": { - "return": "int", - "arguments": "(SSL *, void *, int)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "SSL_set_bio": { - "return": "void", - "arguments": "(SSL *, BIO *, BIO *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "SSL_set_connect_state": { - "return": "void", - "arguments": "(SSL *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "SSL_shutdown": { - "return": "int", - "arguments": "(SSL *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "SSL_state": { - "return": "int", - "arguments": "(const SSL *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "SSL_write": { - "return": "int", - "arguments": "(SSL *, const void *, int)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "Void_FreeCore": { - "return": "void", - "arguments": "(VSCore *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "X509_STORE_CTX_get_error": { - "return": "int", - "arguments": "(X509_STORE_CTX *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "XAllocColor": { - "return": "Status", - "arguments": "(Display *, Colormap, XColor *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "XCloseDisplay": { - "return": "int", - "arguments": "(Display *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "XCopyArea": { - "return": "int", - "arguments": "(Display *, Drawable, Drawable, GC, int, int, unsigned int, unsigned, int, int)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "XCreateColormap": { - "return": "Colormap", - "arguments": "(Display *, Window, Visual *, int)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "XCreatePixmap": { - "return": "Pixmap", - "arguments": "(Display *, Drawable, unsigned int, unsigned int, unsigned int)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "XCreateWindow": { - "return": "Window", - "arguments": "(Display *, Window, int, int, unsigned int, unsigned int, unsigned int, int, unsigned int, Visual *, unsigned long, XSetWindowAttributes *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "XDrawPoint": { - "return": "int", - "arguments": "(Display *, Drawable, GC, int, int)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "XDrawString": { - "return": "int", - "arguments": "(Display *, Drawable, GC, int, int, char *, int)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "XDrawText": { - "return": "int", - "arguments": "(Display *, Drawable, GC, int, int, XTextItem *, int)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "XFillRectangle": { - "return": "int", - "arguments": "(Display *, Drawable, GC, int, int, unsigned int, unsigned int)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "XFillRectangles": { - "return": "int", - "arguments": "(Display *, Drawable, GC, XRectangle *, int)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "XGetGCValues": { - "return": "Status", - "arguments": "(Display *, GC, unsigned long, XGCValues *", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "XGetGeometry": { - "return": "Status", - "arguments": "(Display *, Drawable, Window *, int *, int *, unsigned int *, unsigned int *, unsigned int *, unsigned int *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "XInternAtom": { - "return": "Atom", - "arguments": "(Display *, char *, Bool)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "XMapWindow": { - "return": "int", - "arguments": "(Display *, Window)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "XNextEvent": { - "return": "int", - "arguments": "(Display *, XEvent *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "XPutImage": { - "return": "int", - "arguments": "(Display *, Drawable, GC, XImage *, int, int, int, int, unsigned int, unsigned int)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "XQueryColor": { - "return": "int", - "arguments": "(Display *, Colormap, XColor *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "XResizeWindow": { - "return": "int", - "arguments": "(Display *, Window, unsigned, unsigned)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "XSelectInput": { - "return": "int", - "arguments": "(Display *, Window, long)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "XSendEvent": { - "return": "Status", - "arguments": "(Display *, Window, Bool, long, XEvent *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "XSetBackground": { - "return": "int", - "arguments": "(Display *, GC, unsigned long)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "XSetClipMask": { - "return": "int", - "arguments": "(Display *, GC, Pixmap)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "XSetClipOrigin": { - "return": "int", - "arguments": "(Display *, GC, int, int)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "XSetFillStyle": { - "return": "int", - "arguments": "(Display *, GC, int)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "XSetFont": { - "return": "int", - "arguments": "(Display *, GC, Font)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "XSetForeground": { - "return": "int", - "arguments": "(Display *, GC, unsigned long)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "XSetFunction": { - "return": "int", - "arguments": "(Display *, GC, int)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "XSetGraphicsExposures": { - "return": "int", - "arguments": "(Display *, GC, Bool)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "XSetLineAttributes": { - "return": "int", - "arguments": "(Display *, GC, unsigned int, int, int, int)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "XSetTile": { - "return": "int", - "arguments": "(Display *, GC, Pixmap)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "XSetWMHints": { - "return": "int", - "arguments": "(Display *, Window, XWMHints *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "XSetWMNormalHints": { - "return": "void", - "arguments": "(Display *, Window, XSizeHints *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "XSetWindowBackgroundPixmap": { - "return": "void", - "arguments": "(Display *, Window, XSizeHints *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "XStoreName": { - "return": "int", - "arguments": "(Display *, Window, char *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "XSync": { - "return": "int", - "arguments": "(Display *, Bool)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "XVisualIDFromVisual": { - "return": "VisualID", - "arguments": "(Visual *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "XWMGeometry": { - "return": "int", - "arguments": "(Display *, int, char *, char *, unsigned int, XSizeHints *, int *, int *, int *, int *, int *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "XtAppSetFallbackResources": { - "return": "void", - "arguments": "(XtAppContext, String* )", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "XtCloseDisplay": { - "return": "void", - "arguments": "(Display *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "XtDestroyApplicationContext": { - "return": "void", - "arguments": "(XtAppContext)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "XtDestroyWidget": { - "return": "void", - "arguments": "(Widget)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "_IO_getc": { - "return": "int", - "arguments": "(_IO_FILE *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "_IO_putc": { - "return": "int", - "arguments": "(int, _IO_FILE *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "__assert_fail": { - "return": "void", - "arguments": "(const char *, const char *, unsigned int, const char *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "__dn_expand": { - "return": "void", - "arguments": "(const char *, const char *, unsigned int, const char *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "__dn_skipname": { - "return": "int", - "arguments": "(const unsigned char *, const unsigned char *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "__res_nclose": { - "return": "void", - "arguments": "(res_state)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "__res_ninit": { - "return": "int", - "arguments": "(res_state)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "__res_nmkquery": { - "return": "int", - "arguments": "(res_state, int, const char *, int, int, const uchar_t *, int, const uchar_t *, uchar_t *, int)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "__res_nsend": { - "return": "int", - "arguments": "(res_state, const uchar_t *, int, uchar_t *, int)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "__res_query": { - "return": "int", - "arguments": "(const char *, int, int, uchar_t *, int)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "__res_querydomain": { - "return": "int", - "arguments": "(const char *, const char *, int, int, unsigned char *, int)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "__res_search": { - "return": "int", - "arguments": "(const char *, int, int, unsigned char *, int)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "__sigsetjmp": { - "return": "int", - "arguments": "(sigjmp_buf, int)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "_obstack_begin": { - "return": "extern int", - "arguments": "(struct obstack *, int, int, void *(*) (long), void (*) (void *))", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "_obstack_memory_used": { - "return": "int", - "arguments": "(struct obstack *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "_obstack_newchunk": { - "return": "extern void", - "arguments": "(struct obstack *, int)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "_setjmp": { - "return": "int", - "arguments": "(jmp_buf)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "accept": { - "return": "int", - "arguments": "(int, struct sockaddr *restrict, socklen_t *restrict)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "access": { - "return": "int", - "arguments": "(const char *, int)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "asprintf": { - "return": "int", - "arguments": "(char **restrict, const char *restrict, ...)", - "type": "EFT_A0R_NEW", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Dummy" - }, - "StoreStmt": { - "src": "Dummy", - "dst": "Arg0" - } - }, - "atexit": { - "return": "int", - "arguments": "(void (*function)(void))", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "atof": { - "return": "double", - "arguments": "(const char *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "atoi": { - "return": "int", - "arguments": "(const char *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "atol": { - "return": "long int", - "arguments": "(const char *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "bind": { - "return": "int", - "arguments": "(int, const struct sockaddr *, socklen_t)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "cfgetospeed": { - "return": "speed_t", - "arguments": "(const struct termios *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "cfsetispeed": { - "return": "int", - "arguments": "(struct termios *, speed_t)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "cfsetospeed": { - "return": "int", - "arguments": "(struct termios *, speed_t)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "chdir": { - "return": "int", - "arguments": "(const char *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "chmod": { - "return": "int", - "arguments": "(const char *, mode_t)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "chown": { - "return": "int", - "arguments": "(const char *, uid_t, gid_t)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "chroot": { - "return": "int", - "arguments": "(const char *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "clearerr": { - "return": "void", - "arguments": "(FILE *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "clearok": { - "return": "int", - "arguments": "(WINDOW *, bool)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "closedir": { - "return": "int", - "arguments": "(DIR *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "compress2": { - "return": "int", - "arguments": "(Bytef *, uLongf *, const Bytef *, uLong, int)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "confstr": { - "return": "size_t", - "arguments": "(int, char *, size_t)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "connect": { - "return": "int", - "arguments": "(int, const struct sockaddr *, socklen_t)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "crc32": { - "return": "uLong", - "arguments": "(uLong, const Bytef *, uInt)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "creat": { - "return": "int", - "arguments": "(const char *, mode_t)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "deflate": { - "return": "int", - "arguments": "(z_streamp, int)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "deflateEnd": { - "return": "int", - "arguments": "(z_streamp)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "deflateInit2_": { - "return": "int", - "arguments": "(z_streamp, int, char *, int)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "deflateReset": { - "return": "int", - "arguments": "(z_streamp)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "delwin": { - "return": "int", - "arguments": "(WINDOW *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "dladdr": { - "return": "int", - "arguments": "(const void *, Dl_info *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "dlclose": { - "return": "int", - "arguments": "(void *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "execl": { - "return": "int", - "arguments": "(const char *, const char *, ...)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "execle": { - "return": "int", - "arguments": "(const char *, const char *, ..., char * const [])", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "execlp": { - "return": "int", - "arguments": "(const char *, const char *, ...)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "execv": { - "return": "int", - "arguments": "(const char *, char *const [])", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "execve": { - "return": "int", - "arguments": "(const char *, char *const [], char *const [])", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "execvp": { - "return": "int", - "arguments": "(const char *, char *const [])", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "feof": { - "return": "int", - "arguments": "(FILE *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "ferror": { - "return": "int", - "arguments": "(FILE *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "fflush": { - "return": "int", - "arguments": "(FILE *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "fgetc": { - "return": "int", - "arguments": "(FILE *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "fgetpos": { - "return": "int", - "arguments": "(FILE *, fpos_t *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "fileno": { - "return": "int", - "arguments": "(FILE *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "flockfile": { - "return": "void", - "arguments": "(FILE *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "fnmatch": { - "return": "int", - "arguments": "(const char *, const char *, int)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "forkpty": { - "return": "pid_t", - "arguments": "(int *, char *, const struct termios *, const struct winsize *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "fprintf": { - "return": "int", - "arguments": "(FILE *, const char *, ...)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "fputc": { - "return": "int", - "arguments": "(int, FILE *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "fputs": { - "return": "int", - "arguments": "(const char *, FILE *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "fread": { - "return": "size_t", - "arguments": "(void *, size_t, size_t, FILE *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "frexp": { - "return": "double", - "arguments": "(double, int *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "fscanf": { - "return": "int", - "arguments": "(FILE *, const char *, ...)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "fseek": { - "return": "int", - "arguments": "(FILE *, long int, int)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "fseeko": { - "return": "int", - "arguments": "(FILE *, off_t, int)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "fsetpos": { - "return": "int", - "arguments": "(FILE *, const fpos_t *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "fstat": { - "return": "int", - "arguments": "(int, struct stat *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "fstatfs": { - "return": "int", - "arguments": "(int, struct statfs *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "ftell": { - "return": "long int", - "arguments": "(FILE *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "ftello": { - "return": "off_t", - "arguments": "(FILE *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "ftok": { - "return": "key_t", - "arguments": "(const char *, int)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "funlockfile": { - "return": "void", - "arguments": "(FILE *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "fwrite": { - "return": "size_t", - "arguments": "(const void *, size_t, size_t, FILE *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "g_scanner_destroy": { - "return": "void", - "arguments": "(GScanner *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "g_scanner_eof": { - "return": "gboolean", - "arguments": "(GScanner *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "g_scanner_get_next_token": { - "return": "GTokenType", - "arguments": "(GScanner *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "g_scanner_input_file": { - "return": "void", - "arguments": " (GScanner *, gint)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "g_scanner_scope_add_symbol": { - "return": "void", - "arguments": "(GScanner *, guint, const gchar *, gpointer)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "gcry_cipher_close": { - "return": "void", - "arguments": "(GCRY_CIPHER_HD)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "gcry_cipher_ctl": { - "return": "int", - "arguments": "(GCRY_CIPHER_HD, int, void *, size_t)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "gcry_cipher_decrypt": { - "return": "int", - "arguments": "(GCRY_CIPHER_HD, unsigned char, size_t, unsigned char, size_t)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "gcry_cipher_map_name": { - "return": "int", - "arguments": "(const char *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "gcry_cipher_open": { - "return": "void", - "arguments": "(GCRY_CIPHER_HD)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "gcry_md_close": { - "return": "void", - "arguments": "(GCRY_MD_HD)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "gcry_md_ctl": { - "return": "int", - "arguments": "(GCRY_MD_HD, int, unsigned char *, size_t)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "gcry_md_get_algo": { - "return": "unsigned int", - "arguments": "(int)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "gcry_md_hash_buffer": { - "return": "int", - "arguments": "(int, char *, const char *, size_t)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "gcry_md_map_name": { - "return": "int", - "arguments": "(const char *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "gcry_md_open": { - "return": "GCRY_MD_HD", - "arguments": "(int, unsigned int)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "gcry_md_setkey": { - "return": "GCRY_ERROR_T", - "arguments": "(GCRY_MD_HD, const void *, size_t)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "gcry_md_write": { - "return": "int", - "arguments": "(GCRY_MD_HD, unsigned char *, size_t)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "gcry_mpi_add": { - "return": "void", - "arguments": "(gcry_mpi_t, gcry_mpi_t, gcry_mpi_t)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "gcry_mpi_add_ui": { - "return": "void", - "arguments": "(gcry_mpi_t, gcry_mpi_t, unsigned long)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "gcry_mpi_clear_highbit": { - "return": "void", - "arguments": "(gcry_mpi_t, unsigned int)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "gcry_mpi_print": { - "return": "gcry_error_t", - "arguments": "(enum gcry_mpi_format, unsigned char *, size_t, size_t *, struct gcry_mpi *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "getaddrinfo": { - "return": "int", - "arguments": "(const char *, const char *, const struct addrinfo *, struct addrinfo **)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "getc_unlocked": { - "return": "int", - "arguments": "(FILE *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "getgroups": { - "return": "int", - "arguments": "(int, gid_t [])", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "gethostname": { - "return": "int", - "arguments": "(char *, size_t)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "getloadavg": { - "return": "int", - "arguments": "(double [], int)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "getopt": { - "return": "int", - "arguments": "(int, char *const [], const char *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "getopt_long": { - "return": "int", - "arguments": "(int, char * const [], const char *, const struct option *, int *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "getopt_long_only": { - "return": "int", - "arguments": "(int, char * const [], const char *, const struct option *, int *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "getpeername": { - "return": "int", - "arguments": "(int, struct sockaddr *restrict, socklen_t *restrict)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "getresgid": { - "return": "int", - "arguments": "(gid_t *, gid_t *, gid_t *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "getresuid": { - "return": "int", - "arguments": "(uid_t *, uid_t *, uid_t *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "getrlimit": { - "return": "int", - "arguments": "(int, struct rlimit *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "getrusage": { - "return": "int", - "arguments": "(int, struct rusage *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "getsockname": { - "return": "int", - "arguments": "(int, struct sockaddr *restrict, socklen_t *restrict)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "getsockopt": { - "return": "int", - "arguments": "(int, int, int, void *restrict, socklen_t *restrict)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "gettimeofday": { - "return": "int", - "arguments": "(struct timeval *restrict, struct timezone *restrict)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "gnutls_pkcs12_bag_decrypt": { - "return": "int", - "arguments": "(gnutls_pkcs12_bag_t, const char*)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "gnutls_pkcs12_bag_deinit": { - "return": "void", - "arguments": "(gnutls_pkcs12_bag_t)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "gnutls_pkcs12_bag_get_count": { - "return": "int", - "arguments": "(gnutls_pkcs12_bag_t)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "gnutls_pkcs12_bag_get_type": { - "return": "int", - "arguments": "(gnutls_pkcs12_bag_t, unsigned)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "gnutls_x509_crt_deinit": { - "return": "void", - "arguments": "(gnutls_x509_crt_t)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "gnutls_x509_crt_get_dn_by_oid": { - "return": "int", - "arguments": "(gnutls_x509_crt_t, const char *, unsigned, unsigned int, void *, size_t *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "gnutls_x509_crt_get_key_id": { - "return": "int", - "arguments": "(gnutls_x509_crt_t, unsigned int, unsigned char *, size_t *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "gnutls_x509_privkey_deinit": { - "return": "void", - "arguments": "(gnutls_x509_privkey_t)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "gnutls_x509_privkey_get_key_id": { - "return": "int", - "arguments": "(gnutls_x509_privkey_t, unsigned int, unsigned char *, size_t *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "gzclose": { - "return": "int", - "arguments": "(gzFile)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "gzeof": { - "return": "int", - "arguments": "(gzFile)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "gzgetc": { - "return": "int", - "arguments": "(gzFile)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "gzread": { - "return": "int", - "arguments": "(gzFile, voidp, unsigned int)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "gzseek": { - "return": "z_off_t", - "arguments": "(gzFile, z_off_t, int)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "gztell": { - "return": "z_off_t", - "arguments": "(gzFile)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "gzwrite": { - "return": "int", - "arguments": "(gzFile, voidpc, unsigned int)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "hstrerror": { - "return": "const char *", - "arguments": "(int)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "iconv_close": { - "return": "int", - "arguments": "(iconv_t)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "inet_addr": { - "return": "in_addr_t", - "arguments": "(const char *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "inet_aton": { - "return": "int", - "arguments": "(const char *, struct in_addr *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "inet_pton": { - "return": "int", - "arguments": "(int, const char *restrict, void *restrict)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "inflate": { - "return": "int", - "arguments": "(z_streamp, int)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "inflateEnd": { - "return": "int", - "arguments": "(z_streamp)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "inflateInit2_": { - "return": "int", - "arguments": "(z_streamp, int, char *, int)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "inflateInit_": { - "return": "int", - "arguments": "(z_streamp, const char *, int)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "inflateReset": { - "return": "int", - "arguments": "(z_streamp)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "initgroups": { - "return": "int", - "arguments": "(const char *, gid_t)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "jpeg_CreateCompress": { - "return": "void", - "arguments": "(j_compress_ptr, int, size_t)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "jpeg_CreateDecompress": { - "return": "void", - "arguments": "(j_decompress_ptr, int, size_t)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "jpeg_destroy": { - "return": "void", - "arguments": "(j_common_ptr)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "jpeg_finish_compress": { - "return": "void", - "arguments": "(j_compress_ptr)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "jpeg_finish_decompress": { - "return": "boolean", - "arguments": "(j_decompress_ptr)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "jpeg_read_header": { - "return": "int", - "arguments": "(j_decompress_ptr, boolean)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "jpeg_read_scanlines": { - "return": "JDIMENSION", - "arguments": "(j_decompress_ptr, JSAMPARRAY, JDIMENSION)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "jpeg_resync_to_restart": { - "return": "boolean", - "arguments": "(j_decompress_ptr, int)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "jpeg_set_colorspace": { - "return": "void", - "arguments": "(j_compress_ptr, J_COLOR_SPACE)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "jpeg_set_defaults": { - "return": "void", - "arguments": "(j_compress_ptr)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "jpeg_set_linear_quality": { - "return": "void", - "arguments": "(j_compress_ptr, int, boolean)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "jpeg_set_quality": { - "return": "void", - "arguments": "(j_compress_ptr, int, boolean)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "jpeg_start_compress": { - "return": "void", - "arguments": "(j_compress_ptr, boolean)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "jpeg_start_decompress": { - "return": "boolean", - "arguments": "(j_decompress_ptr)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "jpeg_write_scanlines": { - "return": "JDIMENSION", - "arguments": "(j_compress_ptr, JSAMPARRAY, JDIMENSION)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "keypad": { - "return": "int", - "arguments": "(WINDOW *, bool)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "lchown": { - "return": "int", - "arguments": "(const char *, uid_t, gid_t)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "link": { - "return": "int", - "arguments": "(const char *, const char *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "llvm.dbg": { - "return": "void", - "arguments": "(metadata, metadata, metadata)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "llvm.stackrestore": { - "return": "void", - "arguments": "(ptr)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "llvm.va_copy": { - "return": "void", - "arguments": "(ptr, ptr)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "llvm.va_end": { - "return": "void", - "arguments": "(i8*)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "llvm.va_start": { - "return": "void", - "arguments": "(i8*)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "longjmp": { - "return": "void", - "arguments": "(jmp_buf, int)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "lstat": { - "return": "int", - "arguments": "(const char *, struct stat *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "mblen": { - "return": "int", - "arguments": "(const char *, size_t)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "mbrlen": { - "return": "size_t", - "arguments": "(const char*, size_t, mbstate_t*)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "mbrtowc": { - "return": "size_t", - "arguments": "(wchar_t *restrict, const char *restrict, size_t, mbstate_t *restrict)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "mbtowc": { - "return": "int", - "arguments": "(wchar_t*, const char *, std::size_t)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "memcmp": { - "return": "int", - "arguments": "(const void *, const void *, size_t)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "mkdir": { - "return": "int", - "arguments": "(const char *, mode_t)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "mknod": { - "return": "int", - "arguments": "(const char *, mode_t, dev_t)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "mkfifo": { - "return": "int", - "arguments": "(const char *, mode_t)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "mkstemp": { - "return": "int", - "arguments": "(char *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "mkstemp64": { - "return": "int", - "arguments": "(char *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "mktime": { - "return": "time_t", - "arguments": "(struct tm *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "modf": { - "return": "double", - "arguments": "(double, double *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "mprotect": { - "return": "int", - "arguments": "(void *, size_t, int)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "munmap": { - "return": "int", - "arguments": "(void *, size_t)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "nanosleep": { - "return": "int", - "arguments": "(const struct timespec *, struct timespec *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "nodelay": { - "return": "int", - "arguments": "(WINDOW *, bool)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "open": { - "return": "int", - "arguments": "(const char *, int, mode_t)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "openlog": { - "return": "void", - "arguments": "(const char *, int, int)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "openpty": { - "return": "int", - "arguments": "(int *, int *, char *, const struct termios *, const struct winsize *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "pathconf": { - "return": "long", - "arguments": "(const char *, int)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "pclose": { - "return": "int", - "arguments": "(FILE *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "perror": { - "return": "void", - "arguments": "(const char *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "pipe": { - "return": "int", - "arguments": "(int[2])", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "png_destroy_write_struct": { - "return": "void", - "arguments": "(png_structpp, png_infopp)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "png_init_io": { - "return": "void", - "arguments": "(png_structp, png_FILE_p)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "png_set_bKGD": { - "return": "void", - "arguments": "(png_structp, png_infop, png_color_16p)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "png_set_invert_alpha": { - "return": "void", - "arguments": "(png_structp)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "png_set_invert_mono": { - "return": "void", - "arguments": "(png_structp)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "png_write_end": { - "return": "void", - "arguments": "(png_structp, png_infop)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "png_write_info": { - "return": "void", - "arguments": "(png_structp, png_infop)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "png_write_rows": { - "return": "void", - "arguments": "(png_structp, png_bytepp, png_uint_32)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "poll": { - "return": "int", - "arguments": "(struct pollfd *, nfds_t, int)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "pread64": { - "return": "ssize_t", - "arguments": "(int, void *, size_t, off64_t)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "printf": { - "return": "int", - "arguments": "(const char *, ...)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "pthread_attr_destroy": { - "return": "int", - "arguments": "(pthread_attr_t *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "pthread_attr_init": { - "return": "int", - "arguments": "(pthread_attr_t *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "pthread_attr_setscope": { - "return": "int", - "arguments": "(pthread_attr_t *, int)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "pthread_attr_setstacksize": { - "return": "int", - "arguments": "(pthread_attr_t *, size_t)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "pthread_create": { - "return": "int", - "arguments": "(pthread_t *, const pthread_attr_t *, void *(*start_routine)(void*), void *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "pthread_mutex_destroy": { - "return": "int", - "arguments": "(pthread_mutex_t *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "pthread_mutex_init": { - "return": "int", - "arguments": "(pthread_mutex_t *, const pthread_mutexattr_t *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "pthread_mutex_lock": { - "return": "int", - "arguments": "(pthread_mutex_t *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "pthread_mutex_unlock": { - "return": "int", - "arguments": "(pthread_mutex_t *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "pthread_mutexattr_destroy": { - "return": "int", - "arguments": "(pthread_mutexattr_t *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "pthread_mutexattr_init": { - "return": "int", - "arguments": "(pthread_mutexattr_t *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "pthread_mutexattr_settype": { - "return": "int", - "arguments": "(pthread_mutexattr_t *, int)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "ptsname": { - "return": "char *", - "arguments": "(int)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "putenv": { - "return": "int", - "arguments": "(char *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "puts": { - "return": "int", - "arguments": "(const char *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "qsort": { - "return": "void", - "arguments": "(void *, size_t, size_t, int (*compar)(const void *, const void*))", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "re_compile_fastmap": { - "return": "int", - "arguments": "(struct re_pattern_buffer *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "re_exec": { - "return": "int", - "arguments": "(char *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "re_search": { - "return": "int", - "arguments": "(struct re_pattern_buffer *, const char *, const int, const int, const int, struct re_registers *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "read": { - "return": "ssize_t", - "arguments": "(int, void *, size_t)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "readlink": { - "return": "ssize_t", - "arguments": "(const char *restrict, char *restrict, size_t)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "recv": { - "return": "ssize_t", - "arguments": "(int, void *, size_t, int)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "recvfrom": { - "return": "ssize_t", - "arguments": "(int, void *, size_t, int, struct sockaddr *, socklen_t *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "regcomp": { - "return": "int", - "arguments": "(regex_t *restrict, const char *restrict, int)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "regerror": { - "return": "size_t", - "arguments": "(int, const regex_t *, char *, size_t)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "remove": { - "return": "int", - "arguments": "(const char *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "rename": { - "return": "int", - "arguments": "(const char *, const char *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "rewind": { - "return": "void", - "arguments": "(FILE *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "rewinddir": { - "return": "void", - "arguments": "(DIR *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "rmdir": { - "return": "int", - "arguments": "(const char *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "rresvport": { - "return": "int", - "arguments": "(int *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "scrollok": { - "return": "int", - "arguments": "(WINDOW *, bool)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "select": { - "return": "int", - "arguments": "(int, fd_set *restrict, fd_set *restrict, fd_set *restrict, struct timeval *restrict)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "sem_destroy": { - "return": "int", - "arguments": "(sem_t *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "sem_init": { - "return": "int", - "arguments": "(sem_t *, int, unsigned int)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "sem_post": { - "return": "int", - "arguments": "(sem_t *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "sem_trywait": { - "return": "int", - "arguments": "(sem_t *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "sem_wait": { - "return": "int", - "arguments": "(sem_t *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "send": { - "return": "ssize_t", - "arguments": "(int, const void *, size_t, int)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "sendto": { - "return": "ssize_t", - "arguments": "(int, const void *, size_t, int, const struct sockaddr *, socklen_t)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "setbuf": { - "return": "void", - "arguments": "(FILE *, char *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "setenv": { - "return": "int", - "arguments": "(const char *, const char *, int)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "setgroups": { - "return": "int", - "arguments": "(size_t, const gid_t *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "setitimer": { - "return": "int", - "arguments": "(int, const struct itimerval *, struct itimerval *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "setrlimit": { - "return": "int", - "arguments": "(int, const struct rlimit *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "setsockopt": { - "return": "int", - "arguments": "(int, int, int, const void *, socklen_t)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "setvbuf": { - "return": "int", - "arguments": "(FILE *, char *, int, size_t)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "sigaction": { - "return": "int", - "arguments": "(int, const struct sigaction *restrict, struct sigaction *restrict)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "sigaddset": { - "return": "int", - "arguments": "(sigset_t *, int)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "sigaltstack": { - "return": "int", - "arguments": "(const stack_t *restrict, stack_t *restrict)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "sigdelset": { - "return": "int", - "arguments": "(sigset_t *, int)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "sigemptyset": { - "return": "int", - "arguments": "(sigset_t *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "sigfillset": { - "return": "int", - "arguments": "(sigset_t *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "sigisemptyset": { - "return": "int", - "arguments": "(sigset_t *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "sigismember": { - "return": "int", - "arguments": "(const sigset_t *, int)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "siglongjmp": { - "return": "void", - "arguments": "(sigjmp_buf, int)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "sigprocmask": { - "return": "int", - "arguments": "(int, const sigset_t *restrict, sigset_t *restrict)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "sigsuspend": { - "return": "int", - "arguments": "(const sigset_t *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "snprintf": { - "return": "int", - "arguments": "(char *, size_t, const char *, ...)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "socketpair": { - "return": "int", - "arguments": "(int, int, int, int[2])", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "sprintf": { - "return": "int", - "arguments": "(char *, const char *, ...)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "sscanf": { - "return": "int", - "arguments": "(const char *, const char *, ...)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "stat": { - "return": "int", - "arguments": "(const char *restrict, struct stat *restrict)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "statfs": { - "return": "int", - "arguments": "(const char *, struct statfs *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "statvfs": { - "return": "int", - "arguments": "(const char *restrict, struct statvfs *restrict)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "strcasecmp": { - "return": "int", - "arguments": "(const char *, const char *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "strcmp": { - "return": "int", - "arguments": "(const char *, const char *s)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "strcoll": { - "return": "int", - "arguments": "(const char *, const char *s)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "strcspn": { - "return": "size_t", - "arguments": "(const char *, const char *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "strfmon": { - "return": "ssize_t", - "arguments": "(char *, size_t, const char *, ...)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "strftime": { - "return": "size_t", - "arguments": "(char *restrict, size_t, const char *restrict, const struct tm *restrict)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "strlen": { - "return": "size_t", - "arguments": "(const char *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "strncasecmp": { - "return": "int", - "arguments": "(const char *, const char *, size_t)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "strncmp": { - "return": "int", - "arguments": "(const char *, const char *, size_t)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "strspn": { - "return": "size_t", - "arguments": "(const char *, const char *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "symlink": { - "return": "int", - "arguments": "(const char *, const char *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "sysinfo": { - "return": "int", - "arguments": "(struct sysinfo *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "syslog": { - "return": "void", - "arguments": "(int, const char *, ...)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "system": { - "return": "int", - "arguments": "(const char *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "tcgetattr": { - "return": "int", - "arguments": "(int, struct termios *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "tcsetattr": { - "return": "int", - "arguments": "(int, int, const struct termios *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "tgetent": { - "return": "int", - "arguments": "(char *, const char *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "tgetflag": { - "return": "int", - "arguments": "(char[2])", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "tgetnum": { - "return": "int", - "arguments": "(char *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "time": { - "return": "time_t", - "arguments": "(time_t *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "timegm": { - "return": "time_t", - "arguments": "(struct tm *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "times": { - "return": "clock_t", - "arguments": "(struct tms *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "tputs": { - "return": "int", - "arguments": "(const char *, int, int (*putc)(int))", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "truncate": { - "return": "int", - "arguments": "(const char *, off_t)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "uname": { - "return": "int", - "arguments": "(struct utsname *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "uncompress": { - "return": "int", - "arguments": "(Bytef *, uLongf *, const Bytef *, uLong)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "ungetc": { - "return": "int", - "arguments": "(int, FILE *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "unlink": { - "return": "int", - "arguments": "(const char *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "unsetenv": { - "return": "int", - "arguments": "(const char *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "utime": { - "return": "int", - "arguments": "(const char *, const struct utimbuf *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "utimes": { - "return": "int", - "arguments": "(const char *, const struct timeval[2])", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "vasprintf": { - "return": "int", - "arguments": "(char **, const char *, va_list)", - "type": "EFT_A0R_NEW", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Dummy" - }, - "StoreStmt": { - "src": "Dummy", - "dst": "Arg0" - } - }, - "vfprintf": { - "return": "int", - "arguments": "(FILE *, const char *, va_list)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "vprintf": { - "return": "int", - "arguments": "(const char *, va_list)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "vsnprintf": { - "return": "int", - "arguments": "(char *, size_t, const char *, va_list)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "vsprintf": { - "return": "int", - "arguments": "(char *, const char *, va_list)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "waddch": { - "return": "int", - "arguments": "(WINDOW *, chtype)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "waddnstr": { - "return": "int", - "arguments": "(WINDOW *, const char *, int)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "wait": { - "return": "pid_t", - "arguments": "(int *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "wait3": { - "return": "pid_t", - "arguments": "(int *, int, struct rusage *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "wait4": { - "return": "pid_t", - "arguments": "(pid_t, int *, int, struct rusage *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "waitpid": { - "return": "pid_t", - "arguments": "(pid_t, int *, int)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "wattr_off": { - "return": "int", - "arguments": "(WINDOW *, attr_t, void *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "wattr_on": { - "return": "int", - "arguments": "(WINDOW *, attr_t, void *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "wborder": { - "return": "int", - "arguments": "(WINDOW *, chtype, chtype, chtype, chtype, chtype, chtype, chtype, chtype)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "wclrtobot": { - "return": "int", - "arguments": "(WINDOW *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "wclrtoeol": { - "return": "int", - "arguments": "(WINDOW *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "wcrtomb": { - "return": "size_t", - "arguments": "(char *, wchar_t, mbstate_t *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "wctomb": { - "return": "int", - "arguments": "(char *, wchar_t)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "wctype": { - "return": "wctype_t", - "arguments": "(const char* )", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "werase": { - "return": "int", - "arguments": "(WINDOW *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "wgetch": { - "return": "int", - "arguments": "(WINDOW *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "wmove": { - "return": "int", - "arguments": "(WINDOW *, int, int)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "wrefresh": { - "return": "int", - "arguments": "(WINDOW *)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "write": { - "return": "ssize_t", - "arguments": "(int, const void *, size_t)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "wtouchln": { - "return": "int", - "arguments": "(WINDOW *, int, int, int)", - "type": "EFT_NOOP", - "overwrite_app_function": 1 - }, - "_fopen": { - "return": "FILE *", - "arguments": "(const char *, const char *)", - "type": "EFT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "fopen64": { - "return": "FILE *", - "arguments": "(const char *, const char *)", - "type": "EFT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "readdir64": { - "return": "struct dirent64 *", - "arguments": "(DIR *)", - "type": "EFT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "tmpfile64": { - "return": "FILE *", - "arguments": "(void)", - "type": "EFT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "BIO_new_socket": { - "return": "BIO *", - "arguments": "(int, int)", - "type": "EFT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "FT_Get_Sfnt_Table": { - "return": "void *", - "arguments": "(FT_Face, FT_Sfnt_Tag)", - "type": "EFT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "FcFontList": { - "return": "FcFontSet *", - "arguments": "(FcConfig *)", - "type": "EFT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "FcFontMatch": { - "return": "FcPattern *", - "arguments": "(FcConfig *, FcPattern *, FcResult *)", - "type": "EFT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "FcFontRenderPrepare": { - "return": "FcPattern *", - "arguments": "(FcConfig *)", - "type": "EFT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "FcFontSetCreate": { - "return": "FcFontSet *", - "arguments": "(void)", - "type": "EFT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "FcFontSort": { - "return": "FcFontSet *", - "arguments": "(FcConfig *, FcPattern *, FcBool, FcCharSet **, FcResult *)", - "type": "EFT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "FcInitLoadConfig": { - "return": "FcConfig *", - "arguments": "(void)", - "type": "EFT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "FcObjectSetBuild": { - "return": "FcObjectSet *", - "arguments": "(const char *, ...)", - "type": "EFT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "FcObjectSetCreate": { - "return": "FcObjectSet *", - "arguments": "(void)", - "type": "EFT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "FcPatternBuild": { - "return": "FcPattern *", - "arguments": "(FcPattern *, ...)", - "type": "EFT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "FcPatternCreate": { - "return": "FcPattern *", - "arguments": "(void)", - "type": "EFT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "FcPatternDuplicate": { - "return": "FcPattern *", - "arguments": "(const FcPattern *)", - "type": "EFT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "SSL_CTX_new": { - "return": "SSL_CTX *", - "arguments": "(const SSL_METHOD *)", - "type": "EFT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "SSL_get_peer_certificate": { - "return": "X509 *", - "arguments": "(const SSL *)", - "type": "EFT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "SSL_new": { - "return": "SSL *", - "arguments": "(SSL_CTX *)", - "type": "EFT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "SSLv23_client_method": { - "return": "const SSL_METHOD *", - "arguments": "(void)", - "type": "EFT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "SyGetmem": { - "return": "char *", - "arguments": "(long)", - "type": "EFT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "TLSv1_client_method": { - "return": "const SSL_METHOD *", - "arguments": "(void)", - "type": "EFT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "XAddExtension": { - "return": "XExtCodes *", - "arguments": "(DisplayPtr)", - "type": "EFT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "XAllocClassHint": { - "return": "XClassHint *", - "arguments": "(void)", - "type": "EFT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "XAllocSizeHints": { - "return": "XSizeHints *", - "arguments": "(void)", - "type": "EFT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "XAllocStandardColormap": { - "return": "XStandardColormap *", - "arguments": "()", - "type": "EFT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "XCreateFontSet": { - "return": "XFontSet", - "arguments": "(Display *, char *, char ***, int *, char **)", - "type": "EFT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "XCreateImage": { - "return": "XImage *", - "arguments": "(Display *, Visual *, unsigned int, int, int, char *, unsigned int, unsigned int, int, int)", - "type": "EFT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "XCreateGC": { - "return": "GC", - "arguments": "(Display *, Drawable, unsigned long, XGCValues *)", - "type": "EFT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "XESetCloseDisplay": { - "return": "int *", - "arguments": "(Display *, int, int)", - "type": "EFT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "XGetImage": { - "return": "XImage *", - "arguments": "(Display *, Drawable, int, int, unsigned int, unsigned int, unsigned long, int)", - "type": "EFT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "XGetModifierMapping": { - "return": "XModifierKeymap *", - "arguments": "(Display *)", - "type": "EFT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "XGetMotionEvents": { - "return": "XTimeCoord *", - "arguments": "(Display *, Window, Time, Time, int *)", - "type": "EFT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "XGetVisualInfo": { - "return": "XVisualInfo *", - "arguments": "(Display *, long, XVisualInfo *, int *)", - "type": "EFT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "XLoadQueryFont": { - "return": "XFontStruct *", - "arguments": "(Display *, char *)", - "type": "EFT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "XListPixmapFormats": { - "return": "XPixmapFormatValues *", - "arguments": "(Display *, int *)", - "type": "EFT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "XRenderFindFormat": { - "return": "XRenderPictFormat *", - "arguments": "(Display *, unsigned long, _Xconst XRenderPictFormat *, int)", - "type": "EFT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "XRenderFindStandardFormat": { - "return": "XRenderPictFormat *", - "arguments": "(Display *, int)", - "type": "EFT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "XRenderFindVisualFormat": { - "return": "XRenderPictFormat *", - "arguments": "(Display *, _Xconst Visual *)", - "type": "EFT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "XOpenDisplay": { - "return": "Display *", - "arguments": "(char *)", - "type": "EFT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "XSetErrorHandler": { - "return": "int *", - "arguments": "(Display *, XErrorEvent *)", - "type": "EFT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "XSetIOErrorHandler": { - "return": "int *", - "arguments": "(Display *)", - "type": "EFT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "XShapeGetRectangles": { - "return": "XRectangle *", - "arguments": "(Display *, Window, int, int *, int *)", - "type": "EFT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "XShmCreateImage": { - "return": "XImage *", - "arguments": "(Display *, Visual *, unsigned int, int, char *, XShmSegmentInfo *, unsigned int, unsigned int)", - "type": "EFT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "XSynchronize": { - "return": "int *", - "arguments": "(Display *, Bool)", - "type": "EFT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "XcursorImageCreate": { - "return": "XcursorImage *", - "arguments": "(int, int)", - "type": "EFT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "XcursorLibraryLoadImages": { - "return": "XcursorImages *", - "arguments": "(const char *, const char *, int)", - "type": "EFT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "XcursorShapeLoadImages": { - "return": "XcursorImages *", - "arguments": "(unsigned int, const char *, int)", - "type": "EFT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "XineramaQueryScreens": { - "return": "XineramaScreenInfo *", - "arguments": "(Display *, int *)", - "type": "EFT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "XkbGetMap": { - "return": "XkbDescPtr", - "arguments": "(Display *, unsigned int, unsigned int)", - "type": "EFT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "XtAppCreateShell": { - "return": "Widget", - "arguments": "(String, String, WidgetClass, Display *, ArgList, Cardinal)", - "type": "EFT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "XtCreateApplicationContext": { - "return": "XtAppContext", - "arguments": "(void)", - "type": "EFT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "XtOpenDisplay": { - "return": "Display *", - "arguments": "(XtAppContext, String, String, String, XrmOptionDescRec *, Cardinal, int *, String *)", - "type": "EFT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "alloc": { - "return": "int", - "arguments": "(pthdb_user_t, size_t, void **)", - "type": "EFT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "alloc_check": { - "return": "char *", - "arguments": "(int, int)", - "type": "EFT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "alloc_clear": { - "return": "void", - "arguments": "(struct_cache *)", - "type": "EFT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "art_svp_from_vpath": { - "return": "ArtSVP*", - "arguments": "((ArtVpath *)", - "type": "EFT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "art_svp_vpath_stroke": { - "return": "ArtSVP*", - "arguments": "(ArtVpath *, ArtPathStrokeJoinType, ArtPathStrokeCapType, double, double, double)", - "type": "EFT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "art_svp_writer_rewind_new": { - "return": "ArtSvpWriter *", - "arguments": "(ArtWindRule)", - "type": "EFT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "art_svp_writer_rewind_reap": { - "return": "ArtSVP *", - "arguments": "(ArtSvpWriter *)", - "type": "EFT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "art_vpath_dash": { - "return": "ArtVpath *", - "arguments": "(const ArtVpath *, const ArtVpathDash *)", - "type": "EFT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "cairo_create": { - "return": "cairo_t *", - "arguments": "(cairo_surface_t *)", - "type": "EFT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "cairo_image_surface_create_for_data": { - "return": "cairo_surface_t *", - "arguments": "(unsigned char *, cairo_format_t, int, int, int)", - "type": "EFT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "cairo_pattern_create_for_surface": { - "return": "cairo_pattern_t *", - "arguments": "(cairo_surface_t *)", - "type": "EFT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "cairo_surface_create_similar": { - "return": "cairo_surface_t *", - "arguments": "(cairo_surface_t *, cairo_content_t, int, int)", - "type": "EFT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "calloc": { - "return": "void *", - "arguments": "(size_t, size_t)", - "type": "EFT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "zmalloc": { - "return": "void *", - "arguments": "(size_t)", - "type": "EFT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "fopen": { - "return": "FILE *", - "arguments": "(const char *, const char *)", - "type": "EFT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "fopencookie": { - "return": "FILE *", - "arguments": "(void *restrict, const char *restrict, cookie_io_functions_t)", - "type": "EFT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "g_scanner_new": { - "return": "GScanner *", - "arguments": "(const GScannerConfig *)", - "type": "EFT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "gcry_sexp_nth_mpi": { - "return": " gcry_mpi_t", - "arguments": "(gcry_sexp_t, int, int)", - "type": "EFT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "gzdopen": { - "return": "gcry_mpi_t", - "arguments": "(gcry_sexp_t, int, int)", - "type": "EFT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "iconv_open": { - "return": "iconv_t", - "arguments": "(const char *, const char *)", - "type": "EFT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "jpeg_alloc_huff_table": { - "return": "JHUFF_TBL *", - "arguments": "(j_common_ptr)", - "type": "EFT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "jpeg_alloc_quant_table": { - "return": "JQUANT_TBL *", - "arguments": "(j_common_ptr)", - "type": "EFT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "lalloc": { - "return": "void *", - "arguments": "(size_t, int)", - "type": "EFT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "lalloc_clear": { - "return": "void *", - "arguments": "(size_t, int)", - "type": "EFT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "malloc": { - "return": "void *", - "arguments": "(size_t)", - "type": "EFT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "nhalloc": { - "return": "long *", - "arguments": "(unsigned int, const char *, int)", - "type": "EFT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "oballoc": { - "return": "void *", - "arguments": "(size_t)", - "type": "EFT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "pango_cairo_font_map_create_context": { - "return": "PangoContext *", - "arguments": "(PangoCairoFontMap *)", - "type": "EFT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "pcre_compile": { - "return": "pcre *", - "arguments": "(const char *, int, const char **, int *, const unsigned char *)", - "type": "EFT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "pcre_study": { - "return": "pcre_extra *", - "arguments": "(const pcre *, int, const char **)", - "type": "EFT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "permalloc": { - "return": "Perm_t *", - "arguments": "(int)", - "type": "EFT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "png_create_info_struct": { - "return": "png_infop", - "arguments": "(png_structp)", - "type": "EFT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "png_create_write_struct": { - "return": "png_structp", - "arguments": "(png_const_charp, png_voidp, png_error_ptr, png_error_ptr)", - "type": "EFT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "popen": { - "return": "FILE *", - "arguments": "(const char *, const char *)", - "type": "EFT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "pthread_getspecific": { - "return": "FILE *", - "arguments": "(const char *, const char *)", - "type": "EFT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "readdir": { - "return": "struct dirent *", - "arguments": "(DIR *)", - "type": "EFT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "safe_calloc": { - "return": "void *", - "arguments": "(unsigned, unsigned)", - "type": "EFT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "safe_malloc": { - "return": "void *", - "arguments": "(size_t)", - "type": "EFT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "safecalloc": { - "return": "char *", - "arguments": "(int, int)", - "type": "EFT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "safemalloc": { - "return": "char *", - "arguments": "(int)", - "type": "EFT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "safexcalloc": { - "return": "char *", - "arguments": "(I32, MEM_SIZE, MEM_SIZE)", - "type": "EFT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "safexmalloc": { - "return": "char *", - "arguments": "(int, MEM_SIZE)", - "type": "EFT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "savealloc": { - "return": "char *", - "arguments": "(MEM_SIZE)", - "type": "EFT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "setmntent": { - "return": "FILE *", - "arguments": "(const char *, const char *)", - "type": "EFT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "shmat": { - "return": "void *", - "arguments": "(int, const void *, int)", - "type": "EFT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "__sysv_signal": { - "return": "void (i32)*", - "arguments": "(i32, void (i32)*)", - "type": "EFT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "signal": { - "return": "void (i32)*", - "arguments": "(i32, void (i32)*)", - "type": "EFT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "sigset": { - "return": "sighandler_t", - "arguments": "(int, sighandler_t)", - "type": "EFT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "tempnam": { - "return": "char *", - "arguments": "(const char *, const char *)", - "type": "EFT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "tmpfile": { - "return": "FILE *", - "arguments": "(void)", - "type": "EFT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "xalloc": { - "return": "static int", - "arguments": "()", - "type": "EFT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "xcalloc": { - "return": "void *", - "arguments": "(size_t, size_t)", - "type": "EFT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "xmalloc": { - "return": "void *", - "arguments": "(size_t)", - "type": "EFT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "_Znwm": { - "return": "i8*", - "arguments": "(i64)", - "type": "EFT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "_Znam": { - "return": "i8*", - "arguments": "(i64)", - "type": "EFT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "_Znaj": { - "return": "i8*", - "arguments": "(i32)", - "type": "EFT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "_Znwj": { - "return": "i8*", - "arguments": "(i64)", - "type": "EFT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "__cxa_allocate_exception": { - "return": "void *", - "arguments": "(size_t)", - "type": "EFT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "aligned_alloc": { - "return": "void *", - "arguments": "(size_t, size_t)", - "type": "EFT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "memalign": { - "return": "void *", - "arguments": "(size_t, size_t)", - "type": "EFT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "valloc": { - "return": "void *", - "arguments": "(size_t)", - "type": "EFT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "VOS_MemAlloc": { - "return": "EXT_DECL UINT8 *", - "arguments": "(UINT32)", - "type": "EFT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "mmap64": { - "return": "void *", - "arguments": "(void *, size_t, int, int, int, off64_t)", - "type": "EFT_NOSTRUCT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "X509_NAME_oneline": { - "return": "char *", - "arguments": "(X509_NAME *,char *, int)", - "type": "EFT_NOSTRUCT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "X509_verify_cert_error_string": { - "return": "const char *", - "arguments": "(long)", - "type": "EFT_NOSTRUCT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "XBaseFontNameListOfFontSet": { - "return": "char *", - "arguments": "(XFontSet)", - "type": "EFT_NOSTRUCT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "XGetAtomName": { - "return": "char *", - "arguments": "(Display *, Atom)", - "type": "EFT_NOSTRUCT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "XGetDefault": { - "return": "char *", - "arguments": "(Display *, char *, char *)", - "type": "EFT_NOSTRUCT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "XGetKeyboardMapping": { - "return": "KeySym *", - "arguments": "(Display *, KeyCode, int, int *)", - "type": "EFT_NOSTRUCT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "XListDepths": { - "return": "int *", - "arguments": "(Display *, int, int)", - "type": "EFT_NOSTRUCT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "XListFonts": { - "return": "char **", - "arguments": "(Display *, char *, int, int *)", - "type": "EFT_NOSTRUCT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "XSetLocaleModifiers": { - "return": "char *", - "arguments": "(char *)", - "type": "EFT_NOSTRUCT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "XcursorGetTheme": { - "return": "char *", - "arguments": "(Display *)", - "type": "EFT_NOSTRUCT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "__strdup": { - "return": "char *", - "arguments": "(const char)", - "type": "EFT_NOSTRUCT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "crypt": { - "return": "char *", - "arguments": "(const char *, const char *)", - "type": "EFT_NOSTRUCT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "ctime": { - "return": "char *", - "arguments": "(const time_t *)", - "type": "EFT_NOSTRUCT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "dlerror": { - "return": "char *", - "arguments": "(void)", - "type": "EFT_NOSTRUCT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "dlopen": { - "return": "void *", - "arguments": "(const char *, int)", - "type": "EFT_NOSTRUCT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "gai_strerror": { - "return": "const char *", - "arguments": "(int)", - "type": "EFT_NOSTRUCT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "gcry_cipher_algo_name": { - "return": "const char *", - "arguments": "(int)", - "type": "EFT_NOSTRUCT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "gcry_md_algo_name": { - "return": "const char *", - "arguments": "(int)", - "type": "EFT_NOSTRUCT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "gcry_md_read": { - "return": "unsigned char *", - "arguments": "(GCRY_MD_HD, int)", - "type": "EFT_NOSTRUCT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "getenv": { - "return": "char *", - "arguments": "(const char *)", - "type": "EFT_NOSTRUCT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "getlogin": { - "return": "char *", - "arguments": "(void)", - "type": "EFT_NOSTRUCT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "getpass": { - "return": "char *", - "arguments": "(const char *)", - "type": "EFT_NOSTRUCT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "gnutls_strerror": { - "return": "const char *", - "arguments": "(int)", - "type": "EFT_NOSTRUCT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "gpg_strerror": { - "return": "const char *", - "arguments": "(unsigned int)", - "type": "EFT_NOSTRUCT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "gzerror": { - "return": "const char *", - "arguments": "(gzFile, int *)", - "type": "EFT_NOSTRUCT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "inet_ntoa": { - "return": "char *", - "arguments": "(struct in_addr)", - "type": "EFT_NOSTRUCT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "initscr": { - "return": "WINDOW *", - "arguments": "(void)", - "type": "EFT_NOSTRUCT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "llvm.stacksave": { - "return": "ptr *", - "arguments": "()", - "type": "EFT_NOSTRUCT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "mmap": { - "return": "void *", - "arguments": "(void *, size_t, int, int, int, off_t)", - "type": "EFT_NOSTRUCT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "newwin": { - "return": "WINDOW *", - "arguments": "(int, int, int, int)", - "type": "EFT_NOSTRUCT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "nl_langinfo": { - "return": "char *", - "arguments": "(nl_item)", - "type": "EFT_NOSTRUCT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "opendir": { - "return": "DIR *", - "arguments": "(const char *)", - "type": "EFT_NOSTRUCT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "sbrk": { - "return": "void *", - "arguments": "(intptr_t)", - "type": "EFT_NOSTRUCT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "strdup": { - "return": "char *", - "arguments": "(const char *)", - "type": "EFT_NOSTRUCT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "strerror": { - "return": "char *", - "arguments": "(int)", - "type": "EFT_NOSTRUCT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "strsignal": { - "return": "char *", - "arguments": "(int)", - "type": "EFT_NOSTRUCT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "textdomain": { - "return": "char *", - "arguments": "(const char *)", - "type": "EFT_NOSTRUCT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "tgetstr": { - "return": "char *", - "arguments": "(char *, char **)", - "type": "EFT_NOSTRUCT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "tigetstr": { - "return": "char *", - "arguments": "(char *)", - "type": "EFT_NOSTRUCT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "tmpnam": { - "return": "char *", - "arguments": "(char *)", - "type": "EFT_NOSTRUCT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "ttyname": { - "return": "char *", - "arguments": "(int)", - "type": "EFT_NOSTRUCT_ALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "__ctype_b_loc": { - "return": "const unsigned short **", - "arguments": "(void)", - "type": "EFT_STAT2", - "overwrite_app_function": 0, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "__ctype_tolower_loc": { - "return": "int32_t **", - "arguments": "(void)", - "type": "EFT_STAT2", - "overwrite_app_function": 0, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "__ctype_toupper_loc": { - "return": "int32_t **", - "arguments": "(void)", - "type": "EFT_STAT2", - "overwrite_app_function": 0, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "XKeysymToString": { - "return": "char *", - "arguments": "(KeySym)", - "type": "EFT_STAT", - "overwrite_app_function": 0, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "__errno_location": { - "return": "int *", - "arguments": "(void)", - "type": "EFT_STAT", - "overwrite_app_function": 0, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "__h_errno_location": { - "return": "int *", - "arguments": "(void)", - "type": "EFT_STAT", - "overwrite_app_function": 0, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "__res_state": { - "return": "struct __res_state *", - "arguments": "(void)", - "type": "EFT_STAT", - "overwrite_app_function": 0, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "asctime": { - "return": "char *", - "arguments": "(const struct tm *)", - "type": "EFT_STAT", - "overwrite_app_function": 0, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "bindtextdomain": { - "return": "char *", - "arguments": "(const char *, const char *)", - "type": "EFT_STAT", - "overwrite_app_function": 0, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "bind_textdomain_codeset": { - "return": "char *", - "arguments": "(const char *, const char *)", - "type": "EFT_STAT", - "overwrite_app_function": 0, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "ctermid": { - "return": "char *", - "arguments": "(char *)", - "type": "EFT_STAT", - "overwrite_app_function": 0, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "dcgettext": { - "return": "char *", - "arguments": "(const char * , const char *, int)", - "type": "EFT_STAT", - "overwrite_app_function": 0, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "dgettext": { - "return": "char *", - "arguments": " (const char * domainname, const char * msgid)", - "type": "EFT_STAT", - "overwrite_app_function": 0, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "dngettext": { - "return": "char *", - "arguments": "(const char *, const char *, const char *, unsigned long int)", - "type": "EFT_STAT", - "overwrite_app_function": 0, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "fdopen": { - "return": "FILE *", - "arguments": "(int, const char *)", - "type": "EFT_STAT", - "overwrite_app_function": 0, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "gcry_strerror": { - "return": "const char *", - "arguments": "(gcry_error_t)", - "type": "EFT_STAT", - "overwrite_app_function": 0, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "gcry_strsource": { - "return": "const char *", - "arguments": "(gcry_error_t)", - "type": "EFT_STAT", - "overwrite_app_function": 0, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "getgrgid": { - "return": "struct group *", - "arguments": "(gid_t)", - "type": "EFT_STAT", - "overwrite_app_function": 0, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "getgrnam": { - "return": "struct group *", - "arguments": "(const char *)", - "type": "EFT_STAT", - "overwrite_app_function": 0, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "gethostbyaddr": { - "return": "struct hostent *", - "arguments": "(const void *, socklen_t, int)", - "type": "EFT_STAT", - "overwrite_app_function": 0, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "gethostbyname": { - "return": "struct hostent *", - "arguments": "(const char *)", - "type": "EFT_STAT", - "overwrite_app_function": 0, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "gethostbyname2": { - "return": "struct hostent *", - "arguments": "(const char *, int)", - "type": "EFT_STAT", - "overwrite_app_function": 0, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "getmntent": { - "return": "struct mntent *", - "arguments": "(FILE *)", - "type": "EFT_STAT", - "overwrite_app_function": 0, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "getprotobyname": { - "return": "struct protoent *", - "arguments": "(const char *)", - "type": "EFT_STAT", - "overwrite_app_function": 0, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "getprotobynumber": { - "return": "struct protoent *", - "arguments": "(int)", - "type": "EFT_STAT", - "overwrite_app_function": 0, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "getpwent": { - "return": "struct passwd *", - "arguments": "(void)", - "type": "EFT_STAT", - "overwrite_app_function": 0, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "getpwnam": { - "return": "struct passwd *", - "arguments": "(const char *)", - "type": "EFT_STAT", - "overwrite_app_function": 0, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "getpwuid": { - "return": "struct passwd *", - "arguments": "(uid_t)", - "type": "EFT_STAT", - "overwrite_app_function": 0, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "getservbyname": { - "return": "struct servent *", - "arguments": "(const char *, const char *)", - "type": "EFT_STAT", - "overwrite_app_function": 0, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "getservbyport": { - "return": "struct servent *", - "arguments": "(int, const char *)", - "type": "EFT_STAT", - "overwrite_app_function": 0, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "getspnam": { - "return": "struct spwd *", - "arguments": "(const char *)", - "type": "EFT_STAT", - "overwrite_app_function": 0, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "gettext": { - "return": "char *", - "arguments": "(const char *)", - "type": "EFT_STAT", - "overwrite_app_function": 0, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "gmtime": { - "return": "struct tm *", - "arguments": "(const time_t *)", - "type": "EFT_STAT", - "overwrite_app_function": 0, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "gnu_get_libc_version": { - "return": "const char *", - "arguments": "(void)", - "type": "EFT_STAT", - "overwrite_app_function": 0, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "gnutls_check_version": { - "return": "const char *", - "arguments": "(const char *)", - "type": "EFT_STAT", - "overwrite_app_function": 0, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "localeconv": { - "return": "struct lconv *", - "arguments": "(void)", - "type": "EFT_STAT", - "overwrite_app_function": 0, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "localtime": { - "return": "struct tm *", - "arguments": "(const time_t *)", - "type": "EFT_STAT", - "overwrite_app_function": 0, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "ngettext": { - "return": "char *", - "arguments": "(const char *, const char *, unsigned long int)", - "type": "EFT_STAT", - "overwrite_app_function": 0, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "pango_cairo_font_map_get_default": { - "return": "PangoFontMap *", - "arguments": "(void)", - "type": "EFT_STAT", - "overwrite_app_function": 0, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "re_comp": { - "return": "char *", - "arguments": "(const char *)", - "type": "EFT_STAT", - "overwrite_app_function": 0, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "setlocale": { - "return": "char *", - "arguments": "(int, const char *)", - "type": "EFT_STAT", - "overwrite_app_function": 0, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "tgoto": { - "return": "char *", - "arguments": "(const char *, int col, int)", - "type": "EFT_STAT", - "overwrite_app_function": 0, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "tparm": { - "return": "char *", - "arguments": "(char *, ...)", - "type": "EFT_STAT", - "overwrite_app_function": 0, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "zError": { - "return": "const char *", - "arguments": "(int)", - "type": "EFT_STAT", - "overwrite_app_function": 0, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "getcwd": { - "return": "char *", - "arguments": "(char *, size_t )", - "type": "EFT_REALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "mem_realloc": { - "return": "void *", - "arguments": "(void *, size_t)", - "type": "EFT_REALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "realloc": { - "return": "void *", - "arguments": "(void *, size_t)", - "type": "EFT_REALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "realloc_obj": { - "return": "struct obj *", - "arguments": "(struct obj *, int, genericptr_t, int, const char *)", - "type": "EFT_REALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "safe_realloc": { - "return": "void *", - "arguments": "(void *, size_t)", - "type": "EFT_REALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "saferealloc": { - "return": "void *", - "arguments": "(void *, size_t, size_t)", - "type": "EFT_REALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "safexrealloc": { - "return": "char *", - "arguments": "()", - "type": "EFT_REALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "strtok": { - "return": "char *", - "arguments": "(char *, const char *)", - "type": "EFT_REALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "strtok_r": { - "return": "char *", - "arguments": "(char *, const char *, char **)", - "type": "EFT_REALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "xrealloc": { - "return": "void *", - "arguments": "(void *ptr, size_t size)", - "type": "EFT_REALLOC", - "overwrite_app_function": 1, - "AddrStmt": { - "src": "Obj", - "dst": "Ret" - } - }, - "SSL_CTX_free": { - "return": "void", - "arguments": "(SSL_CTX *)", - "type": "EFT_FREE", - "overwrite_app_function": 1 - }, - "SSL_free": { - "return": "void", - "arguments": "(SSL *)", - "type": "EFT_FREE", - "overwrite_app_function": 1 - }, - "cfree": { - "return": "void", - "arguments": "(void *)", - "type": "EFT_FREE", - "overwrite_app_function": 1 - }, - "free": { - "return": "void", - "arguments": "(void *)", - "type": "EFT_FREE", - "overwrite_app_function": 1 - }, - "free_all_mem": { - "return": "void", - "arguments": "(EXIStream *)", - "type": "EFT_FREE", - "overwrite_app_function": 1 - }, - "freeaddrinfo": { - "return": "void", - "arguments": "(struct addrinfo *)", - "type": "EFT_FREE", - "overwrite_app_function": 1 - }, - "gcry_mpi_release": { - "return": "void", - "arguments": "(gcry_mpi_t)", - "type": "EFT_FREE", - "overwrite_app_function": 1 - }, - "gcry_sexp_release": { - "return": "void", - "arguments": "(gcry_sexp_t)", - "type": "EFT_FREE", - "overwrite_app_function": 1 - }, - "globfree": { - "return": "void", - "arguments": "(glob_t *)", - "type": "EFT_FREE", - "overwrite_app_function": 1 - }, - "nhfree": { - "return": "void", - "arguments": "(genericptr_t, const char *, int)", - "type": "EFT_FREE", - "overwrite_app_function": 1 - }, - "obstack_free": { - "return": "void", - "arguments": "(struct obstack *, void *)", - "type": "EFT_FREE", - "overwrite_app_function": 1 - }, - "safe_free": { - "return": "void", - "arguments": "(void *)", - "type": "EFT_FREE", - "overwrite_app_function": 1 - }, - "safexfree": { - "return": "void", - "arguments": "(char *)", - "type": "EFT_FREE", - "overwrite_app_function": 1 - }, - "vim_free": { - "return": "void", - "arguments": "void *", - "type": "EFT_FREE", - "overwrite_app_function": 1 - }, - "xfree": { - "return": "int", - "arguments": "(void *)", - "type": "EFT_FREE", - "overwrite_app_function": 1 - }, - "fclose": { - "return": "int", - "arguments": "(FILE *)", - "type": "EFT_FREE", - "overwrite_app_function": 1 - }, - "XFreeColormap": { - "return": "void", - "arguments": "(Display *, Colormap)", - "type": "EFT_FREE", - "overwrite_app_function": 1 - }, - "XFreeColors": { - "return": "void", - "arguments": "(Display *,Colormap, unsigned long, int, unsigned long)", - "type": "EFT_FREE", - "overwrite_app_function": 1 - }, - "XFreeFont": { - "return": "void", - "arguments": "(Display *, XFontStruct *)", - "type": "EFT_FREE", - "overwrite_app_function": 1 - }, - "XFreeFontNames": { - "return": "void", - "arguments": "(char *)", - "type": "EFT_FREE", - "overwrite_app_function": 1 - }, - "XFreeGC": { - "return": "void", - "arguments": "(Display *, GC)", - "type": "EFT_FREE", - "overwrite_app_function": 1 - }, - "XFreePixmap": { - "return": "void", - "arguments": "(Display *, Pixmap)", - "type": "EFT_FREE", - "overwrite_app_function": 1 - }, - "XFree": { - "return": "int", - "arguments": "(void *)", - "type": "EFT_FREE", - "overwrite_app_function": 1 - }, - "_ZdaPv": { - "return": "void", - "arguments": "(void *)", - "type": "EFT_FREE", - "overwrite_app_function": 1 - }, - "_ZdlPv": { - "return": "void", - "arguments": "(void *)", - "type": "EFT_FREE", - "overwrite_app_function": 1 - }, - "__rawmemchr": { - "return": "ptr_t", - "arguments": "(const ptr_t, int)", - "type": "EFT_L_A0", - "overwrite_app_function": 0, - "CopyStmt": { - "src": "Arg0", - "dst": "Ret" - } - }, - "cairo_surface_reference": { - "return": "cairo_surface_t *", - "arguments": "(cairo_surface_t *)", - "type": "EFT_L_A0", - "overwrite_app_function": 0, - "CopyStmt": { - "src": "Arg0", - "dst": "Ret" - } - }, - "fgets": { - "return": "char *", - "arguments": "(char *, int, FILE *)", - "type": "EFT_L_A0", - "overwrite_app_function": 0, - "CopyStmt": { - "src": "Arg0", - "dst": "Ret" - } - }, - "jpeg_std_error": { - "return": "struct jpeg_error_mgr *", - "arguments": "(struct jpeg_error_mgr *)", - "type": "EFT_L_A0", - "overwrite_app_function": 0, - "CopyStmt": { - "src": "Arg0", - "dst": "Ret" - } - }, - "memchr": { - "return": "void *", - "arguments": "(const void *, int, size_t)", - "type": "EFT_L_A0", - "overwrite_app_function": 0, - "CopyStmt": { - "src": "Arg0", - "dst": "Ret" - } - }, - "mremap": { - "return": "void *", - "arguments": "(void *, size_t, size_t, int)", - "type": "EFT_L_A0", - "overwrite_app_function": 0, - "CopyStmt": { - "src": "Arg0", - "dst": "Ret" - } - }, - "strchr": { - "return": "char *", - "arguments": "(const char *, int)", - "type": "EFT_L_A0", - "overwrite_app_function": 0, - "CopyStmt": { - "src": "Arg0", - "dst": "Ret" - } - }, - "strerror_r": { - "return": "char *", - "arguments": "(int, char *, size_t)", - "type": "EFT_L_A0", - "overwrite_app_function": 0, - "CopyStmt": { - "src": "Arg0", - "dst": "Ret" - } - }, - "strpbrk": { - "return": "char *", - "arguments": "(const char *, const char *)", - "type": "EFT_L_A0", - "overwrite_app_function": 0, - "CopyStmt": { - "src": "Arg0", - "dst": "Ret" - } - }, - "strptime": { - "return": "char *", - "arguments": "(const char *restrict, const char *restrict, struct tm *restrict)", - "type": "EFT_L_A0", - "overwrite_app_function": 0, - "CopyStmt": { - "src": "Arg0", - "dst": "Ret" - } - }, - "strrchr": { - "return": "char *", - "arguments": "(const char *, int)", - "type": "EFT_L_A0", - "overwrite_app_function": 0, - "CopyStmt": { - "src": "Arg0", - "dst": "Ret" - } - }, - "strstr": { - "return": "char *", - "arguments": "(const char *, const char *)", - "type": "EFT_L_A0", - "overwrite_app_function": 0, - "CopyStmt": { - "src": "Arg0", - "dst": "Ret" - } - }, - "tmpnam_r": { - "return": "char *", - "arguments": "(char *)", - "type": "EFT_L_A0", - "overwrite_app_function": 0, - "CopyStmt": { - "src": "Arg0", - "dst": "Ret" - } - }, - "isalnum": { - "return": "int", - "arguments": "(int)", - "type": "EFT_L_A0", - "overwrite_app_function": 0, - "CopyStmt": { - "src": "Arg0", - "dst": "Ret" - } - }, - "isalpha": { - "return": "int", - "arguments": "(int)", - "type": "EFT_L_A0", - "overwrite_app_function": 0, - "CopyStmt": { - "src": "Arg0", - "dst": "Ret" - } - }, - "isblank": { - "return": "int", - "arguments": "(int)", - "type": "EFT_L_A0", - "overwrite_app_function": 0, - "CopyStmt": { - "src": "Arg0", - "dst": "Ret" - } - }, - "iscntrl": { - "return": "int", - "arguments": "(int)", - "type": "EFT_L_A0", - "overwrite_app_function": 0, - "CopyStmt": { - "src": "Arg0", - "dst": "Ret" - } - }, - "isdigit": { - "return": "int", - "arguments": "(int)", - "type": "EFT_L_A0", - "overwrite_app_function": 0, - "CopyStmt": { - "src": "Arg0", - "dst": "Ret" - } - }, - "isgraph": { - "return": "int", - "arguments": "(int)", - "type": "EFT_L_A0", - "overwrite_app_function": 0, - "CopyStmt": { - "src": "Arg0", - "dst": "Ret" - } - }, - "islower": { - "return": "int", - "arguments": "(int)", - "type": "EFT_L_A0", - "overwrite_app_function": 0, - "CopyStmt": { - "src": "Arg0", - "dst": "Ret" - } - }, - "isprint": { - "return": "int", - "arguments": "(int)", - "type": "EFT_L_A0", - "overwrite_app_function": 0, - "CopyStmt": { - "src": "Arg0", - "dst": "Ret" - } - }, - "ispunct": { - "return": "int", - "arguments": "(int)", - "type": "EFT_L_A0", - "overwrite_app_function": 0, - "CopyStmt": { - "src": "Arg0", - "dst": "Ret" - } - }, - "isspace": { - "return": "int", - "arguments": "(int)", - "type": "EFT_L_A0", - "overwrite_app_function": 0, - "CopyStmt": { - "src": "Arg0", - "dst": "Ret" - } - }, - "isupper": { - "return": "int", - "arguments": "(int)", - "type": "EFT_L_A0", - "overwrite_app_function": 0, - "CopyStmt": { - "src": "Arg0", - "dst": "Ret" - } - }, - "isxdigit": { - "return": "int", - "arguments": "(int)", - "type": "EFT_L_A0", - "overwrite_app_function": 0, - "CopyStmt": { - "src": "Arg0", - "dst": "Ret" - } - }, - "asctime_r": { - "return": "char *", - "arguments": "(const struct tm *, char *)", - "type": "EFT_L_A1", - "overwrite_app_function": 0, - "CopyStmt": { - "src": "Arg1", - "dst": "Ret" - } - }, - "bsearch": { - "return": "void *", - "arguments": "(const void *, const void *, size_t, size_t, int (*compar)(const void *, const void *))", - "type": "EFT_L_A1", - "overwrite_app_function": 0, - "CopyStmt": { - "src": "Arg1", - "dst": "Ret" - } - }, - "getmntent_r": { - "return": "struct mntent *", - "arguments": "(FILE *restrict, struct mntent *restrict, char *restrict, int)", - "type": "EFT_L_A1", - "overwrite_app_function": 0, - "CopyStmt": { - "src": "Arg1", - "dst": "Ret" - } - }, - "gmtime_r": { - "return": "struct tm *", - "arguments": "(const time_t *, struct tm *)", - "type": "EFT_L_A1", - "overwrite_app_function": 0, - "CopyStmt": { - "src": "Arg1", - "dst": "Ret" - } - }, - "gzgets": { - "return": "char *", - "arguments": "(gzFile, char *, int)", - "type": "EFT_L_A1", - "overwrite_app_function": 0, - "CopyStmt": { - "src": "Arg1", - "dst": "Ret" - } - }, - "localtime_r": { - "return": "struct tm *", - "arguments": "(const time_t *, struct tm *)", - "type": "EFT_L_A1", - "overwrite_app_function": 0, - "CopyStmt": { - "src": "Arg1", - "dst": "Ret" - } - }, - "realpath": { - "return": "char *", - "arguments": "(const char *restrict, char *restrict)", - "type": "EFT_L_A1", - "overwrite_app_function": 0, - "CopyStmt": { - "src": "Arg1", - "dst": "Ret" - } - }, - "freopen64": { - "return": "FILE *", - "arguments": "(const char*, const char*, FILE *)", - "type": "EFT_L_A2", - "overwrite_app_function": 0, - "CopyStmt": { - "src": "Arg2", - "dst": "Ret" - } - }, - "freopen": { - "return": "FILE *", - "arguments": "(const char *, const char *, FILE *)", - "type": "EFT_L_A2", - "overwrite_app_function": 0, - "CopyStmt": { - "src": "Arg2", - "dst": "Ret" - } - }, - "inet_ntop": { - "return": "const char *", - "arguments": "(int, const void *restrict, char *restrict, socklen_t)", - "type": "EFT_L_A2", - "overwrite_app_function": 0, - "CopyStmt": { - "src": "Arg2", - "dst": "Ret" - } - }, - "XGetSubImage": { - "return": "XImage *", - "arguments": "(Display *, Drawable, int, int, unsigned int, unsigned int, unsigned long, unsigned long, int, XImage *, int)", - "type": "EFT_L_A8", - "overwrite_app_function": 0, - "CopyStmt": { - "src": "Arg8", - "dst": "Ret" - } - }, - "llvm.memset": { - "return": "void", - "arguments": "(i8*, i8, i32, i32, i1)", - "type": "EFT_L_A0__A0R_A1", - "overwrite_app_function": 0, - "memset_like": { - "src": "Arg0", - "dst": "Arg1", - "size": "Arg2" - } - }, - "llvm.memset.p0i8.i32": { - "return": "void", - "arguments": "(i8*, i8, i32, i32, i1)", - "type": "EFT_L_A0__A0R_A1", - "overwrite_app_function": 0, - "memset_like": { - "src": "Arg0", - "dst": "Arg1", - "size": "Arg2" - } - }, - "llvm.memset.p0i8.i64": { - "return": "void", - "arguments": "(i8*, i8, i64, i1)", - "type": "EFT_L_A0__A0R_A1", - "overwrite_app_function": 0, - "memset_like": { - "src": "Arg0", - "dst": "Arg1", - "size": "Arg2" - } - }, - "__memset_chk": { - "return": "void *", - "arguments": "(void *, int, size_t, size_t)", - "type": "EFT_L_A0__A0R_A1", - "overwrite_app_function": 0, - "memset_like": { - "src": "Arg0", - "dst": "Arg1", - "size": "Arg2" - } - }, - "llvm.memcpy": { - "return": "void", - "arguments": "(i8*, i8*, i32, i32, i1)", - "type": "EFT_L_A0__A0R_A1R", - "overwrite_app_function": 0, - "memcpy_like": { - "src": "Arg0", - "dst": "Arg1", - "size": "Arg2" - }, - "CopyStmt": { - "src": "Arg0", - "dst": "Ret" - } - }, - "llvm.memcpy.p0i8.p0i8.i32": { - "return": "void", - "arguments": "(i8*, i8*, i32, i32, i1)", - "type": "EFT_L_A0__A0R_A1R", - "overwrite_app_function": 0, - "memcpy_like": { - "src": "Arg0", - "dst": "Arg1", - "size": "Arg2" - }, - "CopyStmt": { - "src": "Arg0", - "dst": "Ret" - } - }, - "llvm.memcpy.p0i8.p0i8.i64": { - "return": "void", - "arguments": "(i8*, i8*, i64, i1)", - "type": "EFT_L_A0__A0R_A1R", - "overwrite_app_function": 0, - "memcpy_like": { - "src": "Arg0", - "dst": "Arg1", - "size": "Arg2" - }, - "CopyStmt": { - "src": "Arg0", - "dst": "Ret" - } - }, - "llvm.memmove": { - "return": "void", - "arguments": "(i8*, i8*, i32, i1)", - "type": "EFT_L_A0__A0R_A1R", - "overwrite_app_function": 0, - "memcpy_like": { - "src": "Arg0", - "dst": "Arg1", - "size": "Arg2" - }, - "CopyStmt": { - "src": "Arg0", - "dst": "Ret" - } - }, - "llvm.memmove.p0i8.p0i8.i32": { - "return": "void", - "arguments": "(i8*, i8*, i32, i1)", - "type": "EFT_L_A0__A0R_A1R", - "overwrite_app_function": 0, - "memcpy_like": { - "src": "Arg0", - "dst": "Arg1", - "size": "Arg2" - }, - "CopyStmt": { - "src": "Arg0", - "dst": "Ret" - } - }, - "llvm.memmove.p0i8.p0i8.i64": { - "return": "void", - "arguments": "(i8*, i8*, i64, i1)", - "type": "EFT_L_A0__A0R_A1R", - "overwrite_app_function": 0, - "memcpy_like": { - "src": "Arg0", - "dst": "Arg1", - "size": "Arg2" - }, - "CopyStmt": { - "src": "Arg0", - "dst": "Ret" - } - }, - "memccpy": { - "return": "void *", - "arguments": "(void *restrict, const void *restrict, int, size_t)", - "type": "EFT_L_A0__A0R_A1R", - "overwrite_app_function": 0, - "memcpy_like": { - "src": "Arg0", - "dst": "Arg1", - "size": "Arg2" - }, - "CopyStmt": { - "src": "Arg0", - "dst": "Ret" - } - }, - "memcpy": { - "return": "void *", - "arguments": "(void *, const void *, size_t)", - "type": "EFT_L_A0__A0R_A1R", - "overwrite_app_function": 0, - "memcpy_like": { - "src": "Arg0", - "dst": "Arg1", - "size": "Arg2" - }, - "CopyStmt": { - "src": "Arg0", - "dst": "Ret" - } - }, - "memmove": { - "return": "void *", - "arguments": "(void *, const void *, size_t)", - "type": "EFT_L_A0__A0R_A1R", - "overwrite_app_function": 0, - "memcpy_like": { - "src": "Arg0", - "dst": "Arg1", - "size": "Arg2" - }, - "CopyStmt": { - "src": "Arg0", - "dst": "Ret" - } - }, - "bcopy": { - "return": "void", - "arguments": "(const void *, void *, size_t)", - "type": "EFT_A1R_A0R", - "overwrite_app_function": 0, - "memcpy_like": { - "src": "Arg1", - "dst": "Arg0", - "size": "Arg2" - } - }, - "iconv": { - "return": "size_t", - "arguments": "(iconv_t, char **restrict, size_t *restrict, char **restrict, size_t *restrict)", - "type": "EFT_A3R_A1R_NS", - "overwrite_app_function": 0, - "memcpy_like": { - "src": "Arg3", - "dst": "Arg1" - } - }, - "strtod": { - "return": "double", - "arguments": "(const char *, char **)", - "type": "EFT_A1R_A0", - "overwrite_app_function": 0, - "StoreStmt": { - "src": "Arg0", - "dst": "Arg1" - } - }, - "strtof": { - "return": "float", - "arguments": "(const char *, char **)", - "type": "EFT_A1R_A0", - "overwrite_app_function": 0, - "StoreStmt": { - "src": "Arg0", - "dst": "Arg1" - } - }, - "strtol": { - "return": "long int", - "arguments": "(const char *, char **, int)", - "type": "EFT_A1R_A0", - "overwrite_app_function": 0, - "StoreStmt": { - "src": "Arg0", - "dst": "Arg1" - } - }, - "strtold": { - "return": "long double", - "arguments": "(const char *, char **)", - "type": "EFT_A1R_A0", - "overwrite_app_function": 0, - "StoreStmt": { - "src": "Arg0", - "dst": "Arg1" - } - }, - "strtoll": { - "return": "long long int", - "arguments": "(const char *, char **, int)", - "type": "EFT_A1R_A0", - "overwrite_app_function": 0, - "StoreStmt": { - "src": "Arg0", - "dst": "Arg1" - } - }, - "strtoul": { - "return": "unsigned long int", - "arguments": "(const char *, char **, int)", - "type": "EFT_A1R_A0", - "overwrite_app_function": 0, - "StoreStmt": { - "src": "Arg0", - "dst": "Arg1" - } - }, - "readdir_r":{ - "return": "int", - "arguments": "(DIR *restrict, struct dirent *restrict, struct dirent **restrict)", - "type": "EFT_A2R_A1", - "overwrite_app_function": 0, - "StoreStmt": { - "src": "Arg1", - "dst": "Arg2" - } - }, - "__strcpy_chk": { - "return": "char *", - "arguments": "(char *, const char *, size_t)", - "type": "EFT_L_A0__A1_A0", - "overwrite_app_function": 0, - "memcpy_like": { - "src": "Arg0", - "dst": "Arg1", - "size": "Arg2" - }, - "CopyStmt": { - "src": "Arg0", - "dst": "Ret" - } - }, - "__strcat_chk": { - "return": "char *", - "arguments": "(char *, const char *, size_t)", - "type": "EFT_L_A0__A1_A0", - "overwrite_app_function": 0, - "memcpy_like": { - "src": "Arg0", - "dst": "Arg1", - "size": "Arg2" - }, - "CopyStmt": { - "src": "Arg0", - "dst": "Ret" - } - }, - "stpcpy": { - "return": "char *", - "arguments": "(char *restrict, const char *restrict)", - "type": "EFT_L_A0__A1_A0", - "overwrite_app_function": 0, - "memcpy_like": { - "src": "Arg0", - "dst": "Arg1" - }, - "CopyStmt": { - "src": "Arg0", - "dst": "Ret" - } - }, - "strcat": { - "return": "char *", - "arguments": "(char *, char *)", - "type": "EFT_L_A0__A1_A0", - "overwrite_app_function": 0, - "memcpy_like": { - "src": "Arg0", - "dst": "Arg1" - }, - "CopyStmt": { - "src": "Arg0", - "dst": "Ret" - } - }, - "strcpy": { - "return": "char *", - "arguments": "(char *, const char *)", - "type": "EFT_L_A0__A1_A0", - "overwrite_app_function": 0, - "memcpy_like": { - "src": "Arg0", - "dst": "Arg1" - }, - "CopyStmt": { - "src": "Arg0", - "dst": "Ret" - } - }, - "strncat": { - "return": "char *", - "arguments": "(char *, const char *, size_t)", - "type": "EFT_L_A0__A1_A0", - "overwrite_app_function": 0, - "memcpy_like": { - "src": "Arg0", - "dst": "Arg1", - "size": "Arg2" - }, - "CopyStmt": { - "src": "Arg0", - "dst": "Ret" - } - }, - "strncpy": { - "return": "char *", - "arguments": "(char *, const char *, size_t)", - "type": "EFT_L_A0__A1_A0", - "overwrite_app_function": 0, - "memcpy_like": { - "src": "Arg0", - "dst": "Arg1", - "size": "Arg2" - }, - "CopyStmt": { - "src": "Arg0", - "dst": "Ret" - } - }, - "getpwnam_r":{ - "return": "int", - "arguments": "(const char *, struct passwd *, char *, size_t, struct passwd **)", - "type": "EFT_A4R_A1", - "overwrite_app_function": 0, - "StoreStmt": { - "src": "Arg1", - "dst": "Arg4" - } - }, - "getpwuid_r":{ - "return": "int", - "arguments": "(uid_t, struct passwd *, char *, size_t, struct passwd **)", - "type": "EFT_A4R_A1", - "overwrite_app_function": 0, - "StoreStmt": { - "src": "Arg1", - "dst": "Arg4" - } - }, - "db_create": { - "return": "int", - "arguments": "(DB **, DB_ENV *, u_int32_t)", - "type": "EFT_A0R_NEW", - "overwrite_app_function": 0, - "AddrStmt": { - "src": "Obj", - "dst": "Dummy" - }, - "StoreStmt": { - "src": "Dummy", - "dst": "Arg0" - } - }, - "gcry_mpi_scan": { - "return": "gcry_error_t", - "arguments": "(gcry_mpi_t *, enum gcry_mpi_format, const unsigned char *, size_t, size_t *)", - "type": "EFT_A0R_NEW", - "overwrite_app_function": 0, - "AddrStmt": { - "src": "Obj", - "dst": "Dummy" - }, - "StoreStmt": { - "src": "Dummy", - "dst": "Arg0" - } - }, - "gcry_pk_decrypt": { - "return": "gcry_error_t", - "arguments": "(gcry_sexp_t *, gcry_sexp_t, gcry_sexp_t)", - "type": "EFT_A0R_NEW", - "overwrite_app_function": 0, - "AddrStmt": { - "src": "Obj", - "dst": "Dummy" - }, - "StoreStmt": { - "src": "Dummy", - "dst": "Arg0" - } - }, - "gcry_sexp_build": { - "return": "gcry_error_t", - "arguments": "(gcry_sexp_t *, size_t *, const char *, ...)", - "type": "EFT_A0R_NEW", - "overwrite_app_function": 0, - "AddrStmt": { - "src": "Obj", - "dst": "Dummy" - }, - "StoreStmt": { - "src": "Dummy", - "dst": "Arg0" - } - }, - "gnutls_pkcs12_bag_init": { - "return": "int", - "arguments": "(gnutls_pkcs12_bag_t *)", - "type": "EFT_A0R_NEW", - "overwrite_app_function": 0, - "AddrStmt": { - "src": "Obj", - "dst": "Dummy" - }, - "StoreStmt": { - "src": "Dummy", - "dst": "Arg0" - } - }, - "gnutls_pkcs12_init": { - "return": "int", - "arguments": "(gnutls_pkcs12_t *)", - "type": "EFT_A0R_NEW", - "overwrite_app_function": 0, - "AddrStmt": { - "src": "Obj", - "dst": "Dummy" - }, - "StoreStmt": { - "src": "Dummy", - "dst": "Arg0" - } - }, - "gnutls_x509_crt_init": { - "return": "int", - "arguments": "(gnutls_x509_crt_t *)", - "type": "EFT_A0R_NEW", - "overwrite_app_function": 0, - "AddrStmt": { - "src": "Obj", - "dst": "Dummy" - }, - "StoreStmt": { - "src": "Dummy", - "dst": "Arg0" - } - }, - "gnutls_x509_privkey_init": { - "return": "int", - "arguments": "(gnutls_x509_privkey_t *)", - "type": "EFT_A0R_NEW", - "overwrite_app_function": 0, - "AddrStmt": { - "src": "Obj", - "dst": "Dummy" - }, - "StoreStmt": { - "src": "Dummy", - "dst": "Arg0" - } - }, - "posix_memalign": { - "return": "int", - "arguments": "(void **, size_t, size_t)", - "type": "EFT_A0R_NEW", - "overwrite_app_function": 0, - "AddrStmt": { - "src": "Obj", - "dst": "Dummy" - }, - "StoreStmt": { - "src": "Dummy", - "dst": "Arg0" - } - }, - "scandir": { - "return": "int", - "arguments": "(const char *, struct dirent ***, int (*filter)(const struct dirent *), int (*compar)(const struct dirent **, const struct dirent **))", - "type": "EFT_A1R_NEW", - "overwrite_app_function": 0, - "AddrStmt": { - "src": "Obj", - "dst": "Dummy" - }, - "StoreStmt": { - "src": "Dummy", - "dst": "Arg1" - } - }, - "XGetRGBColormaps": { - "return": "Status", - "arguments": "(Display *, Window, XStandardColormap **, int *, Atom)", - "type": "EFT_A2R_NEW", - "overwrite_app_function": 0, - "AddrStmt": { - "src": "Obj", - "dst": "Dummy" - }, - "StoreStmt": { - "src": "Dummy", - "dst": "Arg2" - } - }, - "XmbTextPropertyToTextList": { - "return": "int", - "arguments": "(Display *, XTextProperty *, char ***, int *)", - "type": "EFT_A2R_NEW", - "overwrite_app_function": 0, - "AddrStmt": { - "src": "Obj", - "dst": "Dummy" - }, - "StoreStmt": { - "src": "Dummy", - "dst": "Arg2" - } - }, - "XQueryTree": { - "return": "Status", - "arguments": "(Display *, Window, Window *, Window *, Window **, unsigned int *)", - "type": "EFT_A4R_NEW", - "overwrite_app_function": 0, - "AddrStmt": { - "src": "Obj", - "dst": "Dummy" - }, - "StoreStmt": { - "src": "Dummy", - "dst": "Arg4" - } - }, - "XGetWindowProperty": { - "return": "int", - "arguments": "(Display *, Window, Atom, long, long, Bool, Atom, Atom *, int *, unsigned long *, unsigned long *, unsigned char **)", - "type": "EFT_A11R_NEW", - "overwrite_app_function": 0, - "AddrStmt": { - "src": "Obj", - "dst": "Dummy" - }, - "StoreStmt": { - "src": "Dummy", - "dst": "Arg11" - } - }, - "_ZSt29_Rb_tree_insert_and_rebalancebPSt18_Rb_tree_node_baseS0_RS_":{ - "return": "void", - "arguments": "(bool, std::_Rb_tree_node_base*, std::_Rb_tree_node_base*, std::_Rb_tree_node_base&)", - "type": "EFT_STD_RB_TREE_INSERT_AND_REBALANCE", - "overwrite_app_function": 0, - "Rb_tree_ops": { - "src": "Arg1", - "dst": "Arg3" - } - }, - "_ZNSt8__detail15_List_node_base7_M_hookEPS0_":{ - "return": "void", - "arguments": "(struct.std::__detail::_List_node_base*, struct.std::__detail::_List_node_base*)", - "type": "EFT_STD_LIST_HOOK", - "overwrite_app_function": 0, - "StoreStmt": { - "src": "Arg0", - "dst": "Arg1" - } - }, - "_ZNSsC1EPKcRKSaIcE":{ - "return": "void", - "arguments": "(char const*, std::allocator const&)", - "type": "CPP_EFT_A0R_A1", - "overwrite_app_function": 0, - "StoreStmt": { - "src": "Arg1", - "dst": "Arg0" - } - }, - "_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC1EPKcRKS3_":{ - "return": "void", - "arguments": "(char const*, std::allocator const&)", - "type": "CPP_EFT_A0R_A1", - "overwrite_app_function": 0, - "StoreStmt": { - "src": "Arg1", - "dst": "Arg0" - } - }, - "_ZNSsC1EPKcmRKSaIcE":{ - "return": "void", - "arguments": "(char const*, unsigned long, std::allocator const&)", - "type": "CPP_EFT_A0R_A1", - "overwrite_app_function": 0, - "StoreStmt": { - "src": "Arg1", - "dst": "Arg0" - } - }, - "_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC1EPKcmRKS3_":{ - "return": "void", - "arguments": "(char const*, unsigned long, std::allocator const&)", - "type": "CPP_EFT_A0R_A1", - "overwrite_app_function": 0, - "StoreStmt": { - "src": "Arg1", - "dst": "Arg0" - } - }, - "_ZNSsaSEPKc":{ - "return": "void", - "arguments": "(char const*)", - "type": "CPP_EFT_A0R_A1", - "overwrite_app_function": 0, - "StoreStmt": { - "src": "Arg1", - "dst": "Arg0" - } - }, - "_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEaSEPKc":{ - "return": "void", - "arguments": "(char const*)", - "type": "CPP_EFT_A0R_A1", - "overwrite_app_function": 0, - "StoreStmt": { - "src": "Arg1", - "dst": "Arg0" - } - }, - "_ZNSsC1ERKSs":{ - "return": "void", - "arguments": "(std::basic_string, std::allocator > const&)", - "type": "CPP_EFT_A0R_A1R", - "overwrite_app_function": 0, - "LoadStmt": { - "src": "Arg1", - "dst": "Dummy" - }, - "StoreStmt": { - "src": "Dummy", - "dst": "Arg0" - } - }, - "_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC1ERKS4_":{ - "return": "void", - "arguments": "(std::__cxx11::basic_string, std::allocator > const&)", - "type": "CPP_EFT_A0R_A1R", - "overwrite_app_function": 0, - "LoadStmt": { - "src": "Arg1", - "dst": "Dummy" - }, - "StoreStmt": { - "src": "Dummy", - "dst": "Arg0" - } - }, - "_ZNSsC1ERKSsmm":{ - "return": "void", - "arguments": "(std::basic_string, std::allocator > const&, unsigned long, unsigned long)", - "type": "CPP_EFT_A0R_A1R", - "overwrite_app_function": 0, - "LoadStmt": { - "src": "Arg1", - "dst": "Dummy" - }, - "StoreStmt": { - "src": "Dummy", - "dst": "Arg0" - } - }, - "_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC1ERKS4_mm":{ - "return": "void", - "arguments": "(std::__cxx11::basic_string, std::allocator > const&, unsigned long, unsigned long)", - "type": "CPP_EFT_A0R_A1R", - "overwrite_app_function": 0, - "LoadStmt": { - "src": "Arg1", - "dst": "Dummy" - }, - "StoreStmt": { - "src": "Dummy", - "dst": "Arg0" - } - }, - "_ZNSsaSERKSs":{ - "return": "void", - "arguments": "(std::basic_string, std::allocator > const&)", - "type": "CPP_EFT_A0R_A1R", - "overwrite_app_function": 0, - "LoadStmt": { - "src": "Arg1", - "dst": "Dummy" - }, - "StoreStmt": { - "src": "Dummy", - "dst": "Arg0" - } - }, - "_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEaSERKS4_":{ - "return": "void", - "arguments": "(std::__cxx11::basic_string, std::allocator > const&)", - "type": "CPP_EFT_A0R_A1R", - "overwrite_app_function": 0, - "LoadStmt": { - "src": "Arg1", - "dst": "Dummy" - }, - "StoreStmt": { - "src": "Dummy", - "dst": "Arg0" - } - }, - "_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEaSEOS4_":{ - "return": "void", - "arguments": "(std::__cxx11::basic_string, std::allocator >&&)", - "type": "CPP_EFT_A0R_A1R", - "overwrite_app_function": 0, - "LoadStmt": { - "src": "Arg1", - "dst": "Dummy" - }, - "StoreStmt": { - "src": "Dummy", - "dst": "Arg0" - } - }, - "_ZStlsIcSt11char_traitsIcESaIcEERSt13basic_ostreamIT_T0_ES7_RKSbIS4_S5_T1_E":{ - "return": "void", - "arguments": "(std::basic_ostream >&, std::basic_string, std::allocator > const&)", - "type": "CPP_EFT_A1R", - "overwrite_app_function": 0, - "LoadStmt": { - "src": "Arg1", - "dst": "Dummy" - } - }, - "_ZStlsIcSt11char_traitsIcESaIcEERSt13basic_ostreamIT_T0_ES7_RKNSt7__cxx1112basic_stringIS4_S5_T1_EE":{ - "return": "void", - "arguments": "(std::basic_ostream >&, std::__cxx11::basic_string, std::allocator > const&)", - "type": "CPP_EFT_A1R", - "overwrite_app_function": 0, - "LoadStmt": { - "src": "Arg1", - "dst": "Dummy" - } - }, - "__dynamic_cast":{ - "return": "void *", - "arguments": "(const void *, const abi::__class_type_info *, const abi::__class_type_info *, std::ptrdiff_t)", - "type": "CPP_EFT_DYNAMIC_CAST", - "overwrite_app_function": 0, - "CopyStmt": { - "src": "Arg0", - "dst": "Ret" - } - }, - "_ZNSt5arrayIPK1ALm2EE4backEv":{ - "return": "%class.A** ", - "arguments": "(%struct.std::array *)", - "type": "CPP_EFT_DYNAMIC_CAST", - "overwrite_app_function": 1, - "GepStmt1": { - "src": "Arg0", - "dst": "Dummy", - "offset": "0" - }, - "GepStmt2": { - "src": "Dummy", - "dst": "Ret", - "offset": "0" - } - }, - "my_multi_free":{ - "return": "void", - "arguments": "(int id, void** ptr)", - "type": "EFT_FREE_MULTILEVEL", - "overwrite_app_function": 1, - "LoadStmt": { - "src": "Arg1", - "dst": "Dummy" - }, - "StoreStmt": { - "src": "NullPtr", - "dst": "Dummy" - } - }, - "swapExtCallStmt":{ - "return": "void", - "arguments": "(char **, char **)", - "type": "EFT_NOOP", - "overwrite_app_function": 0, - "CallStmt": { - "callee_name": "swap", - "callee_return": "void", - "callee_arguments": "(char **, char **)", - "CopyStmt1": { - "src": "swapExtCallStmt_Arg0", - "dst": "swap_Arg0" - }, - "CopyStmt2": { - "src": "swapExtCallStmt_Arg1", - "dst": "swap_Arg1" - } - } - } -} diff --git a/svf/include/Util/SVFUtil.h b/svf/include/Util/SVFUtil.h index 32fa6d35c..5880751dc 100644 --- a/svf/include/Util/SVFUtil.h +++ b/svf/include/Util/SVFUtil.h @@ -33,7 +33,7 @@ #include "FastCluster/fastcluster.h" #include "SVFIR/SVFValue.h" #include "SVFIR/SVFModule.h" -#include "Util/ExtAPI.h" +#include #include "MemoryModel/PointsTo.h" #include @@ -303,18 +303,31 @@ bool startAnalysisLimitTimer(unsigned timeLimit); /// timer or not (return value of startLimitTimer). void stopAnalysisLimitTimer(bool limitTimerSet); +inline bool hasExtFuncProperty(const SVFFunction* fun, const std::string& propertyName) +{ + return fun->getName().find(propertyName) != std::string::npos; +} + /// Return true if the call is an external call (external library in function summary table) /// If the libary function is redefined in the application code (e.g., memcpy), it will return false and will not be treated as an external call. //@{ inline bool isExtCall(const SVFFunction* fun) { - return fun && ExtAPI::getExtAPI()->is_ext(fun); + if (!fun) + return false; + else if (fun->isDeclaration() || fun->isIntrinsic()) + return true; + return false; } -// Return true if extern function contains memset_like or memcpy_like operations -inline bool isMemSetOrCpyExtFun(const SVFFunction* fun) +inline bool isMemcpyExtFun(const SVFFunction* fun) { - return fun && ExtAPI::getExtAPI()->is_memset_or_memcpy(fun); + return fun && hasExtFuncProperty(fun, "_MEMCPY"); +} + +inline bool isMemsetExtFun(const SVFFunction* fun) +{ + return fun && hasExtFuncProperty(fun, "_MEMSET"); } /// Return true if the call is a heap allocator/reallocator @@ -322,20 +335,31 @@ inline bool isMemSetOrCpyExtFun(const SVFFunction* fun) /// note that these two functions are not suppose to be used externally inline bool isHeapAllocExtFunViaRet(const SVFFunction* fun) { - return fun && (ExtAPI::getExtAPI()->is_alloc(fun) - || ExtAPI::getExtAPI()->is_realloc(fun)); + return fun && (hasExtFuncProperty(fun, "_ALLOC_RET") + || hasExtFuncProperty(fun, "_REALLOC_RET")); } inline bool isHeapAllocExtFunViaArg(const SVFFunction* fun) { - return fun && ExtAPI::getExtAPI()->is_arg_alloc(fun); + return fun && hasExtFuncProperty(fun, "_ALLOC_ARG"); } /// Get the position of argument that holds an allocated heap object. //@{ inline int getHeapAllocHoldingArgPosition(const SVFFunction* fun) { - return ExtAPI::getExtAPI()->get_alloc_arg_pos(fun); + std::string s = "_ALLOC_ARG"; + std::string subStr = fun->getName().substr(fun->getName().find(s) + s.length()); + std::string number; + for (char c : subStr) { + if (isdigit(c)) { + number.push_back(c); + } else { + break; + } + } + assert(!number.empty() && "Incorrect naming convention for svf external functions(ALLOCHEAPVIAARG + number)?"); + return std::stoi(number); } /// Return true if the call is a heap reallocator @@ -343,7 +367,7 @@ inline int getHeapAllocHoldingArgPosition(const SVFFunction* fun) /// note that this function is not suppose to be used externally inline bool isReallocExtFun(const SVFFunction* fun) { - return fun && (ExtAPI::getExtAPI()->is_realloc(fun)); + return fun && hasExtFuncProperty(fun, "_REALLOC_RET"); } /// Return true if the call is a heap dealloc or not @@ -351,7 +375,7 @@ inline bool isReallocExtFun(const SVFFunction* fun) /// note that this function is not suppose to be used externally inline bool isDeallocExtFun(const SVFFunction* fun) { - return fun && (ExtAPI::getExtAPI()->is_dealloc(fun)); + return fun && hasExtFuncProperty(fun, "_ALLOC_RET"); } /// Return true if the call is a static global call @@ -359,7 +383,7 @@ inline bool isDeallocExtFun(const SVFFunction* fun) /// note that this function is not suppose to be used externally inline bool isStaticExtFun(const SVFFunction* fun) { - return fun && ExtAPI::getExtAPI()->has_static(fun); + return fun && hasExtFuncProperty(fun, "_STATIC"); } /// Program entry function e.g. main diff --git a/svf/lib/SVFIR/SVFModule.cpp b/svf/lib/SVFIR/SVFModule.cpp index 9c4da6128..430f8057f 100644 --- a/svf/lib/SVFIR/SVFModule.cpp +++ b/svf/lib/SVFIR/SVFModule.cpp @@ -42,7 +42,6 @@ SVFModule::~SVFModule() delete o; NodeIDAllocator::unset(); ThreadAPI::destroy(); - ExtAPI::destory(); } const SVFFunction* SVFModule::getSVFFunction(const std::string& name) diff --git a/svf/lib/Util/ExtAPI.cpp b/svf/lib/Util/ExtAPI.cpp deleted file mode 100644 index 683e41913..000000000 --- a/svf/lib/Util/ExtAPI.cpp +++ /dev/null @@ -1,694 +0,0 @@ -//===- ExtAPI.cpp -- External functions -----------------------------------------// -// -// SVF: Static Value-Flow Analysis -// -// Copyright (C) <2013-2017> -// - -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Affero General Public License for more details. - -// You should have received a copy of the GNU Affero General Public License -// along with this program. If not, see . -// -//===----------------------------------------------------------------------===// - -/* - * ExtAPI.cpp - * - * Created on: July 1, 2022 - * Author: Shuangxiang Kan - */ - -#include "Util/ExtAPI.h" -#include "SVFIR/SVFVariables.h" -#include "Util/SVFUtil.h" -#include "Util/cJSON.h" -#include -#include -#include - -using namespace SVF; - -ExtAPI* ExtAPI::extOp = nullptr; -cJSON* ExtAPI::root = nullptr; - -// Get environment variables $SVF_DIR and "npm root" through popen() method -static std::string GetStdoutFromCommand(const std::string& command) -{ - char buffer[128]; - std::string result = ""; - // Open pipe to file - FILE* pipe = popen(command.c_str(), "r"); - if (!pipe) - { - return "popen failed!"; - } - // read till end of process: - while (!feof(pipe)) - { - // use buffer to read and add to result - if (fgets(buffer, 128, pipe) != NULL) - result += buffer; - } - pclose(pipe); - // remove "\n" - result.erase(remove(result.begin(), result.end(), '\n'), result.end()); - return result; -} - -// Get ExtAPI.json file -static std::string getJsonFile(const std::string& path) -{ - std::string jsonFilePath = GetStdoutFromCommand(path); - if (path.compare("npm root") == 0) - { - int os_flag = 1; - // SVF installed via npm needs to determine the type of operating - // system, otherwise the ExtAPI.json path may not be found. -#ifdef linux - // Linux os - os_flag = 0; - jsonFilePath.append("/svf-lib/SVF-linux"); -#endif - // Mac os - if (os_flag == 1) - { - jsonFilePath.append("/svf-lib/SVF-osx"); - } - } - if (jsonFilePath.back() != '/') jsonFilePath.push_back('/'); - jsonFilePath.append(EXTAPI_JSON_PATH); - return jsonFilePath; -} - -static cJSON* parseJson(const std::string& path, off_t fileSize) -{ - FILE* file = fopen(path.c_str(), "r"); - if (!file) - { - return nullptr; - } - - // allocate memory size matched with file size - char* jsonStr = (char*)calloc(fileSize + 1, sizeof(char)); - - // read json string from file - u32_t size = fread(jsonStr, sizeof(char), fileSize, file); - if (size == 0) - { - SVFUtil::errs() << SVFUtil::errMsg("\t Wrong ExtAPI.json path!! ") - << "The current ExtAPI.json path is: " << path << "\n"; - assert(false && "Read ExtAPI.json file fails!"); - return nullptr; - } - fclose(file); - - // convert json string to json pointer variable - cJSON* root = cJSON_Parse(jsonStr); - if (!root) - { - free(jsonStr); - return nullptr; - } - free(jsonStr); - return root; -} - -ExtAPI* ExtAPI::getExtAPI(const std::string& path) -{ - if (extOp == nullptr) - { - extOp = new ExtAPI; - } - if (root == nullptr) - { - struct stat statbuf; - - // Four ways to get ExtAPI.json path - // 1. Explicit path provided - // 2. default path (get ExtAPI.json path from Util/config.h) - // 3. from $SVF_DIR - // 4. from "npm root"(If SVF is installed via npm) - - std::string jsonFilePath = path; - if (!jsonFilePath.empty() && !stat(jsonFilePath.c_str(), &statbuf)) - { - root = parseJson(jsonFilePath, statbuf.st_size); - return extOp; - } - - jsonFilePath = std::string(PROJECT_PATH) + '/' + EXTAPI_JSON_PATH; - if (!stat(jsonFilePath.c_str(), &statbuf)) - { - root = parseJson(jsonFilePath, statbuf.st_size); - return extOp; - } - - jsonFilePath = getJsonFile("echo $SVF_DIR"); - if (!stat(jsonFilePath.c_str(), &statbuf)) - { - root = parseJson(jsonFilePath, statbuf.st_size); - return extOp; - } - - jsonFilePath = getJsonFile("npm root"); - if (!stat(jsonFilePath.c_str(), &statbuf)) - { - root = parseJson(jsonFilePath, statbuf.st_size); - return extOp; - } - SVFUtil::errs() << "No JsonFile found at " << jsonFilePath << " for getExtAPI(); set $SVF_DIR first!\n"; - abort(); - } - return extOp; -} - -void ExtAPI::destory() -{ - if (extOp != nullptr) - { - delete extOp; - extOp = nullptr; - } - if (root != nullptr) - { - cJSON_Delete(root); - root = nullptr; - } -} - -void ExtAPI::add_entry(const char* funName, const char* returnType, - std::vector argTypes, extType type, - bool overwrite_app_function) -{ - assert(root && "Parse the json before adding additional entries"); - assert(get_type(funName) == EFT_NULL && "Do not add entries that already exist"); - auto entry = cJSON_CreateObject(); - - // add the signature fields - auto returnTypeString = cJSON_CreateString(returnType); - cJSON_AddItemToObject(entry, "return", returnTypeString); - - std::stringstream ss; - ss << "("; - for (auto str : argTypes) - ss << str << ","; - std::string formattedArgs = ss.str(); - if (formattedArgs.back() == ',') - formattedArgs.back() = ')'; - else - formattedArgs.append(")"); - auto argsString = cJSON_CreateString(formattedArgs.c_str()); - cJSON_AddItemToObject(entry, "argument", argsString); - - // add the type field - auto typeString = cJSON_CreateString(extType_toString(type).c_str()); - cJSON_AddItemToObject(entry, JSON_OPT_FUNCTIONTYPE, typeString); - - // add the 'overwrite_app_function' field - auto overwriteBool = cJSON_CreateNumber(overwrite_app_function ? 1 : 0); - cJSON_AddItemToObject(entry, JSON_OPT_OVERWRITE, overwriteBool); - - // add object to root - cJSON_AddItemToObject(root, funName, entry); -} - -// Get the corresponding name in ext_t, e.g. "EXT_ADDR" in {"addr", EXT_ADDR}, -std::string ExtAPI::get_opName(const std::string& s) -{ - u32_t end = 0; - while (end < s.size() && !isdigit(s[end])) - end++; - return s.substr(0, end); -} - -const std::string& ExtAPI::extType_toString(extType type) -{ - auto it = - std::find_if(type_pair.begin(), type_pair.end(), - [&](const auto& pair) - { - return pair.second == type; - }); - assert(it != type_pair.end()); - return it->first; -} - -// Get numeric index of the argument in external function -u32_t ExtAPI::getArgPos(const std::string& s) -{ - u32_t start = 0; - while (start < s.size() && isalpha(s[start])) - start++; - if (s.substr(0, start) != "Arg") - assert(false && "the argument of extern function in ExtAPI.json should start with 'Arg' !"); - u32_t end = start + 1; - while (end < s.size() && isdigit(s[end])) - end++; - std::string digitStr = s.substr(start, end - start); - u32_t argNum = atoi(digitStr.c_str()); - return argNum; -} - -// return value >= 0 is an argument node -// return value = -1 is an inst node -// return value = -2 is a Dummy node -// return value = -3 is an object node -// return value = -4 is a nullptr node -// return value = -5 is an offset -// return value = -6 is an illegal operand format -s32_t ExtAPI::getNodeIDType(const std::string& s) -{ - u32_t argPos = -1; - // 'A' represents an argument - if (s.size() == 0) - return -5; - u32_t start = 0; - while (start < s.size() && isalpha(s[start])) - start++; - std::string argStr = s.substr(0, start); - if (argStr == "Arg") - { - u32_t end = start + 1; - while (end < s.size() && isdigit(s[end])) - end++; - std::string digitStr = s.substr(start, end - start); - argPos = atoi(digitStr.c_str()); - return argPos; - } - - static const Map argStrToBinOp = - { - {"Ret", -1}, - {"Dummy", -2}, - {"Obj", -3}, - {"NullPtr", -4}, - {"Add", BinaryOPStmt::Add}, - {"Sub", BinaryOPStmt::Sub}, - {"Mul", BinaryOPStmt::Mul}, - {"SDiv", BinaryOPStmt::SDiv}, - {"SRem", BinaryOPStmt::SRem}, - {"Xor", BinaryOPStmt::Xor}, - {"And", BinaryOPStmt::And}, - {"Or", BinaryOPStmt::Or}, - {"AShr", BinaryOPStmt::AShr}, - {"Shl", BinaryOPStmt::Shl}, - {"ICMP_EQ", CmpStmt::ICMP_EQ}, - {"ICMP_NE", CmpStmt::ICMP_NE}, - {"ICMP_UGT", CmpStmt::ICMP_UGT}, - {"ICMP_SGT", CmpStmt::ICMP_SGT}, - {"ICMP_UGE", CmpStmt::ICMP_UGE}, - {"ICMP_SGE", CmpStmt::ICMP_SGE}, - {"ICMP_ULT", CmpStmt::ICMP_ULT}, - {"ICMP_SLT", CmpStmt::ICMP_SLT}, - {"ICMP_ULE", CmpStmt::ICMP_ULE}, - {"ICMP_SLE", CmpStmt::ICMP_SLE}, - {"FNeg", UnaryOPStmt::FNeg}, - }; - - auto it = argStrToBinOp.find(argStr); - if (it != argStrToBinOp.cend()) - return it->second; - // offset - u32_t i = 0; - while (i < s.size() && isdigit(s[i])) - i++; - if (i == s.size()) - return -5; - // illegal operand format - return -6; -} - -// Get external function name, e.g "memcpy" -std::string ExtAPI::get_name(const SVFFunction* F) -{ - assert(F); - std::string funName = F->getName(); - if (F->isIntrinsic()) - { - unsigned start = funName.find('.'); - unsigned end = funName.substr(start + 1).find('.'); - funName = "llvm." + funName.substr(start + 1, end); - } - return funName; -} - -// Get specifications of external functions in ExtAPI.json file -cJSON* ExtAPI::get_FunJson(const std::string& funName) -{ - assert(root && "JSON not loaded"); - return cJSON_GetObjectItemCaseSensitive(root, funName.c_str()); -} - -ExtAPI::Operand ExtAPI::getBasicOperation(cJSON* obj) -{ - Operand basicOp; - if (strstr(obj->string, "AddrStmt") != NULL) - basicOp.setType(ExtAPI::OperationType::Addr); - else if (strstr(obj->string, "CopyStmt") != NULL) - basicOp.setType(ExtAPI::OperationType::Copy); - else if (strstr(obj->string, "LoadStmt") != NULL) - basicOp.setType(ExtAPI::OperationType::Load); - else if (strstr(obj->string, "StoreStmt") != NULL) - basicOp.setType(ExtAPI::OperationType::Store); - else if (strstr(obj->string, "GepStmt") != NULL) - basicOp.setType(ExtAPI::OperationType::Gep); - else if (strstr(obj->string, "ReturnStmt") != NULL) - basicOp.setType(ExtAPI::OperationType::Return); - else if (strstr(obj->string, "Rb_tree_ops") != NULL) - basicOp.setType(ExtAPI::OperationType::Rb_tree_ops); - else if (strstr(obj->string, "memcpy_like") != NULL) - basicOp.setType(ExtAPI::OperationType::Memcpy_like); - else if (strstr(obj->string, "memset_like") != NULL) - basicOp.setType(ExtAPI::OperationType::Memset_like); - else - assert(false && "Unknown operation type"); - - cJSON* value = obj->child; - while (value) - { - if (strcmp(value->string, "src") == 0) - basicOp.setSrcValue(value->valuestring); - else if (strcmp(value->string, "dst") == 0) - basicOp.setDstValue(value->valuestring); - else if (strcmp(value->string, "offset") == 0 || strcmp(value->string, "size") == 0) - basicOp.setOffsetOrSizeStr(value->valuestring); - else - assert(false && "Unknown operation value"); - value = value->next; - } - return basicOp; -} - -// Get all operations of an extern function -ExtAPI::ExtFunctionOps ExtAPI::getExtFunctionOps(const SVFFunction* extFunction) -{ - ExtAPI::ExtFunctionOps extFunctionOps; - extFunctionOps.setExtFunName(extFunction->getName()); - if (!is_sameSignature(extFunction)) - return extFunctionOps; - - auto it = extFunToOps.find(extFunction->getName()); - if (it != extFunToOps.end()) - return it->second; - - extFunctionOps.setExtFunName(extFunction->getName()); - cJSON* item = get_FunJson(extFunction->getName()); - if (item != nullptr) - { - cJSON* obj = item->child; - // Get the first operation of the function - obj = obj->next->next->next->next; - while (obj) - { - ExtOperation operation; - if (obj->type == cJSON_Object || obj->type == cJSON_Array) - { - if (strstr(obj->string, "CallStmt") != NULL) - { - extFunctionOps.setCallStmtNum(extFunctionOps.getCallStmtNum() + 1); - operation.setCallOp(true); - cJSON* value = obj->child; - while (value) - { - if (strcmp(value->string, "callee_name") == 0) - operation.setCalleeName(value->valuestring); - else if (strcmp(value->string, "callee_return") == 0) - operation.setCalleeReturn(value->valuestring); - else if (strcmp(value->string, "callee_arguments") == 0) - operation.setCalleeArguments(value->valuestring); - else - operation.getCalleeOperands().push_back(getBasicOperation(value)); - value = value->next; - } - } - else if (strstr(obj->string, "CondStmt") != NULL) - { - operation.setConOp(true); - obj = obj->child; - assert(strcmp(obj->string, "Condition") == 0 && "Unknown operation type"); - operation.setConOp(obj->valuestring); - obj = obj->next; - assert(strcmp(obj->string, "TrueBranch") == 0 && "Unknown operation type"); - cJSON* value = obj->child; - while (value) - { - operation.getTrueBranchOperands().push_back(getBasicOperation(value)); - value = value->next; - } - obj = obj->next; - assert(strcmp(obj->string, "FalseBranch") == 0&& "Unknown operation type"); - value = obj->child; - while (value) - { - operation.getFalseBranchOperands().push_back(getBasicOperation(value)); - value = value->next; - } - } - else - operation.setBasicOp(getBasicOperation(obj)); - } - obj = obj->next; - extFunctionOps.getOperations().push_back(operation); - } - } - extFunToOps[extFunction->getName()] = extFunctionOps; - return extFunctionOps; -} - -// Get arguments of the operation, e.g. ["A1R", "A0", "A2"] -std::vector ExtAPI::get_opArgs(const cJSON* value) -{ - std::vector args; - while (value) - { - if (value->type == cJSON_String) - args.push_back(value->valuestring); - value = value->next; - } - return args; -} - -ExtAPI::extType ExtAPI::get_type(const std::string& funName) -{ - cJSON* item = get_FunJson(funName); - std::string type = ""; - if (item != nullptr) - { - // Get the first operation of the function - cJSON* obj = item->child->next->next; - if (strcmp(obj->string, JSON_OPT_FUNCTIONTYPE) == 0) - type = obj->valuestring; - else - assert(false && "The function operation format is illegal!"); - } - std::map::const_iterator it = type_pair.find(type); - if (it == type_pair.end()) - return EFT_NULL; - else - return it->second; -} - -// Get property of the operation, e.g. "EFT_A1R_A0R" -ExtAPI::extType ExtAPI::get_type(const SVF::SVFFunction* F) -{ - return get_type(get_name(F)); -} - -// Get priority of he function, return value -// 0: Apply user-defined functions -// 1: Apply function specification in ExtAPI.json -u32_t ExtAPI::isOverwrittenAppFunction(const SVF::SVFFunction* callee) -{ - std::string funName = get_name(callee); - return isOverwrittenAppFunction(funName); -} - -u32_t ExtAPI::isOverwrittenAppFunction(const std::string& funName) -{ - cJSON* item = get_FunJson(funName); - if (item != nullptr) - { - cJSON* obj = item->child; - obj = obj->next->next->next; - if (strcmp(obj->string, JSON_OPT_OVERWRITE) == 0) - return obj->valueint; - else - assert(false && "The function operation format is illegal!"); - } - return 0; -} - -void ExtAPI::setOverWrittenAppFunction(const std::string& funcName, u32_t overwrite_app_function) -{ - auto item = get_FunJson(funcName); - assert(item && "Do not set fields for ExtAPI funcs that don't exist!"); - auto overwrite_obj = item->child->next->next->next; - assert(overwrite_obj); - assert(strcmp(overwrite_obj->string, JSON_OPT_OVERWRITE) == 0); - cJSON_SetIntValue(overwrite_obj, overwrite_app_function); -} - -// Does (F) have a static var X (unavailable to us) that its return points to? -bool ExtAPI::has_static(const SVFFunction* F) -{ - ExtAPI::extType t = get_type(F); - return t == EFT_STAT || t == EFT_STAT2; -} - -// Assuming hasStatic(F), does (F) have a second static Y where X -> Y? -bool ExtAPI::has_static2(const SVFFunction* F) -{ - ExtAPI::extType t = get_type(F); - return t == EFT_STAT2; -} - -bool ExtAPI::is_memset_or_memcpy(const SVFFunction* F) -{ - ExtAPI::extType t = get_type(F); - return t == EFT_L_A0__A0R_A1 || t == EFT_L_A0__A0R_A1R || t == EFT_A1R_A0R || t == EFT_A3R_A1R_NS - || t == EFT_STD_RB_TREE_INSERT_AND_REBALANCE || t == EFT_L_A0__A1_A0; -} - -bool ExtAPI::is_alloc(const SVFFunction* F) -{ - ExtAPI::extType t = get_type(F); - return t == EFT_ALLOC || t == EFT_NOSTRUCT_ALLOC; -} - -// Does (F) allocate a new object and assign it to one of its arguments? -bool ExtAPI::is_arg_alloc(const SVFFunction* F) -{ - ExtAPI::extType t = get_type(F); - return t == EFT_A0R_NEW || t == EFT_A1R_NEW || t == EFT_A2R_NEW || - t == EFT_A4R_NEW || t == EFT_A11R_NEW; -} - -// Get the position of argument which holds the new object -s32_t ExtAPI::get_alloc_arg_pos(const SVFFunction* F) -{ - ExtAPI::extType t = get_type(F); - switch (t) - { - case EFT_A0R_NEW: - return 0; - case EFT_A1R_NEW: - return 1; - case EFT_A2R_NEW: - return 2; - case EFT_A4R_NEW: - return 4; - case EFT_A11R_NEW: - return 11; - default: - assert(false && "Not an alloc call via argument."); - return -1; - } -} - -// Does (F) allocate only non-struct objects? -bool ExtAPI::no_struct_alloc(const SVFFunction* F) -{ - ExtAPI::extType t = get_type(F); - return t == EFT_NOSTRUCT_ALLOC; -} - -// Does (F) not free/release any memory? -bool ExtAPI::is_dealloc(const SVFFunction* F) -{ - ExtAPI::extType t = get_type(F); - return t == EFT_FREE; -} - -// Does (F) not do anything with the known pointers? -bool ExtAPI::is_noop(const SVFFunction* F) -{ - ExtAPI::extType t = get_type(F); - return t == EFT_NOOP || t == EFT_FREE; -} - -// Does (F) reallocate a new object? -bool ExtAPI::is_realloc(const SVFFunction* F) -{ - ExtAPI::extType t = get_type(F); - return t == EFT_REALLOC; -} - -// Does (F) have the same return type(pointer or nonpointer) and same number of -// arguments -bool ExtAPI::is_sameSignature(const SVFFunction* F) -{ - cJSON* item = get_FunJson(F->getName()); - // If return type is pointer - bool isPointer = false; - // The number of arguments - u32_t argNum = 0; - if (item != nullptr) - { - // Get the "return" attribute - cJSON* obj = item->child; - if (strlen(obj->valuestring) == 0) // e.g. "return": "" - assert(false && "'return' should not be empty!"); - // If "return": "..." includes "*", the return type of extern function is a pointer - if (strstr(obj->valuestring, "*") != NULL) - isPointer = true; - // Get the "arguments" attribute - obj = obj->next; - if (strlen(obj->valuestring) == 0) // e.g. "arguments": "", - assert(false && "'arguments' should not be empty!"); - // If "arguments": "()", the number of arguments is 0, otherwise, number >= 1; - if (strcmp(obj->valuestring, "()") != 0) - { - argNum++; - for (u32_t i = 0; i < strlen(obj->valuestring); i++) - if (obj->valuestring[i] == ',') // Calculate the number of arguments based on the number of "," - argNum++; - } - } - - if ( !F->isVarArg() && F->arg_size() != argNum) // The number of arguments is different - return false; - // Is the return type the same? - return F->getReturnType()->isPointerTy() == isPointer; -} - -// Should (F) be considered "external" (either not defined in the program -// or a user-defined version of a known alloc or no-op)? -bool ExtAPI::is_ext(const SVFFunction* F) -{ - assert(F && "Null SVFFunction* pointer"); - bool res; - if (F->isDeclaration() || F->isIntrinsic()) - { - res = 1; - } - else - { - ExtAPI::extType t = get_type(F); - if (t != EFT_NULL) - { - u32_t overwrittenAppFunction = isOverwrittenAppFunction(F); - if (!is_sameSignature(F)) - res = 0; - // overwrittenAppFunction = 1: Execute function specification in - // ExtAPI.json F is considered as external function - else if (overwrittenAppFunction == 1) - res = 1; - // overwrittenAppFunction = 0: Execute user-defined functions - // F is not considered as external function - else - res = 0; - } - else - res = 0; - } - return res; -} diff --git a/svf/lib/Util/Options.cpp b/svf/lib/Util/Options.cpp index 946f45f66..0a5b7a27c 100644 --- a/svf/lib/Util/Options.cpp +++ b/svf/lib/Util/Options.cpp @@ -772,7 +772,7 @@ const Option Options::VtableInSVFIR( //WPAPass.cpp const Option Options::ExtAPIInput( - "extapi", "External API ext.bc", "" + "extapi", "External API extapi.bc", std::string(EXTAPI_PATH) + "/extapi.bc" ); const Option Options::AnderSVFG( diff --git a/svf/lib/Util/extapi.c b/svf/lib/Util/extapi.c new file mode 100644 index 000000000..64cd231df --- /dev/null +++ b/svf/lib/Util/extapi.c @@ -0,0 +1,734 @@ +#define NULL ((void *)0) + +/* + The functions in extapi.bc are named using two patterns: + 1: "svf_methodName"; + 2: "svf_methodName_methodProperties"; + + "svf_methodName": which is used to replace the functionality of methodName with the 'definition' of svf_methodName. + + "svf_methodName_methodProperties": The second pattern, svf_methodName_methodProperties, + is used when certain external functions cannot be implemented using C/C++ code. For example, + functions like malloc() require object allocation, which SVF needs to analyze at a logical level + while the actual malloc() is executed at a physical level. In such cases, additional properties + are added to the signature of the external method. svf_methodName_methodProperties is used as a + 'declaration', and when SVF encounters a function named svf_methodName_methodProperties(), + it processes the method based on its name and properties. + + + However, when Clang compiles extapi.c to LLVM IR, it treats unused function declarations in svf_methodName_methodProperties as dead code + and removes them. To preserve the function declarations of svf_methodName_methodProperties, they need to be called in svf_preserveExtFuncDeclarations(). + + The description of methodProperties is as follows: + + ALLOC_RET, // returns a ptr to a newly allocated object + ALLOC_ARGi // stores a pointer to an allocated object in *argi + REALLOC_RET, + STATIC, // retval points to an unknown static var X + MEMSET, // memcpy() operations + MEMCPY, // memset() operations + OVERWRITE, // svf extern function overwrite app function +*/ + +extern const unsigned short **svf___ctype_b_loc_STATIC_ALLOC_RET(void); + +extern int **svf___ctype_tolower_loc_STATIC_ALLOC_RET(void); + +extern int **svf___ctype_toupper_loc_STATIC_ALLOC_RET(void); + +extern int *svf___errno_location_STATIC_ALLOC_RET(void); + +extern int * svf___h_errno_location_STATIC_ALLOC_RET(void); + +extern void* svf___res_state_STATIC_ALLOC_RET(void); + +extern char *svf_asctime_STATIC_ALLOC_RET(const void *timeptr); + +extern char * svf_bindtextdomain_STATIC_ALLOC_RET(const char * domainname, const char * dirname); + +extern char * svf_bind_textdomain_codeset_STATIC_ALLOC_RET(const char * domainname, const char * codeset); + +extern char *svf_ctermid_STATIC_ALLOC_RET(char *s); + +extern char * svf_dcgettext_STATIC_ALLOC_RET(const char * domainname, const char * msgid, int category); + +extern char * svf_dgettext_STATIC_ALLOC_RET(const char * domainname, const char * msgid); + +extern char * svf_dngettext_STATIC_ALLOC_RET(const char * domainname, const char * msgid, const char * msgid_plural, unsigned long int n); + +extern void *svf_fdopen_STATIC_ALLOC_RET(int fd, const char *mode); + +extern struct group *svf_getgrgid_STATIC_ALLOC_RET(unsigned int gid); + +extern struct group *svf_getgrnam_STATIC_ALLOC_RET(const char *name); + +extern struct hostent *svf_gethostbyaddr_STATIC_ALLOC_RET(const void *addr, unsigned int len, int type); + +extern struct hostent *svf_gethostbyname_STATIC_ALLOC_RET(const char *name); + +extern struct hostent *svf_gethostbyname2_STATIC_ALLOC_RET(const char *name, int af); + +extern struct mntent *svf_getmntent_STATIC_ALLOC_RET(void *stream); + +extern struct protoent *svf_getprotobyname_STATIC_ALLOC_RET(const char *name); + +extern struct protoent *svf_getprotobynumber_STATIC_ALLOC_RET(int proto); + +extern struct passwd *svf_getpwent_STATIC_ALLOC_RET(void); + +extern struct passwd *svf_getpwnam_STATIC_ALLOC_RET(const char *name); + +extern struct passwd *svf_getpwuid_STATIC_ALLOC_RET(unsigned int uid); + +extern struct servent *svf_getservbyname_STATIC_ALLOC_RET(const char *name, const char *proto); + +extern struct servent *svf_getservbyport_STATIC_ALLOC_RET(int port, const char *proto); + +extern struct spwd *svf_getspnam_STATIC_ALLOC_RET(const char *name); + +extern char * svf_gettext_STATIC_ALLOC_RET(const char * msgid); + +extern struct tm *svf_gmtime_STATIC_ALLOC_RET(const void *timer); + +extern const char *svf_gnu_get_libc_version_STATIC_ALLOC_RET(void); + +extern const char * svf_gnutls_check_version_STATIC_ALLOC_RET(const char * req_version); + +extern struct lconv *svf_localeconv_STATIC_ALLOC_RET(void); + +extern struct tm *svf_localtime_STATIC_ALLOC_RET(const void *timer); + +extern char * svf_ngettext_STATIC_ALLOC_RET(const char * msgid, const char * msgid_plural, unsigned long int n); + +extern void *svf_pango_cairo_font_map_get_default_STATIC_ALLOC_RET(void); + +extern char *svf_re_comp_STATIC_ALLOC_RET(const char *regex); + +extern char *svf_setlocale_STATIC_ALLOC_RET(int category, const char *locale); + +extern char *svf_tgoto_STATIC_ALLOC_RET(const char *cap, int col, int row); + +extern char *svf_tparm_STATIC_ALLOC_RET(char *str, ...); + +extern const char *svf_zError_STATIC_ALLOC_RET(int a); + +extern void *svf_fopen_ALLOC_RET(const char *voidname, const char *mode); + +extern void *svf_fopen64_ALLOC_RET(const char *voidname, const char *mode); + +extern struct dirent64 *svf_readdir64_ALLOC_RET(void *dirp); + +extern void *svf_tmpvoid64_ALLOC_RET(void); + +extern void *svf_calloc_ALLOC_RET(unsigned long nitems, unsigned long size); + +extern void *svf_zmalloc_ALLOC_RET(unsigned long size); + +extern void *svf_gzdopen_ALLOC_RET(int fd, const char *mode); + +extern void *svf_iconv_open_ALLOC_RET(const char *tocode, const char *fromcode); + +extern void *svf_lalloc_ALLOC_RET(unsigned long size, int a); + +extern void *svf_lalloc_clear_ALLOC_RET(unsigned long size, int a); + +extern long *svf_nhalloc_ALLOC_RET(unsigned int a, const char *b, int c); + +extern void *svf_oballoc_ALLOC_RET(unsigned long size); + +extern void *svf_popen_ALLOC_RET(const char *command, const char *type); + +extern void *svf_pthread_getspecific_ALLOC_RET(const char *a, const char *b); + +extern struct dirent *svf_readdir_ALLOC_RET(void *dirp); + +extern void* svf_safe_calloc_ALLOC_RET(unsigned nelem, unsigned elsize); + +extern void* svf_safe_malloc_ALLOC_RET(unsigned long); + +extern char* svf_safecalloc_ALLOC_RET(int a, int b); + +extern char* svf_safemalloc_ALLOC_RET(int a, int b); + +extern void *svf_setmntent_ALLOC_RET(const char *voidname, const char *type); + +extern void *svf_shmat_ALLOC_RET(int shmid, const void *shmaddr, int shmflg); + +extern void* svf___sysv_signal_ALLOC_RET(int a, void *b); + +extern void (*svf_signal_ALLOC_RET(int sig, void (*func)(int)))(int); + +extern char *svf_tempnam_ALLOC_RET(const char *dir, const char *pfx); + +extern void *svf_tmpvoid_ALLOC_RET(void); + +extern void* svf_xcalloc_ALLOC_RET(unsigned long size1, unsigned long size2); + +extern void* svf_xmalloc_ALLOC_RET(unsigned long size); + +extern void *svf__Znam_ALLOC_RET(unsigned long size); + +extern void *svf__Znaj_ALLOC_RET(unsigned long size); + +extern void *svf__Znwj_ALLOC_RET(unsigned long size); + +extern void *svf___cxa_allocate_exception_ALLOC_RET(unsigned long size); + +extern void* svf_aligned_alloc_ALLOC_RET(unsigned long size1, unsigned long size2); + +extern void* svf_memalign_ALLOC_RET(unsigned long size1, unsigned long size2); + +extern void *svf_valloc_ALLOC_RET(unsigned long size); + +extern void *svf_mmap64_ALLOC_RET(void *addr, unsigned long len, int prot, int flags, int fildes, long off); + +extern char *svf_XSetLocaleModifiers_ALLOC_RET(char *a); + +extern char * svf___strdup_ALLOC_RET(const char * string); + +extern char *svf_crypt_ALLOC_RET(const char *key, const char *salt); + +extern char *svf_ctime_ALLOC_RET(const void *timer); + +extern char *svf_dlerror_ALLOC_RET(void); + +extern void *svf_dlopen_ALLOC_RET(const char *voidname, int flags); + +extern const char *svf_gai_strerror_ALLOC_RET(int errcode); + +extern const char *svf_gcry_cipher_algo_name_ALLOC_RET(int errcode); + +extern const char *svfgcry_md_algo_name_ALLOC_RET_(int errcode); + +extern char *svf_getenv_ALLOC_RET(const char *name); + +extern char *svf_getlogin_ALLOC_RET(void); + +extern char *svf_getpass_ALLOC_RET(const char *prompt); + +extern const char * svf_gnutls_strerror_ALLOC_RET(int error); + +extern const char *svf_gpg_strerror_ALLOC_RET(unsigned int a); + +extern const char * svf_gzerror_ALLOC_RET(void* file, int * errnum); + +extern char *svf_inet_ntoa_ALLOC_RET(unsigned int in); + +extern void *svf_initscr_ALLOC_RET(void); + +extern void* svf_llvm_stacksave_ALLOC_RET(); + +extern void *svf_mmap_ALLOC_RET(void *addr, unsigned long len, int prot, int flags, int fildes, long off); + +extern void *svf_newwin_ALLOC_RET(int nlines, int ncols, int begin_y, int begin_x); + +extern char *svf_nl_langinfo_ALLOC_RET(int item); + +extern void *svf_opendir_ALLOC_RET(const char *name); + +extern void *svf_sbrk_ALLOC_RET(long increment); + +extern char *svf_strdup_ALLOC_RET(const char *s); + +extern char *svf_strerror_ALLOC_RET(int errnum); + +extern char *svf_strsignal_ALLOC_RET(int errnum); + +extern char * svf_textdomain_ALLOC_RET(const char * domainname); + +extern char *svf_tgetstr_ALLOC_RET(char *id, char **area); + +extern char *svf_tigetstr_ALLOC_RET(char *capname); + +extern char *svf_tmpnam_ALLOC_RET(char *s); + +extern char *svf_ttyname_ALLOC_RET(int fd); + +extern void *svf_malloc_ALLOC_RET(unsigned long size); + +extern char *svf_getcwd_REALLOC_RET(char *buf, unsigned long size); + +extern char *svf_mem_realloc_REALLOC_RET(void *ptr, unsigned long size); + +extern char *svf_realloc_REALLOC_RET(void *ptr, unsigned long size); + +extern void* svf_safe_realloc_REALLOC_RET(void *p, unsigned long n); + +extern void* svf_saferealloc_REALLOC_RET(void *p, unsigned long n1, unsigned long n2); + +extern void* svf_safexrealloc_REALLOC_RET(); + +extern char *svf_strtok_REALLOC_RET(char *str, const char *delim); + +extern char *svf_strtok_r_REALLOC_RET(char *str, const char *delim, char **saveptr); + +extern void *svf_xrealloc_REALLOC_RET(void *ptr, unsigned long bytes); + +extern void *svf__Znwm_ALLOC_RET(unsigned long size); + +extern void *svf_SyGetmem_ALLOC_RET_OVERWRITE(unsigned long size); + +extern int svf_asprintf_ALLOC_ARG0(char **restrict strp, const char *restrict fmt, ...); + +extern int svf_vasprintf_ALLOC_ARG0(char **strp, const char *fmt, void* ap); + +extern int svf_db_create_ALLOC_ARG0(void **dbp, void *dbenv, unsigned int flags); + +extern int svf_gnutls_pkcs12_bag_init_ALLOC_ARG0(void *a); + +extern int svf_gnutls_pkcs12_init_ALLOC_ARG0(void *a); + +extern int svf_gnutls_x509_crt_init_ALLOC_ARG0(void *a); + +extern int svf_gnutls_x509_privkey_init_ALLOC_ARG0(void *a); + +extern int svf_posix_memalign_ALLOC_ARG0(void **a, unsigned long b, unsigned long c); + +extern int svf_scandir_ALLOC_ARG1(const char *restrict dirp, struct dirent ***restrict namelist, int (*filter)(const struct dirent *), int (*compar)(const struct dirent **, const struct dirent **)); + +extern int svf_XmbTextPropertyToTextList_ALLOC_ARG2(void *a, void *b, char ***c, int *d); + +//llvm.memcpy.p0i8.p0i8.i64 +extern void svf_llvm_memcpy_p0i8_p0i8_i64_MEMCPY(char* dst, char* src, int sz, int flag); + +extern void svf_llvm_memcpy_p0i8_p0i8_i32_MEMCPY(char* dst, char* src, int sz, int flag); + +extern void svf_llvm_memcpy_MEMCPY(char* dst, char* src, int sz, int flag); + +extern void svf_llvm_memmove_MEMCPY(char* dst, char* src, int sz, int flag); + +extern void svf_llvm_memmove_p0i8_p0i8_i64_MEMCPY(char* dst, char* src, int sz, int flag); + +extern void svf_llvm_memmove_p0i8_p0i8_i32_MEMCPY(char* dst, char* src, int sz, int flag); + +extern void svf___memcpy_chk_MEMCPY(char* dst, char* src, int sz, int flag); + +extern void *svf_memmove_MEMCPY(void *str1, const void *str2, unsigned long n); + +extern void svf_bcopy_MEMCPY(const void *s1, void *s2, unsigned long n); + +extern void *svf_memccpy_MEMCPY( void * restrict dest, const void * restrict src, int c, unsigned long count); + +extern void svf___memmove_chk_MEMCPY(char* dst, char* src, int sz); + +extern void svf_llvm_memset_MEMSET(char* dst, char elem, int sz); + +extern void svf_llvm_memset_p0i8_i32_MEMSET(char* dst, char elem, int sz); + +extern void svf_llvm_memset_p0i8_i64_MEMSET(char* dst, char elem, int sz); + +extern void svf_MEMSET(char* dst, char elem, int sz); + +extern char * svf___memset_chk_MEMSET(char * dest, const char * src, unsigned long destlen); + +char * svf___strcpy_chk_MEMCPY(char * dest, const char * src, unsigned long destlen); + +extern char * svf___strcat_chk_MEMCPY(char * dest, const char * src, unsigned long destlen); + +extern char *svf_stpcpy_MEMCPY(char *restrict dst, const char *restrict src); + +extern char *svf_strcat_MEMCPY(char *dest, const char *src); + +extern char *svf_strcpy_MEMCPY(char *dest, const char *src); + +extern char *svf_strncat_MEMCPY(char *dest, const char *src, unsigned long n); + +extern char *svf_strncpy_MEMCPY(char *dest, const char *src, unsigned long n); + +extern unsigned long svf_iconv_MEMCPY(void* cd, char **restrict inbuf, unsigned long *restrict inbytesleft, char **restrict outbuf, unsigned long *restrict outbytesleft); + +extern void* svf__ZNSt5arrayIPK1ALm2EE4backEv_OVERWRITE(void *arg); + +extern void * svf___rawmemchr(const void * s, int c) +{ + return (void *)s; +} + +struct jpeg_error_mgr *svf_jpeg_std_error(struct jpeg_error_mgr * a) +{ + return a; +} + +char *svf_fgets(char *str, int n, void *stream) +{ + return str; +} + +void *svf_memchr(const void *str, int c, unsigned long n) +{ + return (void *)str; +} + +void * svf_mremap(void * old_address, unsigned long old_size, unsigned long new_size, int flags) +{ + return old_address; +} + +char *svf_strchr(const char *str, int c) +{ + return (char *)str; +} + +char *svf_strerror_r(int errnum, char *buf, unsigned long buflen) +{ + return buf; +} + +char *svf_strpbrk(const char *str1, const char *str2) +{ + return (char *)str1; +} + +char *svf_strptime(const char *restrict s, const char *restrict format, struct tm *restrict tm) +{ + return (char *)s; +} + +char *svf_strrchr(const char *str, int c) +{ + return (char *)str; +} + +char *svf_strstr(const char *haystack, const char *needle) +{ + return (char *)haystack; +} + +char *svf_tmpnam_r(char *s) +{ + return s; +} + +int svf_isalnum(int character) +{ + return character; +} + +int svf_isalpha(int character) +{ + return character; +} + +int svf_isblank(int character) +{ + return character; +} + +int svf_iscntrl(int c) +{ + return c; +} + +int svf_isdigit(int c) +{ + return c; +} + +int svf_isgraph(int c) +{ + return c; +} + +int svf_islower( int arg ) +{ + return arg; +} + +int svf_isprint(int c) +{ + return c; +} + +int svf_ispunct(int argument) +{ + return argument; +} + +int svf_isspace(char c) +{ + return c; +} + +int svf_isupper(int c) +{ + return c; +} + +int svf_isxdigit(int c) +{ + return c; +} + +char *svf_asctime_r(const struct tm *tm, char *buf) +{ + return buf; +} + +void *svf_bsearch(const void *key, const void *base, unsigned long nitems, unsigned long size, int (*compar)(const void *, const void *)) +{ + return (void *)base; +} + +struct mntent *svf_getmntent_r(void *fp, struct mntent *mntbuf, char *buf, int buflen) +{ + return mntbuf; +} + +struct tm *svf_gmtime_r(const void *timer, struct tm *buf) +{ + return buf; +} + +char * svf_gzgets(void* file, char * buf, int len) +{ + return buf; +} + +struct tm *svf_localtime_r(const void *timep, struct tm *result) +{ + return result; +} + +char *svf_realpath(const char *restrict path, char *restrict resolved_path) +{ + return resolved_path; +} + +void* svf_freopen64( const char* voidname, const char* mode, void* fp ) +{ + return fp; +} + +void* svf_freopen(const char* voidname, const char* mode, void* fp) +{ + return fp; +} + +const char *svf_inet_ntop(int af, const void *restrict src, char *restrict dst, unsigned int size) +{ + return dst; +} + +double svf_strtod(const char *str, char **endptr) +{ + *endptr = (char *)str; + return 0.0; +} + +float svf_strtof(const char *nptr, char **endptr) +{ + *endptr = (char *)nptr; + return 0.0; +} + +long int svf_strtol(const char *str, char **endptr, int base) +{ + *endptr = (char *)str; + return 0; +} + +long double svf_strtold(const char* str, char** endptr) +{ + *endptr = (char *)str; + return 0.0; +} + +unsigned long int svf_strtoul(const char *str, char **endptr, int base) +{ + *endptr = (char *)str; + return 0; +} + +int svf_readdir_r(void *__restrict__dir, struct dirent *__restrict__entry, struct dirent **__restrict__result) +{ + __restrict__entry = *__restrict__result; + return 0; +} + +int svf_getpwnam_r(const char *name, struct passwd *pwd, char *buf, unsigned long buflen, struct passwd **result) +{ + *result = pwd; + return 0; +} + +int svf_getpwuid_r(unsigned int uid, struct passwd *pwd, char *buf, unsigned long buflen, struct passwd **result) +{ + *result = pwd; + return 0; +} + + +void svf__ZNSt8__detail15_List_node_base7_M_hookEPS0_(void *arg0, void **arg1) +{ + *arg1 = arg0; +} + +void* svf___dynamic_cast(void* source, const void* sourceTypeInfo, const void* targetTypeInfo, unsigned long castType) +{ + return source; +} + +void svf__ZNSsC1EPKcRKSaIcE(void **arg0, void *arg1) +{ + *arg0 = arg1; +} + +void svf__ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC1EPKcRKS3_(void **arg0, void *arg1) +{ + *arg0 = arg1; +} + +void svf_preserveExtFuncDeclarations() +{ + svf_asprintf_ALLOC_ARG0(NULL, NULL); + svf_vasprintf_ALLOC_ARG0(NULL, NULL, NULL); + svf_db_create_ALLOC_ARG0(NULL, NULL, 0); + svf_gnutls_pkcs12_bag_init_ALLOC_ARG0(NULL); + svf_gnutls_pkcs12_init_ALLOC_ARG0(NULL); + svf_gnutls_x509_crt_init_ALLOC_ARG0(NULL); + svf_gnutls_x509_privkey_init_ALLOC_ARG0(NULL); + svf_posix_memalign_ALLOC_ARG0(NULL, 0, 0); + svf_scandir_ALLOC_ARG1(NULL, NULL, NULL, NULL); + svf_XmbTextPropertyToTextList_ALLOC_ARG2(NULL, NULL, NULL, NULL); + svf_llvm_memcpy_p0i8_p0i8_i64_MEMCPY(NULL, NULL, 0, 0); + svf_llvm_memcpy_p0i8_p0i8_i32_MEMCPY(NULL, NULL, 0, 0); + svf_llvm_memcpy_MEMCPY(NULL, NULL, 0, 0); + svf_llvm_memmove_MEMCPY(NULL, NULL, 0, 0); + svf_llvm_memmove_p0i8_p0i8_i64_MEMCPY(NULL, NULL, 0, 0); + svf_llvm_memmove_p0i8_p0i8_i32_MEMCPY(NULL, NULL, 0, 0); + svf___memcpy_chk_MEMCPY(NULL, NULL, 0, 0); + svf_memmove_MEMCPY(NULL, NULL, 0); + svf_bcopy_MEMCPY(NULL, NULL, 0); + svf_memccpy_MEMCPY(NULL, NULL, 0, 0); + svf___memmove_chk_MEMCPY(NULL, NULL, 0); + svf_llvm_memset_MEMSET(NULL, 'a', 0); + svf_llvm_memset_p0i8_i32_MEMSET(NULL, 'a', 0); + svf_llvm_memset_p0i8_i64_MEMSET(NULL, 'a', 0); + svf___memset_chk_MEMSET(NULL, NULL, 0); + svf___strcpy_chk_MEMCPY(NULL, NULL, 0); + svf___strcat_chk_MEMCPY(NULL, NULL, 0); + svf_stpcpy_MEMCPY(NULL, NULL); + svf_strcat_MEMCPY(NULL, NULL); + svf_strcpy_MEMCPY(NULL, NULL); + svf_strncat_MEMCPY(NULL, NULL, 0); + svf_strncpy_MEMCPY(NULL, NULL, 0); + svf_iconv_MEMCPY(NULL, NULL, NULL, NULL, NULL); + svf___ctype_b_loc_STATIC_ALLOC_RET(); + svf___ctype_tolower_loc_STATIC_ALLOC_RET(); + svf___ctype_toupper_loc_STATIC_ALLOC_RET(); + svf___errno_location_STATIC_ALLOC_RET(); + svf___h_errno_location_STATIC_ALLOC_RET(); + svf___res_state_STATIC_ALLOC_RET(); + svf_asctime_STATIC_ALLOC_RET(NULL); + svf_bindtextdomain_STATIC_ALLOC_RET(NULL, NULL); + svf_bind_textdomain_codeset_STATIC_ALLOC_RET(NULL, NULL); + svf_ctermid_STATIC_ALLOC_RET(NULL); + svf_dcgettext_STATIC_ALLOC_RET(NULL, NULL, 0); + svf_dgettext_STATIC_ALLOC_RET(NULL, NULL); + svf_dngettext_STATIC_ALLOC_RET(NULL, NULL, NULL, 0); + svf_fdopen_STATIC_ALLOC_RET(0, NULL); + svf_getgrgid_STATIC_ALLOC_RET(0); + svf_getgrnam_STATIC_ALLOC_RET(NULL); + svf_gethostbyaddr_STATIC_ALLOC_RET(NULL, 0, 0); + svf_gethostbyname_STATIC_ALLOC_RET(NULL); + svf_gethostbyname2_STATIC_ALLOC_RET(NULL, 0); + svf_getmntent_STATIC_ALLOC_RET(NULL); + svf_getprotobyname_STATIC_ALLOC_RET(NULL); + svf_getprotobynumber_STATIC_ALLOC_RET(0); + svf_getpwent_STATIC_ALLOC_RET(); + svf_getpwnam_STATIC_ALLOC_RET(NULL); + svf_getpwuid_STATIC_ALLOC_RET(0); + svf_getservbyname_STATIC_ALLOC_RET(NULL, NULL); + svf_getservbyport_STATIC_ALLOC_RET(0, NULL); + svf_getspnam_STATIC_ALLOC_RET(NULL); + svf_gettext_STATIC_ALLOC_RET(NULL); + svf_gmtime_STATIC_ALLOC_RET(NULL); + svf_gnu_get_libc_version_STATIC_ALLOC_RET(); + svf_gnutls_check_version_STATIC_ALLOC_RET(NULL); + svf_localeconv_STATIC_ALLOC_RET(); + svf_localtime_STATIC_ALLOC_RET(NULL); + svf_ngettext_STATIC_ALLOC_RET(NULL, NULL, 0); + svf_pango_cairo_font_map_get_default_STATIC_ALLOC_RET(); + svf_re_comp_STATIC_ALLOC_RET(NULL); + svf_setlocale_STATIC_ALLOC_RET(0, NULL); + svf_tgoto_STATIC_ALLOC_RET(NULL, 0, 0); + svf_tparm_STATIC_ALLOC_RET(NULL); + svf_zError_STATIC_ALLOC_RET(0); + svf_fopen_ALLOC_RET(NULL, NULL); + svf_fopen64_ALLOC_RET(NULL, NULL); + svf_readdir64_ALLOC_RET(NULL); + svf_tmpvoid64_ALLOC_RET(); + svf_calloc_ALLOC_RET(0, 0); + svf_zmalloc_ALLOC_RET(0); + svf_gzdopen_ALLOC_RET(0, NULL); + svf_iconv_open_ALLOC_RET(NULL, NULL); + svf_lalloc_ALLOC_RET(0, 0); + svf_lalloc_clear_ALLOC_RET(0, 0); + svf_nhalloc_ALLOC_RET(0, NULL, 0); + svf_oballoc_ALLOC_RET(0); + svf_popen_ALLOC_RET(NULL, NULL); + svf_pthread_getspecific_ALLOC_RET(NULL, NULL); + svf_readdir_ALLOC_RET(NULL); + svf_safe_calloc_ALLOC_RET(0, 0); + svf_safe_malloc_ALLOC_RET(0); + svf_safecalloc_ALLOC_RET(0, 0); + svf_safemalloc_ALLOC_RET(0, 0); + svf_setmntent_ALLOC_RET(NULL, NULL); + svf_shmat_ALLOC_RET(0, NULL, 0); + svf___sysv_signal_ALLOC_RET(0, NULL); + svf_signal_ALLOC_RET(0, NULL); + svf_tempnam_ALLOC_RET(NULL, NULL); + svf_tmpvoid_ALLOC_RET(); + svf_xcalloc_ALLOC_RET(0, 0); + svf_xmalloc_ALLOC_RET(0); + svf__Znam_ALLOC_RET(0); + svf__Znaj_ALLOC_RET(0); + svf__Znwj_ALLOC_RET(0); + svf___cxa_allocate_exception_ALLOC_RET(0); + svf_aligned_alloc_ALLOC_RET(0, 0); + svf_memalign_ALLOC_RET(0, 0); + svf_valloc_ALLOC_RET(0); + svf_mmap64_ALLOC_RET(NULL, 0, 0, 0, 0, 0); + svf_XSetLocaleModifiers_ALLOC_RET(NULL); + svf___strdup_ALLOC_RET(NULL); + svf_crypt_ALLOC_RET(NULL, NULL); + svf_dlerror_ALLOC_RET(); + svf_dlopen_ALLOC_RET(NULL, 0); + svf_gai_strerror_ALLOC_RET(0); + svf_gcry_cipher_algo_name_ALLOC_RET(0); + svf_getenv_ALLOC_RET(NULL); + svf_getlogin_ALLOC_RET(); + svf_getpass_ALLOC_RET(NULL); + svf_gnutls_strerror_ALLOC_RET(0); + svf_gpg_strerror_ALLOC_RET(0); + svf_gzerror_ALLOC_RET(NULL, NULL); + svf_inet_ntoa_ALLOC_RET(0); + svf_initscr_ALLOC_RET(); + svf_llvm_stacksave_ALLOC_RET(); + svf_mmap_ALLOC_RET(NULL, 0, 0, 0, 0, 0); + svf_newwin_ALLOC_RET(0, 0, 0, 0); + svf_nl_langinfo_ALLOC_RET(0); + svf_opendir_ALLOC_RET(NULL); + svf_sbrk_ALLOC_RET(0); + svf_strdup_ALLOC_RET(NULL); + svf_strerror_ALLOC_RET(0); + svf_strsignal_ALLOC_RET(0); + svf_textdomain_ALLOC_RET(NULL); + svf_tgetstr_ALLOC_RET(NULL, NULL); + svf_tigetstr_ALLOC_RET(NULL); + svf_tmpnam_ALLOC_RET(NULL); + svf_ttyname_ALLOC_RET(0); + svf_malloc_ALLOC_RET(0); + svf_getcwd_REALLOC_RET(NULL, 0); + svf_mem_realloc_REALLOC_RET(NULL, 0); + svf_realloc_REALLOC_RET(NULL, 0); + svf_safe_realloc_REALLOC_RET(NULL, 0); + svf_saferealloc_REALLOC_RET(NULL, 0, 0); + svf_safexrealloc_REALLOC_RET(); + svf_strtok_REALLOC_RET(NULL, NULL); + svf_strtok_r_REALLOC_RET(NULL, NULL, NULL); + svf_xrealloc_REALLOC_RET(NULL, 0); + svf__Znwm_ALLOC_RET(0); + svf_SyGetmem_ALLOC_RET_OVERWRITE(0); + svf__ZNSt5arrayIPK1ALm2EE4backEv_OVERWRITE(NULL); +} \ No newline at end of file From 1fab767b4c493f840ed69c2c32d78b0faf0004cc Mon Sep 17 00:00:00 2001 From: shuangxiang kan <18550887212@163.com> Date: Thu, 13 Jul 2023 15:04:12 +1000 Subject: [PATCH 2/5] Fix memory leaks --- CMakeLists.txt | 3 ++- svf-llvm/lib/LLVMModule.cpp | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7fb931882..d4140c3f4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -89,9 +89,10 @@ install( PATTERN "**/*.h") # Compile extapi.c to extapi.bc +string(REGEX REPLACE "/lib/cmake/llvm$" "" LLVM_DIR "${LLVM_DIR}") add_custom_command( OUTPUT ${PROJECT_BINARY_DIR}/include/Util/extapi.bc - COMMAND ${PROJECT_SOURCE_DIR}/llvm-14.0.0.obj/bin/clang -S -c -Xclang -disable-O0-optnone -fno-discard-value-names -emit-llvm ${PROJECT_SOURCE_DIR}/svf/lib/Util/extapi.c -o ${PROJECT_BINARY_DIR}/include/Util/extapi.bc + COMMAND ${LLVM_DIR}/bin/clang -S -c -Xclang -disable-O0-optnone -fno-discard-value-names -emit-llvm ${PROJECT_SOURCE_DIR}/svf/lib/Util/extapi.c -o ${PROJECT_BINARY_DIR}/include/Util/extapi.bc DEPENDS ${PROJECT_SOURCE_DIR}/svf/lib/Util/extapi.c ) diff --git a/svf-llvm/lib/LLVMModule.cpp b/svf-llvm/lib/LLVMModule.cpp index f732f8167..a8e268284 100644 --- a/svf-llvm/lib/LLVMModule.cpp +++ b/svf-llvm/lib/LLVMModule.cpp @@ -163,7 +163,7 @@ void LLVMModuleSet::createSVFDataStructure() /// Function for (Function& func : mod.functions()) { - if (func.isDeclaration()) + if (func.isDeclaration() && (FunDefToDeclsMap.find(&func) != FunDefToDeclsMap.end() || mod.getName().str() != Options::ExtAPIInput())) { /// if this function is declaration candidateDecls.push_back(&func); @@ -171,7 +171,7 @@ void LLVMModuleSet::createSVFDataStructure() else { /// if this function is definition - if (mod.getName().str() == Options::ExtAPIInput() && FunDefToDeclsMap[&func].empty() && func.getName().str() != "svf__main") + if (mod.getName().str() == Options::ExtAPIInput() && FunDefToDeclsMap.find(&func) == FunDefToDeclsMap.end() && func.getName().str() != "svf__main") { /// if this function func defined in ExtAPI but never used in application code (without any corresponding declared functions). removedFuncList.push_back(&func); @@ -187,7 +187,7 @@ void LLVMModuleSet::createSVFDataStructure() } for (Function* func : removedFuncList) { - mod.getFunctionList().remove(func); + func->eraseFromParent(); } } for (const Function* func: candidateDefs) From 6113491ac2444e9ce2925886276cf8e8b9876009 Mon Sep 17 00:00:00 2001 From: shuangxiang kan <18550887212@163.com> Date: Thu, 13 Jul 2023 15:56:27 +1000 Subject: [PATCH 3/5] Fix function declaration errors. --- svf/lib/Util/extapi.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/svf/lib/Util/extapi.c b/svf/lib/Util/extapi.c index 64cd231df..993637014 100644 --- a/svf/lib/Util/extapi.c +++ b/svf/lib/Util/extapi.c @@ -311,15 +311,15 @@ extern void *svf_memccpy_MEMCPY( void * restrict dest, const void * restrict src extern void svf___memmove_chk_MEMCPY(char* dst, char* src, int sz); -extern void svf_llvm_memset_MEMSET(char* dst, char elem, int sz); +extern void svf_llvm_memset_MEMSET(char* dst, char elem, int sz, int flag); -extern void svf_llvm_memset_p0i8_i32_MEMSET(char* dst, char elem, int sz); +extern void svf_llvm_memset_p0i8_i32_MEMSET(char* dst, char elem, int sz, int flag); -extern void svf_llvm_memset_p0i8_i64_MEMSET(char* dst, char elem, int sz); +extern void svf_llvm_memset_p0i8_i64_MEMSET(char* dst, char elem, int sz, int flag); -extern void svf_MEMSET(char* dst, char elem, int sz); +extern void svf_MEMSET(char* dst, char elem, int sz, int flag); -extern char * svf___memset_chk_MEMSET(char * dest, const char * src, unsigned long destlen); +extern char * svf___memset_chk_MEMSET(char * dest, int c, unsigned long destlen, int flag); char * svf___strcpy_chk_MEMCPY(char * dest, const char * src, unsigned long destlen); @@ -601,10 +601,11 @@ void svf_preserveExtFuncDeclarations() svf_bcopy_MEMCPY(NULL, NULL, 0); svf_memccpy_MEMCPY(NULL, NULL, 0, 0); svf___memmove_chk_MEMCPY(NULL, NULL, 0); - svf_llvm_memset_MEMSET(NULL, 'a', 0); - svf_llvm_memset_p0i8_i32_MEMSET(NULL, 'a', 0); - svf_llvm_memset_p0i8_i64_MEMSET(NULL, 'a', 0); - svf___memset_chk_MEMSET(NULL, NULL, 0); + svf_llvm_memset_MEMSET(NULL, 'a', 0, 0); + svf_llvm_memset_p0i8_i32_MEMSET(NULL, 'a', 0, 0); + svf_llvm_memset_p0i8_i64_MEMSET(NULL, 'a', 0, 0); + svf_MEMSET(NULL, 'a', 0, 0); + svf___memset_chk_MEMSET(NULL, 'a', 0, 0); svf___strcpy_chk_MEMCPY(NULL, NULL, 0); svf___strcat_chk_MEMCPY(NULL, NULL, 0); svf_stpcpy_MEMCPY(NULL, NULL); From 56589f62ebde604ff05cc07f2aeebc1c16067a1d Mon Sep 17 00:00:00 2001 From: shuangxiang kan <18550887212@163.com> Date: Sun, 16 Jul 2023 22:34:21 +1000 Subject: [PATCH 4/5] Ignore extapi.c coverage --- .codecov.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.codecov.yml b/.codecov.yml index cff053995..27c7d6bc2 100644 --- a/.codecov.yml +++ b/.codecov.yml @@ -26,3 +26,6 @@ comment: layout: "reach,diff,flags,tree" behavior: default require_changes: no + +ignore: + - "svf/lib/Util/extapi.c" From e7b4759c3bd9b857affaf99a4bd4ad06b2f0fd46 Mon Sep 17 00:00:00 2001 From: shuangxiang kan <18550887212@163.com> Date: Mon, 17 Jul 2023 11:04:56 +1000 Subject: [PATCH 5/5] Ignore extapi.c coverage2 --- .codecov.yml | 3 --- .github/workflows/github-action.yml | 1 + 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/.codecov.yml b/.codecov.yml index 27c7d6bc2..cff053995 100644 --- a/.codecov.yml +++ b/.codecov.yml @@ -26,6 +26,3 @@ comment: layout: "reach,diff,flags,tree" behavior: default require_changes: no - -ignore: - - "svf/lib/Util/extapi.c" diff --git a/.github/workflows/github-action.yml b/.github/workflows/github-action.yml index 6c7c1fd0f..fe11a7f69 100644 --- a/.github/workflows/github-action.yml +++ b/.github/workflows/github-action.yml @@ -112,6 +112,7 @@ jobs: lcov --remove coverage.info '${{github.workspace}}/svf/lib/FastCluster/*' --output-file coverage.info lcov --remove coverage.info '${{github.workspace}}/svf/include/AbstractExecution/*' --output-file coverage.info lcov --remove coverage.info '${{github.workspace}}/svf/lib/AbstractExecution/*' --output-file coverage.info + lcov --remove coverage.info '${{github.workspace}}/svf/lib/Util/extapi.c' --output-file coverage.info - name: upload-coverage if: runner.os == 'Linux'