Giter Site home page Giter Site logo

sluck430 / tplite Goto Github PK

View Code? Open in Web Editor NEW

This project forked from tricker-z/tplite

0.0 0.0 0.0 513 KB

ISSTA'23 - Third-party Library Dependency for Large-scale SCA in the C/C++ Ecosystem: How Far Are We?

License: Apache License 2.0

Python 100.00%

tplite's Introduction

TPLite

TPLite: TPL dependency scanner with origin detection and centrality analysis

Publication

Third-Party Library Dependency for Large-Scale SCA in the C/C++ Ecosystem: How Far Are We?, ISSTA'2023

@inproceedings{jiang2023third,
  title = {Third-Party Library Dependency for Large-Scale SCA in the C/C++ Ecosystem: How Far Are We?},
  author = {Jiang, Ling and Yuan, Hengchen and Tang, Qiyi and Nie, Sen and Wu, Shi and Zhang, Yuqun},
  doi = {10.1145/3597926.3598143},
  booktitle = {Proceedings of the 32nd ACM SIGSOFT International Symposium on Software Testing and Analysis},
  pages = {1383-1395},
  year = {2023}
}

Environment

  • python >= 3.8

  • tree-sitter >= 0.20.1

  • networkx >= 3.0

Usage

Build with local CLI

$ git submodule update --init --recursive

$ python -m venv .env
$ source .env/bin/activate
$ pip install -r requirements.txt

Quick Start

  1. Extract the source function code with tree-sitter and generate the signatures (extractor/extract_func.py)
$ python extractor/extract_func.py        \
		--tpls_url data/input/tpls_1k_url.csv \
		--output data/func_sigs/
  • --tpls_url: path of the csv file of all tpl urls with the format - tpl_uuid,repo_url
  • --output: output directory of the tpl signature

Output format: tpl signature with tpl_uuid as the file name in json

{
 "func_sha256": [
  "func_src_code",
  {
   "tag_name_1": [
    "tag_commit_time_1",
    "tag_func_file_path_1"
   ],
   "tag_name_2": [
    "tag_commit_time_2",
    "tag_func_file_path_2"
   ]
  }
 ], 
}
  1. Generate the tpl dependencies with TPLite (tplite/src/resolve_dep.py)
$ python tplite/src/resolve_dep.py      \
		--tpl_sigs data/func_sigs/          \
		--tpl_name data/input/tpls_name.csv \
		--store_path output/                \
		--cpu 30
  • --tpl_sigs: tpl signatures (output of step-1)
  • --tpl_name: path of the csv file of all tpl names with the format - tpl_uuid,tpl_name
  • --store_path: output directory including the tpl dependencies (tpl_dep.csv) and other meta data

tplite's People

Contributors

tricker-z avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.