-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add docker image for signature generation with sigem
- Loading branch information
Showing
4 changed files
with
48 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
FROM rust:1.77 AS builder | ||
# The binaryninja-api commit to use, remember sigem is pulled from here. | ||
ARG COMMIT=30a0fbb5839b08dc58efe602a5cd19c90fbd4c50 | ||
# Copy the binja install. This won't be included in the final image. | ||
COPY ./binaryninja /binaryninja | ||
ENV BINARYNINJADIR=/binaryninja | ||
# Clone the binaryninja-api repo where `sigem` lives. | ||
RUN apt-get update && apt-get install -y git libclang-dev | ||
RUN git clone https://github.com/Vector35/binaryninja-api /binaryninja-api \ | ||
&& cd /binaryninja-api \ | ||
&& git checkout $COMMIT | ||
# Install sigem | ||
RUN cargo install --path /binaryninja-api/plugins/warp/ --bin sigem | ||
|
||
FROM ubuntu:24.10 AS runner | ||
# Copy sigem binary over | ||
COPY --from=builder /usr/local/cargo/bin/sigem /usr/local/bin/sigem | ||
# Copy in the entrypoint (what sets up the environment) | ||
COPY ./entrypoint.sh /entrypoint.sh | ||
RUN chmod +x /entrypoint.sh | ||
ENTRYPOINT ["/entrypoint.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
services: | ||
sigem: | ||
build: | ||
context: . | ||
dockerfile: Dockerfile | ||
environment: | ||
BN_LICENSE_FILE: /run/secrets/license | ||
volumes: | ||
- ./binaryninja:/binaryninja:ro | ||
- ./signatures:/signatures | ||
- ./data:/data:ro | ||
secrets: | ||
- license | ||
command: [ "/data/a.out", "/signatures/a" ] | ||
|
||
secrets: | ||
license: | ||
file: license.dat |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/usr/bin/env bash | ||
set -Eeuo pipefail | ||
|
||
mkdir -p ~/.binaryninja | ||
cp "$BN_LICENSE_FILE" ~/.binaryninja/license.dat | ||
exec sigem "$@" |