Penguin ———— An open-source PE file parsing tool that originated from a project born out of learning PE files. It is not intended to replace any existing tools, but rather to provide reverse engineers with more options.
If you don't need to modify the language, you can compile directly:
git clone git@github.com:dDostalker/Penguin.git
cd Penguin
cargo build --releaseThe following are Penguin's features:
- View common information in PE files
- Modify import and export tables
- Quickly export PE information as JSON and TOML
- One-click resource extraction
- 🚧 Dynamic linking with custom parameter debugging functionality
- Provide CLI interaction for convenient scripting tools
- 🚧 Malicious PE analysis related features (entropy calculation, malicious import table highlighting)
- ……
- Supports multiple languages with custom language addition (set through TOML files in the config folder and then compile)
- Uses direct file I/O instead of loading entire PE files into memory, providing support for large PE files and simultaneous operation of multiple PE files
- Solves pain points of old tools, such as import/export table search, non-standard section name display, GUI interface, etc.
- Open-source tool ensuring tool security, continuously absorbing community suggestions with more development potential
- ……
- Features are not complete, core parts like debugging are still under development
- Currently only supports PE files with the same endianness as the host
Penguin uses a compile-time system based on build.rs and macros, allowing different languages to be selected at compile time.
- Defines the currently used language
- Contains text content for all supported languages
- Supported languages: chinese, english (you can add your own)
- Reads configuration file at compile time
- Generates constant code for the corresponding language
- Sets environment variables
- Contains constants generated at build time
- Provides macros and utility functions
- Supports language detection and formatting
Edit the config/language.toml file and modify the language field:
# Switch to English
language = "english"
# Switch to Chinese
language = "chinese"use crate::i18n;
// Get application title
let title = i18n::APP_TITLE;
// Using macro (recommended)
let title = i18n!(APP_TITLE);use crate::i18n;
// Check if it's English
if i18n::is_language("english") {
// English-specific logic
}
// Get current language
let current_lang = i18n::get_current_language();use crate::i18n::utils;
// Format numbers according to language
let formatted = utils::format_number(1234567);
// Format addresses
let addr = utils::format_address(0x12345678);- Add new entries for all languages in
config/language.toml:
[chinese]
new_text = "新文本"
[english]
new_text = "New Text"- Use in code:
let text = i18n::NEW_TEXT;- Add new language section in
config/language.toml:
[german]
app_title = "Penguin PE Analysator"
# ... other text- Update default configuration in
build.rs(optional)
build.rsreadsconfig/language.toml- Selects corresponding language based on
languagefield - Generates
language_constants.rsfile - Sets
CURRENT_LANGUAGEenvironment variable - Main program includes generated constants during compilation
- Recompilation required after modifying configuration file
- All languages must contain the same keys
- Generated constants file is located in
target/directory - Supported languages are hardcoded in
build.rs
language = "english"
[english]
app_title = "Penguin PE Analyzer"
welcome_message = "Welcome to Penguin!"
[chinese]
app_title = "Penguin PE 分析器"
welcome_message = "欢迎使用 Penguin!"