Skip to content

Commit

Permalink
Add README for ofrak_gpu, compiled futhark code, rename CLI file
Browse files Browse the repository at this point in the history
  • Loading branch information
Ivanov1ch committed Aug 7, 2024
1 parent 38669f1 commit d5ba4de
Show file tree
Hide file tree
Showing 6 changed files with 12,333 additions and 5 deletions.
4 changes: 2 additions & 2 deletions ofrak_gpu/.coveragerc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[run]
omit =
ofrak_gpu/entropy.py
ofrak_gpu/run.py
ofrak_gpu/bench.py
ofrak_gpu/run_entropy.py
ofrak_gpu/bench_entropy.py
2 changes: 0 additions & 2 deletions ofrak_gpu/.gitignore

This file was deleted.

26 changes: 25 additions & 1 deletion ofrak_gpu/README.md
Original file line number Diff line number Diff line change
@@ -1 +1,25 @@
# ofrak_gpu
# OFRAK
OFRAK (Open Firmware Reverse Analysis Konsole) is a binary analysis and modification platform that combines the ability to unpack, analyze, modify, and repack binaries.


# Package: ofrak_gpu

```
OFRAK
└───...
└───ofrak_gpu <-- //YOU ARE HERE//
│ └───entropy.fut // Futhark source code for GPU-bound entropy calculations
│ └───entropy.py // Pyopencl equivalent of entropy.fut, generated by the futhark compiler (see "Futhark Compilation")
│ └───run_entropy.py // CLI to run compute the entropy of a file
└───...
```

This package contains the GPU-bound implementations of expensive computations performed by OFRAK.

## Futhark Compilation
The [Futhark language](https://futhark-lang.org/) is not required to install and run this module, nor will the Futhark compiler be installed into your Docker container. Instead, `entropy.py`, the compiled pyopencl output of `entropy.fut`, has been provided. If you would like to make any changes to `entropy.fut`, you will have to re-compile `entropy.py` with `futhark pyopencl --library entropy.fut -o entropy.py` - see the `make futhark` target. The `--library` flag must be used.
## Dependencies
This package requires numpy, pyopencl, and an OpenCL platform to run. If you don't have an OpenCL platform and want to test your code, consider [oclgrind, pocl, or another pip-installable CPU runtime for OpenCL](https://documen.tician.de/pyopencl/misc.html#enabling-access-to-cpus-and-gpus-via-py-opencl). oclgrind is installed by default by requirements-test to run tests. The Futhark compiler is not required, see "Futhark Compilation."

## Testing
This package maintains 100% test coverage of functions. See `ofrak_gpu_test`.
Binary file removed ofrak_gpu/max_entropy_256_B_windows.bin
Binary file not shown.
Loading

0 comments on commit d5ba4de

Please sign in to comment.