Lesson 03-Reverse Engineering Tools

Static Analysis Tools

Static analysis tools are used to analyze binary files without running the program, extracting code structure, functions, strings, and data flow information. The following is a detailed introduction to three mainstream tools.

IDA Pro

Overview:

  • Developer: Hex-Rays
  • Platform: Windows, Linux, macOS
  • License: Commercial software (expensive, about $760-$3200/year), provides limited free version (IDA Free)
  • Features: Multi-architecture disassembler and debugger, supports x86, x64, ARM, MIPS, etc., integrates Hex-Rays decompiler to generate pseudocode.
  • Characteristics:
    • Powerful automatic code analysis, identifying functions, strings, and cross-references.
    • Interactive interface, supports graphical code flow graphs.
    • Rich plugin ecosystem and script support (IDAPython, IDC).
    • Large community with abundant tutorial resources.

Application Scenarios:

  • Malware analysis: Extract malicious code logic.
  • Vulnerability research: Discover buffer overflows and other vulnerabilities.
  • Legacy software maintenance: Analyze old programs without source code.

Example:
Use IDAPython to extract function list:

import idaapi
import idautils

for func_ea in idautils.Functions():
    func_name = idaapi.get_func_name(func_ea)
    print(f"Function: {func_name} at 0x{func_ea:x}")

Advantages:

  • Industry standard, comprehensive features, high decompilation quality.
  • Supports numerous architectures and file formats (PE, ELF, Mach-O).
  • Powerful script and plugin support.

Limitations:

  • High license fees, restricting use by individual developers.
  • Outdated interface, steep learning curve.
  • Free version has limited features (e.g., x86 only).

Integration with Python:
IDAPython allows automation of analysis tasks, such as batch renaming functions or extracting strings:

import idaapi
for ea in idautils.Strings():
    print(f"String: {ea.str} at 0x{ea.ea:x}")

Ghidra

Overview:

  • Developer: National Security Agency (NSA)
  • Platform: Windows, Linux, macOS
  • License: Open source (free)
  • Features: Open-source reverse engineering framework, supports multiple architectures (x86, ARM, MIPS, etc.), provides disassembly, decompilation, scripting, and collaboration features.
  • Characteristics:
    • Built-in decompiler, generates C-like pseudocode.
    • Cross-platform, modern interface, supports team collaboration.
    • Supports Java and Python scripting (GhidraScript).
    • Rapid community development since open-sourced in 2019.

Application Scenarios:

  • Academic research: Free and powerful, suitable for students and researchers.
  • Malware analysis: Analyze cross-platform malicious code.
  • CTF competitions: Quickly parse binary files.

Example:
Use Ghidra Python script to extract functions:

from ghidra.program.model.listing import FunctionManager

fm = currentProgram.getFunctionManager()
for func in fm.getFunctions(True):
    print(f"Function: {func.getName()} at 0x{func.getEntryPoint()}")

Advantages:

  • Completely free, features close to IDA Pro.
  • Supports multiple architectures and file formats, cross-platform operation.
  • Active community and plugin ecosystem.

Limitations:

  • Slower performance, especially with large files (>150 MB).
  • Some architecture support less complete than IDA Pro.
  • Minor bugs that may affect stability.

Integration with Python:
Ghidra’s Python scripting supports automated analysis, such as fixing stack strings:

from ghidra.app.script import GhidraScript

class StackStringScript(GhidraScript):
    def run(self):
        print("Analyzing stack strings...")
        # Implement stack string extraction logic

Radare2

Overview:

  • Developer: Open-source community
  • Platform: Windows, Linux, macOS, iOS, Android
  • License: Open source (free)
  • Features: Modular reverse engineering framework, supports disassembly, debugging, data analysis, and patching, covering x86, ARM, MIPS, etc. architectures.
  • Characteristics:
    • Powerful command-line interface (CLI), supports graphical frontend Cutter.
    • Scripting support (Python, JavaScript, Go, etc.).
    • Lightweight, suitable for embedded devices and mobile platforms.

Application Scenarios:

  • Embedded system analysis: Parse firmware and IoT devices.
  • Low-resource environments: Run on resource-constrained devices.
  • Advanced users: Need highly customized analysis workflows.

Example:
Use Radare2’s Python interface (r2pipe) to extract functions:

import r2pipe

r2 = r2pipe.open("sample.exe")
r2.cmd("aaa")  # Auto analysis
functions = r2.cmdj("aflj")  # Get function list (JSON format)
for func in functions:
    print(f"Function: {func['name']} at 0x{func['offset']:x}")

Advantages:

  • Free and highly customizable, supports multiple platforms.
  • Powerful CLI and script support, suitable for automation.
  • Lightweight, suitable for low-resource environments.

Limitations:

  • Steep learning curve, command-line interface unfriendly.
  • Auto analysis less intelligent than IDA Pro or Ghidra.
  • Graphical frontend (e.g., Cutter) features not yet complete.

Integration with Python:
r2pipe provides Python interface, simplifying command-line operations:

import r2pipe
r2 = r2pipe.open("sample.bin")
r2.cmd("s main")  # Jump to main function
print(r2.cmd("pd 10"))  # Disassemble 10 instructions

Dynamic Analysis Tools

Dynamic analysis tools analyze code by running the program and monitoring its behavior (such as registers, memory, network activity), commonly used for debugging and malware analysis.

OllyDbg

Overview:

  • Developer: Oleh Yuschuk
  • Platform: Windows
  • License: Free (open source)
  • Features: 32-bit Windows debugger, focused on binary code analysis, supports breakpoint management and plugin extensions.
  • Characteristics:
    • Simple and easy-to-use graphical interface, suitable for beginners.
    • Real-time code and data analysis.
    • Supports plugins (e.g., OllyScript) for extended functionality.

Application Scenarios:

  • Malware analysis: Track running Windows executable files.
  • Vulnerability development: Debug buffer overflows.
  • CTF competitions: Analyze 32-bit PE files.

Example:
OllyDbg itself has no script interface, but automation can be achieved via plugins (e.g., OllyScript):

; OllyScript example: Set breakpoint
bp 0x00401000
msg "Breakpoint set at 0x00401000"

Advantages:

  • Free and lightweight, intuitive interface.
  • Rich plugin ecosystem, suitable for quick debugging.
  • Extensive community support, many tutorials.

Limitations:

  • Supports only 32-bit Windows programs, 64-bit requires unofficial plugins.
  • Last updated in 2013, features somewhat outdated.
  • No support for non-Windows platforms.

Integration with Python:
Call OllyDbg plugins via Python (e.g., PyOllyDbg):

# Requires specific plugin installation, not widely supported

x64dbg

Overview:

  • Developer: Open-source community
  • Platform: Windows
  • License: Open source (free)
  • Features: Debugger supporting 32-bit and 64-bit Windows programs, integrates disassembler and script engine.
  • Characteristics:
    • Modern interface, similar to OllyDbg but more powerful.
    • Supports plugins (e.g., ScyllaHide anti-anti-debugging) and Python scripting (x64dbgpy).
    • Powerful breakpoint management and memory analysis.

Application Scenarios:

  • Modern malware analysis: Supports 64-bit programs.
  • Vulnerability research: Develop complex exploits.
  • Game modification: Modify in-memory game data.

Example:
Use x64dbg Python script to set breakpoint:

from x64dbgpy import *

SetBreakpoint(0x00401000)
print("Breakpoint set at 0x00401000")

Advantages:

  • Free and supports 32/64-bit, modern design.
  • Active community, rich plugin ecosystem.
  • Powerful script support (x64dbgpy).

Limitations:

  • Limited to Windows platform.
  • Still requires some learning cost for beginners.
  • Some advanced features depend on plugins.

Integration with Python:
x64dbg’s x64dbgpy module supports automated debugging:

from x64dbgpy import *
Run()  # Run program
print(GetRegister("EAX"))  # Get EAX register value

WinDbg

Overview:

  • Developer: Microsoft
  • Platform: Windows
  • License: Free (included in Windows SDK)
  • Features: User-mode and kernel-mode debugger, supports x86/x64, excels at crash dump analysis and driver debugging.
  • Characteristics:
    • Powerful kernel debugging capabilities, suitable for driver development.
    • Supports symbol servers, parses Microsoft binaries.
    • Command-line interface, supports scripting (WinDbg scripts, Python).

Application Scenarios:

  • Kernel debugging: Analyze Windows drivers.
  • Crash analysis: Parse blue screen dump files.
  • Malware analysis: Monitor system-level behavior.

Example:
WinDbg command to extract call stack:

k  # Display call stack

Use PyKD (WinDbg Python extension):

import pykd

print(pykd.dbgCommand("k"))  # Get call stack

Advantages:

  • Free and powerful, official Microsoft support.
  • Unmatched kernel debugging capabilities.
  • Symbol server integration, suitable for Windows ecosystem.

Limitations:

  • Command-line interface unfriendly, steep learning curve.
  • Limited GUI support (WinDbg Preview has improvements).
  • Poor cross-platform support.

Integration with Python:
PyKD provides Python interface, simplifying WinDbg operations:

import pykd
regs = pykd.reg("rax")  # Read RAX register
print(f"RAX: 0x{regs:x}")

Disassembly and Decompilation Tools

Disassembly tools convert machine code to assembly code, while decompilation tools further generate high-level language-like pseudocode, improving code readability.

Hex-Rays

Overview:

  • Developer: Hex-Rays
  • Platform: Windows, Linux, macOS (as IDA Pro plugin)
  • License: Commercial software (requires separate purchase)
  • Features: IDA Pro decompilation plugin, converts assembly code to C-like pseudocode, supports x86, x64, ARM, etc.
  • Characteristics:
    • High-quality decompilation, generates pseudocode close to source code.
    • Seamless integration with IDA Pro, strong interactivity.
    • Supports analysis of complex code structures.

Application Scenarios:

  • Malware analysis: Understand complex logic.
  • Vulnerability research: Analyze control flow and data flow.
  • Code recovery: Restore lost source code.

Example:
Hex-Rays decompilation output (pseudocode):

int __cdecl main(int argc, char **argv)
{
  printf("Hello, World!\n");
  return 0;
}

Advantages:

  • Industry-leading decompilation quality.
  • Integrated with IDA Pro, provides interactive analysis.
  • Supports multiple architectures.

Limitations:

  • High license fees, only as IDA Pro plugin.
  • Limited effectiveness on obfuscated code.
  • Depends on IDA Pro environment.

Integration with Python:
Operate Hex-Rays decompilation results via IDAPython:

import idaapi
idaapi.decompile(0x00401000)  # Decompile specified address

RetDec

Overview:

  • Developer: Avast
  • Platform: Windows, Linux, macOS
  • License: Open source (free)
  • Features: Standalone decompiler, converts machine code to LLVM IR or C code, supports x86, x64, ARM, MIPS.
  • Characteristics:
    • Supports multiple file formats (PE, ELF, Mach-O).
    • Provides API and IDA Pro plugin.
    • Focuses on static analysis, generates readable code.

Application Scenarios:

  • Academic research: Free decompilation tool.
  • Malware analysis: Extract logic structures.
  • Cross-platform analysis: Supports multiple architectures.

Example:
Run RetDec from command line:

retdec-decompiler sample.exe

Output (simplified C code):

int main() {
    printf("Hello, World!\n");
    return 0;
}

Advantages:

  • Free and open source, supports multiple platforms.
  • Generated code has high readability.
  • Can be integrated into other tools (e.g., IDA Pro).

Limitations:

  • Slow decompilation speed, low efficiency with large files.
  • Decompilation quality inferior to Hex-Rays.
  • Limited community support.

Integration with Python:
RetDec provides Python API:

from retdec.decompiler import Decompiler

decompiler = Decompiler()
decompiler.decompile("sample.exe", output="output.c")

Debugger and Injection Tools

Debuggers and injection tools are used to modify running programs in real time, analyzing or altering their behavior, commonly used for game modification and dynamic analysis.

Cheat Engine

Overview:

  • Developer: Open-source community
  • Platform: Windows (limited Linux support)
  • License: Open source (free)
  • Features: Memory scanning and modification tool, with debugger, supports scripting (Lua) and memory injection.
  • Characteristics:
    • Powerful memory scanning, find specific values (e.g., health in games).
    • Simple and easy-to-use interface, suitable for beginners.
    • Supports Lua scripting for automated modification tasks.

Application Scenarios:

  • Game modification: Modify health, coins, etc.
  • Memory analysis: Find key data in programs.
  • Teaching: Learn memory management and reverse engineering basics.

Example:
Cheat Engine Lua script to modify memory:

local address = 0x00401000
writeInteger(address, 100) -- Set address value to 100
print(string.format("Value at 0x%X set to 100", address))

Advantages:

  • Free and easy to use, suitable for beginners.
  • Powerful memory scanning and modification features.
  • Lua scripting supports automation.

Limitations:

  • Primarily for game modification, limited professional reverse engineering features.
  • Limited to Windows (incomplete Linux support).
  • May be detected by anti-cheat systems.

Integration with Python:
Operate Cheat Engine via pywin32 (indirect method):

import win32gui
hwnd = win32gui.FindWindow(None, "Cheat Engine")
# Control Cheat Engine window (requires extension)

Frida

Overview:

  • Developer: Open-source community
  • Platform: Windows, Linux, macOS, Android, iOS
  • License: Open source (free)
  • Features: Dynamic instrumentation tool, injects JavaScript scripts to modify running programs in real time.
  • Characteristics:
    • Supports multiple platforms (including mobile devices).
    • JavaScript scripting, flexible and easy to write.
    • Suitable for dynamic analysis and real-time modification.

Application Scenarios:

  • Mobile app analysis: Modify Android/iOS app behavior.
  • Malware analysis: Track function calls.
  • Vulnerability development: Dynamically inject test code.

Example:
Use Frida to intercept Windows function:

Interceptor.attach(Module.getExportByName("kernel32.dll", "CreateFileA"), {
    onEnter: function(args) {
        console.log("CreateFileA called with file: " + args[0].readUtf8String());
    }
});

Run:

frida -f sample.exe -l script.js

Advantages:

  • Cross-platform, suitable for mobile and desktop apps.
  • Simple JavaScript scripting, easy for rapid development.
  • Dynamic instrumentation without modifying binaries.

Limitations:

  • Requires some scripting development experience.
  • Instrumentation may be unstable with complex programs.
  • Higher performance overhead.

Integration with Python:
Frida provides Python bindings (frida-python):

import frida

def on_message(message, data):
    print(message)

script_code = """
Interceptor.attach(Module.getExportByName("kernel32.dll", "CreateFileA"), {
    onEnter: function(args) {
        send("CreateFileA: " + args[0].readUtf8String());
    }
});
"""
process = frida.get_usb_device().attach("sample.exe")
script = process.create_script(script_code)
script.on("message", on_message)
script.load()
input("Press Enter to exit...")

Tool Comparison and Selection Guide

The following is a comparison summary of each tool to help select the appropriate one:

CategoryToolLicensePlatformMain AdvantagesMain Limitations
Static AnalysisIDA ProCommercialWindows, Linux, macOSComprehensive features, high decompilation qualityExpensive, outdated interface
GhidraOpen sourceWindows, Linux, macOSFree, features close to IDA ProSlower performance, some bugs
Radare2Open sourceMulti-platform (including mobile devices)Lightweight, highly customizableSteep learning curve, CLI unfriendly
Dynamic AnalysisOllyDbgOpen sourceWindowsSimple and easy to use, suitable for beginners32-bit only, updates stopped
x64dbgOpen sourceWindowsSupports 64-bit, modern designWindows only
WinDbgFreeWindowsPowerful kernel debugging, Microsoft supportUnfriendly interface, steep learning curve
Disassembly/DecompilationHex-RaysCommercialIDA Pro environmentHigh decompilation quality, integrated with IDAExpensive, depends on IDA Pro
RetDecOpen sourceWindows, Linux, macOSFree, supports multiple architecturesSlow speed, decompilation quality inferior to Hex-Rays
Debugging/InjectionCheat EngineOpen sourceWindows (limited Linux)Simple memory modification, suitable for game moddingLimited professional features, may be detected by anti-cheat
FridaOpen sourceMulti-platform (including mobile devices)Flexible dynamic instrumentation, cross-platformComplex script development, performance overhead

Selection Recommendations:

  • Limited budget: Choose Ghidra, Radare2, x64dbg, RetDec, or Frida, all free and powerful.
  • Professional needs: IDA Pro and Hex-Rays for high-quality decompilation and comprehensive analysis.
  • Beginners: OllyDbg and Cheat Engine have friendly interfaces, suitable for learning reverse engineering basics.
  • Mobile apps: Frida is the top choice for Android/iOS app analysis.
  • Kernel debugging: WinDbg is the best for Windows drivers and crash analysis.
  • CTF competitions: Ghidra and Radare2 (Cutter) are popular due to free and multi-platform support.

Combining Multiple Tools to Analyze PE Files

The following example demonstrates combining Ghidra (static analysis), x64dbg (dynamic debugging), RetDec (decompilation), and Frida (dynamic instrumentation) to analyze a Windows PE file.

Objective: Analyze a simple Windows executable, extract main function logic, debug key functions, and intercept file operations.

Step 1: Ghidra Static Analysis

  1. Open Ghidra, import sample.exe.
  2. Run auto analysis, locate main function.
  3. View decompilation results:
int main() {
    CreateFileA("test.txt", ...);
    printf("Hello, World!\n");
    return 0;
}
  1. Use Python script to extract strings:
from ghidra.program.model.listing import Listing
listing = currentProgram.getListing()
for data in listing.getDefinedData(True):
    if data.getDataType().getName() == "string":
        print(f"String: {data.getValue()} at 0x{data.getAddress()}")

Step 2: x64dbg Dynamic Debugging

  1. Open x64dbg, load sample.exe.
  2. Set breakpoint at CreateFileA call:
from x64dbgpy import *
SetBreakpoint(GetSymbolAddress("kernel32.dll", "CreateFileA"))
Run()
  1. View parameters (filename, etc.) when breakpoint triggers.

Step 3: RetDec Decompilation

  1. Run RetDec:
retdec-decompiler sample.exe
  1. Check generated C code, verify Ghidra analysis results.

Step 4: Frida Dynamic Instrumentation

  1. Write Frida script to intercept CreateFileA:
Interceptor.attach(Module.getExportByName("kernel32.dll", "CreateFileA"), {
    onEnter: function(args) {
        console.log("CreateFileA: " + args[0].readUtf8String());
    }
});
  1. Run:
frida -f sample.exe -l script.js

Output (combined):

  • Ghidra: Extract string "test.txt" and pseudocode.
  • x64dbg: Breakpoint triggers, displays CreateFileA parameters.
  • RetDec: Generates similar C code, confirms logic.
  • Frida: Real-time output CreateFileA: test.txt.

Analysis:

  • Ghidra provides static view, quickly locates key functions.
  • x64dbg verifies dynamic behavior, checks runtime state.
  • RetDec provides independent decompilation results, cross-verification.
  • Frida dynamically modifies program, suitable for real-time analysis.

Windows Reverse Engineering Environment Setup

Windows is a common platform for reverse engineering, especially for analyzing Windows executable files (PE format) or malware. The following are setup steps and recommended tools.

Hardware and System Requirements

  • Operating System: Windows 10/11 (64-bit, recommend Professional edition for virtualization support).
  • Hardware: At least 16GB RAM, 4-core CPU, 500GB SSD (virtual machines and tools take significant space).
  • Network: Controllable network environment, recommend isolated network for malware analysis.

Step 1: Install Basic Tools

Update System:

  • Run Windows Update to ensure latest patches, reduce security risks.
wuauclt.exe /detectnow

Install Python:

  • Download Python 3.10+ (recommend latest stable version) from python.org.
  • Check “Add Python to PATH” during installation.
  • Verify installation:
python --version
pip install --upgrade pip

Install Git:

  • Download Git for Windows from git-scm.com.
  • Configure Git Bash after installation:
git --version

Step 2: Install Reverse Engineering Tools

Static Analysis Tools:

  • IDA Pro (commercial software):
  • Download IDA Free (limited features) or purchase full version from hex-rays.com.
  • Verify after installation:
ida64.exe  # Run IDA Free
  • Ghidra (open source):
  • Download from ghidra-sre.org, requires Java 17+.
  • Unzip and run:
ghidraRun.bat
  • Install Python support:
pip install ghidra-bridge
  • Radare2 (open source):
  • Download Windows binary from radare.org or install via Git:
git clone https://github.com/radareorg/radare2
cd radare2
sys\install.bat
r2 -v  # Verify installation
  • Install Python bindings:
pip install r2pipe

Dynamic Analysis Tools:

  • x64dbg (open source):
  • Download from x64dbg.com, unzip to use.
  • Verify:
x64dbg.exe
  • Install Python plugin:
pip install x64dbgpy
  • WinDbg (free):
  • Install Windows 10/11 SDK from microsoft.com.
  • Select “Debugging Tools for Windows”.
  • Verify:
windbg.exe
  • Install PyKD:
pip install pykd

Disassembly and Decompilation Tools:

  • Hex-Rays: Purchased with IDA Pro, requires separate license, integrates after installation.
  • RetDec (open source):
  • Download from retdec.com or GitHub:
git clone https://github.com/avast/retdec
  • Compile per official docs or use precompiled binary.
  • Verify:
retdec-decompiler.exe sample.exe

Debugging and Injection Tools:

  • Cheat Engine (open source):
  • Download from cheatengine.org, install and run:
CheatEngine.exe
  • Frida (open source):
  • Install Python bindings:
pip install frida-tools frida
  • Verify:
frida --version

Step 3: Configure Environment Variables

  • Add tool paths to PATH environment variable (e.g., Radare2, Python script directories).
  • Example (PowerShell):
$env:Path += ";C:\path\to\radare2\bin"

Step 4: Install Auxiliary Tools

  • PEiD: Detect packers and encryptors in PE files, download from open-source community.
  • Process Explorer: Monitor processes and handles, download from sysinternals.com.
  • Wireshark: Analyze network traffic, download from wireshark.org.
  • CFF Explorer: Analyze PE file structure, download from ntcore.com.

Example: Verify Environment

Analyze a PE file:

# Use Ghidra to import file
ghidraRun.bat sample.exe

# Use x64dbg for debugging
x64dbg.exe sample.exe

# Use Frida for injection
frida -f sample.exe -l script.js

Linux Reverse Engineering Environment Setup

Linux is a powerful platform for reverse engineering, especially suitable for analyzing ELF files, embedded systems, and cross-platform malware. The following are setup steps.

Hardware and System Requirements

  • Operating System: Ubuntu 22.04 LTS (or similar distributions, e.g., Kali Linux).
  • Hardware: At least 16GB RAM, 4-core CPU, 500GB SSD.
  • Network: Isolated network, recommend using virtual machines.

Step 1: Install Basic Tools

  1. Update System:
sudo apt update && sudo apt upgrade -y
  1. Install Python:
sudo apt install python3 python3-pip python3-venv -y
python3 --version
pip3 install --upgrade pip
  1. Install Git:
sudo apt install git -y
git --version
  1. Install Build Tools:
sudo apt install build-essential gcc g++ make cmake -y

Step 2: Install Reverse Engineering Tools

Static Analysis Tools:

  • Ghidra (open source):
  • Install Java 17:
sudo apt install openjdk-17-jdk -y
  • Download Ghidra from ghidra-sre.org, unzip and run:
./ghidraRun
  • Install Python support:
pip3 install ghidra-bridge
  • Radare2 (open source):
  • Install:
git clone https://github.com/radareorg/radare2
cd radare2
./sys/install.sh
r2 -v
  • Install Python bindings:
pip3 install r2pipe
  • IDA Pro (commercial software):
  • Download Linux version from hex-rays.com, requires license.
  • Install and verify:
./ida64

Dynamic Analysis Tools:

  • GDB (open source):
  • Install enhanced version (e.g., GDB-PEDA):
sudo apt install gdb -y
git clone https://github.com/longld/peda.git ~/peda
echo "source ~/peda/peda.py" >> ~/.gdbinit
gdb --version
  • Dynamorio (open source, dynamic instrumentation):
  • Download from dynamorio.org:
git clone https://github.com/DynamoRIO/dynamorio
cd dynamorio
mkdir build
cd build
cmake ..
make -j$(nproc)
sudo make install

Disassembly and Decompilation Tools:

  • RetDec (open source):
  • Download and compile:
git clone https://github.com/avast/retdec
cd retdec
mkdir build && cd build
cmake .. -DCMAKE_INSTALL_PREFIX=/opt/retdec
make -j$(nproc)
sudo make install
/opt/retdec/bin/retdec-decompiler sample
  • Capstone (disassembly engine):
sudo apt install libcapstone-dev -y
pip3 install capstone

Debugging and Injection Tools:

  • Frida (open source):
pip3 install frida-tools frida
frida --version
  • pwndbg (GDB enhancement plugin):
git clone https://github.com/pwndbg/pwndbg
cd pwndbg
./setup.sh

Step 3: Configure Environment Variables

  • Add tool paths to PATH:
echo 'export PATH=$PATH:/opt/retdec/bin' >> ~/.bashrc
source ~/.bashrc

Step 4: Install Auxiliary Tools

  • strings: Extract strings from binary files:
sudo apt install binutils -y
  • Wireshark: Network analysis:
sudo apt install wireshark -y
  • YARA: Malware signature matching:
sudo apt install yara -y
pip3 install yara-python

Example: Verify Environment

Analyze an ELF file:

# Use Radare2 for analysis
r2 sample
aaa
afl  # List functions

# Use GDB for debugging
gdb sample
source ~/peda/peda.py
break main
run

Share your love