Codeqlcompile - 自动反编译闭源应用,创建codeql数据库

Related tags

Databasecodeql
Overview

codeql_compile

自动反编译闭源应用,创建codeql数据库

准备

首先下载ecj.jar和idea提供反编译的java-decompiler.jar,将其放置在脚本的相同目录中。

使用方法

1.在windows上使用 2.第二步不是必须项,可以直接执行第一步,然后就可以开始创建数据库 3.最好限制下要分析的包范围,过大反而不利于分析。

1、反编译项目

默认情况下使用java-decompiler.jar进行反编译

参数-a:指定项目源代码

参数-d:指定反编译代码的依赖包路径

python3 codeql_compile.py -a D:\project\java\apps\2\cloud -d D:\project\java\apps\BOOT-INF\lib

执行后会在当前目录生成 [项目名]save[时间戳] 目录,该目录的run.cmd是编译代码的执行文件

2、校验反编译

对java-decompiler反编译的内容先编译一遍确认失败文件,再使用procyon反编译替换失败文件

先下载procyon.jar,将其放置在脚本的相同目录中

参数-o:指定成功反编译代码存放的路径,即先前java-decompiler.jar反编译后的路径

参数-c:启用校验

python3 codeql_compile.py -a D:\project\java\apps\2\cloud -o D:\project\java\apps\BOOT-INF\lib -c

3、使用codeql创建数据库

参数--command:指定生成的run.cmd

D:\codeql.exe database create D:\codeql\databases\demo-database --language="java" --source-root=D:\codeql\demo_save_1641018608 --command="run.cmd"
You might also like...
Comments
  • FileNotFoundError: [WinError 3] 系统找不到指定的路径。

    FileNotFoundError: [WinError 3] 系统找不到指定的路径。

    E:\codeql\codeql_compile
    λ python3 codeql_compile.py -a D:\infiles -o D:\infiles_save_1643827355 -c
    Traceback (most recent call last):
      File "E:\codeql\codeql_compile\codeql_compile.py", line 127, in <module>
        check()
      File "E:\codeql\codeql_compile\codeql_compile.py", line 70, in check
        shutil.rmtree(save_path + "/procyon_class")
      File "E:\Python39\lib\shutil.py", line 737, in rmtree
        return _rmtree_unsafe(path, onerror)
      File "E:\Python39\lib\shutil.py", line 596, in _rmtree_unsafe
        onerror(os.scandir, path, sys.exc_info())
      File "E:\Python39\lib\shutil.py", line 593, in _rmtree_unsafe
        with os.scandir(path) as scandir_it:
    FileNotFoundError: [WinError 3] 系统找不到指定的路径。: 'D:\\infiles_save_1643827355/procyon_class'
    
    opened by maybe-why-not 1
Youtube Kanalinda tanittigim ve Programladigim SQLite3 ile calisan Kütüphane Programi

SQLite3 Kütüphane Uygulamasi SQLite3 ile calisan Kütüphane Arayüzü Yükleme Yerel veritabani olusacaktir. Yaptiginiz islemler kaybolmaz! Temel Gereksin

Mikael Pikulski 6 Aug 13, 2022
Python function to extract all the rows from a SQLite database file while iterating over its bytes, such as while downloading it

Python function to extract all the rows from a SQLite database file while iterating over its bytes, such as while downloading it

Department for International Trade 16 Nov 09, 2022
A Persistent Embedded Graph Database for Python

Cog - Embedded Graph Database for Python cogdb.io New release: 2.0.5! Installing Cog pip install cogdb Cog is a persistent embedded graph database im

Arun Mahendra 214 Dec 30, 2022
TelegramDB - A library which uses your telegram account as a database for your projects

TelegramDB A library which uses your telegram account as a database for your projects. Basic Usage from pyrogram import Client from telegram import Te

Kaizoku 79 Nov 22, 2022
A Python wrapper API for operating and working with the Neo4j Graph Data Science (GDS) library

gdsclient This repo hosts the sources for gdsclient, a Python wrapper API for operating and working with the Neo4j Graph Data Science (GDS) library. g

Neo Technology 101 Jan 05, 2023
Turn SELECT queries returned by a query into links to execute them

datasette-query-links Turn SELECT queries returned by a query into links to execute them Installation Install this plugin in the same environment as D

Simon Willison 5 Apr 27, 2022
A Modular MWDB Utility to Collect Fresh Malware Samples

MWDB Feeds A Modular MWDB Utility to Collect Fresh Malware Samples This project is FREE as in FREE 🍺 , use it commercially, privately or however you

c3rb3ru5 32 Jul 07, 2022
Enfilade: Tool to Detect Infections in MongoDB Instances

Enfilade: Tool to Detect Infections in MongoDB Instances

Aditya K Sood 7 Feb 21, 2022
This is a simple graph database in SQLite, inspired by

This is a simple graph database in SQLite, inspired by "SQLite as a document database".

Denis Papathanasiou 1.2k Jan 03, 2023
TinyDB is a lightweight document oriented database optimized for your happiness :)

Quick Links Example Code Supported Python Versions Documentation Changelog Extensions Contributing Introduction TinyDB is a lightweight document orien

Markus Siemens 5.6k Dec 30, 2022
A Simple , ☁️ Lightweight , 💪 Efficent JSON based database for 🐍 Python.

A Simple, Lightweight, Efficent JSON based DataBase for Python The current stable version is v1.6.1 pip install pysondb==1.6.1 Support the project her

PysonDB 282 Jan 07, 2023
Decentralised graph database management system

Decentralised graph database management system To get started clone the repo, and run the command below. python3 database.py Now, create a new termina

Omkar Patil 2 Apr 18, 2022
Simple embedded in memory json database

dbj dbj is a simple embedded in memory json database. It is easy to use, fast and has a simple query language. The code is fully documented, tested an

Pedro Gonring 25 Aug 12, 2022
A fast ordered NoSQL database.

MerkavaDB Note This is still in active development. Things will change. If you are interested in helping out, or would like to see any particular feat

Adam Hopkins 6 Sep 29, 2022
Python object-oriented database

ZODB, a Python object-oriented database ZODB provides an object-oriented database for Python that provides a high-degree of transparency. ZODB runs on

Zope 574 Dec 31, 2022
Oh-My-PickleDB is an open source key-value store using Python's json module.

OH-MY-PICKLEDB oh-my-pickleDB is a lightweight, fast, and intuitive data manager written in python 📝 Table of Contents About Getting Started Deployme

Adrián Toral 6 Feb 20, 2022
Elara DB is an easy to use, lightweight NoSQL database that can also be used as a fast in-memory cache.

Elara DB is an easy to use, lightweight NoSQL database written for python that can also be used as a fast in-memory cache for JSON-serializable data. Includes various methods and features to manipula

Saurabh Pujari 101 Jan 04, 2023
securedb is a fast and lightweight Python framework to easily interact with JSON-based encrypted databases.

securedb securedb is a Python framework that lets you work with encrypted JSON databases. Features: newkey() to generate an encryption key write(key,

Filippo Romani 2 Nov 23, 2022
Migrate data from SQL to NoSQL easily

Migrate data from SQL to NoSQL easily Installation 💯 pip install sql2nosql --upgrade Dependencies 📢 For the package to work, it first needs "clients

Facundo Padilla 43 Mar 26, 2022
Manage your sqlite database very easy (like django) ...

Manage your sqlite database very easy (like django) ...

aWolver 1 Feb 09, 2022