Giter Site home page Giter Site logo

silab-nitkc / hibari-gas Goto Github PK

View Code? Open in Web Editor NEW
7.0 1.0 1.0 6.43 MB

An experimental obfuscator for software protection using the SMT-based code generation

License: Apache License 2.0

Python 100.00%
obfuscator software-protection smt-solver code-generation

hibari-gas's Introduction

hibari

hibari is an experimental obfuscator for the assembly language, which aims to protect software against Man-at-the-end attacks. Hibari takes an assembly program (in the GNU assembler format) as input, and returns an obfuscated assembly program as output. In hibari, some code fragments included in the target program are replaced with obscure fragments, preserving their semantics. The obscure fragments are generated using an SMT solver Z3.

Requirements

  • Python 3.9 (or higher)
  • z3py
  • lark-python

Usage

usage: obfuscator.py [-h] [-o O] [-n N] [-l L] src

positional arguments:
  src         Path of input file.

optional arguments:
  -h, --help  show this help message and exit
  -o O        Path of output file.
  -n N        Maximum number of lines to obfuscate at once.
  -l L        Number of instructions used for obfuscation.

Example

python3.9 obfuscator.py target.s -o out.s

Reference

光本智洋,神崎雄一郎,“SMTソルバによる命令列生成を用いたアセンブリプログラムの難読化,” 情報処理学会 第83回全国大会講演論文集 (講演番号2K-04),2021年3月.

hibari-gas's People

Contributors

yuichirok avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

tamada

hibari-gas's Issues

GASとSMTの処理を分離する

libs/GAS/libs/SMT/の処理を完全に独立させる.

  • libs/GAS/で入出力例を生成し,libs/SMT/に渡して命令列を生成
  • libs/SMT/で命令列を生成し,libs/GAS/に渡して実行可能コードを生成

難読化の前後でゼロフラグの値が保証されない

addl $3, %eax
jz hoge

addlが難読化されて

addl $3, %eax
subl $3, R0+1*8(%rip)

jz hoge

などとなってしまうケースが発生していた.
(上の例では%eaxの値に基づいていたはずのゼロフラグが,R0+1*8の値で更新されてしまう)

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.