repX Documentation

Developer-Facing References for repX Primitives

repX is a reverse engineering toolkit designed for structured binary analysis, vulnerability pattern detection, and automated report generation. These docs cover the core API surface, configuration options, and integration patterns.

Installation

npm install @rsaha/repx

Requires Node.js 20+ and platform-specific binary analysis dependencies.

Configuration

// repx.config.ts
export default {
  arch: 'x86_64',         // Target architecture
  mode: 'static',         // 'static' | 'dynamic' | 'hybrid'
  outputDir: './reports',  // Report output directory
  maxThreads: 4,          // Parallel analysis threads
  timeout: 30000,         // Analysis timeout (ms)
  patterns: {
    builtIn: true,        // Use built-in vulnerability patterns
    custom: './patterns', // Custom pattern directory
  },
};

API Reference

repx.init(config)

Initialize a repX analysis session with target binary configuration.

import { repx } from '@rsaha/repx';

const session = repx.init({
  target: './bin/sample.elf',
  arch: 'x86_64',
  mode: 'static',
  output: './reports',
});

session.disassemble(opts)

Disassemble target binary with configurable depth and symbol resolution.

const result = await session.disassemble({
  entryPoint: 'main',
  depth: 3,
  resolveSymbols: true,
  includeStrings: true,
});

console.log(result.functions); // Map<string, Function>
console.log(result.callGraph); // DAG of function calls

session.analyze(pattern)

Run pattern-based analysis across disassembled output.

const vulns = await session.analyze({
  patterns: ['buffer-overflow', 'format-string', 'use-after-free'],
  confidence: 0.75,
  maxDepth: 5,
});

for (const v of vulns) {
  console.log(`[${v.severity}] ${v.type} at ${v.location}`);
}

session.export(format)

Export analysis results in structured formats.

await session.export({
  format: 'json', // 'json' | 'sarif' | 'markdown'
  path: './reports/analysis.json',
  includeDisassembly: false,
  includeCallGraph: true,
});

Further Reading

Architecture Overview

How repX structures binary analysis pipelines

Pattern Authoring Guide

Write custom vulnerability detection patterns

CLI Reference

Command-line interface for repX operations

Integration Examples

CI/CD integration and automated analysis

HUD · Page · Tree