Skip to content

Commit

Permalink
Initial upload
Browse files Browse the repository at this point in the history
  • Loading branch information
aus10pv committed Jun 8, 2023
1 parent f0acb4e commit df99458
Show file tree
Hide file tree
Showing 29 changed files with 4,000 additions and 0 deletions.
27 changes: 27 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
name: Bug report
about: Help us improve Cartographer!
title: ''
labels: bug
assignees: aus10pv

---

**Describe the bug**
Please provide a clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Additional context**
Add any other context about the problem here.
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for Cartographer!
title: ''
labels: enhancement
assignees: aus10pv

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
51 changes: 51 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: build

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
# Root directory for doing Ghidra work (building, etc.)
root: ["/tmp/ghidra"]
# Ghidra build version(s)
version: [10.3]
include:
- version: 10.3
release_url: "https://github.com/NationalSecurityAgency/ghidra/releases/download/Ghidra_10.3_build"
filename: "ghidra_10.3_PUBLIC_20230510.zip"
directory: "ghidra_10.3_PUBLIC"

steps:
- uses: actions/checkout@v3

- name: Download Ghidra
run: |
wget -P ${{matrix.root}} -q ${{matrix.release_url}}/${{matrix.filename}}
unzip -d ${{matrix.root}} -q ${{matrix.root}}/${{matrix.filename}}
- name: Setup Java
uses: actions/setup-java@v3
with:
java-version: 17
distribution: temurin

- name: Build plugin via gradle
run: gradle -PGHIDRA_INSTALL_DIR=${{matrix.root}}/${{matrix.directory}} -PZIP_NAME_PREFIX=ghidra_${{matrix.version}}

# Uploading a ZIP file as an artifact creates a double-ZIP
- name: Fix artifact ZIP
run: unzip -d dist/${{matrix.version}} dist/*_${{matrix.version}}_*.zip

# Upload the unzipped contents as the artifact to create a Ghidra-loadable ZIP file
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: ghidra_${{matrix.version}}_Cartographer
path: dist/${{matrix.version}}/*
if-no-files-found: error
51 changes: 51 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: release

on:
release:
types: [published]

# Required for updating published release contents
permissions:
contents: write

jobs:
release:
runs-on: ubuntu-latest
strategy:
matrix:
# Root directory for doing Ghidra work (building, etc.)
root: ["/tmp/ghidra"]
# Repository name ("Cartographer")
name: ["${{github.event.repository.name}}"]
# Ghidra build version(s)
version: [10.3]
include:
- version: 10.3
release_url: https://github.com/NationalSecurityAgency/ghidra/releases/download/Ghidra_10.3_build
filename: ghidra_10.3_PUBLIC_20230510.zip
directory: ghidra_10.3_PUBLIC

steps:
- uses: actions/checkout@v3

- name: Download Ghidra
run: |
wget -P ${{matrix.root}} -q ${{matrix.release_url}}/${{matrix.filename}}
unzip -d ${{matrix.root}} -q ${{matrix.root}}/${{matrix.filename}}
- name: Setup Java
uses: actions/setup-java@v3
with:
java-version: 17
distribution: temurin

- name: Build plugin via gradle
run: gradle -PGHIDRA_INSTALL_DIR=${{matrix.root}}/${{matrix.directory}}

- name: Rename ZIP for upload
run: mv dist/*_${{matrix.version}}_*.zip dist/ghidra_${{matrix.version}}_${{matrix.name}}.zip

- name: Upload release ZIP
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
run: gh release upload ${{github.event.release.tag_name}} dist/ghidra_${{matrix.version}}_${{matrix.name}}.zip
72 changes: 72 additions & 0 deletions EZCOV.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# EZCOV Format

The EZCOV ("Easy Coverage") format was created to simplify the formatting of coverage data and to provide Ghidra-specific functionality in Cartographer.

Below is an example of the EZCOV format.

```
EZCOV VERSION: 1
0x00101000, 20, [ ]
0x00101016, 5, [ ]
0x00201251, 6, [ MAIN ]
0x00201257, 22, [ MAIN ]
0x00101160, 9, [ OVR1 ]
```

## Structure

EZCOV files consist of 3 sections:

- [Version](#version)
- [Options](#options) (optional)
- [Coverage Data](#coverage-data)

Single-line comments start with the `#` character.

## Version

The version is a single line at the top of the file that dictates the EZCOV version.

```
EZCOV VERSION: 1
```

## Options

The options section is an **optional** section that defines any additional functionality, features, or options about the coverage data.

This section begins with the `OPTIONS:` keyword, followed by one or more lines of options.

**Note:** This section is unused in EZCOV version 1.

```
OPTIONS:
fix_jumps
auto_disassemble
...
```

## Coverage Data

Each line of coverage data contains a series of comma-separate values that determine which parts of the program were executed.

At minimum, this contains the **offset**, **size**, and **address space**.

* **Offset**: Hexadecimal address in memory where the program began execution.
* **Size**: Decimal number of bytes executed.
* **Address Space**: Name of the address space where the code was executed.
* This is useful for exploring multiple loaded binaries that occupy the same address(es) in RAM.
* If blank, the program's default address space is used.

```
#
# Columns:
#
# OFFSET, SIZE, [ ADDRESS_SPACE ]
#
0x4002B260, 12, [ ]
0x4002B270, 12, [ ]
0x400A2F34, 8, [ OV1 ]
0x400A3278, 20, [ OV1 ]
0x400A328C, 12, [ OV1 ]
```
Empty file added Module.manifest
Empty file.
Loading

0 comments on commit df99458

Please sign in to comment.