Giter Club home page Giter Club logo

pe-packer's Introduction

Windows PE Packer

C MASM CMake Windows License

Languages

Introduction

test-helloworld

PE-Packer is a simple packer for Windows PE files. The new PE file after packing can obstruct the process of reverse engineering.

It will do the following things when packing a PE file:

  • Transforming the original import table.
  • Encrypting sections.
  • Clearing section names.
  • Installing the shell-entry.

When running a packed PE file, the shell-entry will decrypt and load the original program as follows:

  • Decrypting sections.
  • Initializing the original import table.
  • Relocation.

Before packing, using some disassembly tools can disassemble the executable file to analyze the code, such as IDA Pro.

  • Disassembling the code.

    code

  • Searching constant strings.

    string

  • Analyzing the import table.

    import-table

After packing, the reverse analysis will be obstructed.

  • Disassembling the code.

    packed-code

  • Searching constant strings.

    packed-string

  • Analyzing the import table.

    packed-import-table

Warning

This project is just a demo for beginners to study Windows PE Format and Assembly Language. It still has some compatibility problems and bugs that cannot be used in practice.

Getting Started

Prerequisites

The project must configure on/for Windows 32-bit and can only process 32-bit .exe programs now.

  • Install MASM32.
  • Install MinGW-w64, select i686 architecture.
  • Install CMake.
  • Set the PATH environment variables of these three tools.

Building

mkdir -p build
cd build
cmake .. -D CMAKE_C_COMPILER=gcc -G "MinGW Makefiles"
cmake --build .

Or run the build.ps1 file directly:

PS> .\build.ps1

Usage

To pack a program, you must specify its input name and the output name.

PE-Packer <input-file> <output-file>

For example:

PE-Packer hello.exe hello-pack.exe

Documents

You can use Doxygen to generate the document.

References

《加密与解密(第3版)》段钢

PE Format - Windows Dev Center

License

Distributed under the MIT License. See LICENSE for more information.

pe-packer's People

Contributors

czs108 avatar imgbotapp 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.