Giter Club home page Giter Club logo

learning-packer's Introduction

learning-packer

介绍

各案例的主题:

  1. 基本的 PE32 程序加载。
  2. 从内存加载 PE32 程序。
  3. 从内存加载不支持 ASLR 的 PE32 程序。
  4. 从内存加载 zlib 压缩过的 PE32 程序。
  5. 从资源加载编码为 PNG 灰度图的 PE32 程序。
  6. 几种反调试技术。
  7. 关于反反汇编(花指令)技术。
  8. 基于LLVM Pass 的简单代码混淆技术。

构造输出结果的 python 脚本也可以用 c++ 代码结合 LIEF 库,接口和逻辑都一样。

出于保持简单的考虑,另外 LIEF 也没提供 MinGW 版本的库,所以统一为使用 Python 版本的 LIEF。

2021年10月22日 为止,lief 没有提供类型存根,造成 VSCode 对 lief 库的函数和模块无法提供补全提示和即时的代码检查。 为了 VSCode 正确提供 LIEF 库的智能提示,可以使用 mypy 提供的 stubgen 脚本生成 pyi 存根。

这是可选的,提供存根可以有效提高在 VSCode 里编写代码的体验。

./venv/Scripts/Activate.ps1
pip install mypy
stubgen -p lief -o typings

开发环境

开发工具:

  • nasm
  • Python 3.8
  • MSYS2/mingw-w64-i686

Python 第三方包:

  • lief
  • pypng
pip install lief pypng

C 第三方库:

  • zlib
  • libpng
# 在 MSYS2 命令行环境里执行
pacman -Sy mingw-w64-i686-zlib mingw-w64-i686-libpng

注意需要把 nasm[/path/to/your/msys64]/mingw32/bin 加入 PATH 环境变量。

实验方式

准备好环境之后执行案例目录里的 build.py 脚本即可。

# pacman -Sy mingw-w64-i686-zlib mingw-w64-i686-libpng
# python38 -m venv venv
# ./venv/Scripts/Activate.ps1
# pip install lief pypng
cd packer4
python build.py
./packed.exe

LICENSE

MIT License

Copyright (c) 2021 weak_ptr [email protected]

learning-packer's People

Contributors

nnnewb 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.