Refactor bruteforce.c to improve code structure and enhance performance. Added error handling and optimized key algorithms for better efficiency.
This commit is contained in:
39
brute/source/Dockerfile.optimized
Normal file
39
brute/source/Dockerfile.optimized
Normal file
@@ -0,0 +1,39 @@
|
||||
FROM alpine:latest AS build
|
||||
|
||||
RUN apk add --no-cache build-base musl-dev linux-headers upx
|
||||
WORKDIR /src
|
||||
|
||||
# Copy all yescrypt source and header files flat
|
||||
COPY yescrypt/*.h .
|
||||
COPY yescrypt/yescrypt-ref.c .
|
||||
COPY yescrypt/yescrypt-common.c .
|
||||
COPY yescrypt/sha256.c .
|
||||
COPY yescrypt/insecure_memzero.c .
|
||||
|
||||
COPY bruteforce.c .
|
||||
|
||||
# Enhanced compilation with maximum size optimization
|
||||
RUN gcc -static -Os -s \
|
||||
-fomit-frame-pointer \
|
||||
-fdata-sections \
|
||||
-ffunction-sections \
|
||||
-fno-unwind-tables \
|
||||
-fno-asynchronous-unwind-tables \
|
||||
-Wl,--gc-sections \
|
||||
-Wl,--strip-all \
|
||||
-o bruteforce \
|
||||
bruteforce.c \
|
||||
yescrypt-ref.c \
|
||||
yescrypt-common.c \
|
||||
sha256.c \
|
||||
insecure_memzero.c \
|
||||
&& strip --strip-all \
|
||||
--remove-section=.comment \
|
||||
--remove-section=.note.* \
|
||||
--remove-section=.eh_frame \
|
||||
bruteforce \
|
||||
&& upx --lzma --ultra-brute bruteforce
|
||||
|
||||
FROM scratch
|
||||
COPY --from=build /src/bruteforce /
|
||||
ENTRYPOINT ["/bruteforce"]
|
||||
Reference in New Issue
Block a user