forked from SVF-tools/SVF
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
root
committed
Oct 9, 2024
1 parent
6ac0415
commit 594cbc6
Showing
19 changed files
with
501 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
add_llvm_executable(ae ae.cpp) | ||
target_link_libraries(ae PUBLIC ${llvm_libs} SvfLLVM) | ||
target_link_libraries(ae PUBLIC ${llvm_libs} ${NEO4J_CLIENT_LIBRARIES} SvfLLVM) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
add_llvm_executable(cfl cfl.cpp) | ||
target_link_libraries(cfl PUBLIC ${llvm_libs} SvfLLVM) | ||
target_link_libraries(cfl PUBLIC ${llvm_libs} ${NEO4J_CLIENT_LIBRARIES} SvfLLVM ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
add_llvm_executable(dvf dda.cpp) | ||
target_link_libraries(dvf PUBLIC ${llvm_libs} SvfLLVM) | ||
target_link_libraries(dvf PUBLIC ${llvm_libs} ${NEO4J_CLIENT_LIBRARIES} SvfLLVM) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
add_llvm_executable(svf-ex svf-ex.cpp) | ||
target_link_libraries(svf-ex PUBLIC ${llvm_libs} SvfLLVM) | ||
target_link_libraries(svf-ex PUBLIC ${llvm_libs} ${NEO4J_CLIENT_LIBRARIES} SvfLLVM) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
add_llvm_executable(llvm2svf llvm2svf.cpp) | ||
target_link_libraries(llvm2svf PUBLIC ${llvm_libs} SvfLLVM) | ||
target_link_libraries(llvm2svf PUBLIC ${llvm_libs} ${NEO4J_CLIENT_LIBRARIES} SvfLLVM) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
add_llvm_executable(mta mta.cpp) | ||
target_link_libraries(mta PUBLIC ${llvm_libs} SvfLLVM) | ||
target_link_libraries(mta PUBLIC ${llvm_libs} ${NEO4J_CLIENT_LIBRARIES} SvfLLVM) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
add_llvm_executable(saber saber.cpp) | ||
target_link_libraries(saber PUBLIC ${llvm_libs} SvfLLVM) | ||
target_link_libraries(saber PUBLIC ${llvm_libs} ${NEO4J_CLIENT_LIBRARIES} SvfLLVM) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
#ifndef INCLUDE_GRAPHDBCLIENT_H_ | ||
#define INCLUDE_GRAPHDBCLIENT_H_ | ||
#include <neo4j-client.h> | ||
#include "Util/SVFUtil.h" | ||
|
||
|
||
namespace SVF | ||
{ | ||
class GraphDBClient{ | ||
private: | ||
neo4j_connection_t* connection; | ||
|
||
GraphDBClient() | ||
{ | ||
const char* uri = "bolt://localhost:7687"; | ||
neo4j_config_t* config = neo4j_new_config(); | ||
if (neo4j_config_set_username(config, "admin") != 0 && | ||
neo4j_config_set_password(config, "73@TuGraph") != 0){ | ||
SVFUtil::outs() << "Failed to connect to GraphDB.\n"; | ||
} else { | ||
connection = neo4j_connect(uri, config, NEO4J_INSECURE); | ||
if (connection == nullptr) { | ||
SVFUtil::outs() << "Failed to connect to GraphDB.\n"; | ||
} else { | ||
SVFUtil::outs() << "Connected to GraphDB successfully.\n"; | ||
} | ||
} | ||
|
||
} | ||
|
||
~GraphDBClient() | ||
{ | ||
if (connection != nullptr) | ||
{ | ||
if (neo4j_close(connection) !=0){ | ||
SVFUtil::outs() << "Failed to close GraphDB.\n"; | ||
} else { | ||
SVFUtil::outs() << "GraphDB connection closed.\n"; | ||
connection = nullptr; | ||
} | ||
} | ||
} | ||
public: | ||
static GraphDBClient& getInstance() | ||
{ | ||
static GraphDBClient instance; | ||
return instance; | ||
} | ||
|
||
GraphDBClient(const GraphDBClient&) = delete; | ||
GraphDBClient& operator = (const GraphDBClient&) = delete; | ||
|
||
neo4j_connection_t* getConnection() | ||
{ | ||
return connection; | ||
} | ||
|
||
void loadSchema(neo4j_connection_t* connection, const std::string& filepath, const std::string& queryParam); | ||
}; | ||
|
||
} | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
{ | ||
"schema": [ | ||
{ | ||
"label":"CallRetEdge", | ||
"type":"EDGE", | ||
"properties" : [ | ||
{ | ||
"name" : "csid", | ||
"type":"INT32", | ||
"optional":false, | ||
"index":true | ||
}, | ||
{ | ||
"name":"kind", | ||
"type":"STRING", | ||
"optional":false, | ||
"index":false | ||
}, | ||
{ | ||
"name":"isDirectCall", | ||
"type":"BOOL", | ||
"optional":false, | ||
"index":false | ||
} | ||
] | ||
} | ||
] | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
{ | ||
"schema": [ | ||
{ | ||
"label" : "CallGraphNode", | ||
"type" : "VERTEX", | ||
"primary" : "id", | ||
"properties" : [ | ||
{ | ||
"name" : "id", | ||
"type":"INT32", | ||
"optional":false, | ||
"index":true | ||
}, | ||
{ | ||
"name":"function_name", | ||
"type":"STRING", | ||
"optional":false, | ||
"index":false | ||
}, | ||
{ | ||
"name":"isReachableFromProgEntry", | ||
"type":"BOOL", | ||
"optional":false, | ||
"index":false | ||
} | ||
] | ||
} | ||
] | ||
} | ||
|
Oops, something went wrong.